Overview
This guide provides a step-by-step process for exporting an AWS EC2 instance as a VMDK (VMware disk format) for transfer to the Micron21 mCloud platform.
📌 Note: This guide performs all steps using the AWS root account.
Prerequisites
Before proceeding with the export, ensure that your EC2 instance meets AWS export requirements.
Check EC2 Instance Eligibility
AWS imposes restrictions on instances that can be exported. Your EC2 instance must meet the following criteria:
The instance must have been imported initially into AWS (i.e., it cannot be an Amazon-provided AMI) or a custom AMI.
Amazon EBS encryption must not be enabled on the instance.
You can't export an instance if it contains third-party software provided by AWS. For example, VM Export cannot export Windows or SQL Server instances or any instance created from an image in the AWS Marketplace.
For the full list of export requirements, refer to the AWS VMware Export Prerequisites: https://docs.aws.amazon.com/vm-import/latest/userguide/vmexport-limits.html
Step 1: Create an S3 Bucket
To store the exported EC2 instance, you need an S3 bucket.
In the S3 Dashboard, click Create Bucket.
Set a Unique Bucket Name:
Enter a globally unique name, e.g., my-micron21-exports
Avoid spaces or uppercase letters.
In Object Ownership, enable ACLs and change Object Ownership to Object writer.
Uncheck Block all Public Access.
Check: I acknowledge that the current setting might result in this bucket and the objects within becoming public
Click Create bucket
Step 2: Grant EC2 Export Permissions
In the S3 Console, click on your newly created bucket.
Navigate to the Permissions tab.
Scroll down to Access control list (ACL) and click Edit.
Click Add grantee.
Enter the correct Canonical ID for your AWS region:
Region | Canonical ID |
Asia Pacific (Melbourne) | 8b8ea36ab97c280aa8558c57a380353ac7712f01f82c21598afbb17e188b9ad5 |
AWS GovCloud (US) | af913ca13efe7a94b88392711f6cfc8aa07c9d1454d4f190a624b126733a5602 |
All other regions | c4d8eabf8db69dbe46bfe0e517100c554f01200b104d59cd408e777ba442a322 |
For more regions: https://docs.aws.amazon.com/vm-import/latest/userguide/vmexport-prerequisites.html
Grant the following permissions:
Objects: Write
Bucket ACL: Read
Click Save changes.
Step 3: Export the EC2 Instance as a VMDK
1. Ensure permissions are set before starting the export.
2. Run the following command in AWS CLI, replacing i-xxxxxxxxxxxxxxxxx with your EC2 instance ID and your-export-bucket with your S3 bucket name:
aws ec2 create-instance-export-task \
--instance-id i-xxxxxxxxxxxxxxxxx \
--target-environment vmware \
--export-to-s3-task DiskImageFormat=VMDK,S3Bucket=your-export-bucket,S3Prefix=exported-instance/
Step 4: Monitor the Export Progress
Run the following command in AWS CLI to track the progress:
aws ec2 describe-export-tasks
Possible Statuses:
"active" → The export is still in progress.
"completed" → The VMDK file is available in S3.
Step 5: Download the Exported VMDK
Once the export is completed:
Open the S3 Console.
Navigate to your-export-bucket/exported-instance/.
Locate the VMDK file.
Click Download
Step 6: Convert the VMDK File to RAW Format (Windows)
To convert the VMDK file to RAW format using QEMU on Windows:
Download QEMU for Windows from Cloudbase QEMU: https://cloudbase.it/qemu-img-windows/
Open Command Prompt and navigate to the folder containing the downloaded file.
Run the following command:
qemu-img.exe convert -f vmdk -O raw source-image.vmdk destination-image.img
Step 7: Upload the Image to mCloud
Log in to the mCloud Dashboard.
Navigate to the Project tab → Open the Compute tab → Click Images.
Click Create Image.
In the Create An Image dialog box, enter the following:
Image Name: Enter a descriptive name.
Image Description: Provide a brief summary.
Image Source: Choose Image File.
Format: Select Raw.
Click Create Image.
After completing this step, you can create an instance using the newly uploaded image. For further details, refer to this guide: https://support.micron21.com/kb/articles/how-to-create-a-vm-instance-from-an-image-in-mcloud