'Eject a slave from a XenServer resource pool.'

def _eject_slave(self, aggregate_id, compute_uuid, host_uuid):

    try:
        vm_ref = self._session.VM.get_by_uuid(compute_uuid)
        self._session.VM.clean_shutdown(vm_ref)
        host_ref = self._session.host.get_by_uuid(host_uuid)
        self._session.pool.eject(host_ref)
    except self._session.XenAPI.Failure as e:
        LOG.error('Pool-eject    failed:    %s', e)
        raise exception.AggregateError(aggregate_id=aggregate_id, action='remove_from_aggregate', reason=six.text_type(e.details))
