Bug 1186199 - Per-node memory binding lost when 'auto' vcpu placement without <memory> placement
Summary: Per-node memory binding lost when 'auto' vcpu placement without <memory> plac...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.1
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Peter Krempa
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-01-27 09:52 UTC by Jincheng Miao
Modified: 2015-11-19 06:08 UTC (History)
5 users (show)

Fixed In Version: libvirt-1.2.13-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-19 06:08:48 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2202 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2015-11-19 08:17:58 UTC

Description Jincheng Miao 2015-01-27 09:52:49 UTC
Description of problem:
when there is no numatune for memory, 'auto' placement vcpu will add 'auto' placement memory numatune automatically.
But user specified memnode for each guest NUMA node in numatune, when 'auto' placement vcpu without memory placement. The libvirtd will add memory placement to 'auto' and remove memnode.

Although this configuration doesn't align vcpus, but it should be valid.

Version-Release number of selected component (if applicable):
libvirt-1.2.8-15.el7.x86_64
qemu-kvm-rhev-2.1.2-21.el7.x86_64
3.10.0-223.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.  prepare guest xml
# cat dummy.xml
<domain type='qemu'>
  <name>dummy</name>
  <memory unit='KiB'>2097152</memory>
  <vcpu placement='auto'>4</vcpu>
  <numatune>
    <memnode cellid="0" mode="strict" nodeset="1"/>
    <memnode cellid="1" mode="preferred" nodeset="0"/>
  </numatune>
  <os>
    <type arch='x86_64' machine='pc'>hvm</type>
  </os>
  <cpu>
    <numa>
      <cell id='0' cpus='0-1' memory='1048576'/>
      <cell id='1' cpus='2-3' memory='1048576'/>
    </numa>
  </cpu>
</domain>

# virsh define dummy.xml


2. then check xml, the <memnode> is lost
# virsh dumpxml dummy
<domain type='qemu'>
  <name>dummy</name>
  <uuid>1fd33000-27cb-425c-94f9-c7454914acdb</uuid>
  <memory unit='KiB'>2097152</memory>
  <currentMemory unit='KiB'>2097152</currentMemory>
  <vcpu placement='auto'>4</vcpu>
  <numatune>
    <memory mode='strict' placement='auto'/>
  </numatune>
  <os>
    <type arch='x86_64' machine='pc-i440fx-rhel7.1.0'>hvm</type>
    <boot dev='hd'/>
  </os>
  <cpu>
    <numa>
      <cell id='0' cpus='0-1' memory='1048576'/>
      <cell id='1' cpus='2-3' memory='1048576'/>
    </numa>
  </cpu>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <controller type='usb' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'/>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </memballoon>
  </devices>
</domain>

Expect result:
memnode is an other memory placement configuration, 'auto' vcpu placement should not remove it.

Comment 1 Peter Krempa 2015-03-04 13:43:23 UTC
Fixed upstream:

commit 638e3d270fc4b1ebeab0d139c2b4e54f590eb8b5
Author: Peter Krempa <pkrempa@redhat.com>
Date:   Thu Feb 12 16:04:45 2015 +0100

    conf: numa: Refactor logic in virDomainNumatuneParseXML
    
    Shuffling around the logic will allow to simplify the code quite a bit.
    As an additional bonus the change in the logic now reports an error if
    automatic placement is selected and individual placement is configured.

v1.2.12-174-g638e3d2

Comment 3 Luyao Huang 2015-05-19 03:43:44 UTC
I can reproduce this issue with libvirt-1.2.8-16.el7.x86_64:

1. add <memnode> in numatune settings:

# virsh edit test3 

...
  <vcpu placement='auto'>4</vcpu>
  <numatune>
    <memnode cellid="0" mode="strict" nodeset="1"/>
    <memnode cellid="1" mode="preferred" nodeset="0"/>
  </numatune>
...

2. recheck the xml:

# virsh dumpxml test3
...
  <vcpu placement='auto' current='1'>2</vcpu>
  <numatune>
    <memory mode='strict' placement='auto'/>
  </numatune>
...

And verify this bug with libvirt-1.2.15-2.el7.x86_64:

1. try to add  <memnode> in numatune settings and set numa placement is auto:

# virsh edit test3

  <vcpu placement='auto'>4</vcpu>
  <numatune>
    <memnode cellid="0" mode="strict" nodeset="1"/>
    <memnode cellid="1" mode="preferred" nodeset="0"/>
  </numatune>

error: unsupported configuration: Per-node binding is not compatible with automatic NUMA placement.
Failed. Try again? [y,n,i,f,?]:

Comment 6 errata-xmlrpc 2015-11-19 06:08:48 UTC
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.

https://rhn.redhat.com/errata/RHBA-2015-2202.html


Note You need to log in before you can comment on or make changes to this bug.