Site Tools


cloud:aws:exportec2

Export an EC2 instance as ova/vmdk

Export

You need AWS CLI in order to export an instance, check here how to install it Lunetikk.de - AWS CLI

Create a json file with the following content (replace <YOUR BUCKET> with one of your buckets):

{
    "ContainerFormat": "ova",
    "DiskImageFormat": "VMDK",
    "S3Bucket": "<YOUR BUCKET>",
    "S3Prefix": "vms/"
}

Then export via AWS CLI

aws ec2 create-instance-export-task --instance-id <INSTANCE-ID> --target-environment vmware --export-to-s3-task file://C:\<PATH TO YOUR JSON>

Example:
aws ec2 create-instance-export-task --instance-id i-0c3786ac638b6bc7c --target-environment vmware --export-to-s3-task file://C:\Users\Lunetikk\Desktop\aws\aws.json

You can check if the task is still running via

aws ec2 describe-export-tasks --export-task-ids <EXPORT-TASK-ID>

Or cancel it

aws ec2 cancel-export-task --export-task-id <EXPORT-TASK-ID>

The .ova will then be in your bucket under /vms

Source: docs.aws.amazon.com - vmexport

Troubleshooting

Export failed with “invalid parameter”, check here: Lunetikk.de - AWS Troubleshooting


cloud/aws/exportec2.txt · Last modified: 2022/09/03 16:26 by lunetikk