Export virtual machine from Instance

To export virtual machines for deployment to on-premises virtualization environments, AWS supports direct export from EC2 Instance through AWS CLI.

Export virtual machine from EC2 Instance

  1. Access the Amazon EC2 console to get the Instance ID information needed for export.

EC2 Console

  1. Run the aws ec2 create-instance-export-task command to initiate the task of exporting EC2 Instance to a format suitable for the target virtualization environment. You need to enter the following parameters:

    • --instance-id: Instance ID obtained from the EC2 instances list.
    • --target-environment: Target virtualization environment (e.g., vmware)
    • --export-to-s3-task: Specify the parameters of the exported virtual machine:
      • Format (vmdk)
      • Storage S3 bucket (export-bucket-2026-1a)
      • Prefix in bucket (vms/)

    To avoid input errors, create a JSON file export-task.json containing the parameters for --export-to-s3-task:

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

    AWS CLI Export Task

    • In the directory containing the configuration file, run the following command to start exporting the EC2 instance to a virtual machine file saved in S3.
    aws ec2 create-instance-export-task --region ap-southeast-1 --instance-id i-xxxxxxx --target-environment vmware --export-to-s3-task file://export-task.json
    

You can modify the parameters as appropriate (such as region and instance id)

Check Export Task Status

  1. The export process may take some time (approximately 60 minutes). Use the following command to check progress:

    aws ec2 describe-export-tasks --export-task-ids <ExportTaskID>
    

You can modify the parameters as appropriate (such as replacing export-i-xxxxxxx with your export-task-ids)

S3 Bucket S3 Bucket

  1. After completion, the virtual machine file will be saved in the specified S3 bucket.

S3 Bucket

Testing deployment of exported virtual machine

After downloading the disk image file (VMDK or VHD) to the on-premises system, you can deploy the virtual machine using this file on the corresponding virtualization platform (VMware or Hyper-V).