Bug 1080471
| Summary: | libvirtd crashes if VM crashes or is destroyed while hot-attaching disks | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Jan Kurik <jkurik> | ||||||
| Component: | libvirt | Assignee: | Peter Krempa <pkrempa> | ||||||
| Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> | ||||||
| Severity: | high | Docs Contact: | |||||||
| Priority: | high | ||||||||
| Version: | 6.2 | CC: | acathrow, ajia, bili, chhu, dyuan, eblake, jdenemar, jherrman, mzhan, pkrempa, pm-eus, shyu, tdosek | ||||||
| Target Milestone: | rc | Keywords: | ZStream | ||||||
| Target Release: | --- | ||||||||
| Hardware: | x86_64 | ||||||||
| OS: | Linux | ||||||||
| Whiteboard: | |||||||||
| Fixed In Version: | libvirt-0.10.2-29.el6_5.7 | Doc Type: | Bug Fix | ||||||
| Doc Text: |
Prior to this update, there was a typographical error in a condition that checks whether QEMU successfully attached a new disk to a guest. Due to the error, the libvirtd daemon terminated unexpectedly if the monitor command was unsuccesful; for instance, in case of a virtual machine failure or when attaching a guest disk drive was interrupted. In this update, the error has been corrected, and libvirtd no longer crashes in the described circumstances.
|
Story Points: | --- | ||||||
| Clone Of: | Environment: | ||||||||
| Last Closed: | 2014-04-07 07:26:07 UTC | Type: | --- | ||||||
| Regression: | --- | Mount Type: | --- | ||||||
| Documentation: | --- | CRM: | |||||||
| Verified Versions: | Category: | --- | |||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||
| Embargoed: | |||||||||
| Bug Depends On: | 1076719 | ||||||||
| Bug Blocks: | |||||||||
| Attachments: |
|
||||||||
|
Description
Jan Kurik
2014-03-25 13:52:46 UTC
Try to verify with packages:
libvirt-0.10.2-29.el6_5.6.x86_64
qemu-kvm-rhev-0.12.1.2-2.415.el6_5.6.x86_64
Test steps:
1. Create a guest with glusterfs volume
# virsh create r6-qcow2-gluster.xml
Domain r6-qcow2 created from r6-qcow2-gluster.xml
# virsh dumpxml r6-qcow2| grep disk -A 5
<disk type='network' device='disk'>
<driver name='qemu' type='qcow2' cache='none'/>
<source protocol='gluster' name='gluster-vol1/rhel6-qcow2-disk.img'>
<host name='10.66.84.12' port='24007'/>
</source>
<target dev='vda' bus='virtio'/>
<alias name='virtio-disk0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</disk>
2. Try to attach a gluster volume which is not available, the vm exit and get error:"error: Unable to write to monitor: Broken pipe" , no libvirtd crash.
# more disk-gluster-vol.xml
<disk type='network' device='disk'>
<driver name='qemu' type='qcow2'/>
<source protocol='gluster' name='gluster-vol1/test.img'>
<host name='10.66.106.22' port='24007'/>
</source>
<target dev='vdb' bus='virtio'/>
</disk>
# virsh attach-device r6-qcow2 disk-gluster-vol.xml
error: Failed to attach device from disk-gluster-vol.xml
error: Unable to write to monitor: Broken pipe
# virsh list --all
Id Name State
----------------------------------------------------
# service libvirtd status
libvirtd (pid 1292) is running...
3. Redo step1 to create the guest with gluestfs volume.
# virsh create r6-qcow2-gluster.xml
Domain r6-qcow2 created from r6-qcow2-gluster.xml
# virsh list --all
Id Name State
----------------------------------------------------
7 r6-qcow2 running
4. Try to attach a gluster volume which is not available, press Ctrl+C to interupt the "virsh attach-device". The vm exit, no livirtd crash.
# virsh attach-device r6-qcow2 disk-gluster-vol.xml
^C
# virsh list --all
Id Name State
---------------------------------------------------
# service libvirtd status
libvirtd (pid 1292) is running...
Expected Results:
In step2, the vm is not exit, and get error similar to:
error: internal error: unable to execute QEMU command '__com.redhat_drive_add': could not open disk image gluster://10.66.106.22/gluster-vol1/test.img: Could not open 'gluster://10.66.106.22/gluster-vol1/test.img': Transport endpoint is not connected
In step4, the vm is not exit, and can be destroy by user later.
Actual Results:
In step2, the vm is exit and get error:
error: Unable to write to monitor: Broken pipe
In step4, the vm is exit.
*** Bug 1080884 has been marked as a duplicate of this bug. *** Created attachment 878925 [details]
vm log
Created attachment 878928 [details]
libvirtd log
It turns out patch happily applied the reproducer from the commit message in addition to the patch itself. We need to respin the build with a new patch modified in a way that prevents the reproducer from being applied. To verify this additional issue, check that there's no "kill(mon->vm->pid, 9);" line in src/qemu/qemu_monitor.c after %prep phase. Verified with packages:
libvirt-0.10.2-29.el6_5.7.x86_64
qemu-kvm-rhev-0.12.1.2-2.415.el6_5.6.x86_64
Test steps:
1. Create a guest with gluster volume
# virsh create r6-qcow2-gluster.xml
Domain r6-qcow2 created from r6-qcow2-gluster.xml
# virsh dumpxml r6-qcow2| grep disk -A 5
<disk type='network' device='disk'>
<driver name='qemu' type='qcow2' cache='none'/>
<source protocol='gluster' name='gluster-vol1/rhel6-qcow2-disk.img'>
<host name='10.66.84.12' port='24007'/>
</source>
<target dev='vda' bus='virtio'/>
<alias name='virtio-disk0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</disk>
2. Try to attach a gluster volume which is not available, got the qemu error.
VM is still running, no libvirtd crash.
# more disk-gluster-vol.xml
<disk type='network' device='disk'>
<driver name='qemu' type='qcow2'/>
<source protocol='gluster' name='gluster-vol1/test.img'>
<host name='10.66.106.22' port='24007'/>
</source>
<target dev='vdb' bus='virtio'/>
</disk>
# virsh attach-device r6-qcow2 disk-gluster-vol.xml
error: Failed to attach device from disk-gluster-vol.xml
error: internal error unable to execute QEMU command '__com.redhat_drive_add': Device 'drive-virtio-disk1' could not be initialized
# virsh list --all
Id Name State
----------------------------------------------------
2 r6-qcow2 running
# service libvirtd status
libvirtd (pid 10490) is running...
3. Try to attach a gluster volume which is not available, press Ctrl+C to interupt the "virsh attach-device" process. VM is still running, then destroy the vm successfully, no libvirtd crash.
# virsh attach-device r6-qcow2 disk-gluster-vol.xml
^C
# virsh list --all
Id Name State
----------------------------------------------------
2 r6-qcow2 running
# virsh destroy r6-qcow2
Domain r6-qcow2 destroyed
# virsh list --all
Id Name State
----------------------------------------------------
# service libvirtd status
libvirtd (pid 10490) is running...
4. Attach/detach another available gluster volume successfully.
# more disk-gluster-vol.xml
<disk type='network' device='disk'>
<driver name='qemu' type='raw'/>
<source protocol='gluster' name='gluster-vol1/exist.img'>
<host name='10.66.84.12' port='24007'/>
</source>
<target dev='vdb' bus='virtio'/>
</disk>
# virsh attach-device r6-qcow2 disk-gluster-vol.xml
Device attached successfully
# virsh detach-device r6-qcow2 disk-gluster-vol.xml
Device detached successfully
# virsh list --all
Id Name State
----------------------------------------------------
2 r6-qcow2 running
# service libvirtd status
libvirtd (pid 10490) is running...
Test results:
current command work well.
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. http://rhn.redhat.com/errata/RHBA-2014-0375.html |