'Driver entry point to attach a volume to an instance.
Do the LUN masking on the storage system so the initiator can access
the LUN on the target. Also return the iSCSI properties so the
initiator can find the LUN. This implementation does not call
_get_iscsi_properties() to get the properties because cannot store the
LUN number in the database. We only find out what the LUN number will
be during this method call so we construct the properties dictionary
ourselves.'

def initialize_connection_iscsi(self, volume, connector):

    initiator_name = connector['initiator']
    name = volume['name']
    lun_id = self._map_lun(name, [initiator_name], 'iscsi', None)
    LOG.debug('Mapped    LUN    %(name)s    to    the    initiator    %(initiator_name)s', {'name': name, 'initiator_name': initiator_name})
    target_list = self.zapi_client.get_iscsi_target_details()
    if (not target_list):
        raise exception.VolumeBackendAPIException(data=(_('Failed    to    get    LUN    target    list    for    the    LUN    %s') % name))
    LOG.debug('Successfully    fetched    target    list    for    LUN    %(name)s    and    initiator    %(initiator_name)s', {'name': name, 'initiator_name': initiator_name})
    preferred_target = self._get_preferred_target_from_list(target_list)
    if (preferred_target is None):
        msg = _('Failed    to    get    target    portal    for    the    LUN    %s')
        raise exception.VolumeBackendAPIException(data=(msg % name))
    (address, port) = (preferred_target['address'], preferred_target['port'])
    iqn = self.zapi_client.get_iscsi_service_details()
    if (not iqn):
        msg = _('Failed    to    get    target    IQN    for    the    LUN    %s')
        raise exception.VolumeBackendAPIException(data=(msg % name))
    properties = na_utils.get_iscsi_connection_properties(lun_id, volume, iqn, address, port)
    if self.configuration.use_chap_auth:
        (chap_username, chap_password) = self._configure_chap(initiator_name)
        self._add_chap_properties(properties, chap_username, chap_password)
    return properties
