VM Export: An error occurred (InvalidParameter) when calling the ExportImage operation: The image ID provided does not exist
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?
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
Relevant questions
"export-image" returns "InvalidParameter" "The image ID (ami-03af6a70ccd8cb578) provided does not exist"
Accepted Answerasked 6 months agoVM Export of AMI is not Completing
asked a year agoEC2 Image Builder: Role does not exist or does not have sufficient permissions
asked 19 days agoVM Export: An error occurred (InvalidParameter) when calling the ExportImage operation: The image ID provided does not exist
asked 2 months agoVM Export: An error occurred (Invalid Parameter) when calling the ExportImage operation: Access denied to the bucket
asked 2 months agoAn error occurred (ValidationException) when calling the CreateActivation
asked 2 years agohow can I upload my own image of an operating system?
asked a month agoAn error occurred (ModelError) when calling the InvokeEndpoint operation
asked a year agoNotExportable error. Can't export an EC2 instance as OVA image.
asked 2 months agoBest method for exporting/downloading an AWS image to an offline location where it can be run locally as a vmdk or vdi image?
Accepted Answerasked a month ago