'Return True if host has sufficient CPU cores.
:param host_state: nova.scheduler.host_manager.HostState
:param spec_obj: filter options
:return: boolean'

def host_passes(self, host_state, spec_obj):

    if (not host_state.vcpus_total):
        LOG.warning(_LW('VCPUs    not    set;    assuming    CPU    collection    broken'))
        return True
    instance_vcpus = spec_obj.vcpus
    cpu_allocation_ratio = self._get_cpu_allocation_ratio(host_state, spec_obj)
    vcpus_total = (host_state.vcpus_total * cpu_allocation_ratio)
    if (vcpus_total > 0):
        host_state.limits['vcpu'] = vcpus_total
        if (instance_vcpus > host_state.vcpus_total):
            LOG.debug('%(host_state)s    does    not    have    %(instance_vcpus)d    total    cpus    before    overcommit,    it    only    has    %(cpus)d', {'host_state': host_state, 'instance_vcpus': instance_vcpus, 'cpus': host_state.vcpus_total})
            return False
    free_vcpus = (vcpus_total - host_state.vcpus_used)
    if (free_vcpus < instance_vcpus):
        LOG.debug('%(host_state)s    does    not    have    %(instance_vcpus)d    usable    vcpus,    it    only    has    %(free_vcpus)d    usable    vcpus', {'host_state': host_state, 'instance_vcpus': instance_vcpus, 'free_vcpus': free_vcpus})
        return False
    return True
