Bug 723967
Summary: | virsh command will be hung when enable lock_manager in qemu.conf | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Alex Jia <ajia> |
Component: | libvirt | Assignee: | Daniel Berrangé <berrange> |
Status: | CLOSED NOTABUG | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | high | Docs Contact: | |
Priority: | high | ||
Version: | 6.2 | CC: | dallan, rwu |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2011-10-17 07:55:27 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: | |||
Bug Blocks: | 572343, 578121 |
Description
Alex Jia
2011-07-21 16:22:08 UTC
In fact, there are 3 issues with sanlock lock manager for this bug: 1. libvirt hasn't created /var/lib/libvirt/sanlock directory Now, it is okay for me, I can see _LIBVIRT__DISKS__ under the above directory: # ll -Z /var/lib/libvirt/sanlock -rw-------. root root unconfined_u:object_r:virt_var_lib_t:s0 __LIBVIRT__DISKS__ 2. enable lock manager in qemu.conf then restart libvirtd service, this will hang virsh command. Now, it is okay for me, libvirtd can shut down when initialization fails, and I can catch 'SIGTERM' signal by gdb: ......02:12:30.404: 28854: error : daemonRunStateInit:1162 : Driver state initialization failed Program received signal SIGTERM, Terminated. ...... 3. "Unable to add lockspace /var/lib/libvirt/sanlock/__LIBVIRT__DISKS__: Operation not permitted" This issue hasn't been resolved, and this will lead to libvirtd dead, please see "How to reproduce?" section: # service libvirtd status libvirtd dead but subsys locked How to reproduce? 1. enable sanlock in qemu.conf 2. enable auto_disk_leases, host_id and disk_lease_dir in /etc/libvirt/qemu-sanlock.conf 3. restart libvirtd service 4. service libvirtd status BTW, I haven't started wdmd and sanlock daemon, and hasn't done any configuration for sharing storage and guest, only simply change qemu.conf and qemu-sanlock.conf configuration then restart libvirtd service. Alex In addition, the 'sanlock_add_lockspace' function will be failed, IMHO it should has relationship with above issue 3. src/locking/lock_driver_sanlock.c: 144 static int virLockManagerSanlockSetupLockspace(void) ...... 233 if ((rv = sanlock_add_lockspace(&ls, 0)) < 0) { 234 if (-rv != EEXIST) { 235 if (rv <= -200) 236 virLockError(VIR_ERR_INTERNAL_ERROR, 237 _("Unable to add lockspace %s: error %d"), 238 path, rv); 239 else 240 virReportSystemError(-rv, 241 _("Unable to add lockspace %s"), 242 path); 243 return -1; ..... Alex This issue still exists on rhel6.2 beta with libvirt-0.9.4-12.el6.x86_64. I don't see what the actual bug is here. If you have enabled sanlock in libvirtd, and not started sanlock, then the expected behaviour is to see something like the following log messages 2011-09-14 12:30:09.850: 11987: error : virLockManagerSanlockSetupLockspace:241 : Unable to add lockspace /var/lib/libvirt/sanlock/__LIBVIRT__DISKS__: Connection refused 2011-09-14 12:30:09.872: 11987: error : qemudLoadDriverConfig:457 : Failed to load lock manager sanlock 2011-09-14 12:30:09.872: 11987: error : qemudStartup:570 : Missing lock manager implementation 2011-09-14 12:30:09.873: 11987: error : virStateInitialize:862 : Initialization of QEMU state driver failed 2011-09-14 12:30:10.352: 11987: error : daemonRunStateInit:1149 : Driver state initialization failed and then libvirtd will exit. (In reply to comment #6) > 2011-09-14 12:30:09.873: 11987: error : virStateInitialize:862 : Initialization > of QEMU state driver failed > 2011-09-14 12:30:10.352: 11987: error : daemonRunStateInit:1149 : Driver state > initialization failed Hi Daniel, Yeah, I can see the above errors when I configured qemu.conf and qemu-sanlock.conf the restart libvirtd service with sanlock daemon stop. > > and then libvirtd will exit. And when I run client cmdline such as virsh list, libvirtd has exited: # virsh list error: Failed to reconnect to the hypervisor error: no valid connection error: Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory # service libvirtd status libvirtd dead but subsys locked Notes: so is libvirtd dead a expected behaviour? This testing is based on libvirt-0.9.4-14.el6.x86_64. Thanks, Alex > Notes: so is libvirtd dead a expected behaviour?
Yes you have told libvirt to use sanlock for protecting disks & sanlock could not be configured. So the only safe thing for libvirtd to do is to refuse to start.
Hi Daniel, IMHO, this is a bug, and you have applied patch on Comment 1, except this, I following some test steps from http://libvirt.org/locking.html, which says we need the following steps: # chkconfig sanlock on # service sanlock start If not, we should document these stuff again, otherwise, users probably also make mistake. In addition, please give a fixed version for this bug. Thanks, Alex |