Bug 1584091 - libvirt: vpx:// driver does not accept a number of vCPUs when it is not 1 or a multiple of 2
Summary: libvirt: vpx:// driver does not accept a number of vCPUs when it is not 1 or ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.6
Hardware: x86_64
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Pino Toscano
QA Contact: mxie@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-05-30 09:13 UTC by mxie@redhat.com
Modified: 2018-10-30 09:56 UTC (History)
9 users (show)

Fixed In Version: libvirt-4.5.0-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-30 09:55:54 UTC
Target Upstream Version:


Attachments (Terms of Use)
singular-cpus.vmx (3.01 KB, text/plain)
2018-05-30 09:13 UTC, mxie@redhat.com
no flags Details


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:3113 None None None 2018-10-30 09:56:51 UTC

Description mxie@redhat.com 2018-05-30 09:13:48 UTC
Created attachment 1445733 [details]
singular-cpus.vmx

Description of problem:
Libvirt: vpx:// driver can not get CPU topology from vmware when guest's cpu num is singular

Version-Release number of selected component (if applicable):
libvirt-4.3.0-1.el7.x86_64
qemu-kvm-rhev-2.12.0-2.el7.x86_64


How reproducible:
100%

Steps to Reproduce:
1. Set 1 sockets and 7 core for guest's cpu on vmware host

2. Use virsh to check guest's cpu topology
# virsh -c vpx://root@10.73.75.182/data/10.73.3.19/?no_verify=1
Enter root's password for 10.73.75.182: 
Welcome to virsh, the virtualization interactive terminal.

Type:  'help' for help with commands
       'quit' to quit
virsh # dumpxml esx5.5-win2016-x86_64
error: internal error: Expecting VMX entry 'numvcpus' to be an unsigned integer (1 or a multiple of 2) but found 7


Actual results:
As above description

Expected results:
Libvirt: vpx:// driver can get CPU topology from vmware when guest's cpu num is singular

Additional info:

Comment 2 Richard W.M. Jones 2018-05-30 09:17:34 UTC
https://libvirt.org/git/?p=libvirt.git;a=blob;f=src/vmx/vmx.c;h=bdc27b15b0f44fac837e5658f788be679cacceb6;hb=HEAD#l1509

I've no idea why this check is there, but it seems reasonable
to just remove it.  I'll post a patch shortly.

Comment 3 Pino Toscano 2018-05-30 09:21:31 UTC
Copying my comments from bug 1568148 comment 21:

It looks like the limitation of numvcpus to be 1 or a multiple of 2 was part of the initial commit of the VMX parser, in 2009. Not sure why it was added in the first place, and since the VMX file format is proprietary of VMware, I have no idea whether removing the limitation might break anything.

I just wrote to libvir-list, and to the author of the VMX parser asking for more details:
https://www.redhat.com/archives/libvir-list/2018-May/msg02159.html

Comment 4 Richard W.M. Jones 2018-05-30 09:34:55 UTC
Pino's question:

https://www.redhat.com/archives/libvir-list/2018-May/msg02159.html

My patch which just removes the test:

https://www.redhat.com/archives/libvir-list/2018-May/msg02160.html

Comment 5 Pino Toscano 2018-06-22 08:53:48 UTC
Fixed upstream with:

commit c92b6023e8eb670e01571e299a85e9da9bd4844c
Author:     Pino Toscano <ptoscano@redhat.com>
AuthorDate: Thu Jun 14 15:34:25 2018 +0200
Commit:     Jiri Denemark <jdenemar@redhat.com>
CommitDate: Fri Jun 22 10:37:24 2018 +0200

    vmx: allow an odd number of vCPUs
    
    Most probably this was a limitation in older ESX versions, and it seems
    it does not exist anymore in more recent versions; see the following
    thread:
    https://www.redhat.com/archives/libvir-list/2018-May/msg02159.html
    https://www.redhat.com/archives/libvir-list/2018-June/msg00043.html
    
    Hence, allow an odd number (greater than 1) of vCPUs, since most
    probably older versions of ESXi will error out anyway.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1584091
    
    Signed-off-by: Pino Toscano <ptoscano@redhat.com>
    Reviewed-by: Jiri Denemark <jdenemar@redhat.com>

Comment 7 mxie@redhat.com 2018-07-23 07:23:31 UTC
Verify the bug with builds:
libvirt-4.5.0-3.el7.x86_64
qemu-kvm-rhev-2.12.0-7.el7.x86_64


Steps:
Scenario1:
1.1 Set 7 sockets and 1 core in guest's cpu topology on ESXi6.7 host
1.2 Use virsh to check guest's cpu topology

# virsh -c vpx://root@10.73.73.141/data/10.73.75.219/?no_verify=1
Enter root's password for 10.73.73.141: 
Welcome to virsh, the virtualization interactive terminal.

Type:  'help' for help with commands
       'quit' to quit

virsh # dumpxml esx6.7-win2008r2-x86_64
....
  <vcpu placement='static'>7</vcpu>
....

Scenario2
2.1 Set 3 sockets and 3 cores in guest's cpu topology on ESXi6.7 host
2.2 Use virsh to check guest's cpu topology
virsh # dumpxml esx6.7-win2008r2-x86_64
....
  <cpu>
    <topology sockets='3' cores='3' threads='1'/>
  </cpu>
....

Scenario3:
3.1 Set 1 sockets and 5 cores in guest's cpu topology on ESXi6.7 host
3.2 Use virsh to check guest's cpu topology
virsh # dumpxml esx6.7-win2008r2-x86_64
....
  <cpu>
    <topology sockets='1' cores='5' threads='1'/>
  </cpu>
....

Result:
    Scenario1's problem has bug1590079 to be tracked, libvirt: vpx:// driver has accepted a number of vCPUs when it is not 1 or a multiple of 2 according to scenario2 and sceanrio3, so move the bug from ON_QA to VERIFIED

Comment 9 errata-xmlrpc 2018-10-30 09:55:54 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/RHSA-2018:3113


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