Red Hat Bugzilla – Bug 1370066
Use setvcpus to change maximum vcpu number will make guest have broken settings
Last modified: 2016-11-03 14:53:54 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:
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
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
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