AWS EC2 Export
Firstly we need to install AWS Command Line Interface
The AWS Command Line Interface (CLI) is a unified tool to manage your AWS services. With just one tool to download and configure, you can control multiple AWS services from the command line and automate them through scripts.
Download The AWS CLI MSI Installer for Windows from http://docs.aws.amazon.com/cli/latest/userguide/awscli-install-windows.html based on your windows
For Windows 64 bit.
Now Download python from https://www.python.org/downloads/windows/
Then open your AWS console and do the following
Get the “Access Key ID” and “Secret Access Key”
check aws version to see python and aws cli installed properly
Type “aws configure”
VM Export – Prerequisites
To export a VM from Amazon EC2, install the AWS CLI on the instance. (We did in first stage)
You can create an Amazon S3 bucket for storing the exported instances and grant VM Import/Export permission to access the bucket. If you already have a bucket and want to use it, you can use it instead of creating a bucket.
To create an S3 bucket
- Open the Amazon S3 console at https://console.aws.amazon.com/s3/
- Choose Create Bucket.
- In the Create a Bucket dialog box, do the following:
- For Bucket Name, type a name for your bucket. This name must be unique across all existing bucket names in Amazon S3. In some regions, there might be additional restrictions on bucket names.
- For Region, select a region.
- Choose Create. When the bucket is created, the details pane opens with the Permissions section expanded.
- Choose Add More Permissions.
- For Grantee, type the appropriate region-specific canonical account ID:
- China (Beijing): 834bafd86b15b6ca71074df0fd1f93d234b9d5e848a2cb31f880c149003ce36f
- AWS GovCloud (US-West): af913ca13efe7a94b88392711f6cfc8aa07c9d1454d4f190a624b126733a5602
- All other regions: c4d8eabf8db69dbe46bfe0e517100c554f01200b104d59cd408e777ba442a322
- Select Upload/Delete and View Permissions.
- Choose Save.
Before starting VM Export from AWS, Please do not forget the following
Exporting instances and volumes is subject to the following limitations:
- You can’t export an instance from Amazon EC2 unless you previously imported it into Amazon EC2 from another virtualization environment.
- You must export your instances and volumes to one of the following image formats that your virtualization environment supports:
- Open Virtual Appliance (OVA), which is compatible with VMware vSphere versions 4, 5, and 6.
- Virtual Hard Disk (VHD), which is compatible with Citrix Xen and Microsoft Hyper-V virtualization products.
- Stream-optimized ESX Virtual Machine Disk (VMDK), which is compatible with VMware ESX and VMware vSphere versions 4, 5, and 6.
- You can’t export Amazon EBS data volumes.
- You can’t export an instance that has more than one virtual disk.
- You can’t export an instance that has more than one network interface.
- You can’t export an instance from Amazon EC2 if you’ve shared it from another AWS account.
- You can’t have more than five export tasks per region in progress at the same time.
- VMs with volumes larger than 1 TiB are not supported.
Add firstname.lastname@example.org account for access
Then type the following;
aws ec2 create-instance-export-task –instance-id i-0dcffb71970b3e49c –target-environment vmware –export-to-s3-task DiskImageFormat=VMDK,ContainerFormat=ova,S3Bucket=vmexportcloudepict,S3Prefix=export-new1.ova –region us-east-1
If the image was previously imported into AWS, then following the documentation steps above will suffice. If not please reach us to solve this problem.