Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to change the zone of a running EC2 instance?

I currently get "insufficient capacity" error when I try to start an EBS backed micro instance that was running 30 mins ago.

I'm trying to use:

> ec2-modify-instance-attribute instance_id --SOME_OPTION-TO-CHANGE-ZONE

But I'm making no progress. This is related to: http://stackoverflow.com/questions/8425739/is-it-possible-to-change-the-availability-zone-of-an-existing-ec2-t1-micro-insta

Thanks for any help - I'm fairly new at EC2.

share|improve this question
up vote 3 down vote accepted

No, but you can create an AMI from it, which'll let you launch an exact copy of that instance in any availability zone within that region. Launch the copy and kill the original.

share|improve this answer

If you are using EBS root, you can also do something like the following:

  1. Create a SNAPSHOT of your old system's root volume. You may need to stop your instance for this process. This is usually faster than creating an image.
  2. Create a new volume from the SNAPSHOT in the new availability zone.
  3. Choose "Launch More Like This" button on the old system and launch the same AMI into the new availability-zone.
  4. Stop the instance once it has been created. Note it's root device which is often /dev/xvda.
  5. Disassociate and delete the auto-generated root EBS volume that was associated with the new instance.
  6. Associate the new volume you created with the new instance in the new availability zone with the root device you noted above.
  7. Boot the new instance and validate everything looks good.

If you are using community images then you should consider booting the image you are using and then immediately making an image from it that you own. Otherwise, you run the risk of a community image getting removed and you not being able to do the "Launch More Like This" and other operations.

I usually create a small (~8gb) image from the community image and then change the root volume to my larger (>$200gb) EBS partition.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.