How do I find to which device an EBS Volume is mounted with Python Boto v2.0?
boto.ec2.Volume has some interesting properies like attachment_state
and
The best way I've found is to get all resources in one region at a time and associate them yourself:
#!/usr/bin/env python2
import boto.ec2
REGION = 'us-east'
CONN = boto.ec2.connect_to_region(REGION)
def main():
volumes = conn.get_all_volumes()
for volume in volumes:
print volume
# Match to an instance id
print volume.attach_data.instance_id
# # Object attributes:
# print volume.__dict__
# # Object methods:
# print(dir(volume))
if __name__ == '__main__':
main()