RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1370066 - Use setvcpus to change maximum vcpu number will make guest have broken settings
Summary: Use setvcpus to change maximum vcpu number will make guest have broken settings
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.3
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Peter Krempa
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-25 08:42 UTC by Luyao Huang
Modified: 2016-11-03 18:53 UTC (History)
4 users (show)

Fixed In Version: libvirt-2.0.0-7.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-03 18:53:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2577 0 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2016-11-03 12:07:06 UTC

Description Luyao Huang 2016-08-25 08:42:32 UTC
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 15:39:17 UTC
Fixed upstream:

commit 802fac97ec8c8bd5438ec5bcd4d13edb03b00fc2
Author: Peter Krempa <pkrempa>
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>
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-22 02:46:15 UTC
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 18:53: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://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.