'Unassign the volume from the host.'

@cinder_utils.trace
def terminate_connection(self, volume, connector, **kwargs):

    client = self._login()
    try:
        volume_info = client.getVolumeByName(volume['name'])
        server_info = client.getServerByName(connector['host'])
        volume_list = client.findServerVolumes(server_info['name'])
        removeServer = True
        for entry in volume_list:
            if (entry['id'] != volume_info['id']):
                removeServer = False
                break
        client.removeServerAccess(volume_info['id'], server_info['id'])
        if removeServer:
            client.deleteServer(server_info['id'])
    except hpeexceptions.HTTPNotFound as ex:
        if self._active_backend_id:
            LOG.warning('Because    the    host    is    currently    in    a    failed-over    state,    the    volume    will    not    be    properly    detached    from    the    primary    array.    The    detach    will    be    considered    a    success    as    far    as    Cinder    is    concerned.    The    volume    can    now    be    attached    to    the    secondary    target.')
            return
        else:
            raise exception.VolumeBackendAPIException(ex)
    except Exception as ex:
        raise exception.VolumeBackendAPIException(ex)
    finally:
        self._logout(client)
