通过Boto3检查EC2的竞价实例

0

【以下的问题经过翻译处理】 如果一个实例正在运行,而我只知道它的ID、区域和一般信息,有没有办法使用boto3检查这个实例是按需还是竞价实例?

profile picture
EXPERT
asked 6 months ago4 views
1 Answer
0

【以下的回答经过翻译处理】 是的,您可以使用ec2.describe_instances()并检查InstanceLifecycle值,对于一种Spot实例,它将是“spot”。可能还有一个“SpotInstanceRequestId”值。

profile picture
EXPERT
answered 6 months 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