'Assigns the volume to a server.
Assign any created volume to a compute node/host so that it can be
used from that host.
The  driver returns a driver_volume_type of \'fibre_channel\'.
The target_wwn can be a single entry or a list of wwns that
correspond to the list of remote wwn(s) that will export the volume.
Example return values:
\'driver_volume_type\': \'fibre_channel\'
\'data\': {
\'encrypted\': False,
\'target_discovered\': True,
\'target_lun\': 1,
\'target_wwn\': \'1234567890123\',
or
\'driver_volume_type\': \'fibre_channel\'
\'data\': {
\'encrypted\': False,
\'target_discovered\': True,
\'target_lun\': 1,
\'target_wwn\': [\'1234567890123\', \'0987654321321\'],
Steps to export a volume on 3PAR
* Create a host on the 3par with the target wwn
* Create a VLUN for that HOST with the volume we want to export.'

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

    common = self._login()
    try:
        host = self._create_host(common, volume, connector)
        (target_wwns, init_targ_map, numPaths) = self._build_initiator_target_map(common, connector)
        existing_vlun = common.find_existing_vlun(volume, host)
        vlun = None
        if (existing_vlun is None):
            nsp = None
            lun_id = None
            active_fc_port_list = common.get_active_fc_target_ports()
            if self.lookup_service:
                if (not init_targ_map):
                    msg = _('Setup    is    incomplete.    Device    mapping    not    found    from    FC    network.    Cannot    perform    VLUN    creation.')
                    LOG.error(msg)
                    raise exception.FCSanLookupServiceException(msg)
                for target_wwn in target_wwns:
                    for port in active_fc_port_list:
                        if (port['portWWN'].lower() == target_wwn.lower()):
                            nsp = port['nsp']
                            vlun = common.create_vlun(volume, host, nsp, lun_id=lun_id)
                            if (lun_id is None):
                                lun_id = vlun['lun']
                            break
            else:
                init_targ_map.clear()
                del target_wwns[:]
                host_connected_nsp = []
                for fcpath in host['FCPaths']:
                    if ('portPos' in fcpath):
                        host_connected_nsp.append(common.build_nsp(fcpath['portPos']))
                for port in active_fc_port_list:
                    if ((port['type'] == common.client.PORT_TYPE_HOST) and (port['nsp'] in host_connected_nsp)):
                        nsp = port['nsp']
                        vlun = common.create_vlun(volume, host, nsp, lun_id=lun_id)
                        target_wwns.append(port['portWWN'])
                        if (vlun['remoteName'] in init_targ_map):
                            init_targ_map[vlun['remoteName']].append(port['portWWN'])
                        else:
                            init_targ_map[vlun['remoteName']] = [port['portWWN']]
                        if (lun_id is None):
                            lun_id = vlun['lun']
            if (lun_id is None):
                msg = _('No    new    vlun(s)    were    created')
                LOG.error(msg)
                raise exception.VolumeDriverException(msg)
        else:
            vlun = existing_vlun
        info = {'driver_volume_type': 'fibre_channel', 'data': {'target_lun': vlun['lun'], 'target_discovered': True, 'target_wwn': target_wwns, 'initiator_target_map': init_targ_map}}
        encryption_key_id = volume.get('encryption_key_id', None)
        info['data']['encrypted'] = (encryption_key_id is not None)
        return info
    finally:
        self._logout(common)
