Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1434550

Summary: virsh host capabilities shows incorrect number of sockets
Product: [Community] Virtualization Tools Reporter: Richard W.M. Jones <rjones>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED CANTFIX QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: jdenemar, libvirt-maint, pkrempa, rbalakri, srwx4096
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-28 13:18:54 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:
Bug Depends On:    
Bug Blocks: 910269    
Attachments:
Description Flags
capabilities.xml none

Description Richard W.M. Jones 2017-03-21 17:27:00 UTC
Description of problem:

$ sudo virsh capabilities

<capabilities>

  <host>
    <uuid>00000000-0000-0040-8000-408d5caa0fdb</uuid>
    <cpu>
      <arch>x86_64</arch>
      <model>Broadwell</model>
      <vendor>Intel</vendor>
      <topology sockets='1' cores='8' threads='1'/>

However the real host has 2 sockets.

Cores and threads are correct.

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

libvirt-daemon-3.1.0-1.fc27.x86_64

How reproducible:

100%

Steps to Reproduce:
1. See above.

Host is this one:

https://rwmj.wordpress.com/2016/08/31/new-dev-server/

As you can see from the photograph, there are two sockets.

Comment 1 Jiri Denemark 2017-03-21 20:57:30 UTC
Is this a NUMA machine? The number of sockets is counted per NUMA node. It is similar to what virNodeGetInfo returns, just the number of NUMA cells are completely ignored here. Use other parts of the capabilities XML if you want to see the real CPU topology.

Comment 2 Richard W.M. Jones 2017-03-22 10:16:03 UTC
Created attachment 1265346 [details]
capabilities.xml

It is a NUMA machine (in as much as every machine with > 1 sockets
these days is NUMA).  This is a bit unexpected as I'd expect
"sockets" to be the number of sockets.  It does show
<cells num='2'> which I guess refers to NUMA cells.

Full capabilities XML attached.

Comment 3 srwx4096 2017-03-28 13:12:02 UTC
Hi Richard,

I am new here. It seems to me it's a design decision when it was implemented, it maybe a design flaw as we see it today. 

I am simply practicing to contribute some code. Do we need to actually fix it or leave as it is?

Dan

Comment 4 Peter Krempa 2017-03-28 13:18:54 UTC
As Jirka said, this was a wrong decision originally and it can't be changed now.

If you are unsure how to aggregate data from the topology XML, you can check out libvirt-python.git/examples/topology.py