Export virtual machine from Instance

To export virtual machines for deployment to virtualized environments, AWS supports direct export from EC2 Instance using the AWS CLI.

Export virtual machines from EC2 Instance.

  1. Please access the EC2 Management console to get the Instance ID information to export.

 VMWare Workstation

  1. Run the command aws ec2 create-instance-export-task to launch the process of exporting EC2 Instance to the desired format for your virtualized environment. You need to enter the following parameters:

    • –instance-id: The Instance ID retrieved from the list of EC2 instances.
    • –target-environment: Target virtualization environment (eg microsoft)
    • –export-to-s3-task: Specify the exported virtual machine parameters:
  • Format (vhd)
  • S3 bucket storage (export-bucket-2021)
  • Storage path in the bucket (vms/)
  • To minimize the possibility of incorrect input, create a file named file.json to store the parameters passed to the parameter –export-to-s3-task
{
"ContainerFormat": "ova",
"DiskImageFormat": "VMDK",
"S3Bucket": "export-bucket-2021",
"S3Prefix": "vms/"
}

 VMWare Workstation

  1. It will take some time to be able to export the instance to a VHD file used for deployment on a Hyper-V virtualized environment (or a VMDK file if you use VMWare Workstation). You can use aws ec2 describe-export-tasks command to check export progress
aws ec2 describe-export-tasks --export-task-ids <YourExportTaskID>

 VMWare Workstation

  1. Once done, you will have the virtual machine’s files stored in the S3 bucket.

 VMWare Workstation

Deployment of exported virtual machine

After downloading the vhd hard disk file to the on-premise system, you can try to deploy the virtual machine using this vhd file.