'Initializes the connection and returns device and connection info.
The volume may be already mapped, if this is so the deviceInfo tuple
is returned.  If the volume is not already mapped then we need to
gather information to either 1. Create an new masking view or 2. Add
the volume to an existing storage group within an already existing
maskingview.
The naming convention is the following:
.. code-block:: none
initiator_group_name = OS-<shortHostName>-<shortProtocol>-IG
e.g OS-myShortHost-I-IG
storage_group_name = OS-<shortHostName>-<srpName>-<shortProtocol>-SG
e.g OS-myShortHost-SRP_1-I-SG
port_group_name = OS-<target>-PG  The port_group_name will come from
the EMC configuration xml file.
These are precreated. If the portGroup does not
exist then an error will be returned to the user
maskingview_name  = OS-<shortHostName>-<srpName>-<shortProtocol>-MV
e.g OS-myShortHost-SRP_1-I-MV
:param volume: volume Object
:param connector: the connector Object
:returns: dict -- device_info_dict - device information dict'

def initialize_connection(self, volume, connector):

    extra_specs = self._initial_setup(volume)
    is_multipath = connector.get('multipath', False)
    volume_name = volume.name
    LOG.info('Initialize    connection:    %(volume)s.', {'volume': volume_name})
    if self.utils.is_volume_failed_over(volume):
        extra_specs = self._get_replication_extra_specs(extra_specs, self.rep_config)
    (device_info_dict, is_live_migration, source_storage_group_list) = self.find_host_lun_id(volume, connector['host'], extra_specs)
    masking_view_dict = self._populate_masking_dict(volume, connector, extra_specs)
    if ((('hostlunid' in device_info_dict) and (device_info_dict['hostlunid'] is not None) and (is_live_migration is False)) or (is_live_migration and (len(source_storage_group_list) > 1))):
        hostlunid = device_info_dict['hostlunid']
        LOG.info('Volume    %(volume)s    is    already    mapped.    The    hostlunid    is        %(hostlunid)s.', {'volume': volume_name, 'hostlunid': hostlunid})
        port_group_name = self.get_port_group_from_masking_view(extra_specs[utils.ARRAY], device_info_dict['maskingview'])
    else:
        if is_live_migration:
            (source_nf_sg, source_sg, source_parent_sg, is_source_nf_sg) = self._setup_for_live_migration(device_info_dict, source_storage_group_list)
            masking_view_dict['source_nf_sg'] = source_nf_sg
            masking_view_dict['source_sg'] = source_sg
            masking_view_dict['source_parent_sg'] = source_parent_sg
            try:
                self.masking.pre_live_migration(source_nf_sg, source_sg, source_parent_sg, is_source_nf_sg, device_info_dict, extra_specs)
            except Exception:
                source_storage_group_list = self.rest.get_storage_groups_from_volume(device_info_dict['array'], device_info_dict['device_id'])
                self.masking.failed_live_migration(masking_view_dict, source_storage_group_list, extra_specs)
                exception_message = (_('Unable    to    setup    live    migration    because    of    the    following    error:    %(errorMessage)s.') % {'errorMessage': sys.exc_info()[1]})
                raise exception.VolumeBackendAPIException(data=exception_message)
        (device_info_dict, port_group_name) = self._attach_volume(volume, connector, extra_specs, masking_view_dict, is_live_migration)
        if is_live_migration:
            self.masking.post_live_migration(masking_view_dict, extra_specs)
    if (self.protocol.lower() == 'iscsi'):
        device_info_dict['ip_and_iqn'] = self._find_ip_and_iqns(extra_specs[utils.ARRAY], port_group_name)
        device_info_dict['is_multipath'] = is_multipath
    return device_info_dict
