Step 1: Create OVA
Using vShpere Client
- Turn off the Windows 10 VM you want to import to AWS as an EC2 instance
- Log in to the Host from vShpere client, select the Windows VM, go to file->export->Export OVF template and export.
Using VMWare PowerCLI
- Turn off the Windows VM
Get-VM -Name "Windows-VM-NAME" | Shutdown-VMGuest -confirm:$false- Export the Windows-VM
Get-VM -Name "Windows-VM-NAME" | Export-VApp -Destination ‘C:\DESTINATION‘ -Format OVAStep 2 : Create AWS S3 Bucket
- Log in to your AWS account and navigate to S3
- Create a new bucket and upload the exported to this bucket
Step 3: Convert the OVA to AMI
- Go to EC2 console and spin a new temporary EC2 Instance with Amazon Linux t2.micro free tier with default parameters
- SSH to the EC2 instance you just created
- Configure AWS CLIs
aws configure
AWS Access Key ID [None]: xxxxxxxx
AWS Secret Access Key [None]: xxxxxxxx
Default region name [None]: xxxxxx
Default output format [None]:- You can test if your CLI is configured properly by running the following command
aws ec2 describe-regions- Create the following container.json file with your OVA details
[
{
"Description": "My Server OVA",
"Format": "ova",
"UserBucket": {
"S3Bucket": "my-import-bucket",
"S3Key": "vms/my-server-vm.ova"
}
}]- Start the AMI import (OVA to AMI conversion) process and make note of the Task ID
"ImportTaskId": "import-ami-xxxxxxxxxxxx"
aws ec2 import-image --description "Your Description" --disk-containers "container.json"
- Check the import task status using the task id
aws ec2 describe-import-image-tasks --import-task-ids import-ami-xxxxxxxxxxxxDifferent status for this task
active— The import task is in progress.deleting— The import task is being canceled.deleted— The import task is canceled.updating— Import status is updating.validating— The imported image is being validated.validated— The imported image was validated.converting— The imported image is being converted into an AMI.completed— The import task is completed and the AMI is ready to use.
Step 4: Create EC2 instance using AMI
- Navigate to EC2 on your aws console ->AMIs->select the newly created AMI and click on Launch to create the EC2 instance