Amazon Elastic Compute Cloud
User Guide (API Version 2013-02-01)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Go to the Kindle Store to download this guide in Kindle format.Did this page help you?  Yes | No |  Tell us about it...

Exporting EC2 Instances

If you have previously imported an instance running Microsoft Windows Server into Amazon Elastic Compute Cloud (Amazon EC2), you can use the command line tools to export that Microsoft Windows Server instance to Citrix Xen, Microsoft Hyper-V, or VMware vSphere. Exporting an instance can be useful when you want to deploy a copy of your EC2 instance in your on-site virtualization environment.

Before You Get Started

Before you begin the process of exporting an instance, you need to be aware of the operating systems and image formats we support, and understand the limitations on exporting instances and volumes. You will also need to download and install the EC2 command line tools and sign up for your private key and X.509 certificate before you use the command line interface (CLI) or the API to export your instance. For more information, see Setting Up the Amazon EC2 Command Line Interface Tools on Linux/UNIX.

Operating Systems

The following operating systems can be exported from Amazon EC2:

  • Windows Server 2003 R2 (Standard, Enterprise, and Datacenter)

  • Windows Server 2008 (Standard, Enterprise, and Datacenter)

  • Windows Server 2008 R2 (Standard, Enterprise, and Datacenter)

Image Formats

We support the following image formats for exporting both volumes and instances from Amazon Web Services (AWS):

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

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

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

Known Limitations

The exporting of instances and volumes is subject to the following limitations:

  • You cannot export Amazon Elastic Block Store (Amazon EBS) data volumes.

  • You cannot export an instance that has more than one virtual disk.

  • You cannot export an instance that has more than one network interface.

Export an Instance

You can use the Amazon EC2 command line interface (CLI) to export an instance. The ec2-create-instance-export-task command gathers all of the information necessary (e.g., instance ID; name of the S3 bucket that will hold the exported image; name of the exported image; VMDK, OVA, or VHD format) to properly export the instance to the selected virtualization format. The exported file is saved in the Amazon Simple Storage Service (Amazon S3) bucket that you designate.

Note

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

To export an instance

  1. Create an Amazon S3 bucket where exported instances will be stored. The S3 bucket must grant Upload/Delete and View Permissions access to the vm-import-export@amazon.com account. For more information, see Creating a Bucket and Editing Bucket Permissions in the Amazon Simple Storage Service Console User Guide.

  2. At a command prompt, type the following command: ec2-create-instance-export-task INSTANCE_ID –e TARGET_ENVIRONMENT –f DISK_IMAGE_FORMAT -c CONTAINER_FORMAT –b S3_BUCKET

    Where:

    INSTANCE_ID is the ID of the instance you want to export.

    TARGET_ENVIRONMENT is VMware, Citrix, or Microsoft.

    DISK_IMAGE_FORMAT is VMDK for VMware or VHD for Microsoft Hyper-V and Citrix Xen.

    CONTAINER_FORMAT may be optionally set to OVA when exporting to VMware.

    S3_BUCKET is the name of the Amazon S3 bucket to which you want to export the instance.

  3. To monitor the export of your instance, at the command prompt, type the following command: ec2-describe-export-tasks TASK_ID

    Where:

    TASK_ID is the ID of the export task.

Cancel or Stop the Export of an Instance

You can use the Amazon EC2 command line interface (CLI) to cancel or stop the export of an instance up to the point of completion. The ec2-cancel-export-task 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.

To cancel or stop the export of an instance

  • At the command prompt, type: ec2-cancel-export-task TASK_ID

    Where

    TASK_ID is the ID of the export task you want to cancel.