'Gets iscsi configuration
We ideally get saved information in the volume entity, but fall back
to discovery if need be. Discovery may be completely removed in future
The properties are:
:target_discovered:    boolean indicating whether discovery was used
:target_iqn:    the IQN of the iSCSI target
:target_portal:    the portal of the iSCSI target
:target_lun:    the lun of the iSCSI target
:volume_id:    the id of the volume (currently used by xen)
:auth_method:, :auth_username:, :auth_password:
the authentication details. Right now, either auth_method is not
present meaning no authentication, or auth_method == `CHAP`
meaning use CHAP with the specified credentials.
:discard:    boolean indicating if discard is supported
In some of drivers that support multiple connections (for multipath
and for single path with failover on connection failure), it returns
:target_iqns, :target_portals, :target_luns, which contain lists of
multiple values. The main portal information is also returned in
:target_iqn, :target_portal, :target_lun for backward compatibility.
Note that some of drivers don\'t return :target_portals even if they
support multipath. Then the connector should use sendtargets discovery
to find the other portals if it supports multipath.'

def _get_iscsi_properties(self, volume, multipath=False):

    properties = {}
    location = volume['provider_location']
    if location:
        properties['target_discovered'] = False
    else:
        location = self._do_iscsi_discovery(volume)
        if (not location):
            msg = (_('Could    not    find    iSCSI    export    for    volume    %s') % volume['name'])
            raise exception.InvalidVolume(reason=msg)
        LOG.debug('ISCSI    Discovery:    Found    %s', location)
        properties['target_discovered'] = True
    results = location.split('    ')
    portals = results[0].split(',')[0].split(';')
    iqn = results[1]
    nr_portals = len(portals)
    try:
        lun = int(results[2])
    except (IndexError, ValueError):
        if ((self.configuration.volume_driver == 'cinder.volume.drivers.lvm.ThinLVMVolumeDriver') and (self.configuration.iscsi_helper == 'tgtadm')):
            lun = 1
        else:
            lun = 0
    if (nr_portals > 1):
        properties['target_portals'] = portals
        properties['target_iqns'] = ([iqn] * nr_portals)
        properties['target_luns'] = ([lun] * nr_portals)
    properties['target_portal'] = portals[0]
    properties['target_iqn'] = iqn
    properties['target_lun'] = lun
    properties['volume_id'] = volume['id']
    auth = volume['provider_auth']
    if auth:
        (auth_method, auth_username, auth_secret) = auth.split()
        properties['auth_method'] = auth_method
        properties['auth_username'] = auth_username
        properties['auth_password'] = auth_secret
    geometry = volume.get('provider_geometry', None)
    if geometry:
        (physical_block_size, logical_block_size) = geometry.split()
        properties['physical_block_size'] = physical_block_size
        properties['logical_block_size'] = logical_block_size
    encryption_key_id = volume.get('encryption_key_id', None)
    properties['encrypted'] = (encryption_key_id is not None)
    return properties
