'Assigns the volume to a server.
Assign any created volume to a compute node/host so that it can be
used from that host.
This driver returns a driver_volume_type of \'iscsi\'.
The format of the driver data is defined in _get_iscsi_properties.
Example return value:
.. code-block:: default
\'driver_volume_type\': \'iscsi\',
\'data\': {
\'encrypted\': False,
\'target_discovered\': True,
\'target_iqn\': \'iqn.2010-10.org.openstack:volume-00000001\',
\'target_protal\': \'127.0.0.1:3260\',
\'volume_id\': 1,
Steps to export a volume on 3PAR
* Get the 3PAR iSCSI iqn
* Create a host on the 3par
* create vlun on the 3par'

@utils.trace
def initialize_connection(self, volume, connector):

    common = self._login()
    try:
        if ((volume.get('replication_status') == 'failed-over') and (common._client_conf['hpe3par_api_url'] not in self.iscsi_ips)):
            self.initialize_iscsi_ports(common)
        iscsi_ips = self.iscsi_ips[common._client_conf['hpe3par_api_url']]
        (host, username, password) = self._create_host(common, volume, connector)
        if connector.get('multipath'):
            ready_ports = common.client.getiSCSIPorts(state=common.client.PORT_STATE_READY)
            target_portals = []
            target_iqns = []
            target_luns = []
            target_portal_ips = iscsi_ips.keys()
            existing_vluns = common.find_existing_vluns(volume, host)
            lun_id = None
            for port in ready_ports:
                iscsi_ip = port['IPAddr']
                if (iscsi_ip in target_portal_ips):
                    vlun = None
                    for v in existing_vluns:
                        portPos = common.build_portPos(iscsi_ips[iscsi_ip]['nsp'])
                        if (v['portPos'] == portPos):
                            vlun = v
                            break
                    else:
                        vlun = common.create_vlun(volume, host, iscsi_ips[iscsi_ip]['nsp'], lun_id=lun_id)
                        if (lun_id is None):
                            lun_id = vlun['lun']
                    iscsi_ip_port = ('%s:%s' % (iscsi_ip, iscsi_ips[iscsi_ip]['ip_port']))
                    target_portals.append(iscsi_ip_port)
                    target_iqns.append(port['iSCSIName'])
                    target_luns.append(vlun['lun'])
                else:
                    LOG.warning("iSCSI    IP:    '%s'    was    not    found    in    hpe3par_iscsi_ips    list    defined    in    cinder.conf.", iscsi_ip)
            info = {'driver_volume_type': 'iscsi', 'data': {'target_portals': target_portals, 'target_iqns': target_iqns, 'target_luns': target_luns, 'target_discovered': True}}
        else:
            least_used_nsp = None
            existing_vlun = common.find_existing_vlun(volume, host)
            if existing_vlun:
                least_used_nsp = common.build_nsp(existing_vlun['portPos'])
            if (not least_used_nsp):
                least_used_nsp = self._get_least_used_nsp_for_host(common, host['name'])
            vlun = None
            if (existing_vlun is None):
                vlun = common.create_vlun(volume, host, least_used_nsp)
            else:
                vlun = existing_vlun
            if (least_used_nsp is None):
                LOG.warning('Least    busy    iSCSI    port    not    found,    using    first    iSCSI    port    in    list.')
                iscsi_ip = list(iscsi_ips)[0]
            else:
                iscsi_ip = self._get_ip_using_nsp(least_used_nsp, common)
            iscsi_ip_port = iscsi_ips[iscsi_ip]['ip_port']
            iscsi_target_iqn = iscsi_ips[iscsi_ip]['iqn']
            info = {'driver_volume_type': 'iscsi', 'data': {'target_portal': ('%s:%s' % (iscsi_ip, iscsi_ip_port)), 'target_iqn': iscsi_target_iqn, 'target_lun': vlun['lun'], 'target_discovered': True}}
        if common._client_conf['hpe3par_iscsi_chap_enabled']:
            info['data']['auth_method'] = 'CHAP'
            info['data']['auth_username'] = username
            info['data']['auth_password'] = password
        encryption_key_id = volume.get('encryption_key_id', None)
        info['data']['encrypted'] = (encryption_key_id is not None)
        return info
    finally:
        self._logout(common)
