Import virtual machines from VMware ESX to AWS

Step 0, Option 1: Create AWS keys
Step 0, option 2
– Create AWS user account with full access
– Create configuration file:
– Create a service user account in vCenter:
– Optional: Download and  install AWS Connector for vCenter:
Procedures for Option 1:
Step 1: Install AWS CLI (
Download AWS CLI Tools:
Step 2: Install Java and set Paths
Step 3: Configure CLI
#aws configure
Access Key ID: $accessKey=”xxxxxZFFRVSU45E7xxxxx”
Secret Access Key: $secretAccessKey=”xxxxxAQP9hUzTHJDthDkKC25whquP6cB9Bgxxxxx”
Default Region: us-west-1
Default output format [None]: json
Step 4: Prepare VM
Disable antivirus
Make sure volumes are MBR as GPT is not supported
P2V converted VMs are not supported
Disk cannot exceed 1TB
Step 5: Export VM
vSphere client >> Select VM >> File >> Export >> Export OVF Template >> Enter information >> Choose OVF format
Step 6: Import into AWS EC2
Example of VM with two volumes (C:\ and D:\)
# ec2-import-instance C:\Users\kdoan\Desktop\MAIL03\MAIL03-disk1.vmdk -f VMDK -z us-west-1b -t t2.large -a x86_64 -b -o xxxxxZFFRVSU45E7xxxxx -w xxxxxAQP9hUzTHJDthDkKC25whquP6cB9Bgxxxxx -p Windows –subnet subnet-8e1a28c8
# ec2-import-volume C:\Users\kdoan\Desktop\MAIL03\MAIL03-disk2.vmdk -f VMDK -z us-west-1b -s 100 -b -o xxxxxZFFRVSU45E7xxxxx -w xxxxxAQP9hUzTHJDthDkKC25whquP6cB9Bgxxxxx
Run the instance and attach the volume(s)
Run sysprep
ec2-delete-disk-image -t import-i-ffj3s15y -o xxxxxZFFRVSU45E7xxxxx-w xxxxxAQP9hUzTHJDthDkKC25whquP6cB9Bgxxxxx
Example importing machine with three volumes:
# ec2-import-instance C:\Users\kdoan\Desktop\POLICY01\POLICY01-disk1.vmdk -f VMDK -z us-west-1b -t t2.large -a x86_64 -b -o $accessKey -w $secretAccessKey -p Windows –subnet subnet-8e1a28c8
# ec2-import-volume C:\Users\kdoan\Desktop\POLICY01\POLICY01-disk2.vmdk -f VMDK -z us-west-1b -s 50 -b -o $accessKey -w $secretAccessKey
# ec2-import-volume C:\Users\kdoan\Desktop\POLICY01\POLICY01-disk3.vmdk -f VMDK -z us-west-1b -s 250 -b -o $accessKey -w $secretAccessKey
Other Examples:
# ec2-import-instance C:\Users\kdoan\Desktop\WEB01\WEB01-disk1.vmdk -f VMDK -z us-west-1c -t t2.large -a x86_64 -b -o $accessKey -w $secretAccessKey -p Windows –subnet subnet-28798a4d
# ec2-import-volume C:\Users\kdoan\Desktop\WEB01\WEB01-disk2.vmdk -f VMDK -z us-west-1c -s 100 -b -o $accessKey -w $secretAccessKey
# ec2-import-instance C:\Users\kdoan\Desktop\Export\FTP01\FTP01-disk1.vmdk -f VMDK -z us-west-1c -t t2.medium -a x86_64 -b -o $accessKey -w $secretAccessKey -p Windows –subnet subnet-28798a4d
# ec2-import-volume C:\Users\kdoan\Desktop\Export\FTP01\FTP01-disk2.vmdk -f VMDK -z us-west-1c -s 100 -b -o $accessKey -w $secretAccessKey
# ec2-import-instance C:\Users\kdoan\Desktop\Export\CLAIMS01\CLAIMS01-disk1.vmdk -f VMDK -z us-west-1b -t t2.medium -a x86_64 -b -o $accessKey -w $secretAccessKey -p Windows –subnet subnet-8e1a28c8
# ec2-import-volume C:\Users\kdoan\Desktop\export\CLAIMS01\CLAIMS01-disk2.vmdk -f VMDK -z us-west-1b -s 100 -b -o $accessKey-w $secretAccessKey
# ec2-import-instance C:\Users\kdoan\Desktop\Export\POLICY01\POLICY01-disk1.vmdk -f VMDK -z us-west-1b -t t2.medium -a x86_64 -b -o $secretAccessKey -w $accessKey -p Windows –subnet subnet-8e1a28c8
# ec2-import-volume C:\Users\kdoan\Desktop\export\POLICY01\POLICY01-disk2.vmdk -f VMDK -z us-west-1b -s 50 -b -o $accessKey -w $secretAccessKey
# ec2-import-volume C:\Users\kdoan\Desktop\export\POLICY01\POLICY01-disk3.vmdk -f VMDK -z us-west-1b -s 250 -b -o $accessKey -w $secretAccessKey
# ec2-import-instance C:\Users\kdoan\Desktop\Export\UND01\UND01-disk1.vmdk -f VMDK -z us-west-1b -t t2.medium -a x86_64 -b -o $accessKey -w $secretAccessKey -p Windows –subnet subnet-8e1a28c8
# ec2-import-volume C:\Users\kdoan\Desktop\export\UND01\UND01-disk2.vmdk -f VMDK -z us-west-1b -s 120 -b -o $accessKey -w $secretAccessKey

Leave a Reply

Your email address will not be published. Required fields are marked *