Bug 1514463 - VMs on SCVMM report cores per socket and number of sockets incorrectly
Summary: VMs on SCVMM report cores per socket and number of sockets incorrectly
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Providers
Version: 5.8.0
Hardware: All
OS: All
high
medium
Target Milestone: GA
: 5.10.0
Assignee: Adam Grare
QA Contact: Niyaz Akhtar Ansari
URL:
Whiteboard:
Depends On:
Blocks: 1519473
TreeView+ depends on / blocked
 
Reported: 2017-11-17 14:06 UTC by Felix Dewaleyne
Modified: 2021-06-10 13:37 UTC (History)
8 users (show)

Fixed In Version: 5.10.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1519473 (view as bug list)
Environment:
Last Closed: 2018-06-21 20:35:00 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Felix Dewaleyne 2017-11-17 14:06:08 UTC
Description of problem:
VMs on SCVMM report cores per socket and number of sockets incorrectly

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

How reproducible:
all the time

Steps to Reproduce:
1.set up scvmm provider
2.refresh
3.compare values for cores per socket and number of sockets to the values reported in the provider

Actual results:
the two values are switched around

Expected results:
the numbers are correctly accounted

Additional info:

Comment 4 Adam Grare 2017-11-17 21:20:03 UTC
Felix the screenshot from SCVMM just shows that it has 4 processors is that correct?  Is the expectation that it would be 1 socket and 4 cores?

We collect PhsyicalCPUCount and the LogicalProcessorCount and CoresPerCPU properties from SCVMM so I would argue that what CFME collects and displays is more informative.

Comment 5 Felix Dewaleyne 2017-11-28 14:50:20 UTC
(In reply to Adam Grare from comment #4)
> Felix the screenshot from SCVMM just shows that it has 4 processors is that
> correct?  Is the expectation that it would be 1 socket and 4 cores?
> 
> We collect PhsyicalCPUCount and the LogicalProcessorCount and CoresPerCPU
> properties from SCVMM so I would argue that what CFME collects and displays
> is more informative.

I'll ask the customer if he has a better example.

Comment 6 Roland Wolters 2017-11-28 15:25:52 UTC
Please note that there is a lspci output from within the VM:

# lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                4
On-line CPU(s) list:   0-3
Thread(s) per core:    1
Core(s) per socket:    4

I doubt that there is any further need for other examples: we have the screenshot from CFME and the lspci output, showing clearly that CFME mixes the two relevant values: the number of sockets reports the number of cores and vice versa.

Comment 7 Adam Grare 2017-11-28 16:21:06 UTC
Sorry the parameters that I pasted were for the host not the VM.  We parse the Vm CPU params here:
https://github.com/ManageIQ/manageiq-providers-scvmm/blob/master/app/models/manageiq/providers/microsoft/infra_manager/refresh_parser.rb#L405-L407

I dumped the whole VM object and I don't see anything that indicates a difference between sockets and cores.  The only parameter that SCVMM returns that I see is CPUCount.

Comment 8 Roland Wolters 2017-11-28 16:44:40 UTC
So if SCVMM only returns CPUCount, that should not be interpreted as the number of sockets, right? And why is cpu_cores_per_socket hard coded to 1?

If we only get CPUCount from SCVMM we should at least not treat it arbitrarily in a way that we usually get as many sockets as total CPU cores. That simply doesn't make any sense.

Comment 9 Adam Grare 2017-11-28 17:17:32 UTC
> So if SCVMM only returns CPUCount, that should not be interpreted as the number of sockets, right?

Without any additional info on the CPU topology from SCVMM we are only guessing on this.  The only info we know for sure is that the total number of logical CPUs is 4.

> If we only get CPUCount from SCVMM we should at least not treat it arbitrarily in a way that we usually get as many sockets as total CPU cores. That simply doesn't make any sense.

I don't know that arbitrarily treating CPUCount to be equal to the number of cores is any more accurate than being equal to the number of sockets.  They're both just guesses without SCVMM telling us exactly how many sockets/cores there are.

If it is well known that SCVMM means cores when they say CPUCount then I'm fine switching this to hard-coding 1 socket and CPUCount cores.  If you give a VM 128 CPUs is that reported as 128 cores though?

Comment 10 Adam Grare 2017-11-28 22:12:44 UTC
I tried adding 8 vCPUs to one of our VMs.  CPUCount reported 8 CPUs, the OS reported 2 sockets and 4 cores per socket.

There is not enough information provided by SCVMM to report this the way that the guest OS would see it.

The only sane thing I can see doing would be to only set cpu_total_cores and leaving cpu_sockets and cpu_cores_per_socket nil.  This is a little confusing on the UI because it shows "8 ( Sockets x 0 Cores)" but the UI could be updated to show this properly.

Comment 11 Roland Wolters 2017-11-29 09:34:30 UTC
Without any further information from SCVMM I totally agree that we should only show cpu_total_cores - everything else is just guesswork.
It would be great if the UI could be updated to for example not show "(Sockets x Cores)" if any of the values is zero.

Comment 13 CFME Bot 2017-11-29 17:34:33 UTC
New commit detected on ManageIQ/manageiq-providers-scvmm/master:
https://github.com/ManageIQ/manageiq-providers-scvmm/commit/b0bad3a83b84738b9c1208c7e623eb34fa332638

commit b0bad3a83b84738b9c1208c7e623eb34fa332638
Author:     Adam Grare <agrare>
AuthorDate: Wed Nov 29 11:37:30 2017 -0500
Commit:     Adam Grare <agrare>
CommitDate: Wed Nov 29 11:37:30 2017 -0500

    Don't report misleading sockets/cores
    
    SCVMM doesn't return any information regarding how many sockets or
    cores_per_socket exist on a VM, only the total number of CPUs.
    
    Currently we report all of these CPUs as sockets with 1 core per socket.
    This is misleading since the guest OS typically reports something
    different, e.g. CPUCount: 4 => 1 socket x 4 cores and CPUCount: 8 => 2
    socket x 4 cores.
    
    Rather than guessing on the socket/cores count we can just set the
    cpu_total_cores value and leave the rest blank.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1514463

 app/models/manageiq/providers/microsoft/infra_manager/refresh_parser.rb | 2 --
 .../models/manageiq/providers/microsoft/infra_manager/refresher_spec.rb | 2 --
 2 files changed, 4 deletions(-)

Comment 16 CFME Bot 2017-11-29 21:59:06 UTC
New commit detected on ManageIQ/manageiq-ui-classic/master:
https://github.com/ManageIQ/manageiq-ui-classic/commit/64ba0a3fc87674acc478ee844ef84838252885fa

commit 64ba0a3fc87674acc478ee844ef84838252885fa
Author:     Adam Grare <agrare>
AuthorDate: Wed Nov 29 14:34:35 2017 -0500
Commit:     Adam Grare <agrare>
CommitDate: Wed Nov 29 14:34:35 2017 -0500

    Only show sockets and cores_per_socket if present
    
    On the container textual summary we were showing the sockets and
    cores_per_socket even if these were unset.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1514463

 app/helpers/textual_mixins/textual_devices.rb | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

Comment 17 CFME Bot 2017-11-30 13:39:14 UTC
New commit detected on ManageIQ/manageiq-ui-classic/master:
https://github.com/ManageIQ/manageiq-ui-classic/commit/8097e3c23bb3f9f823b73768b19cd5598d87e4fe

commit 8097e3c23bb3f9f823b73768b19cd5598d87e4fe
Author:     Adam Grare <agrare>
AuthorDate: Wed Nov 29 12:45:21 2017 -0500
Commit:     Adam Grare <agrare>
CommitDate: Wed Nov 29 14:27:39 2017 -0500

    Fix CPU summary for VMs without cores_per_socket
    
    For VMs which do not set cpu_sockets or cpu_cores_per_socket we only
    want to show cpu_total_cores.  There is a check for this already but
    since cpu_sockets has a default value of 1 (assuming for divide-by-zero
    issues) and cpu_total_cores is a virtual delegate with a default value
    of 1 this is always showing up as ' (1 Socket x 0 Cores)'.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1514463

 app/helpers/vm_helper/textual_summary.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comment 18 Adam Grare 2017-11-30 14:20:33 UTC
Okay all PRs have been merged!

We now only show total cpus for SCVMM and fixed the UI to not show "8 (1 Socket x 0 Cores)"


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