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 1451251 - guest will shut down when libvirtd restart after hotplug vcpu with libvirtd restart
Summary: guest will shut down when libvirtd restart after hotplug vcpu with libvirtd ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Peter Krempa
QA Contact: Jingjing Shao
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-05-16 08:39 UTC by Jingjing Shao
Modified: 2017-08-02 01:32 UTC (History)
4 users (show)

Fixed In Version: libvirt-3.2.0-9.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-02 00:08:25 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2017:1846 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2017-08-01 18:02:50 UTC

Description Jingjing Shao 2017-05-16 08:39:31 UTC
Description of problem:
guest will shut down when libvirtd restart after hotplug vcpu with libvirtd restart

Version-Release number of selected component (if applicable):
# rpm -q libvirt
libvirt-3.2.0-5.el7.x86_64


How reproducible:
100%

Steps to Reproduce:
1. Prepare a guest 

# virsh start r7.2
Domain r7.2 started

# virsh vcpucount r7.2
maximum      config       200
maximum      live         200
current      config         3
current      live           3

2.On the first terminal
# virsh setvcpus r7.2  200

On the second terminal
#  service libvirtd restart

On the first terminal
# virsh setvcpus r7.2  200
error: Disconnected from qemu:///system due to keepalive timeout
error: internal error: connection closed due to keepalive timeout

On the second terminal
#  service libvirtd restart
Redirecting to /bin/systemctl restart libvirtd.service

# virsh vcpucount r7.2
maximum      config       200
maximum      live         200
current      config         3
current      live          59


3.# virsh list --all
 Id    Name                           State
----------------------------------------------------
 1     r7.2                           running

# virsh dumpxml r7.2  | grep vcpu -A7
  <vcpu placement='static' current='59'>200</vcpu>
  <vcpus>
    <vcpu id='0' enabled='yes' hotpluggable='no' order='1'/>
    <vcpu id='1' enabled='yes' hotpluggable='yes' order='2'/>
    ......
    <vcpu id='56' enabled='yes' hotpluggable='yes' order='57'/>
    <vcpu id='57' enabled='yes' hotpluggable='yes' order='58'/>
    <vcpu id='58' enabled='yes' hotpluggable='yes'/>
    <vcpu id='59' enabled='no' hotpluggable='yes'/>
    <vcpu id='60' enabled='no' hotpluggable='yes'/>


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


# virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     r7.2                           shut off


# ps -ef | grep qemu
qemu     13861     1 10 16:25 ?        00:00:43 /usr/libexec/qemu-kvm -name guest=r7.2,,debug-threads=on -S -object
secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-1-r7.2/master-key.aes -machine pc-i440fx-rhel7.4.0,accel=kvm,usb=off,dump-guest-core=off -m 1024 -realtime mlock=off -smp 1 ........

Check the libvirtd.log
....
2017-05-16 08:31:46.015+0000: 14165: debug : virQEMUCapsCacheLookup:5341 : Returning caps 0x7f60dc334d80 for /usr/libexec/qemu-kvm
2017-05-16 08:31:46.015+0000: 14165: error : qemuDomainDefVcpusPostParse:2654 : unsupported configuration: all vcpus must have either set or unset order
....

Actual results:
guest shutdown after libvirtd restart

Expected results:
guest should be running 

Additional info:
N/A

Comment 2 Peter Krempa 2017-06-06 10:12:31 UTC
Fixed upstream:

commit ad3c6b229bcc91177db29d307e8ccc22c6c43565
Author: Peter Krempa <pkrempa>
Date:   Tue Jun 6 07:39:25 2017 +0200

    qemu: process: Save vcpu ordering information on reconnect
    
    vCPU ordering information would not be updated if a vCPU emerged or
    disappeared during the time libvirtd is not running. This allowed to
    create invalid configuration like:
    
        [...]
        <vcpu id='56' enabled='yes' hotpluggable='yes' order='57'/>
        <vcpu id='57' enabled='yes' hotpluggable='yes' order='58'/>
        <vcpu id='58' enabled='yes' hotpluggable='yes'/>
    
    Call the function that records the information on reconnect.

Comment 5 Jingjing Shao 2017-06-08 07:05:49 UTC
Verify this bug as below

libvirt-3.2.0-9.virtcov.el7.x86_64

1. # virsh start vm1
Domain vm1 started

#  virsh vcpucount vm1 
maximum      config       200
maximum      live         200
current      config         1
current      live           1


2.On the first terminal
# virsh setvcpus vm1  200

On the second terminal
#  service libvirtd restart

On the first terminal
virsh setvcpus vm1  200 
error: Disconnected from qemu:///system due to keepalive timeout
error: internal error: connection closed due to keepalive timeout

On the second terminal
#  service libvirtd restart
Redirecting to /bin/systemctl restart libvirtd.service

# virsh vcpucount vm1 
maximum      config       200
maximum      live         200
current      config         1
current      live         110


3 # virsh list 
 Id    Name                           State
----------------------------------------------------
 24    vm1                            running

# virsh dumpxml vm1  | grep vcpu -A7
  <vcpu placement='static' current='59'>200</vcpu>
  <vcpus>
    <vcpu id='0' enabled='yes' hotpluggable='no' order='1'/>
    <vcpu id='1' enabled='yes' hotpluggable='yes' order='2'/>
    ......
    <vcpu id='107' enabled='yes' hotpluggable='yes' order='108'/>
    <vcpu id='108' enabled='yes' hotpluggable='yes' order='109'/>
    <vcpu id='109' enabled='yes' hotpluggable='yes' order='110'/>
    <vcpu id='110' enabled='no' hotpluggable='yes'/>
    <vcpu id='111' enabled='no' hotpluggable='yes'/>



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


5 # virsh list 
 Id    Name                           State
----------------------------------------------------
 24    vm1                            running

Comment 6 errata-xmlrpc 2017-08-02 00:08:25 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://access.redhat.com/errata/RHEA-2017:1846

Comment 7 errata-xmlrpc 2017-08-02 01:32:35 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://access.redhat.com/errata/RHEA-2017:1846


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