Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1370066 - Use setvcpus to change maximum vcpu number will make guest have broken settings
Use setvcpus to change maximum vcpu number will make guest have broken settings
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.3
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: Peter Krempa
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-08-25 04:42 EDT by Luyao Huang
Modified: 2016-11-03 14:53 EDT (History)
4 users (show)

See Also:
Fixed In Version: libvirt-2.0.0-7.el7
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-11-03 14:53:54 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2577 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2016-11-03 08:07:06 EDT

  None (edit)
Description Luyao Huang 2016-08-25 04:42:32 EDT
Description of problem:
Use setvcpus to change maximum vcpu number will make guest have broken settings

Version-Release number of selected component (if applicable):
libvirt-2.0.0-6.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. prepare a guest which have vcpu topology
# virsh dumpxml r7
...
  <vcpu placement='static' current='1'>12</vcpu>
...
    <topology sockets='3' cores='2' threads='2'/>
...


2. change guest maximum vcpu:

# virsh setvcpus r7 13 --config --maximum


3. restart libvirtd

# service libvirtd restart
Redirecting to /bin/systemctl restart  libvirtd.service

# virsh edit r7
error: failed to get domain 'r7'
error: Domain not found: no domain with matching name 'r7'

libvirtd log:
journal: Maximum CPUs greater than topology limit


Actual results:
Use setvcpus to change maximum vcpu number will make guest have broken settings and guest disappear after restart libvirtd

Expected results:
report error when change maximum vcpu number

Additional info:
Comment 1 Peter Krempa 2016-08-26 11:39:17 EDT
Fixed upstream:

commit 802fac97ec8c8bd5438ec5bcd4d13edb03b00fc2
Author: Peter Krempa <pkrempa@redhat.com>
Date:   Thu Aug 25 15:30:21 2016 -0400

    qemu: driver: Validate configuration when setting maximum vcpu count
    
    Setting vcpu count when cpu topology is specified may result into an
    invalid configuration. Since the topology can't be modified, reject the
    setting if it doesn't match the requested topology. This will allow
    fixing the topology in case it was broken.
    
    Partially fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1370066

commit c9cb35c255222be7c972f1e049e297517aa84b42
Author: Peter Krempa <pkrempa@redhat.com>
Date:   Thu Aug 25 15:24:22 2016 -0400

    conf: Don't validate vcpu count in XML parser
    
    Validating the vcpu count is more intricate and doing it in the XML
    parser will make previously valid configs (with older qemus) vanish.
    
    Now that we have a very similar check in the qemu domain validation
    callback we can do it in a more appropriate place.
    
    This basically reverts commit b54de0830a.
    
    Partially resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1370066
Comment 4 Luyao Huang 2016-09-21 22:46:15 EDT
Verify this bug with libvirt-2.0.0-10.el7.x86_64:

1. 
# virsh dumpxml r7
...
<vcpu placement='static' current='4'>12</vcpu>
...
<topology sockets='2' cores='3' threads='2'/>
...

2. 

# virsh setvcpus r7 13 --config --maximum
error: invalid argument: CPU topology doesn't match the desired vcpu count

3.

# virsh setvcpus r7 11 --config --maximum
error: invalid argument: CPU topology doesn't match the desired vcpu count
Comment 6 errata-xmlrpc 2016-11-03 14:53:54 EDT
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://rhn.redhat.com/errata/RHSA-2016-2577.html

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