Description of problem:
Running vdsm gets exception while reading libvirt capabilities
Version-Release number of selected component (if applicable):
service vdsmd start
Steps to Reproduce:
1. install and run vdsm, it reproduce during vdsm startup
when running virsh -r capabilities we see no parameters under topology tag:
vdsm throws exception and fails to start:
MainThread::ERROR::2012-10-16 15:42:44,001::vdsm::84::vds::(run) Exception raised
Traceback (most recent call last):
File "/usr/share/vdsm/vdsm", line 82, in run
File "/usr/share/vdsm/vdsm", line 50, in serve_clients
cif = clientIF.getInstance(log)
File "/usr/share/vdsm/clientIF.py", line 126, in getInstance
cls._instance = clientIF(log)
File "/usr/share/vdsm/clientIF.py", line 93, in __init__
File "/usr/share/vdsm/caps.py", line 88, in __init__
self._topology = _getCpuTopology(capabilities)
File "/usr/lib64/python2.6/site-packages/vdsm/utils.py", line 822, in __call__
value = self.func(*args)
File "/usr/share/vdsm/caps.py", line 116, in _getCpuTopology
IndexError: list index out of range
topology should have the attributes cells, sockets, cores and threads in libvirt capabilities xml.
_getCpuTopology is a function from vdsm, which parses cpu topology from /capabilities/host/cpu/topology in libvirt's capabilities XML. The /capabilities/host/topology element shown in bug description is a NUMA topology. While vdsm can use virNodeGetInfo to get the CPU topology (rather than parsing it from capabilities), I agree that we have a bug in libvirt. When host CPU model cannot be detected for some reason, we won't provide the topology even though it's known.
Patch sent upstream for review: https://www.redhat.com/archives/libvir-list/2012-October/msg00976.html
Fixed upstream by v0.10.2-199-gf1c7010:
Author: Jiri Denemark <email@example.com>
Date: Tue Oct 16 21:11:29 2012 +0200
qemu: Always format CPU topology
When libvirt cannot find a suitable CPU model for host CPU (easily
reproducible by running libvirt in a guest), it would not provide CPU
topology in capabilities XML either. Even though CPU topology is known
and can be queried by virNodeGetInfo. With this patch, CPU topology will
always be provided in capabilities XML regardless on the presence of CPU
In POST: http://post-office.corp.redhat.com/archives/rhvirt-patches/2012-October/msg00992.html
Requesting rhel-6.3.z so that we can test rhev-3.1.0 on virtual hosts which tickle this bug.
Verify it as follows, the result is expected. Move its status to VERIFIED.
Login one RHEL6.3 guest ,run the following commands.
# virsh nodeinfo
CPU model: x86_64
CPU frequency: 3092 MHz
CPU socket(s): 1
Core(s) per socket: 4
Thread(s) per core: 1
NUMA cell(s): 1
Memory size: 1020340 KiB
# virsh capabilities
<topology sockets='1' cores='4' threads='1'/>
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.