Move Amazon AMI to another account

Dmitry Kuzmenko picture Dmitry Kuzmenko · Nov 30, 2011 · Viewed 13.2k times · Source

I have some machines created with my account. Some of them uses S3 storage, some EBS.

Now I need to move these machines to my company account to let it pay for.

As I know I can start each machine as my company user and create an image.

I wonder if there is a way to simple copy these machines?

Answer

Eric Hammond picture Eric Hammond · Dec 1, 2011

You can copy an EBS boot AMI from one EC2 account to another using the technique I wrote about here:

Copying EBS Boot AMIs Between EC2 Regions
http://alestic.com/2010/10/ec2-ami-copy

The commands I list are for copying an EBS boot AMI from one region to another, but if you simply use the right commands with different accounts instead of different regions, you can accomplish your goal. Note that you'll have to upload your personal ssh key to both accounts following these instructions:

Uploading Personal ssh Keys to Amazon EC2
http://alestic.com/2010/10/ec2-ssh-keys

Copying S3 based AMIs from one account to another is a bit convoluted and involves commands like:

  • ec2-download-bundle
  • ec2-unbundle
  • (switch accounts)
  • ec2-bundle-vol
  • ec2-upload-bundle
  • ec2-register

Alternatively, you hopefully documented the exact steps you took to create the original AMIs. Simply follow these instructions to create the AMIs in the new account.