Bug 1165119
| Summary: | libvirt should provide more specific error when failed to acquire the lock using sanlock | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Jiri Moskovcak <jmoskovc> |
| Component: | libvirt | Assignee: | Jiri Denemark <jdenemar> |
| Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 7.1 | CC: | dfediuck, dyuan, lhuang, rbalakri, shyu, xuzhang, yanyang, zhwang |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | libvirt-1.2.15-1.el7 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2015-11-19 05:56:13 UTC | Type: | Bug |
| 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: | |||
| Bug Blocks: | 1093704 | ||
|
Description
Jiri Moskovcak
2014-11-18 11:38:38 UTC
Currently, libvirt would report "internal error Failed to acquire lock: error -243" Patch sent upstream for review: https://www.redhat.com/archives/libvir-list/2015-April/msg00585.html Fixed upstream by v1.2.14-161-g4864e37:
commit 4864e377c9a6ef08cd65672775e520751a27f6d7
Author: Jiri Denemark <jdenemar>
Date: Tue Apr 14 16:27:37 2015 +0200
sanlock: Use VIR_ERR_RESOURCE_BUSY if sanlock_acquire fails
When acquiring resource via sanlock fails, we would report it as
VIR_ERR_INTERNAL_ERROR, which is not very friendly to applications using
libvirt. Moreover, the lockd driver would report the same failure as
VIR_ERR_RESOURCE_BUSY, which looks better.
Unfortunately, in sanlock driver we don't really know if acquiring the
resource failed because it was already locked or there was another
reason behind. But the end result is the same and I think using
VIR_ERR_RESOURCE_BUSY reason for all acquire failures is still better
than what we have now.
https://bugzilla.redhat.com/show_bug.cgi?id=1165119
Signed-off-by: Jiri Denemark <jdenemar>
I can reproduce it on libvirt-1.2.8-10.el7.x86_64
Verified on libvirt-1.2.16-1.el7.x86_64
Steps
1. prepare 2 hosts, edit following conf file
# grep "lock_manager" /etc/libvirt/qemu.conf
lock_manager = "sanlock"
# vim /etc/libvirt/qemu-sanlock.conf
auto_disk_leases = 1
disk_lease_dir = "/var/lib/libvirt/sanlock"
host_id = 1 (host_id = 2 on 2nd host)
user = "sanlock"
group = "sanlock"
# getsebool -a
sanlock_use_nfs --> on
virt_use_sanlock --> on
virt_use_nfs --> on
#mount 10.66.4.164:/yy/nfs /var/lib/libvirt/sanlock
#service sanlock start
#service libvirtd restart
2. define/start a guest on 2 hosts with following xml
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/var/lib/libvirt/sanlock/test.img'/>
<target dev='vda' bus='virtio'/>
<boot order='1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
</disk>
start the guest on host 1
# virsh start simple
Domain simple started
start the guest on host2
# virsh start simple
error: Failed to start domain simple
error: resource busy: Failed to acquire lock: error -243
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/RHBA-2015-2202.html |