Memnode element is not supported on all versions of libvirt

Bug #1415333 reported by Vladik Romanovsky
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Vladik Romanovsky

Bug Description

The current version of Libvirt in the gate doesn't support a memnode element in the numa tune configuration.
 When requesting guest topology the instance is crashing with
the following:

Instance failed to spawn
 Traceback (most recent call last):
   File "/opt/stack/new/nova/nova/compute/manager.py", line 2303, in _build_resources
     yield resources
   File "/opt/stack/new/nova/nova/compute/manager.py", line 2173, in _build_and_run_instance
     flavor=flavor)
   File "/opt/stack/new/nova/nova/virt/libvirt/driver.py", line 2320, in spawn
     block_device_info=block_device_info)
   File "/opt/stack/new/nova/nova/virt/libvirt/driver.py", line 4231, in _create_domain_and_network
     power_on=power_on)
   File "/opt/stack/new/nova/nova/virt/libvirt/driver.py", line 4164, in _create_domain
     LOG.error(err)
   File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 82, in __exit__
     six.reraise(self.type_, self.value, self.tb)
   File "/opt/stack/new/nova/nova/virt/libvirt/driver.py", line 4148, in _create_domain
     domain = self._conn.defineXML(xml)
   File "/usr/local/lib/python2.7/dist-packages/eventlet/tpool.py", line 183, in doit
     result = proxy_call(self._autowrap, f, *args, **kwargs)
   File "/usr/local/lib/python2.7/dist-packages/eventlet/tpool.py", line 141, in proxy_call
     rv = execute(f, *args, **kwargs)
   File "/usr/local/lib/python2.7/dist-packages/eventlet/tpool.py", line 122, in execute
     six.reraise(c, e, tb)
   File "/usr/local/lib/python2.7/dist-packages/eventlet/tpool.py", line 80, in tworker
     rv = meth(*args, **kwargs)
   File "/usr/lib/python2.7/dist-packages/libvirt.py", line 3240, in defineXML
     if ret is None:raise libvirtError('virDomainDefineXML() failed', conn=self)
 libvirtError: XML error: unsupported XML element memnode

Tags: libvirt
Changed in nova:
assignee: nobody → Vladik Romanovsky (vladik-romanovsky)
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/150694

Changed in nova:
status: New → In Progress
Changed in nova:
assignee: Vladik Romanovsky (vladik-romanovsky) → sahid (sahid-ferdjaoui)
Changed in nova:
assignee: sahid (sahid-ferdjaoui) → Vladik Romanovsky (vladik-romanovsky)
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/150694
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=cf3a1262ecf12f4345326309c273722ebc26b466
Submitter: Jenkins
Branch: master

commit cf3a1262ecf12f4345326309c273722ebc26b466
Author: Vladik Romanovsky <email address hidden>
Date: Wed Jan 28 00:54:26 2015 -0500

    libvirt: avoid setting the memnodes where when it's not a supported option

    The current version of Libvirt in the gate doesn't support a memnode element
    in the numa tune configuration. When requesting guest topology the instance
    is crashing. Not setting the numa tune memnodes option when libvirt version
    is less than the required minimum.

    Change-Id: I99d0bb64bd6d698f2d5ce978cb3778bbad8eec91
    Closes-Bug: #1415333

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/152405

Thierry Carrez (ttx)
Changed in nova:
milestone: none → kilo-2
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to nova (master)

Reviewed: https://review.openstack.org/152405
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=976dc9707b96de8ebf8b57ea645ff7755fbaa1ce
Submitter: Jenkins
Branch: master

commit 976dc9707b96de8ebf8b57ea645ff7755fbaa1ce
Author: Vladik Romanovsky <email address hidden>
Date: Tue Feb 3 01:07:24 2015 -0500

    libvirt: memnodes shuold be set to a list instead of None

    Currently, _get_guest_numa_tune_memnodes returns None,
    when an installed version of Libvirt doesn't support a
    memnode element in the numa tune configuration,
    while it should always return a list.

    Related-Bug: #1415333

    Change-Id: I28a5a2c65aa703b0161ebca8659dc96a7b6c1bf6

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

Related fix proposed to branch: master
Review: https://review.openstack.org/159106

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to nova (master)

Reviewed: https://review.openstack.org/159106
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=945ab28df04e22f3c1b8948972f538ee6b5e7410
Submitter: Jenkins
Branch: master

commit 945ab28df04e22f3c1b8948972f538ee6b5e7410
Author: Daniel P. Berrange <email address hidden>
Date: Wed Feb 25 10:11:14 2015 +0000

    libvirt: fix disablement of NUMA & hugepages on unsupported platforms

    Two previous commits updated the libvirt XML config generator so
    that it would omit the config elements for huge pages and NUMA
    placement when running on old libvirt:

      commit cf3a1262ecf12f4345326309c273722ebc26b466
      Author: Vladik Romanovsky <email address hidden>
      Date: Wed Jan 28 00:54:26 2015 -0500

        libvirt: avoid setting the memnodes where when it's not a supported option

      commit 3466e727546e0f7595378b8274254bed913f42ee
      Author: Vladik Romanovsky <email address hidden>
      Date: Tue Jan 6 14:23:38 2015 -0500

        libvirt: not setting membacking when mempages are empty host topology

    The problem arising from this is that the hosts are still reporting
    to the schedular that they can support NUMA and huge pages if
    libvirt >= 1.0.4, but we are silently discarding the guest config
    if libvirt < 1.2.7 (numa) or 1.2.8 (huge pages).

    The result is that the schedular thinks the host can support the
    requested feature and so places the guest there, but the actual
    guest that is launched is missing the feature. So the user is not
    getting what they requested.

    The correct approach is to update the "_get_host_numa_topology"
    method so that it does not report any NUMA topology in the first
    place, if the host is incapable of having guests configured in
    the way Nova requires. Likewise if the host cannot support the
    huge page configuration method required, it should not report
    availability of huge pages.

    In summary, we are moving the version checks added by the two
    commits above to the point at which host capability reporting
    is done. We add a fatal error check in the guest XML config
    generator methods, so that if there is some future schedular
    bug causing it to not honour host capabilities, we see a
    clear error instead of silently starting guests with the
    wrong config.

    There is a further mistake in that a version number check alone
    is insufficient. We must also check that the hypervisor is
    either QEMU or KVM, to prevent the code paths running on Xen
    or LXC.

    Closes-bug: #1425115
    Related-bug: #1408070
    Related-bug: #1415333

    Change-Id: I8326596696cbb030ae95d17f3dd430d05279081a

Thierry Carrez (ttx)
Changed in nova:
milestone: kilo-2 → 2015.1.0
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.