'Attach a volume to a host.
:param volume: the volume object
:param connector: the connector object
:param extra_specs: extra specifications
:param masking_view_dict: masking view information
:returns: dict -- device_info_dict
String -- port group name
:raises: VolumeBackendAPIException'

def _attach_volume(self, volume, connector, extra_specs, masking_view_dict, is_live_migration=False):

    volume_name = volume.name
    if is_live_migration:
        masking_view_dict['isLiveMigration'] = True
    else:
        masking_view_dict['isLiveMigration'] = False
    rollback_dict = self.masking.setup_masking_view(masking_view_dict[utils.ARRAY], masking_view_dict, extra_specs)
    (device_info_dict, __, __) = self.find_host_lun_id(volume, connector['host'], extra_specs)
    if ('hostlunid' not in device_info_dict):
        LOG.error('Error    Attaching    volume    %(vol)s.    Cannot    retrieve    hostlunid.    ', {'vol': volume_name})
        self.masking.check_if_rollback_action_for_masking_required(masking_view_dict[utils.ARRAY], masking_view_dict[utils.DEVICE_ID], rollback_dict)
        exception_message = (_('Error    Attaching    volume    %(vol)s.') % {'vol': volume_name})
        raise exception.VolumeBackendAPIException(data=exception_message)
    return (device_info_dict, rollback_dict[utils.PORTGROUPNAME])
