0
我正在寫一個蟒蛇腳本快照來檢查我的所有正在運行的實例爲EBS快照...地圖AWS實例/卷與博託
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>}}
我是boto的新手。我在正確的道路上嗎?
我需要先獲得blockDeviceMapping
,然後調用音量函數嗎?
如何獲得實際卷ID,以便我可以檢查現有快照?