def get_instance_id_to_volume_id_map(volume_info):
    """Generate instance_id to volume 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'):
            ec2_instance_id = volume.get('Attachments')[0].get('InstanceId')
            current_volumes = instance_id_to_volume_id_map.get(ec2_instance_id)
            if current_volumes is None:
                current_volumes = []
            current_volumes.append(volume_id)
            instance_id_to_volume_id_map[ec2_instance_id] = current_volumes
    return instance_id_to_volume_id_map
