Move an EBS backed AWS instance to another EC2 Region

by Alexander Weiß

Recently Amazon announced a new feature of the EC2 Management Console which makes moving EBS backed instances from one region to another a lot easier: You can copy an EBS Snapshot to another EC2 Region with a single click. In this post I’ll explain the whole process of moving one instance from one EC2 Region to another.

There are many ways to move an instance to another region, you can find a list of the different possibilites here. With the new feature of inter region EBS copies, there is a new apporach availabe. You can split this process in two major steps. First you have to make a Snapshot and copy it to the target EC2 region. Then you have to create an AMI from the EBS Snapshot and launch an instance. The whole process is pretty straight forward, but I’ll give you a detailed listing of the necessary steps:

  1. Open the EC2 Management Console and navigate to the “Instances” subsection of “Instances”
  2. Note the value you find in the column “Instance” of the instance you want to move
  3. Navigate to the “Volumes” subsection of “Elastic Block Storage”
  4. Select the EBS Volume which is connected to the instance you want to move. The value you noted in step 2 should be displayed in the “Attachment Information”
  5. Click on the “Create Snapshot” option in  the “Actions” menu

    Move instance to another EC2 Region: Create Snapshot

    Move instance to another EC2 Region: Create Snapshot

  6. Now you have to name the Snapshot and give a description
  7. Navigate to the “Snapshots” subsection
  8. Select the Snapshot you just created and click on the “Copy” button
  9. Now you have to choose to which EC2 Region the EBS Snapshot will be copied
    Move instance to another EC2 Region: Copy Snapshot

    Move instance to another EC2 Region: Copy Snapshot

     

    Move instance to another EC2 Region: Copy Snapshot success

    Move instance to another EC2 Region: Copy Snapshot success

  10. The copy process is now initiated and you’ll have to wait till the process is finished. If you think you can go on a long coffee break now, I must disappoint you: Copying a 8 GBit Snapshot from the us-east-1 Region to eu-west-1 Region took around 3 minutes

Now comes the tricky part: You have to figure out the right Kernel ID for the AMI you want to create. The problem here is that Kernel IDs of the same AMIs are different for each EC2 Region.

To figure out the right Kernel ID you have to look up the Kernel ID of the instance from which you made the Snapshot. Then you have to use your Google skills to find a list of which gives you an overview of the combinations of Kernel IDs and Regions for the AMI you used, when you launched the instance. When you have found the list, you have to find the Kernel ID of the AMI in your target EC2 Region by digging through the list. Let’s start:

  1. Go to the “Instances” subsection in your source EC2 Region and select the instance you created the Snapshot from
  2. Note the AMI and the Kernel ID
  3. AMI ID KERNEL ID
  4. If you look at the screenshot above you’ll know that I use an AMI based on the Ubuntu Lucid Release 20120724. The Kernel ID of this AMI is aki-4feec43b
  5. I use this information to Google a list of all Ubuntu Lucid AMIs. You can find the list here: http://uec-images.ubuntu.com/query/lucid/server/released.txt

    Move instance to another EC2 Region: AMI list

    Move instance to another EC2 Region: AMI list

  6. In this list you have to find the line with your Kernel ID. Note the storage value and the architecture value. In my case the storage is value is “ebs” and the architecture value is “amd64”
  7. Now you have to find the AMI with the same release number, storage value an architecture value. The value which has to differ is the one for the region, because you are looking for the values  for your target EC2 Region. In my example, the source region is “eu-west-1” and the target region is “us-east-1”. If you match these values (“ebs”, “amd64”, “20120724”, “us-east-1”) you’ll see, that the value of the AMI is ami-d5e554dbc and the Kernel ID is aki-427d952b

With these values you can create an AMI in the target region. You have to use the EBS Snapshot you copied before as the basis for this AMI:

  1. Switch to the target region in the EC2 Management Console
  2. Go to the “Snapshots” subsection
  3. Select the Snapshot you just copied
  4. Click on the “Create Image” button and provide the values you looked up in the image list. In the “Architecture” dropdown menu you have to choose “x86_64” if “amd64” is the architecture of your image otherwise you can use the default value “i386”

    Move instance to another EC2 Region: Create AMI

    Move instance to another EC2 Region: Create AMI

  5. Now go to the “AMI” subsection and select the AMI you created in the step before
  6. Click on the Launch button
  7. Now you have to create an Instance from the AMI, If you are not familiar with this process you find an guide here

That’s it: You now have successfully moved an EBS backed instance from one EC2 Region to another. Compared with the old way to move instances between regions the new feature of inter region EBS copies proves very valuable.

VN:F [1.9.22_1171]
Rating: 10.0/10 (1 vote cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)
Move an EBS backed AWS instance to another EC2 Region, 10.0 out of 10 based on 1 rating