Import your VM as an image - VM Import/Export
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Import your VM as an image

After exporting your VM from your virtualization environment, you can import it to Amazon EC2. The import process is the same regardless of the origin of the VM.

Prerequisites for importing a VM into Amazon EC2

Upload the image to Amazon S3

Upload your VM image file to your S3 bucket using the upload tool of your choice. For information about uploading objects through the Amazon S3 console, see Uploading Objects.

Import the VM

After you upload your VM image file to Amazon S3, you can use the Amazon CLI to import the image. These tools accept either the S3 bucket and path to the file or a URL for a public Amazon S3 file. Private Amazon S3 files require a presigned URL.

You can also use the Import virtual machine images to Amazon template in the Migration Hub Orchestrator console to import your on-premises virtual machine images to Amazon. For more information, see Example 4.

Important
  • Amazon VM Import/Export strongly recommends specifying a value for either the --license-type or --usage-operation parameter when you create a new VM Import task. This ensures your operating system is licensed appropriately and your billing is optimized. For more information, see Licensing for your imported VMs.

  • Amazon VM Import/Export only supports images that were natively installed inside the source VM and not those created using a physical-to-virtual (P2V) conversion process. For more information, see the VM Import/Export Requirements.

  • If you use a JSON file to pass input to the disk-containers parameter, prefix the file path with file:// or a syntax related error might occur.

The following examples use the Amazon CLI command import-image to create import tasks.

Example 1: Import an image with a single disk

Use the following command to import an image with a single disk.

aws ec2 import-image --description "My server VM" --disk-containers "file://C:\import\containers.json"

The following is an example containers.json file that specifies the image using an S3 bucket.

[ { "Description": "My Server OVA", "Format": "ova", "UserBucket": { "S3Bucket": "my-import-bucket", "S3Key": "vms/my-server-vm.ova" } } ]

The following is an example containers.json file that specifies the image using a URL in Amazon S3.

[ { "Description": "My Server OVA", "Format": "ova", "Url": "s3://my-import-bucket/vms/my-server-vm.ova" } ]

Example 2: Import an image with multiple disks

Use the following command to import an image with multiple disks.

aws ec2 import-image --description "My server disks" --disk-containers "file://C:\import\containers.json"

The following is an example containers.json file.

[ { "Description": "First disk", "Format": "vmdk", "UserBucket": { "S3Bucket": "my-import-bucket", "S3Key": "disks/my-server-vm-disk1.vmdk" } }, { "Description": "Second disk", "Format": "vmdk", "UserBucket": { "S3Bucket": "my-import-bucket", "S3Key": "disks/my-server-vm-disk2.vmdk" } } ]

Example 3: Import with the encrypted option enabled

Use the following command to import an image with an encrypted root volume.

aws ec2 import-image --description "My server disks" --encrypted --kms-key-id 0ea3fef3-80a7-4778-9d8c-1c0c6EXAMPLE --disk-containers "file://C:\import\containers.json"

The CMK provided for encryption must not be disabled during the entire import process. For more information, see Amazon EBS Encryption in the Amazon EC2 User Guide.

Example 4: Import an image using the Import virtual machine images to Amazon template in Migration Hub Orchestrator

  1. Open the Migration Hub Orchestrator console.

  2. In the navigation pane, choose Create migration workflow.

  3. On the Choose a workflow template page, choose the Import virtual images to Amazon template.

  4. Configure and submit your workflow to begin the VM import. For more information, see the Amazon Migration Hub Orchestrator User Guide.