我正在编写一个python脚本来检查我所有正在运行的实例是否有ebs快照......
rsv = self.botoEC2.get_all_instances()
for r in rsv:
ins = r.instances[0]
blockDevice = self.getInstanceAttribute(ins,"blockDeviceMapping")
print blockDevice
def getInstanceAttribute(self,instance,attribute):
return instance.get_attribute(attribute)
输出:
{u'blockDeviceMapping': {u'/dev/sda1': <boto.ec2.blockdevicemapping.BlockDeviceType object at 0x10d5faed0>}}
我是新手。我在正确的道路上吗?
我需要先获取blockDeviceMapping
,然后调用音量函数吗?
如何获取实际的卷 ID,以便检查现有快照?