Changing the CPU Pinning of a virtual CPU is no longer possible with rhel6.6

Solution Verified - Updated -

Environment

Red Hat Enterprise Linux 6.6

Issue

Changing the CPU Pinning of a virtual CPU is no longer possible if the new range is outside the previous range of the VM with Red Hat Enterprise Linux 6.6

Resolution

The fix for the cpuset behavior has been released with errata: RHBA-2015:0916

Root Cause

This behavior is a side effect of the patch added to libvirt-0.10.2-36

Diagnostic Steps

Prepare domain

virsh edit test
<domain>
...
  <vcpu placement='auto'>24</vcpu>
  <numatune>
    <memory mode='strict' placement='auto'></memory>
  </numatune>
...
</domain>

virsh start test

Find out domain is allocated to node 2,4-5,7

grep Nodeset /tmp/libvirtd.log 
2013-09-27 03:23:45.443+0000: 52548: debug : qemuProcessStart:3781 : Nodeset returned from numad: 2,4-5,7

Find out the cpu numbers of node

numactl --hardware
available: 8 nodes (0-7)
node 0 cpus: 0 4 8 12 16 20 24 28
node 0 size: 16349 MB
node 0 free: 15690 MB
node 1 cpus: 32 36 40 44 48 52 56 60
node 1 size: 16384 MB
node 1 free: 15934 MB
node 2 cpus: 1 5 9 13 17 21 25 29
node 2 size: 16384 MB
node 2 free: 15913 MB
node 3 cpus: 33 37 41 45 49 53 57 61
node 3 size: 16384 MB
node 3 free: 15943 MB
node 4 cpus: 2 6 10 14 18 22 26 30
node 4 size: 16384 MB
node 4 free: 15818 MB
node 5 cpus: 34 38 42 46 50 54 58 62
node 5 size: 16384 MB
node 5 free: 16007 MB
node 6 cpus: 35 39 43 47 51 55 59 63
node 6 size: 16384 MB
node 6 free: 15913 MB
node 7 cpus: 3 7 11 15 19 23 27 31
node 7 size: 16367 MB
node 7 free: 15780 MB

virsh vcpuinfo test | grep -w "CPU:"
CPU:            47
CPU:            43
CPU:            43
CPU:            24
CPU:            43
CPU:            10
CPU:            26
CPU:            5
CPU:            1
CPU:            9
CPU:            14
CPU:            6
CPU:            52
CPU:            6
CPU:            56
CPU:            63
CPU:            31
CPU:            14
CPU:            30
CPU:            14
CPU:            20
CPU:            4
CPU:            13
CPU:            55

The cpu which each vcpu process running on should be the same with numad returned.
Apparently, the cpu 47 is not in node 2,4-5,7.

Expected result, virsh vcpuinfo should use nodes returned from numad.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.