Blame SOURCES/bz1740069-NovaEvacuate-evacuate_delay.patch

bafc1b
From 8b9c49fd965f73709d5a6e2c21987ba26af4856b Mon Sep 17 00:00:00 2001
bafc1b
From: Luca Miccini <lmiccini@redhat.com>
bafc1b
Date: Wed, 25 Sep 2019 17:12:39 +0200
bafc1b
Subject: [PATCH] Add a configurable delay to Nova Evacuate calls
bafc1b
bafc1b
In case /var/lib/nova/instances resides on NFS we have seen migrations
bafc1b
failing with 'Failed to get "write" lock - Is another process using the
bafc1b
image' errors.
bafc1b
bafc1b
This has been tracked down to grace/lease timeouts not having expired
bafc1b
before attempting the migration/evacuate, so in this cases it might be
bafc1b
desirable to delay the nova evacuate call to give the storage time to
bafc1b
release the locks.
bafc1b
bafc1b
Change-Id: Ie2fe784202d754eda38092479b1ab3ff4d02136a
bafc1b
Resolves: rhbz#1740069
bafc1b
---
bafc1b
bafc1b
diff --git a/heartbeat/NovaEvacuate b/heartbeat/NovaEvacuate
bafc1b
index 810f30a..596f520 100644
bafc1b
--- a/heartbeat/NovaEvacuate
bafc1b
+++ b/heartbeat/NovaEvacuate
bafc1b
@@ -125,6 +125,15 @@
bafc1b
 <content type="boolean" default="0" />
bafc1b
 </parameter>
bafc1b
 
bafc1b
+<parameter name="evacuate_delay" unique="0" required="0">
bafc1b
+<longdesc lang="en">
bafc1b
+Allows delaying the nova evacuate API call, e.g. to give a storage array time to clean
bafc1b
+up eventual locks/leases.
bafc1b
+</longdesc>
bafc1b
+<shortdesc lang="en">Nova evacuate delay</shortdesc>
bafc1b
+<content type="integer" default="0" />
bafc1b
+</parameter>
bafc1b
+
bafc1b
 </parameters>
bafc1b
 
bafc1b
 <actions>
bafc1b
@@ -216,6 +225,11 @@
bafc1b
 		fence_agent="fence_evacuate"
bafc1b
 	    fi
bafc1b
 
bafc1b
+            if [ ${OCF_RESKEY_evacuate_delay} != 0 ]; then
bafc1b
+                ocf_log info "Delaying nova evacuate by $OCF_RESKEY_evacuate_delay seconds"
bafc1b
+                sleep ${OCF_RESKEY_evacuate_delay}
bafc1b
+            fi
bafc1b
+
bafc1b
 	    ocf_log notice "Initiating evacuation of $node with $fence_agent"
bafc1b
 	    $fence_agent ${fence_options} -o status -n ${node}
bafc1b
 	    if [ $? = 1 ]; then