0

I set up my instance to my liking, created an image (AMI) from it, and stopped the instance. I now want to change the AMI for that instance to the new AMI, and re-launch the instance. How do I do this?

To clarify, clicking "Launch" from the list of AMIs in the management console is not what I need. This creates a new instance, making me go through the wizard again when I just want the same configuration, and it gives the new instance a different IP address, and so on.

jameshfisher
  • 34,029
  • 31
  • 121
  • 167

2 Answers2

1

I think you have a misunderstanding of how AMIs work. An AMI is just a template for launching an instance with a particular configuration.

You created your original instance from (presumably) a bare bones distribution AMI (say ami-11111), modified it, and created your own AMI (say ami-22222).

You can now launch instances using ami-22222 that will be configured the way you want, but it no longer has any connection to ami-11111. It doesn't make any sense to "change the AMI [...] to the new AMI".

If you stop an instance it will always get a new IP address when it is restarted. You can get a persistent IP address by:

  • Allocating an Elastic IP.
  • Launching the instance you want (in this case ami-22222)
  • Assigning the Elastic IP to that instance.

The instance will then be accessible via the Elastic IP address.

If you modify the instance in the future and create a new image of it (say, ami-33333), you can:

  • Launch an instance based on ami-33333.
  • Assign your Elastic IP to ami-33333 (thereby disconnecting ami-22222 from that IP).
  • Terminate ami-22222 once the new instance is active.

Note that it can take a minute or so for the transition to the new AMI during which the server will be unresponsive.

ianjs
  • 817
  • 5
  • 8
0

You can't change an existing instance to a new ami, instead you launch a new instance from that ami. When you launch an instance, it creates a copy of the ami in whatever storage type you are using (instance or ebs).

datasage
  • 19,153
  • 2
  • 48
  • 54