Blame SOURCES/bz1740069-NovaEvacuate-evacuate_delay.patch

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