Saturday, 25 April 2015

VM Import Update – Faster and More Flexible, with Multi-Volume Support

https://aws.amazon.com/blogs/aws/vm-import-update-faster-and-more-flexible-with-multi-volume-support/
Benefits of ImportImage:
ImportInstanceImportImage
SourceS3 manifest + objects
(usually uploaded from an on-premises image file)
Image file in S3 or an EBS Snapshot
DestinationStopped EC2 instanceAmazon Machine Image (AMI)
VM ComplexitySingle volume, single diskMultiple volume, multiple disk
Concurrent Imports520
Operating Systems Windows Server 2003, Windows Server 2008, Windows Server 2012, Red Hat Enterprise Linux (RHEL), CentOS, Ubuntu, Debian.
VM FormatsVMDK, VHD, RAWVMDK, VHD, RAW, OVA

If you update AWS CLI to 1.7.24 (pip install --upgrade awscli) you get new command:
http://docs.aws.amazon.com/cli/latest/reference/ec2/import-image.html
aws ec2 import-image
[--dry-run | --no-dry-run]
[--description <value>]
[--disk-containers <value>]
[--license-type <value>]
[--hypervisor <value>]
[--architecture <value>]
[--platform <value>]
[--client-data <value>]
[--client-token <value>]
[--role-name <value>]
[--cli-input-json <value>]
[--generate-cli-skeleton]

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ImportVMImportImage.html
Example using the aws ec2 import-image command with multiple explicit disks
Use aws ec2 import-image command to a new import instance task.
$ aws ec2 import-image --cli-input-json "{  \"Description\": \"Windows 2008 VMDKs\", \"DiskContainers\": [ { \"Description\": \"Second CLI task\", \"UserBucket\": { \"S3Bucket\": \"my-import-bucket\", \"S3Key\" : \"my-windows-2008-vm-disk1.vmdk\" } }, { \"Description\": \"First CLI task\", \"UserBucket\": { \"S3Bucket\": \"my-import-bucket\", \"S3Key\" : \"my-windows-2008-vm-disk2.vmdk\" } }  ], }"
Example response
<ImportImageResponse xmlns="http://ec2.amazonaws.com/doc/2015-03-01/">
    <progress>2</progress>
    <importTaskId>import-ami-fgxn591c</importTaskId>
    <status>active</status>
    <description>Windows 2008 VMDKs</description>
    <snapshotTaskDetailSet>
        <item>
            <diskImageSize>0.0</diskImageSize>
            <userBucket>
                <s3Bucket>my-import-bucket</s3Bucket>
                <s3Key>my-windows-2008-vm-disk1.vmdk</s3Key>
            </userBucket>
        </item>
        <item>
            <diskImageSize>0.0</diskImageSize>
            <userBucket>
                <s3Bucket>my-import-bucket</s3Bucket>
                <s3Key>my-windows-2008-vm-disk2.vmdk</s3Key>
            </userBucket>
        </item>
    </snapshotTaskDetailSet>
    <licenseType>AWS</licenseType>
    <statusMessage>pending</statusMessage>
    <requestId>1571e127-d6d8-4984-b4f1-3a21e9dbdcb5</requestId>
</ImportImageResponse>

No comments:

Post a Comment