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 using VM Import/Export. 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: Import an image using Migration Hub Orchestrator.

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.

Example 1: Import an image using an OVA file

Amazon CLI

Use the following import-image command.

aws ec2 import-image \ --description "$(date '+%b %d %H:%M') My server VM" \ --license-type "AWS" \ --disk-containers '[{ "Format": "OVA", "UserBucket": { "S3Bucket": "amzn-s3-demo-import-bucket", "S3Key": "vms/my-server-vm.ova" } }]'
PowerShell

Use the Import-EC2Image cmdlet as follows.

Import-EC2Image ` -Description ((Get-Date -Format "MMM dd HH:mm ") + "My server OVA") ` -LicenseType "AWS" ` -DiskContainer @( @{ Format = "OVA" UserBucket = @{ S3Bucket = "amzn-s3-demo-import-bucket" S3Key = "vms/my-server-vm.ova" } } )

Example 2: Import an image with multiple disks

Amazon CLI

Use the import-image command.

aws ec2 import-image \ --description "$(date '+%b %d %H:%M') My server disks" \ --license-type "AWS" \ --disk-containers '[ { "Description": "First disk", "Format": "vmdk", "UserBucket": { "S3Bucket": "amzn-s3-demo-import-bucket", "S3Key": "disks/my-server-vm-disk2.vmdk" } }, { "Description": "Second disk", "Format": "vmdk", "UserBucket": { "S3Bucket": "amzn-s3-demo-import-bucket", "S3Key": "disks/my-server-vm-disk2.vmdk" } } ]'
PowerShell

Use the Import-EC2Image cmdlet as follows.

Import-EC2Image ` -Description ((Get-Date -Format "MMM dd HH:mm ") + "My server disks") ` -LicenseType "AWS" ` -DiskContainer @( @{ Description = "First disk" Format = "vmdk" UserBucket = @{ S3Bucket = "amzn-s3-demo-import-bucket" S3Key = "disks/my-server-vm-disk1.vmdk" } }, @{ Description = "Second disk" Format = "vmdk" UserBucket = @{ S3Bucket = "amzn-s3-demo-import-bucket" S3Key = "disks/my-server-vm-disk2.vmdk" } } )

Example 3: Import with the encrypted option enabled

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

Amazon CLI

Use the following import-image command.

aws ec2 import-image \ --description "$(date '+%b %d %H:%M') My server OVA" \ --encrypted \ --kms-key-id 0ea3fef3-80a7-4778-9d8c-1c0c6EXAMPLE \ --disk-containers '[{ "Format": "OVA", "UserBucket": { "S3Bucket": "amzn-s3-demo-import-bucket", "S3Key": "vms/my-server-vm.ova" } }]'
PowerShell

Use the Import-EC2Image cmdlet as follows.

Import-EC2Image ` -Description ((Get-Date -Format "MMM dd HH:mm ") + "My server disks") ` -LicenseType "AWS" ` -DiskContainer @( @{ Format = "OVA" UserBucket = @{ S3Bucket = "amzn-s3-demo-import-bucket" S3Key = "vms/my-server-vm.ova" }0 } ) ` -Encrypted $true ` -KmsKeyId "alias/aws/ebs"

Example 4: Import an image using Migration Hub Orchestrator

Console
To import an image using a template
  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.