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