Report an error when booting an instance with a flavor which has NUMA nodes is set to 0 (hw:numa_nodes=0)

Bug #1402709 reported by Kashyap Chamarthy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Gábor Antal

Bug Description

Booting a Nova instance successfully with hw:numa_nodes=0, with a Nova guest XML like that[*]. This bug came out of this RDO bug -- https://bugzilla.redhat.com/show_bug.cgi?id=1154152.

But, talking with Daniel Berrnage and Nikola Dipanov on IRC, they suggest we should default to 1 node if nothing is specified:

  . . .
  <danpb> hmm, i'm not convinced we should allow nodes=0 at all
  <danpb> we should default 1 node if nothing is specified
  <danpb> We should refuse a vlaue of 0, in case we wish to make use
   of that as a special value at a later date
  <danpb> we don't want people relying on numa_nodes=0 accidentally
   working for them now
  <nikola> danpb, correct
  . . .

Simple test
-------------

NUMA setup instructions here:

   https://review.openstack.org/#/c/131818/1/doc/source/devref/testing/libvirt-numa.rst

$ nova flavor-key m1.tiny set hw:numa_nodes=0
$ nova flavor-show m1.tiny
+----------------------------+------------------------+
| Property | Value |
+----------------------------+------------------------+
| OS-FLV-DISABLED:disabled | False |
| OS-FLV-EXT-DATA:ephemeral | 0 |
| disk | 1 |
| extra_specs | {"hw:numa_nodes": "0"} |
| id | 1 |
| name | m1.tiny |
| os-flavor-access:is_public | True |
| ram | 512 |
| rxtx_factor | 1.0 |
| swap | |
| vcpus | 1 |
+----------------------------+------------------------+
$ nova boot --image cirros-0.3.1-x86_64-disk --flavor m1.tiny cirrvm4

[*] Nova guest XML with an instance booted with hw:numa_nodes=0
-----------------------------------------------------------------------------
<domain type='kvm' id='3'>
  <name>instance-00000004</name>
  <uuid>593f8388-ac9c-4673-b1c7-aa49b1ce83f0</uuid>
  <metadata>
    <nova:instance xmlns:nova="http://openstack.org/xmlns/libvirt/nova/1.0">
      <nova:package version="2015.1"/>
      <nova:name>cirrvm4</nova:name>
      <nova:creationTime>2014-12-15 14:41:43</nova:creationTime>
      <nova:flavor name="m1.tiny">
        <nova:memory>512</nova:memory>
        <nova:disk>1</nova:disk>
        <nova:swap>0</nova:swap>
        <nova:ephemeral>0</nova:ephemeral>
        <nova:vcpus>1</nova:vcpus>
      </nova:flavor>
      <nova:owner>
        <nova:user uuid="0d5623bdae83445ba3a6209ea849fffe">admin</nova:user>
        <nova:project uuid="f9ecf22769cf4ab98543f5ade1454664">admin</nova:project>
      </nova:owner>
      <nova:root type="image" uuid="5bc9a92b-6cda-4916-9bb0-dd9751880cde"/>
    </nova:instance>
  </metadata>
  <memory unit='KiB'>524288</memory>
  <currentMemory unit='KiB'>524288</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='0-3'/>
    <emulatorpin cpuset='0-3'/>
  </cputune>
  <numatune>
    <memory mode='strict' nodeset='0'/>
    <memnode cellid='0' mode='strict' nodeset='0'/>
  </numatune>
  <resource>
    <partition>/machine</partition>
  </resource>
  <sysinfo type='smbios'>
    <system>
      <entry name='manufacturer'>OpenStack Foundation</entry>
      <entry name='product'>OpenStack Nova</entry>
      <entry name='version'>2015.1</entry>
      <entry name='serial'>bf6b5391-2390-df4f-b3dc-aa80d05468bb</entry>
      <entry name='uuid'>593f8388-ac9c-4673-b1c7-aa49b1ce83f0</entry>
    </system>
  </sysinfo>
  <os>
    <type arch='x86_64' machine='pc-i440fx-2.2'>hvm</type>
    <boot dev='hd'/>
    <smbios mode='sysinfo'/>
  </os>
  <features>
    <acpi/>
    <apic/>
  </features>
  <cpu>
    <topology sockets='1' cores='1' threads='1'/>
    <numa>
      <cell id='0' cpus='0' memory='524288' unit='KiB'/>
    </numa>
  </cpu>
  <clock offset='utc'>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='hpet' present='no'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/bin/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source file='/home/kashyapc/src/cloud/data/nova/instances/593f8388-ac9c-4673-b1c7-aa49b1ce83f0/disk'/>
      <backingStore type='file' index='1'>
        <format type='raw'/>
        <source file='/home/kashyapc/src/cloud/data/nova/instances/_base/03a663c2a1c649fe0854f01c82c0ddb3871cf691'/>
        <backingStore/>
      </backingStore>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw' cache='none'/>
      <source file='/home/kashyapc/src/cloud/data/nova/instances/593f8388-ac9c-4673-b1c7-aa49b1ce83f0/disk.config'/>
      <backingStore/>
      <target dev='hdd' bus='ide'/>
      <readonly/>
      <alias name='ide0-1-1'/>
      <address type='drive' controller='0' bus='1' target='0' unit='1'/>
    </disk>
    <controller type='usb' index='0'>
      <alias name='usb0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'>
      <alias name='pci.0'/>
    </controller>
    <controller type='ide' index='0'>
      <alias name='ide0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <interface type='bridge'>
      <mac address='fa:16:3e:79:6c:b8'/>
      <source bridge='qbr7584d9fb-e1'/>
      <target dev='tap7584d9fb-e1'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </interface>
    <serial type='file'>
      <source path='/home/kashyapc/src/cloud/data/nova/instances/593f8388-ac9c-4673-b1c7-aa49b1ce83f0/console.log'/>
      <target port='0'/>
      <alias name='serial0'/>
    </serial>
    <serial type='pty'>
      <source path='/dev/pts/19'/>
      <target port='1'/>
      <alias name='serial1'/>
    </serial>
    <console type='file'>
      <source path='/home/kashyapc/src/cloud/data/nova/instances/593f8388-ac9c-4673-b1c7-aa49b1ce83f0/console.log'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
      <stats period='10'/>
    </memballoon>
  </devices>
  <seclabel type='dynamic' model='selinux' relabel='yes'>
    <label>system_u:system_r:svirt_t:s0:c79,c658</label>
    <imagelabel>system_u:object_r:svirt_image_t:s0:c79,c658</imagelabel>
  </seclabel>
</domain>
-----------------------------------------------------------------------------

Changed in nova:
assignee: nobody → Avinash (avinash-jalumuru)
Changed in nova:
assignee: Avinash (avinash-jalumuru) → Satish Inakoti (inakoti-satish)
Changed in nova:
assignee: Satish Inakoti (inakoti-satish) → nobody
assignee: nobody → Santhosh Peddiboyina (peddiboyina-9)
Revision history for this message
Sean Dague (sdague) wrote :

Please do not assign a bug to yourself unless you have a patch up in gerrit.

Changed in nova:
assignee: Santhosh Peddiboyina (peddiboyina-9) → nobody
Revision history for this message
Joe Gordon (jogo) wrote :

Looks like we currently don't refuse numa_nodes value of 0

tags: added: libvirt low-hanging-fruit
Changed in nova:
status: New → Confirmed
importance: Undecided → Low
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/190267

Changed in nova:
assignee: nobody → Karim Boumedhel (karmab)
status: Confirmed → In Progress
Revision history for this message
Sahid Orentino (sahid-ferdjaoui) wrote :

We also want to verify for no-numeric value.

Changed in nova:
assignee: Karim Boumedhel (karmab) → Sharath S (sharathyadav95)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Michael Still (<email address hidden>) on branch: master
Review: https://review.openstack.org/190267
Reason: This patch has been idle for a long time, so I am abandoning it to keep the review clean sane. If you're interested in still working on this patch, then please unabandon it and upload a new patchset.

Revision history for this message
Markus Zoeller (markus_z) (mzoeller) wrote :

Cleanup
=======

There are no open reviews for this bug report since more than 2 weeks.
To signal that to other contributors which might provide patches for
this bug, I switch the status from "In Progress" to "Confirmed" and
remove the assignee.
Feel free to add yourself as assignee and to push a review for it.

Changed in nova:
status: In Progress → Confirmed
assignee: Sharath S (sharathyadav95) → nobody
Changed in nova:
assignee: nobody → nagachetan (nagachetan-km)
assignee: nagachetan (nagachetan-km) → nobody
Changed in nova:
assignee: nobody → Gábor Antal (gabor.antal)
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/337380

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

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

commit 47d8aa5e7fe0c82ed00017aa2185de1ed5e51a86
Author: Gábor Antal <email address hidden>
Date: Tue Jul 5 00:13:25 2016 +0200

    Throw exception if numa_nodes is not set to integer greater than 0

    As [1] is abandoned, I used that patchset to create a new one.
    This patchset is freshened to the current master branch.

    This patch introduces InvalidNUMANodesNumber exception, which is
    thrown when trying to boot an instance with a flavor that has
    hw:numa_nodes=0 extra spec set. That means that NUMA nodes is set to 0,
    which is incorrect.

    [1]: https://review.openstack.org/#/c/190267

    Change-Id: I6bd8f69e582c537a5fec40064638a8887a08cac4
    Co-Authored-By: Karim Boumedhel <email address hidden>
    Closes-Bug: #1402709

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 14.0.0.0rc1

This issue was fixed in the openstack/nova 14.0.0.0rc1 release candidate.

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.