'Test if this claim can be satisfied given available resources and
optional oversubscription limits
This should be called before the compute node actually consumes the
resources required to execute the claim.
:param resources: available local compute node resources
:returns: Return true if resources are available to claim.'

def _claim_test(self, resources, limits=None):

    if (not limits):
        limits = {}
    memory_mb_limit = limits.get('memory_mb')
    disk_gb_limit = limits.get('disk_gb')
    vcpus_limit = limits.get('vcpu')
    numa_topology_limit = limits.get('numa_topology')
    LOG.info('Attempting    claim    on    node    %(node)s:    memory    %(memory_mb)d    MB,    disk    %(disk_gb)d    GB,    vcpus    %(vcpus)d    CPU', {'node': self.nodename, 'memory_mb': self.memory_mb, 'disk_gb': self.disk_gb, 'vcpus': self.vcpus}, instance=self.instance)
    reasons = [self._test_memory(resources, memory_mb_limit), self._test_disk(resources, disk_gb_limit), self._test_vcpus(resources, vcpus_limit), self._test_numa_topology(resources, numa_topology_limit), self._test_pci()]
    reasons = [r for r in reasons if (r is not None)]
    if (len(reasons) > 0):
        raise exception.ComputeResourcesUnavailable(reason=';    '.join(reasons))
    LOG.info('Claim    successful    on    node    %s', self.nodename, instance=self.instance)
