Move Amazon EC2 AMIs between regions via web-interface?

前端 未结 11 2188
眼角桃花
眼角桃花 2020-12-07 15:54

Any easy way to move and custom AMI image between regions? (tokyo -> singapore)

I know you can mess up with API and S3 to get it done, but there there any easier way

相关标签:
11条回答
  • 2020-12-07 15:59

    I'll add Scalr to the list of tools you can use (Disclaimer: I work there). Within Scalr, you can create your own AMI (we call them roles). Once your role is ready, you just have to choose where you want to deploy it (so in any regions).

    Scalr is open-source released under the Apache 2 license: you can to download it and install it yourself. Otherwise, it is also available through a hosted version including support. Alternatives to Scalr includes RightScale and enStratus.

    0 讨论(0)
  • 2020-12-07 16:03

    As of December, 2012, Amazon now supports migrating an AMI to another region through the UI tool (Amazon Management Console). See their documentation here

    So, how I've done it is..

    1. From the AMI find out the Snapshot-ID and how it is attached (e.g. /dev/sda1)
    2. Select the Snapshot, click "Copy", set Destination region and make the copy (takes a while!)
    3. Select the new Snapshot, click "Create Image"

            Architecture: (choose 32 or 64 bit)

            Name/Description: (give it one)

            Kernel ID: when migrating a Linux AMI, if you choose "default" it may fail. What worked for me was to go to the Amazon Kernels listing here to find the kernels Amazon supports, then specify it when creating the image)

            Root Device Name: /dev/sda1

            Click "Yes, Create"

      4.Launch an instance from the new AMI and test that you can connect.

    0 讨论(0)
  • 2020-12-07 16:03

    As of 2017, it's pretty simple.. just follow the screenshots:

    0 讨论(0)
  • 2020-12-07 16:04

    The following assumes your AWS Console utilities are installed in /opt/aws/bin/, JAVA_HOME=/usr and you are running i386 architecture, otherwise replace with x86_64.

    1) Run a live snapshot, where you believe your image can fit in 1.5GB and you have that to spare in /mnt (check running df)

    /opt/aws/bin/ec2-bundle-vol -d /mnt -k /home/ec2-user/.ec2/pk-XXX.pem -c /home/ec2-user/.ec2/cert-XXX.pem -u 123456789 -r i386 -s 1500

    2) Upload to current region's S3 bucket

    /opt/aws/bin/ec2-upload-bundle -b S3_BUCKET -m /mnt/image.manifest.xml -a abcxyz -s SUPERSECRET

    3) Transfer the image to EU S3 bucket

    /opt/aws/bin/ec2-migrate-image -K /home/ec2-user/.ec2/pk-XXX.pem -C /home/ec2-user/.ec2/cert-XXX.pem -o abcxyz -w SUPERSECRET --bucket S3_BUCKET_US --destination-bucket S3_BUCKET_EU --manifest image.manifest.xml --location EU

    4) Register your AMI so you can fire up the instance in Ireland

    /opt/aws/bin/ec2-register –K /home/ec2-user/.ec2/pk-XXX.pem –C /home/ec2-user/.ec2/cert-XXX.pem http://s3.amazonaws.com:80/S3_BUCKET/image.manifest.xml --region eu-west-1 -name DEVICENAME -a i386 --kernel aki-xxx

    0 讨论(0)
  • 2020-12-07 16:05

    AWS now supports the copy of an EBS snapshot to another region via UI/CLI/API. You can copy the snapshot and then make an AMI from it. Direct AMI copy is coming - from AWS:

    "We also plan to launch Amazon Machine Image (AMI) Copy as a follow-up to this feature, which will enable you to copy both public and custom-created AMIs across regions.

    http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-copy-snapshot.html?ref_=pe_2170_27415460

    0 讨论(0)
  • 2020-12-07 16:13

    There are API tools for this. http://docs.amazonwebservices.com/AWSEC2/latest/CommandLineReference/ApiReference-cmd-MigrateImage.html

    0 讨论(0)
提交回复
热议问题