Bug 1370043 - vcpu order doesn't work as expected
Summary: vcpu order doesn't work as expected
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Peter Krempa
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-25 07:05 UTC by Luyao Huang
Modified: 2016-08-26 15:37 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-08-26 15:37:53 UTC
Embargoed:


Attachments (Terms of Use)

Description Luyao Huang 2016-08-25 07:05:37 UTC
Description of problem:
vcpu order doesn't work

Version-Release number of selected component (if applicable):
v2.1.0-209-ge3229f6

How reproducible:
100%

Steps to Reproduce:
1.
# virsh dumpxml r7 --inactive
<domain type='kvm'>
  <name>r7</name>
  <uuid>67c7a123-5415-4136-af62-a2ee098ba6cd</uuid>
  <maxMemory slots='16' unit='KiB'>15242882</maxMemory>
  <memory unit='KiB'>2228224</memory>
  <currentMemory unit='KiB'>2228224</currentMemory>
  <vcpu placement='static' current='1'>10</vcpu>
  <vcpus>
    <vcpu id='0' enabled='yes' hotpluggable='no' order='1'/>
    <vcpu id='1' enabled='no' hotpluggable='yes' order='8'/>
    <vcpu id='2' enabled='no' hotpluggable='yes' order='3'/>
    <vcpu id='3' enabled='no' hotpluggable='yes' order='4'/>
    <vcpu id='4' enabled='no' hotpluggable='yes' order='5'/>
    <vcpu id='5' enabled='no' hotpluggable='yes' order='6'/>
    <vcpu id='6' enabled='no' hotpluggable='yes' order='7'/>
    <vcpu id='7' enabled='no' hotpluggable='yes' order='2'/>
    <vcpu id='8' enabled='no' hotpluggable='yes' order='9'/>
    <vcpu id='9' enabled='no' hotpluggable='yes' order='10'/>
  </vcpus>


2. 

# virsh start r7
Domain r7 started


3. check xml and order disappear:

# virsh dumpxml r7
<domain type='kvm' id='18'>
  <name>r7</name>
  <uuid>67c7a123-5415-4136-af62-a2ee098ba6cd</uuid>
  <maxMemory slots='16' unit='KiB'>15243264</maxMemory>
  <memory unit='KiB'>2228224</memory>
  <currentMemory unit='KiB'>2228224</currentMemory>
  <vcpu placement='static' current='1'>10</vcpu>
  <vcpus>
    <vcpu id='0' enabled='yes' hotpluggable='no' order='1'/>
    <vcpu id='1' enabled='no' hotpluggable='yes'/>
    <vcpu id='2' enabled='no' hotpluggable='yes'/>
    <vcpu id='3' enabled='no' hotpluggable='yes'/>
    <vcpu id='4' enabled='no' hotpluggable='yes'/>
    <vcpu id='5' enabled='no' hotpluggable='yes'/>
    <vcpu id='6' enabled='no' hotpluggable='yes'/>
    <vcpu id='7' enabled='no' hotpluggable='yes'/>
    <vcpu id='8' enabled='no' hotpluggable='yes'/>
    <vcpu id='9' enabled='no' hotpluggable='yes'/>
  </vcpus>


4. hotplug vcpu:

# virsh setvcpus r7 2

5.

# virsh dumpxml r7
<domain type='kvm' id='18'>
  <name>r7</name>
  <uuid>67c7a123-5415-4136-af62-a2ee098ba6cd</uuid>
  <maxMemory slots='16' unit='KiB'>15243264</maxMemory>
  <memory unit='KiB'>2228224</memory>
  <currentMemory unit='KiB'>2228224</currentMemory>
  <vcpu placement='static' current='2'>10</vcpu>
  <vcpus>
    <vcpu id='0' enabled='yes' hotpluggable='no' order='1'/>
    <vcpu id='1' enabled='yes' hotpluggable='yes' order='2'/>
    <vcpu id='2' enabled='no' hotpluggable='yes'/>
    <vcpu id='3' enabled='no' hotpluggable='yes'/>
    <vcpu id='4' enabled='no' hotpluggable='yes'/>
    <vcpu id='5' enabled='no' hotpluggable='yes'/>
    <vcpu id='6' enabled='no' hotpluggable='yes'/>
    <vcpu id='7' enabled='no' hotpluggable='yes'/>
    <vcpu id='8' enabled='no' hotpluggable='yes'/>
    <vcpu id='9' enabled='no' hotpluggable='yes'/>
  </vcpus>


Actual results:
order disappear during guest start

Expected results:

from libvirt.org:

order allows to specify the order to add the vcpus. For hypervisors/platforms that require to insert multiple vcpus at once the order may be be duplicated accross all vcpus that need to be enabled at once. Specifying order is not necessary, vcpus are then added in an arbitrary order.

I cannot find why libvirt will ignore this configuration from the document

Additional info:

Comment 1 Peter Krempa 2016-08-26 15:37:53 UTC
I've clarified the upstream docs:

commit 54147fd9be31838904f6f2251510da91a1bd0ca7
Author: Peter Krempa <pkrempa>
Date:   Thu Aug 25 11:41:44 2016 -0400

    doc: clarify documentation for vcpu order
    
    Make it clear that vcpu order is valid for online vcpus only and state
    that it has to be specified for all vcpus or not provided at all.


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