'Assigns the volume to a server.
Assign any created volume to a compute node/host so that it can be
used from that host. HPE VSA requires a volume to be assigned
to a server.'

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

    client = self._login()
    try:
        server_info = self._create_server(connector, client)
        volume_info = client.getVolumeByName(volume['name'])
        access_already_enabled = False
        if (volume_info['iscsiSessions'] is not None):
            for session in volume_info['iscsiSessions']:
                server_id = int(session['server']['uri'].split('/')[3])
                if (server_id == server_info['id']):
                    access_already_enabled = True
                    break
        if (not access_already_enabled):
            client.addServerAccess(volume_info['id'], server_info['id'])
        iscsi_properties = self._get_iscsi_properties(volume)
        if (('chapAuthenticationRequired' in server_info) and server_info['chapAuthenticationRequired']):
            iscsi_properties['auth_method'] = 'CHAP'
            iscsi_properties['auth_username'] = connector['initiator']
            iscsi_properties['auth_password'] = server_info['chapTargetSecret']
        return {'driver_volume_type': 'iscsi', 'data': iscsi_properties}
    except Exception as ex:
        raise exception.VolumeBackendAPIException(ex)
    finally:
        self._logout(client)
