Migrating Amazon EC2 AMIs to other regions

It’s been over a year since my last blog post. Time has flown since then, and a lot has happened – I’ll cover the highlights in another post.

In the meantime I wanted to jot down some notes about Amazon Web Services, particularly around launching instances in other regions (mainly for my own benefit !) Amazon currently operates 3 “regions” each of which can be thought of as an individual “cloud” in it’s own right. The most recent came online in December in California.

I wanted to run one of our EC2 instances in this new region, but it wasn’t quite as straightforward as I’d hoped. A few people have mentioned problems about doing this but one post on the AWS dev site was very helpful.

Basically you have to migrate your AMI from one region to another before you can run it. To do this first launch an instance of the AMI you want to migrate in US-East, then on that instance run the following command (detailed help here):

ec2-migrate-bundle -k (your private key file) -c (your cert) -a (your access key) -s (your secret access key) --bucket (your source bucket) --manifest (your manifest filename) --location US --region us-west-1 --destination-bucket (destination bucket you want to create)

… then, on a local machine run:

ec2-register --region us-west-1 --name (your ami name) (your new manifest fullpath on us-west-1)

Note: You can of course use the AWS Console to register your AMI too.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s