get_vcpu_total in nova/virt/libvirt.py reports wrong number of physical CPUs on Xen dom0 systems

Bug #1084611 reported by Christian Berendt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Christian Berendt

Bug Description

The Xen dom0 has 4 physical CPUs assigned, multiprocessing.cpu_count() only sees those CPUs.

But the system has 32 physical CPUs. While using virsh nodeinfo you can receive the correct number of CPUs.

Because we're in the libvirt driver we should use libvirt and not multiprocessing.

Python 2.6.8 (unknown, May 29 2012, 22:30:44)
[GCC 4.3.4 [gcc-4_3-branch revision 152973]] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import multiprocessing
>>> print multiprocessing.cpu_count()
4

# cat /proc/cpuinfo | grep processor | wc -l
4

# virsh nodeinfo
CPU model: x86_64
CPU(s): 32
CPU frequency: 2000 MHz
CPU socket(s): 4
Core(s) per socket: 8
Thread(s) per core: 1
NUMA cell(s): 1
Memory size: 402648064 KiB

# xm cpupool-list
Name CPUs Sched Active Domain count
Pool-0 32 credit y 1

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/17125

Changed in nova:
assignee: nobody → Christian Berendt (berendt)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/17125
Committed: http://github.com/openstack/nova/commit/16cb60ce661f00f9a91c8ad02c381d2f9c504580
Submitter: Jenkins
Branch: master

commit 16cb60ce661f00f9a91c8ad02c381d2f9c504580
Author: Christian Berendt <email address hidden>
Date: Thu Nov 29 18:03:02 2012 +0100

    use libvirt getInfo() to receive number of physical CPUs

    multiprocessing.cpu_count() reports the wrong number of
    physical CPUs on a Xen dom0 system. Because we're inside
    the libvirt virtualization driver the corresponding
    libvirt method (getInfo()) should be used instead.

    fixes bug 1084611

    Change-Id: Ida4be889ce98c7a6f58564a8bc295b360ff65965

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → grizzly-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: grizzly-2 → 2013.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.