Red Hat Bugzilla – Bug 967494
Lockfailure action Restart can shutdown the guest but fail to start it
Last modified: 2015-03-05 02:20:43 EST
+++ This bug was initially created as a clone of Bug #905282 +++ Description of problem: Create this bug to track the Bug 832156 not solved issue Lockfailure action Restart can shutdown the guest but fail to start it I re-write the reproduce steps for further testing since both libvirt and sanlock have changed a lot. Version-Release number of selected component (if applicable): libvirt-0.10.2-17.el6.x86_64 sanlock.x86_64 0:2.6-2.el6 How reproducible: 100% Steps to Reproduce: ---------------------------- 1.Libvirt configuration ---------------------------- # service libvirtd stop # getsebool -a | grep sanlock sanlock_use_fusefs --> off sanlock_use_nfs --> on sanlock_use_samba --> off virt_use_sanlock --> on # tail -5 /etc/libvirt/qemu-sanlock.conf user = "sanlock" group = "sanlock" host_id = 1 auto_disk_leases = 0 /*Because the auto leases will have effect on the action , so close it , create lockspace and lease file mannully*/ disk_lease_dir = "/var/lib/libvirt/sanlock" #tail -1 /etc/libvirt/qemu.conf lock_manager = "sanlock" -------------------------------- 2.Sanlock configureation ----------------------------------- /*create lockspace file*/ #truncate -s 1M /var/lib/libvirt/sanlock/TEST_LS #sanlock direct init -s TEST_LS:0:/var/lib/libvirt/sanlock/TEST_LS:0 /*change to permission to sanlock , since its default is root*/ #chown sanlock:sanlock /var/lib/libvirt/sanlock/TEST_LS:0 /*add lockspace to sanlock */ #service wdmd start #service sanlock start #sanlock client add_lockspace -s TEST_LS:1:var/lib/libvirt/sanlock/TEST_LS:0 /*you can use this command to check the status*/ #sanlock client host_status -s TEST_LS /*create lease file*/ #truncate -s 1M /var/lib/libvirt/sanlock/test-disk-resource-lock #sanlock direct init -r TEST_LS:test-disk-resource-lock:/var/lib/libvirt/sanlock/test-disk-resource-lock:0 /*change permission to sanlock*/ #chown sanlock:sanlock /var/lib/libvirt/sanlock/test-disk-resource-lock ----------------------- 3.Guest XML setting --------------------- A normal shutdown guest , add .... <on_lockfailure>restart</on_lockfailure> .... <lease> <lockspace>TEST_LS</lockspace> <key>test-disk-resource-lock</key> <target path=’/var/lib/libvirt/sanlock/test-disk-resource-lock’/> </lease> ... to the guest. #service libvirtd restart #virsh start $domain ----------------------------------------------------- 4.Try to remove the lockspace when the guest is using. ------------------------------------------------------- #sanlock client rem_lockspace -s __LIBVIRT__DISKS__:1:/var/lib/libvirt/sanlock/__LIBVIRT__DISKS__:0 /*If there is a better way to make the lockspace "lost " , plz correct me :) thanks*/ #virsh domstate $domain shutdown The guest can't start back. Actual results: Guest can't back Expected results: Guest back Additional info: For the disscuess refer bug905280 and bug 832156
This is fixed upstream by v1.2.2-341-g2cc27c3: commit 2cc27c34befd1922878be724f540b5578c3d492c Author: Jiri Denemark <jdenemar@redhat.com> Date: Mon Mar 24 14:23:09 2014 +0100 sanlock: Forbid VIR_DOMAIN_LOCK_FAILURE_RESTART https://bugzilla.redhat.com/show_bug.cgi?id=905282 https://bugzilla.redhat.com/show_bug.cgi?id=967494 When lock failure is detected by sanlock, our sanlock_helper kill script will try to restart (shutdown followed by start) the affected domain when RESTART action is configured for it. While shutting down kills QEMU and removes all its leases (which is what sanlock wants to happen), trying to start it again just hangs because libvirt tries reacquire the locks in the failed lock space. Hence, this action cannot be supported by sanlock driver. Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Verify this bug with libvirt-1.2.8-9.el7.x86_64 Step: 1. Define guest with below options .. <on_lockfailure>restart</on_lockfailure> .. 2. Try to start guest # virsh start r7 error: Failed to start domain r7 error: internal error: Process exited prior to exec: libvirt: Lock Driver error : unsupported configuration: Failure action restart is not supported by sanlock on_lockfailure options "restart" is not supported anymore, so the result is expected.
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/RHSA-2015-0323.html