Check if an EC2 instance could be exported

0

Hi all,

I know how to export an EC2 instance with create-instance-export-task, but I'm trying to find a way to check if a certain instance would be exportable without actually starting the export if it is.

Background: AWS docs say

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.

I have a pretty long list of IDs for EC2 instances and need to find out which of them can or can't be exported, so what I'm looking for is basically some kind of

aws ec2 create-instance-export-task --dry-run --instance-id ...

but I'd be happy with any kind of shell command that tells me "yes, this one can be exported" or "no, this one can't be exported".

Is there any way to do this, or do I have to start an export for every instance, then check the status and cancel it if it's actually running?

Thanks,

Marc

質問済み 10ヶ月前283ビュー
1回答
0

Hi Abhinav,

thanks for your reply. What you describe is what I was hoping for, but it seems it doesn't work like this.

The documentation doesn't list a --instance-id parameter and if I try it, the reply is Unknown options: --instance-id.

The create-instance-export-task actually kind of works, because it will terminate with an error description for instances that can't be exported (marketplace AMI, more than one volume etc.). This is useful because these checks seem to run before the check if the instance is currently running, so it can be used on active instances. The command is

aws ec2 create-instance-export-task --description "test export" \
 --instance-id i-012345... \
 --target-environment vmware \
 --export-to-s3-task DiskImageFormat=vmdk,ContainerFormat=ova,S3Bucket=yourtestbucket

where the bucket exists and has permissions according to the documentation.

Note that this will create the export task if the machine is exportable and currently stopped, I couldn't find a way around that. Since I now found out that almost none of the instances are exportable, because they were created from a marketplace AMI, I need to find a different solution anyway.

Cheers,

Marc

回答済み 10ヶ月前
profile picture
エキスパート
レビュー済み 7ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ