Bug 829316

Summary: [NFR] Sanlock should support graceful release of resources
Product: Red Hat Enterprise Linux 6 Reporter: Federico Simoncelli <fsimonce>
Component: libvirtAssignee: Osier Yang <jyang>
Status: CLOSED DUPLICATE QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.4CC: abaron, acathrow, ajia, berrange, cluster-maint, dallan, dyasny, dyuan, fsimonce, mzhan, rwu, teigland, weizhan
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: 826022 Environment:
Last Closed: 2012-06-15 09:11:07 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: 826022    
Bug Blocks:    

Description Federico Simoncelli 2012-06-06 12:59:14 UTC
Libvirt should expose a way to define a script/executable to gracefully release the locks. Eg:

<?xml version="1.0"?>
<domain type="kvm">
  <devices>
    <leaseFence timeout="X">/path/to/my/fence/script</leaseFence>
    <lease>[...]</lease>
    [...]
  </devices>
</domain>

This has to be done in libvirt because the script must be defined before acquiring the leases for the qemu process.

+++ This bug was initially created as a clone of Bug #826022 +++

Description of problem:
At the moment the only supported way of fencing a process that lost its resources (lockspace unreachable) is killing the pid with SIGTERM/SIGKILL. Looking forward we want support a graceful interaction between sanlock and the monitored process.

Use case:

In oVirt sanlock is used to acquire the volumes (disks) resources for a qemu-kvm process. If the storage domain is unreacheable (lockspace) sanlock is terminating the qemu-kvm process. The graceful way of handling the situation is to interact with the qemu-kvm process (probably a script that connects to libvirt) and pauses the guest.

When the storage is reachable again it's the manager's responsibility (vdsm) to reacquire the lockspace, reacquire the volume resources for the qemu process (checking the lver value to make sure that they haven't changed), and unpause the guest.

The benefit is that during the storage domain down time the VM isn't killed but simply paused.

Possible implementation:
Define a new API to configure a script (per monitored process) to be used for the graceful release of resources.
If the script fails we should escalate to SIGTERM/SIGKILL and ultimately to the dogwatch host fencing.

Comment 2 Daniel Berrangé 2012-06-15 09:11:07 UTC

*** This bug has been marked as a duplicate of bug 832156 ***