VM Export: An error occurred (InvalidParameter) when calling the ExportImage operation: The image ID provided does not exist

1

I'm trying to export the image of an EC2 VM: t2.medium, Ubuntu 20.04 LTS. The instance is stopped during the operation.

I created the vmimport role, created a service role and a role policy as described. AWS CLI credentials correspond to a DevOps role, which should be sufficient for the operation.

The resulting command looks like

aws ec2 export-image \
    --image-id ami-09e67e426f25ce0d7  \
    --disk-image-format VMDK \
    --s3-export-location S3Bucket=auditor-updates,S3Prefix=export/

Command returns the error An error occurred (InvalidParameter) when calling the ExportImage operation: The image ID (ami-09e67e426f25ce0d7) provided does not exist

AMI ID typo is impossible, I just copied it from the instance page of the EC2 console.

If I met any export limitations, how do I know which exactly?

2 Answers
0

Hello,

There are various limitations in exporting images: https://docs.aws.amazon.com/vm-import/latest/userguide/vmexport_image.html#limits-image-export

It appears that image is owned by AWS, and therefore shared with other accounts. Copy the love to your account: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/CopyingAMIs.html https://docs.aws.amazon.com/cli/latest/reference/ec2/copy-image.html

and then export the image:

https://docs.aws.amazon.com/cli/latest/reference/ec2/export-image.html

Thanks Joel

Joel
answered 2 years ago
0

i'm also facing this issue:

An error occurred (InvalidParameter) when calling the ExportImage operation: The service role vmimport provided does not exist or does not have sufficient permissions

is there a solution to it?

Saru
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions