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

Marc
질문됨 5달 전161회 조회
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

Marc
답변함 4달 전
profile picture
전문가
검토됨 한 달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠