0
我想知道有多少個快照在捲上被刪除。在這種情況下,卷的快照可用,但卷被刪除。我不知道我怎麼能找到它。以下是密碼找到卷被刪除的快照
volList=[{"VolumeId":"vol-sss","State":"in-use"},{"VolumeId":"vol-defghi","State":"available"},{"VolumeId":"vol-sfjfrf","State":"in-use"}]
snapList=[{"VolumeId":"vol-sss","snap-id":"sna-1356"},{"VolumeId":"vol-sss","snap-id":"sna-asd"},{"VolumeId":"vol-defghi","snap-id":"snap-1256"},{"VolumeId":"vol-defghi","snap-id":"snap-11"},{"VolumeId":"vol-sfjfrf","snap-id":"snap-456"},{"VolumeId":"v-fffff","snap-id":"snap-123"}]
for snap in snapList:
for vol in volList:
if snap['VolumeId'] == vol['VolumeId']:
print "match volume id :" + snap['VolumeId'] + " state " + vol['State'] + " snap-id : " + snap['snap-id']
else:
print "not match volume id :" + snap['VolumeId'] + " state not found" + " snap-id : " + snap['snap-id']
您顯示代碼,但是什麼是您的問題? – mootmoot
我的問題是volumeid v-fffff存在於管理單元中,但它在vollist中不可用,我想從列表中提取volumeid –