can't start nova-compute: Invalid: Invalid xml. '<cpu>' must be 1,but 5

Bug #735298 reported by Christian Berendt
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Christian Berendt

Bug Description

after updating to bzr rev 802 i can't start nova-compute. fails with the following error.

i'm using libvirt-0.8.8 (default configuration) with kvm.

(nova): TRACE: Traceback (most recent call last):
(nova): TRACE: File "/usr/bin/nova-compute", line 48, in <module>
(nova): TRACE: service.serve()
(nova): TRACE: File "/usr/lib64/python2.6/site-packages/nova/service.py", line 284, in serve
(nova): TRACE: x.start()
(nova): TRACE: File "/usr/lib64/python2.6/site-packages/nova/service.py", line 96, in start
(nova): TRACE: self.manager.update_available_resource(ctxt)
(nova): TRACE: File "/usr/lib64/python2.6/site-packages/nova/exception.py", line 120, in _wrap
(nova): TRACE: return f(*args, **kw)
(nova): TRACE: File "/usr/lib64/python2.6/site-packages/nova/compute/manager.py", line 799, in update_available_resource
(nova): TRACE: return self.driver.update_available_resource(context, self.host)
(nova): TRACE: File "/usr/lib64/python2.6/site-packages/nova/virt/libvirt_conn.py", line 1078, in update_available_resource
(nova): TRACE: 'cpu_info': self.get_cpu_info()}
(nova): TRACE: File "/usr/lib64/python2.6/site-packages/nova/virt/libvirt_conn.py", line 991, in get_cpu_info
(nova): TRACE: + xml.serialize())
(nova): TRACE: Invalid: Invalid xml. '<cpu>' must be 1,but 5
(nova): TRACE: <?xml version="1.0"?>
(nova): TRACE: <capabilities>
(nova): TRACE:
(nova): TRACE: <host>
(nova): TRACE: <uuid>00000000-0000-0000-0000-001d7d4bca3c</uuid>
(nova): TRACE: <cpu>
(nova): TRACE: <arch>x86_64</arch>
(nova): TRACE: <model>core2duo</model>
(nova): TRACE: <vendor>Intel</vendor>
(nova): TRACE: <topology sockets="1" cores="4" threads="1"/>
(nova): TRACE: <feature name="lahf_lm"/>
(nova): TRACE: <feature name="xtpr"/>
(nova): TRACE: <feature name="cx16"/>
(nova): TRACE: <feature name="tm2"/>
(nova): TRACE: <feature name="est"/>
(nova): TRACE: <feature name="vmx"/>
(nova): TRACE: <feature name="ds_cpl"/>
(nova): TRACE: <feature name="pbe"/>
(nova): TRACE: <feature name="tm"/>
(nova): TRACE: <feature name="ht"/>
(nova): TRACE: <feature name="ss"/>
(nova): TRACE: <feature name="acpi"/>
(nova): TRACE: <feature name="ds"/>
(nova): TRACE: </cpu>
(nova): TRACE: <migration_features>
(nova): TRACE: <live/>
(nova): TRACE: <uri_transports>
(nova): TRACE: <uri_transport>tcp</uri_transport>
(nova): TRACE: </uri_transports>
(nova): TRACE: </migration_features>
(nova): TRACE: <topology>
(nova): TRACE: <cells num="1">
(nova): TRACE: <cell id="0">
(nova): TRACE: <cpus num="4">
(nova): TRACE: <cpu id="0"/>
(nova): TRACE: <cpu id="1"/>
(nova): TRACE: <cpu id="2"/>
(nova): TRACE: <cpu id="3"/>
(nova): TRACE: </cpus>
(nova): TRACE: </cell>
(nova): TRACE: </cells>
(nova): TRACE: </topology>
(nova): TRACE: </host>
(nova): TRACE:
(nova): TRACE: <guest>
(nova): TRACE: <os_type>hvm</os_type>
(nova): TRACE: <arch name="i686">
(nova): TRACE: <wordsize>32</wordsize>
(nova): TRACE: <emulator>/usr/bin/qemu-kvm</emulator>
(nova): TRACE: <machine>pc-0.12</machine>
(nova): TRACE: <machine canonical="pc-0.12">pc</machine>
(nova): TRACE: <machine>pc-0.11</machine>
(nova): TRACE: <machine>pc-0.10</machine>
(nova): TRACE: <machine>isapc</machine>
(nova): TRACE: <machine>mac</machine>
(nova): TRACE: <domain type="qemu">
(nova): TRACE: </domain>
(nova): TRACE: <domain type="kvm">
(nova): TRACE: <emulator>/usr/bin/qemu-kvm</emulator>
(nova): TRACE: </domain>
(nova): TRACE: </arch>
(nova): TRACE: <features>
(nova): TRACE: <cpuselection/>
(nova): TRACE: <pae/>
(nova): TRACE: <nonpae/>
(nova): TRACE: <acpi default="on" toggle="yes"/>
(nova): TRACE: <apic default="on" toggle="no"/>
(nova): TRACE: </features>
(nova): TRACE: </guest>
(nova): TRACE:
(nova): TRACE: <guest>
(nova): TRACE: <os_type>hvm</os_type>
(nova): TRACE: <arch name="x86_64">
(nova): TRACE: <wordsize>64</wordsize>
(nova): TRACE: <emulator>/usr/bin/qemu-kvm</emulator>
(nova): TRACE: <machine>pc-0.12</machine>
(nova): TRACE: <machine canonical="pc-0.12">pc</machine>
(nova): TRACE: <machine>pc-0.11</machine>
(nova): TRACE: <machine>pc-0.10</machine>
(nova): TRACE: <machine>isapc</machine>
(nova): TRACE: <machine>mac</machine>
(nova): TRACE: <domain type="qemu">
(nova): TRACE: </domain>
(nova): TRACE: <domain type="kvm">
(nova): TRACE: <emulator>/usr/bin/qemu-kvm</emulator>
(nova): TRACE: </domain>
(nova): TRACE: </arch>
(nova): TRACE: <features>
(nova): TRACE: <cpuselection/>
(nova): TRACE: <acpi default="on" toggle="yes"/>
(nova): TRACE: <apic default="on" toggle="no"/>
(nova): TRACE: </features>
(nova): TRACE: </guest>
(nova): TRACE:
(nova): TRACE: </capabilities>
(nova): TRACE:
(nova): TRACE:

Related branches

Revision history for this message
Jay Pipes (jaypipes) wrote :

Looks like this is a case of bad XML parsing. IIRC, there was a note from Kei that elements like <element /> were not parsed correctly and that they needed to be in the long format <element>blah</element>. Looking at the output, it seems cpu is the only element that uses the short format of <cpu /> instead of <cpu></cpu>? Kei, what do you think?

Revision history for this message
Kei Masumoto (masumotok) wrote :

didnt expect cpu tag appears more than 1 in our hardware envrionments. I think this patch works.. can you try it?

Revision history for this message
Kei Masumoto (masumotok) wrote :

P.S. I created it based on rev 807.

Thierry Carrez (ttx)
Changed in nova:
status: New → Incomplete
Revision history for this message
Christian Berendt (berendt) wrote :

I had to correct the path for more XML object, see my attached branch. After adding the correct paths I can start nova-compute, again. The linked branch is working fine on a system with one installed cpu package (with 4 cores).

I have not yet testet it on a system with more cpu packages, but here is the output of "virsh capabilities" of a system with 2 installed cpu packages. There is only one //host/cpu entry, so I think this patch should work for n (n>=1) cpu packages. I'll open a merge propsal for my linked branch.

---snip---
<capabilities>

  <host>
    <uuid>50596b67-071e-b211-9111-47b1dc6fb85c</uuid>
    <cpu>
      <arch>x86_64</arch>
      <model>Opteron_G2</model>
      <vendor>AMD</vendor>
      <topology sockets='1' cores='2' threads='1'/>
      <feature name='cr8legacy'/>
      <feature name='extapic'/>
      <feature name='cmp_legacy'/>
      <feature name='3dnow'/>
      <feature name='3dnowext'/>
      <feature name='fxsr_opt'/>
      <feature name='mmxext'/>
      <feature name='ht'/>
      <feature name='vme'/>
    </cpu>
    <migration_features>
      <live/>
      <uri_transports>
        <uri_transport>tcp</uri_transport>
      </uri_transports>
    </migration_features>
    <topology>
      <cells num='2'>
        <cell id='0'>
          <cpus num='2'>
            <cpu id='0'/>
            <cpu id='2'/>
          </cpus>
        </cell>
        <cell id='1'>
          <cpus num='2'>
            <cpu id='1'/>
            <cpu id='3'/>
          </cpus>
        </cell>
      </cells>
    </topology>
  </host>

  <guest>
    <os_type>hvm</os_type>
    <arch name='i686'>
      <wordsize>32</wordsize>
      <emulator>/usr/bin/qemu-kvm</emulator>
      <machine>pc-0.12</machine>
      <machine canonical='pc-0.12'>pc</machine>
      <machine>pc-0.11</machine>
      <machine>pc-0.10</machine>
      <machine>isapc</machine>
      <machine>mac</machine>
      <domain type='qemu'>
      </domain>
      <domain type='kvm'>
        <emulator>/usr/bin/qemu-kvm</emulator>
      </domain>
    </arch>
    <features>
      <cpuselection/>
      <pae/>
      <nonpae/>
      <acpi default='on' toggle='yes'/>
      <apic default='on' toggle='no'/>
    </features>
  </guest>

  <guest>
    <os_type>hvm</os_type>
    <arch name='x86_64'>
      <wordsize>64</wordsize>
      <emulator>/usr/bin/qemu-kvm</emulator>
      <machine>pc-0.12</machine>
      <machine canonical='pc-0.12'>pc</machine>
      <machine>pc-0.11</machine>
      <machine>pc-0.10</machine>
      <machine>isapc</machine>
      <machine>mac</machine>
      <domain type='qemu'>
      </domain>
      <domain type='kvm'>
        <emulator>/usr/bin/qemu-kvm</emulator>
      </domain>
    </arch>
    <features>
      <cpuselection/>
      <acpi default='on' toggle='yes'/>
      <apic default='on' toggle='no'/>
    </features>
  </guest>

</capabilities>
---snap---

Thierry Carrez (ttx)
Changed in nova:
assignee: nobody → Christian Berendt (berendt)
importance: Undecided → High
status: Incomplete → In Progress
Revision history for this message
Kei Masumoto (masumotok) wrote :

I checked your branch. and agree to your changes. thank you!

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → 2011.2
status: Fix Committed → Fix Released
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.