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
It isn't clear if you're running this from the instance itself or externally. If the latter, you will not need the metadata call. Just supply the instance id.
from boto.ec2.connection import EC2Connection
from boto.utils import get_instance_metadata
conn = EC2Connection()
m = get_instance_metadata()
volumes = [v for v in conn.get_all_volumes() if v.attach_data.instance_id == m['instance-id']]
print volumes[0].attach_data.device
Note that an instance may have multiple volumes, so robust code won't assume there's a single device.