Exporting an instance as a VM using VM Import/Export - 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).

Exporting an instance as a VM using VM Import/Export

Exporting as a VM is useful when you want to deploy a copy of an Amazon EC2 instance in your virtualization environment. You can export most EC2 instances to Citrix Xen, Microsoft Hyper-V, or VMware vSphere.

When you export an instance, you are charged the standard Amazon S3 rates for the bucket where the exported VM is stored. In addition, there might be a small charge for the temporary use of an Amazon EBS snapshot. For more information about Amazon S3 pricing, see Amazon Simple Storage Service Pricing.



You can't export a VM to an S3 bucket that uses the bucket owner enforced setting for S3 Object Ownership because ACLs are disabled. For more information, see Configuring ACLs in the Amazon Simple Storage Service User Guide.

To export a VM from Amazon EC2, first meet the following prerequisites.

  • Install the Amazon CLI. For more information, see the Amazon Command Line Interface User Guide.


    In supported Amazon Web Services Regions, you can also use Amazon CloudShell for a browser-based, pre-authenticated shell that launches directly from the Amazon Web Services Management Console.

  • Create an Amazon S3 bucket for storing the exported instances or choose an existing bucket. The bucket must be in the Region where you want export your VMs. Additionally, the bucket must belong to the Amazon Web Services account where you are performing the export operation. For more information, see the Amazon Simple Storage Service User Guide.

  • Prepare your Amazon S3 bucket by attaching an access control list (ACL) containing the following grants. For more information, see Managing Access with ACLs in the Amazon Simple Storage Service User Guide.

    • For Grantee, provide the appropriate Region-specific canonical account ID:

      Africa (Cape Town)


      Asia Pacific (Hong Kong)


      Asia Pacific (Hyderabad)


      Asia Pacific (Jakarta)


      Asia Pacific (Melbourne)


      Asia Pacific (Osaka)


      Canada West (Calgary)


      Europe (Milan)


      Europe (Spain)


      Europe (Zurich)


      Israel (Tel Aviv)


      Middle East (Bahrain)


      Middle East (UAE)


      China (Beijing) and China (Ningxia)


      Amazon GovCloud (US)


      All other Regions


    • For each Grantee, provide the following permissions:

      • READ_ACP (In the Amazon S3 console, Bucket ACL should have the Read permission)

      • WRITE (In the Amazon S3 console, Objects should have the Write permission)

Considerations for instance export

Exporting instances and volumes is subject to the following limitations:

  • You must export your instances and volumes to one of the following image formats that your virtualization environment supports:

    • Open Virtual Appliance (OVA), which is compatible with VMware vSphere versions 4, 5, and 6.

    • Virtual Hard Disk (VHD), which is compatible with Citrix Xen and Microsoft Hyper-V virtualization products.

    • Stream-optimized ESX Virtual Machine Disk (VMDK), which is compatible with VMware ESX and VMware vSphere versions 4, 5, and 6.

  • You can't export an instance if it contains third-party software provided by Amazon. For example, VM Export cannot export Windows or SQL Server instances, or any instance created from an image in the Amazon Web Services Marketplace.

  • You can't export an instance with encrypted EBS snapshots in the block device mapping.

  • You can't export an instance with instance store volumes in the block device mapping.

  • You can only export EBS volumes that are specified in the block device mapping, not EBS volumes attached after instance launch.

  • You can't export an instance launched from an imported image if you deleted the AMI or the EBS snapshot for the AMI. To work around the issue, create an AMI from the instance and export the AMI.

  • You can't export an instance that has more than one virtual disk.

  • You can't export an instance that has more than one network interface.

  • You can't export an instance from Amazon EC2 if you've shared it from another Amazon account.

  • By default, you can't have more than 5 conversion tasks per Region in progress at the same time. This limit is adjustable up to 20.

  • VMs with volumes larger than 1 TiB are not supported.

  • You can export a volume to either an unencrypted S3 bucket or to a bucket encrypted using SSE-S3. You cannot export to an S3 bucket encrypted using SSE-KMS.

  • VM Import/Export only supports exporting VMs to an Amazon S3 bucket in the same Amazon Web Services account that you export them from.

  • Export operations do not support hybrid configurations. GRUB2 must be enabled for either BIOS or UEFI, but it can't be enabled for both.

Start an instance export task


Your instance might reboot during the export process. Ensure that you are performing this action when some downtime is acceptable.

To export your instance, use the create-instance-export-task command. The exported file is written to the specified S3 bucket in the following S3 key: prefixexport-i-xxxxxxxxxxxxxxxxx.format (for example, my-export-bucket/vms/export-i-1234567890abcdef0.ova).

aws ec2 create-instance-export-task --instance-id instance-id --target-environment vmware --export-to-s3-task file://C:\file.json

The file file.json is a JSON document that contains the required information.

{ "ContainerFormat": "ova", "DiskImageFormat": "VMDK", "S3Bucket": "my-export-bucket", "S3Prefix": "vms/" }

The following is an example response. The status shown is active, which means that the export task is in progress. The instance export is finished when the status is completed.

{ "ExportTask": { "ExportTaskId": "export-i-021345abcdef6789", "ExportToS3Task": { "ContainerFormat": "ova", "DiskImageFormat": "vmdk", "S3Bucket": "my-export-bucket", "S3Key": "vms/export-i-021345abcdef6789.ova" }, "InstanceExportDetails": { "InstanceId": "i-021345abcdef6789", "TargetEnvironment": "vmware" }, "State": "active" } }

Monitor an instance export task

To monitor the export of your instance, use the following describe-export-tasks command:

aws ec2 describe-export-tasks --export-task-ids export-i-1234567890abcdef0

Cancel an instance export task

If you need to, you can use the following cancel-export-task command to cancel the export of an instance that is in progress.

aws ec2 cancel-export-task --export-task-id export-i-1234567890abcdef0

This command removes all artifacts of the export, including any partially created Amazon S3 objects. If the export task is complete or is in the process of transferring the final disk image, the command fails and returns an error.