def get_volume_id_to_instance_id_map(volume_info):
    """Generate volume id to instance id map.  Unattached volumes will be ignored."""
    instance_id_to_volume_id_map = {}

    for volume_id in volume_info:
        volume = volume_info.get(volume_id)

        if volume.get("Attachments"):
            # Attached volumes
            ec2_instance_id = volume.get("Attachments")[0].get("InstanceId")
            instance_id_to_volume_id_map[volume_id] = ec2_instance_id

    return instance_id_to_volume_id_map