Bug 1820376 - virsh capabilities show incorrect topology info
Summary: virsh capabilities show incorrect topology info
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: libvirt
Version: 8.2
Hardware: ppc64le
OS: Linux
medium
medium
Target Milestone: rc
: 8.3
Assignee: Daniel Henrique Barboza (IBM)
QA Contact: Dan Zheng
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-04-02 22:28 UTC by Daniel Henrique Barboza (IBM)
Modified: 2020-11-17 17:48 UTC (History)
5 users (show)

Fixed In Version: libvirt-6.3.0-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-17 17:48:08 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Daniel Henrique Barboza (IBM) 2020-04-02 22:28:38 UTC
*Note*: this was split from bug 1816037 to track the solution for the topology info documentation fix, as suggested by David Gibson.


Description of problem:
virsh capabilities show incorrect topology info

Version-Release number of selected component (if applicable):
libvirt-6.0.0-14.module+el8.2.0+6069+78a1cb09.ppc64le

How reproducible:
100%

Steps to Reproduce:
1. 'lscpu' show 2 sockets on the host
# lscpu
Architecture:        ppc64le
Byte Order:          Little Endian
CPU(s):              160
On-line CPU(s) list: 0-159
Thread(s) per core:  4
Core(s) per socket:  20
Socket(s):           2
NUMA node(s):        2
Model:               2.2 (pvr 004e 1202)
Model name:          POWER9, altivec supported
CPU max MHz:         3800.0000
CPU min MHz:         2166.0000
L1d cache:           32K
L1i cache:           32K
L2 cache:            512K
L3 cache:            10240K
NUMA node0 CPU(s):   0-79
NUMA node8 CPU(s):   80-159

2. 'virsh capabilities' show '1' socket in cpu topology.
# virsh capabilities
<capabilities>

  <host>
    <uuid>7714c83d-2719-4a89-8119-156778df62e7</uuid>
    <cpu>
      <arch>ppc64le</arch>
      <model>POWER9</model>
      <vendor>IBM</vendor>
      <topology sockets='1' dies='1' cores='20' threads='4'/>   <=== incorrect sockets number
...
    </cpu>


Actual results:
See above

Expected results:
1. topology socket number should be same with host info shown in lscpu

Comment 1 Daniel Henrique Barboza (IBM) 2020-04-02 22:31:42 UTC
I consider this to be a documentation issue. Libvirt is not reporting the total socket
number of the host in the topology XML. It is reporting the number of sockets per
node. This is misleading because the Libvirt documentation states:


(https://libvirt.org/formatdomain.html)
topology

The topology element specifies requested topology of virtual CPU provided to the guest.
Four attributes, sockets, dies, cores, and threads, accept non-zero positive integer values.
They refer *to the total number of CPU sockets,* (...)


And then the user will expect it to match the output of lscpu. I've sent a patch
to amend the documentation to state that we're reporting the sockets per node:


https://www.redhat.com/archives/libvir-list/2020-April/msg00005.html

Aside from that I don't think there's much to be done. I experimented with changing
'sockets' to report the total sockets of the host, but in the end this change
would break a lot of guests that have more than one NUMA node and will end up
with inconsistent topologies. A better fix would be an extra element or
attribute to report this total socket number but I'm unsure if it's worth
the trouble.

As long as the user is informed that the existing 'sockets' value represents sockets
per NUMA node, the user can infer the total number of sockets given that we're
reporting the amount of NUMA nodes.

Comment 2 Daniel Henrique Barboza (IBM) 2020-04-06 20:48:15 UTC
The documentation fix was pushed upstream:

commit 0895a0e75d13874254218e16dc66dcad673671d3
Author: Daniel Henrique Barboza <danielhb413>
Date:   Wed Apr 1 07:56:37 2020 -0300

    formatdomain.html.in: fix 'sockets' info in topology element

v6.2.0-41-g0895a0e75d

Comment 6 Dan Zheng 2020-05-11 12:31:17 UTC
After checking the 'https://libvirt.org/formatdomain.html' and found the documentation has been updated.

Comment 9 errata-xmlrpc 2020-11-17 17:48:08 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 (virt:8.3 bug fix and enhancement update), 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:5137


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