Bug 1129372 - Failed to start domain with specified cputune after decreasing vcpu number
Summary: Failed to start domain with specified cputune after decreasing vcpu number
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Peter Krempa
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-08-12 15:14 UTC by Peter Krempa
Modified: 2015-03-05 07:42 UTC (History)
6 users (show)

Fixed In Version: libvirt-1.2.8-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of: 1126685
Environment:
Last Closed: 2015-03-05 07:42:28 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0323 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2015-03-05 12:10:54 UTC

Description Peter Krempa 2014-08-12 15:14:12 UTC
+++ This bug was initially created as a clone of Bug #1126685 +++

Description of problem:
Failed to start domain with specified cputune and cpuset . 

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

How reproducible:
100%

Steps to Reproduce:
# virsh dumpxml r6.5|grep cpu
  <vcpu placement='static' cpuset='0-1'>4</vcpu>

Note that domain has to have vcpupinning set.

# virsh setvcpus r6.5 1 --maximum --config

# virsh destroy r6.5
Domain r6.5 destroyed

# virsh dumpxml r6.5|grep cpu
  <vcpu placement='static' cpuset='0-1'>1</vcpu>

# virsh start r6.5
error: Failed to start domain r6.5
error: Unable to write to '/sys/fs/cgroup/cpuset/machine/RHEL_nightly.libvirt-qemu/vcpu0/cpuset.cpus': Numerical result out of range

Actual results:
Failed to start domain with specified cputune and cpuset

Expected results:
Successfully start the domain

Additional info:

Comment 1 Peter Krempa 2014-08-18 15:52:01 UTC
Fixed with:

commit 482f4e596fcecff7a9b6ca3ee2b946acfdaf0823
Author: Peter Krempa <pkrempa@redhat.com>
Date:   Fri Aug 15 16:41:47 2014 +0200

    qemu: process: Pin on per-vcpu basis instead of per-vcpupin element
    
    Pin existing vcpus rather than existing vcpu pinning infos. This
    increases the complexity of the lookup, but avoids pinning cpus that are
    not enabled actually.

commit 60df621f75af6e29d721d95a738c8860eed5590e
Author: Peter Krempa <pkrempa@redhat.com>
Date:   Fri Aug 15 16:28:58 2014 +0200

    qemu: cpu: unplug: Remove vcpu pinning on cold cpu unplug
    
    Remove the pinning info when removing to CPU, otherwise when the VM will
    be started our code will try to pin non-existing vcpus as the definition
    wasn't updated.
    
    Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1129372

commit 64bbf4c33d8ad6b5ade5d538d79d15d4cae27a15
Author: Peter Krempa <pkrempa@redhat.com>
Date:   Thu Aug 14 14:38:06 2014 +0200

    conf: Refactor virDomainVcpuPinDefParseXML
    
    Tidy up control flow, change boolean argument to use 'bool', improve
    error message in case the function is used to parse emulator pinning
    info and avoid a few temp variables that made no sense.
    
    Also when the function is called to parse emulator pinning info, there's
    no need to check the processor ID in that case.

commit cb8a94bfa037b12b1c1896bd3c02f5bf6746d9e1
Author: Peter Krempa <pkrempa@redhat.com>
Date:   Thu Aug 14 14:20:37 2014 +0200

    conf: cpupin: Remove useless checking of vcpupin element count
    
    The check doesn't make much sense as right below it the entries are
    either checked for duplicity or ignored in some cases. Having this check
    doesn't actually forbid passing invalid values.

v1.2.7-150-g482f4e5

Comment 3 Jincheng Miao 2014-12-03 09:08:55 UTC
This bug is fixed:

# rpm -q libvirt
libvirt-1.2.8-8.el7.x86_64

# virsh start r7a
Domain r7a started

# virsh dumpxml r7a
...
  <vcpu placement='static' cpuset='0-6'>5</vcpu>
  <cputune>
    <emulatorpin cpuset='3-6'/>
  </cputune>
...

# virsh setvcpus r7a 1 --maximum --config

# virsh destroy r7a
Domain r7a destroyed

# virsh dumpxml r7a
...
  <vcpu placement='static' cpuset='0-6'>1</vcpu>
  <cputune>
    <emulatorpin cpuset='3-6'/>
  </cputune>
...

# virsh start r7a
Domain r7a started


So change the status to VERIFIED.

Comment 5 errata-xmlrpc 2015-03-05 07:42:28 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-2015-0323.html


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