def _get_vcpu_used(self):
    'Get vcpu usage number of physical computer.\n\n        :returns: The total number of vcpu(s) that are currently being used.\n\n        '
    total = 0
    if (CONF.libvirt.virt_type == 'lxc'):
        return (total + 1)
    for dom in self._list_instance_domains():
        try:
            vcpus = dom.vcpus()
        except libvirt.libvirtError as e:
            LOG.warn((_LW("couldn't obtain the vpu count from domain id: %(uuid)s, exception: %(ex)s") % {'uuid': dom.UUIDString(), 'ex': e}))
        else:
            if ((vcpus is not None) and (len(vcpus) > 1)):
                total += len(vcpus[1])
        greenthread.sleep(0)
    return total
Get vcpu usage number of physical computer.

:returns: The total number of vcpu(s) that are currently being used.
def _get_vcpu_used(self):
    'Get vcpu usage number of physical computer.\n\n        :returns: The total number of vcpu(s) that are currently being used.\n\n        '
    total = 0
    if (CONF.libvirt.virt_type == 'lxc'):
        return (total + 1)
    for dom in self._list_instance_domains():
        try:
            vcpus = dom.vcpus()
        except libvirt.libvirtError as e:
            LOG.warn((_LW("couldn't obtain the vpu count from domain id: %(uuid)s, exception: %(ex)s") % {'uuid': dom.UUIDString(), 'ex': e}))
        else:
            if ((vcpus is not None) and (len(vcpus) > 1)):
                total += len(vcpus[1])
        greenthread.sleep(0)
    return total