Bug 1821592 - Unable to start guest with a reduced number of active CPUs and multiple diesb [rhel-8.2.0.z]
Summary: Unable to start guest with a reduced number of active CPUs and multiple diesb...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: libvirt
Version: 8.2
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: 8.3
Assignee: Daniel Berrangé
QA Contact: jiyan
URL:
Whiteboard:
Depends On: 1813395
Blocks: 1785207 1819060
TreeView+ depends on / blocked
 
Reported: 2020-04-07 07:13 UTC by Oneata Mircea Teodor
Modified: 2020-06-15 14:10 UTC (History)
13 users (show)

Fixed In Version: libvirt-6.0.0-17.1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1813395
Environment:
Last Closed: 2020-06-15 14:10:17 UTC
Type: Bug
Target Upstream Version: commit in BZ
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:2552 0 None None None 2020-06-15 14:10:28 UTC

Comment 6 jiyan 2020-05-14 07:48:15 UTC
Reproduced this issue with libvirt-6.0.0-17.module+el8.2.0+6257+0d066c28.x86_64 and verified this issue with libvirt-6.0.0-17.1.module+el8.2.0+6587+cab4dcee.x86_64.

Version:
libvirt-6.0.0-17.module+el8.2.0+6257+0d066c28.x86_64
qemu-kvm-4.2.0-19.module+el8.2.0+6296+6b821950.x86_64
kernel-4.18.0-193.el8.x86_64

Steps:
1. Prepare a shutdown VM with the following conf
# virsh domstate test82 
shut off

# virsh dumpxml test82 --inactive
  <vcpu placement='static' current='24'>32</vcpu>
...
  <cpu mode='host-model' check='partial'>
    <topology sockets='2' dies='2' cores='4' threads='2'/>
  </cpu>

2. Start VM
# virsh start test82
error: Failed to start domain test82
error: internal error: qemu didn't report thread id for vcpu '16'

3. Upgrade libvirt and restart libvirtd service
# yum upgrade libvirt* -y

# rpm -qa libvirt
libvirt-6.0.0-17.1.module+el8.2.0+6587+cab4dcee.x86_64

# systemctl restart libvirtd

4. Start the VM again
# virsh start test82
Domain test82 started

# ps -ef | grep test82
-smp 24,maxcpus=32,sockets=2,dies=2,cores=4,threads=2 

# virsh vcpucount test82 
maximum      config        32
maximum      live          32
current      config        24
current      live          24

# virsh console test82
Connected to domain test82
Escape character is ^]

Red Hat Enterprise Linux 8.2 (Ootpa)
Kernel 4.18.0-193.el8.x86_64 on an x86_64

localhost login: root
Password: 
[root@localhost ~]# lscpu 
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              24
On-line CPU(s) list: 0-23
Thread(s) per core:  2
Core(s) per socket:  6
Socket(s):           2
NUMA node(s):        1
Vendor ID:           GenuineIntel
CPU family:          6
Model:               85
Model name:          Intel Xeon Processor (Cascadelake)

5. Based on step-4, test hot-plugging/unplugging
# virsh setvcpus test82 27

# virsh setvcpu test82 25 --disable

# virsh setvcpu test82 31 --enable

# virsh vcpucount test82 
maximum      config        32
maximum      live          32
current      config        24
current      live          27

# lscpu 
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              27
On-line CPU(s) list: 0-24,26,27
Thread(s) per core:  1
Core(s) per socket:  7
Socket(s):           2
NUMA node(s):        1
Vendor ID:           GenuineIntel
CPU family:          6
Model:               85
Model name:          Intel Xeon Processor (Cascadelake)

Comment 7 jiyan 2020-05-14 10:23:27 UTC
Also tested the following testing scenarios with libvirt-6.0.0-17.1.module+el8.2.0+6587+cab4dcee.x86_64.

Version:
kernel-4.18.0-193.el8.x86_64
libvirt-6.0.0-17.1.module+el8.2.0+6587+cab4dcee.x86_64
qemu-kvm-4.2.0-19.module+el8.2.0+6296+6b821950.x86_64

Steps:
*** S1: Set dies=1 ***
1. Prepare a shutdown VM with the following conf
# virsh domstate test82
shut off

# virsh dumpxml test82 --inactive 
...
  <vcpu placement='static' current='24'>96</vcpu>
  <iothreads>2</iothreads>
  <iothreadids>
    <iothread id='2'/>
    <iothread id='1'/>
  </iothreadids>
  <cputune>
    <shares>2048</shares>
    <vcpupin vcpu='2' cpuset='0-7'/>
    <vcpupin vcpu='19' cpuset='7,170,191'/>
    <emulatorpin cpuset='1-3'/>
    <iothreadpin iothread='2' cpuset='7-8'/>
    <iothreadpin iothread='1' cpuset='5-6'/>
  </cputune>
  <numatune>
    <memory mode='strict' nodeset='0-2'/>
    <memnode cellid='0' mode='strict' nodeset='1'/>
    <memnode cellid='2' mode='preferred' nodeset='2'/>
  </numatune>
...
  <cpu mode='host-model' check='partial'>
    <topology sockets='4' dies='1' cores='4' threads='6'/>
    <numa>
      <cell id='0' cpus='0,4-7' memory='512000' unit='KiB'/>
      <cell id='1' cpus='1,8-10,12-15' memory='512000' unit='KiB' memAccess='shared'>
        <distances>
          <sibling id='1' value='10'/>
        </distances>
      </cell>
      <cell id='2' cpus='2,11' memory='512000' unit='KiB' memAccess='shared'>
        <distances>
          <sibling id='2' value='10'/>
        </distances>
      </cell>
      <cell id='3' cpus='3' memory='512000' unit='KiB'/>
    </numa>
  </cpu>

2. Start VM 
# virsh start test82
Domain test82 started

# ps -ef | grep test82
-smp 24,maxcpus=96,sockets=4,dies=1,cores=4,threads=6 

# virsh vcpucount test82
maximum      config        96
maximum      live          96
current      config        24
current      live          24

# virsh console test82
Connected to domain test82
Escape character is ^]

Red Hat Enterprise Linux 8.2 (Ootpa)
Kernel 4.18.0-193.el8.x86_64 on an x86_64

localhost login: root
Password: 
Last login: Thu May 14 15:43:39 on ttyS0
[root@localhost ~]# lscpu 
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              24
On-line CPU(s) list: 0-23
Thread(s) per core:  2
Core(s) per socket:  10
Socket(s):           1
NUMA node(s):        4
Vendor ID:           GenuineIntel
CPU family:          6
Model:               85
Model name:          Intel Xeon Processor (Cascadelake)
...
NUMA node0 CPU(s):   0,4-7,16-23
NUMA node1 CPU(s):   1,8-10,12-15
NUMA node2 CPU(s):   2,11
NUMA node3 CPU(s):   3

3. Test hot-plugging/unplugging
# virsh setvcpus test82 83

# virsh setvcpu test82 37 --disable

# virsh setvcpu test82 67 --disable

# virsh setvcpu test82 49 --disable

# virsh setvcpu test82 91 --enable

# virsh vcpucount test82 
maximum      config        96
maximum      live          96
current      config        24
current      live          81

# virsh console test82
[root@localhost ~]# lscpu 
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              81
On-line CPU(s) list: 0-36,38-48,50-66,68-83
Thread(s) per core:  3
Core(s) per socket:  5
Socket(s):           4
NUMA node(s):        4

[root@localhost ~]# cat /sys/devices/system/cpu/cpu29/online 
1

[root@localhost ~]# echo 0 > /sys/devices/system/cpu/cpu29/online
[  390.246373] Unregister pv shared memory for cpu 29
[  390.250951] smpboot: CPU 29 is now offline

[root@localhost ~]# lscpu 
Architecture:         x86_64
CPU op-mode(s):       32-bit, 64-bit
Byte Order:           Little Endian
CPU(s):               81
On-line CPU(s) list:  0-28,30-36,38-48,50-66,68-83
Off-line CPU(s) list: 29
Thread(s) per core:   3
Core(s) per socket:   5
Socket(s):            4
NUMA node(s):         4

3. Test hypervisor-cpu-baseline with dumpxml/capabilities file
# virsh capabilities  >> cap.xml

# virsh hypervisor-cpu-baseline cap.xml 
Output the right result here

# virsh dumpxml test82 >> dom.xml

# virsh hypervisor-cpu-baseline dom.xml 
Output the right result here

4. Test managedsave cmd
# virsh managedsave test82 
Domain test82 state saved by libvirt

# virsh start test82 
Domain test82 started

# virsh console test82 
Connected to domain test82
Escape character is ^]

[root@localhost ~]# 
[root@localhost ~]# 
[root@localhost ~]# lscpu 
Architecture:         x86_64
CPU op-mode(s):       32-bit, 64-bit
Byte Order:           Little Endian
CPU(s):               81
On-line CPU(s) list:  0-28,30-36,38-48,50-66,68-83

*** S2: Set dies=3 ***
Execute same test scenarios with S1, all passed.
 <vcpu placement='static' current='64'>96</vcpu>
    <topology sockets='4' dies='3' cores='2' threads='4'/>
# virsh setvcpus test82 82
# virsh setvcpu test82 94 --enable

*** S3: Set dies=5 ***
Execute same test scenarios with S1, all passed.
  <vcpu placement='static' current='156'>160</vcpu>
    <topology sockets='4' dies='5' cores='2' threads='4'/>
# virsh setvcpu test82 159 --enable
# virsh setvcpu test82 98 --disable

All test results are passed, move this bug to be verified.

Comment 9 errata-xmlrpc 2020-06-15 14:10:17 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://access.redhat.com/errata/RHBA-2020:2552


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