Bug 1232663

Summary: cannot change the nodeset if we do not set the numatune in guest xml
Product: Red Hat Enterprise Linux 7 Reporter: Luyao Huang <lhuang>
Component: libvirtAssignee: Michal Privoznik <mprivozn>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2CC: dyuan, honzhang, mprivozn, mzhan, rbalakri
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-1.2.17-3.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-19 06:41:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Luyao Huang 2015-06-17 09:14:29 UTC
description of problem:
cannot change the nodeset if we do not set the numatune in guest xml

Version-Release number of selected component (if applicable):

libvirt-1.2.16-1.el7.x86_64

How reproducible:
100%

Steps to Reproduce:

1. prepare a guest *without* numatune settings:

  <memory unit='KiB'>1024000</memory>
  <currentMemory unit='KiB'>1024000</currentMemory>
  <vcpu placement='static'>5</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-i440fx-rhel7.2.0'>hvm</type>
    <boot dev='hd'/>
  </os>


2. start it and check the numa policy:
# virsh start test4
Domain test4 started

# virsh numatune test4
numa_mode      : strict
numa_nodeset   :

3.

# virsh numatune test4 --mode strict --nodeset 1
error: Unable to change numa parameters
error: Requested operation is not valid: change of nodeset for running domain requires strict numa mode


Actual results:
Cannot change the nodeset if we do not set the numatune in guest xml

from 2 step we know the mode is strict, but when we change the nodeset, libvirt
point out that our mode is not strict

cannot reproduce this issue with libvirt-1.2.15-2.el7.x86_64, so i think maybe this is a regression

Expected results:
2 option

1. show the "default" when we use numatune to check the mode, because we didn't set the numa bind mode in guest xml, and the display from numatune is against itself when we change the node set.

2. allow change the nodeset in step 3 (if with cgroup), because we allow change the nodeset even the guest have no numatune settings in libvirt-1.2.15-2.el7.x86_64, and as we change the nodeset via cgroup, we do not use the libnuma API if cgroup is available.

Comment 1 Michal Privoznik 2015-07-13 16:30:47 UTC
Patch proposed upstream:

https://www.redhat.com/archives/libvir-list/2015-July/msg00516.html

Comment 4 hongming 2015-08-27 09:46:19 UTC
Verify it as follows. The result is expected. Move its status to VERIFIED.

# rpm -q libvirt
libvirt-1.2.17-6.el7.x86_64

# virsh start test4
Domain test4 started

# virsh dumpxml test4|grep numatune

# virsh numatune test4
numa_mode      : strict
numa_nodeset   : 


# virsh numatune test4 --mode strict --nodeset 1

# virsh numatune test4
numa_mode      : strict
numa_nodeset   : 1

# virsh dumpxml test4|grep /numatune -B2
  <numatune>
    <memory mode='strict' nodeset='1'/>
  </numatune>


# virsh list
 Id    Name                           State
----------------------------------------------------
 21    test4                          running


# numastat -p `pidof qemu-kvm`

Per-node process memory usage (in MBs) for PID 27929 (qemu-kvm)
                           Node 0          Node 1           Total
                  --------------- --------------- ---------------
Huge                         0.00            0.00            0.00
Heap                         0.00            6.87            6.87
Stack                        0.00            2.09            2.09
Private                      0.02         2033.41         2033.43
----------------  --------------- --------------- ---------------
Total                        0.02         2042.37         2042.39

Comment 6 errata-xmlrpc 2015-11-19 06:41:31 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