Benefits of ImportImage:
| ImportInstance | ImportImage | |
| Source | S3 manifest + objects (usually uploaded from an on-premises image file) | Image file in S3 or an EBS Snapshot |
| Destination | Stopped EC2 instance | Amazon Machine Image (AMI) |
| VM Complexity | Single volume, single disk | Multiple volume, multiple disk |
| Concurrent Imports | 5 | 20 |
| Operating Systems | Windows Server 2003, Windows Server 2008, Windows Server 2012, Red Hat Enterprise Linux (RHEL), CentOS, Ubuntu, Debian. | |
| VM Formats | VMDK, VHD, RAW | VMDK, VHD, RAW, OVA |
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