Blame SOURCES/bz1760213-fence_compute-disable-service-after-force-down.patch

21d5fd
From 099758a41bbb153c4a13a89de57cdcb72e1f1ea7 Mon Sep 17 00:00:00 2001
21d5fd
From: Michele Baldessari <michele@acksyn.org>
21d5fd
Date: Fri, 11 Oct 2019 10:39:53 +0200
21d5fd
Subject: [PATCH] fence_compute: Invert the force-down/service disable order
21d5fd
21d5fd
In OpenStack Train we first observed that IHA was not working via
21d5fd
https://bugzilla.redhat.com/show_bug.cgi?id=1760213
21d5fd
21d5fd
The reason for this is that nova has made the disabling of the compute
21d5fd
service depend on the compute node being up via:
21d5fd
https://review.opendev.org/#/c/654596/
21d5fd
21d5fd
By first calling force-down, the subsequence service-disable API
21d5fd
call won't wait for the reachability of the compute node any
21d5fd
longer and the whole operation has the same outcome.
21d5fd
21d5fd
Tested this on an OSP Train environment and we correctly
21d5fd
got Instance HA working again and we observed the VMs being
21d5fd
restarted on the available compute nodes.
21d5fd
21d5fd
Co-Authored-By: Luca Miccini <lmiccini@redhat.com>
21d5fd
---
21d5fd
 agents/compute/fence_compute.py | 2 +-
21d5fd
 1 file changed, 1 insertion(+), 1 deletion(-)
21d5fd
21d5fd
diff --git a/agents/compute/fence_compute.py b/agents/compute/fence_compute.py
21d5fd
index a94bdc46..c08a9dbe 100644
21d5fd
--- a/agents/compute/fence_compute.py
21d5fd
+++ b/agents/compute/fence_compute.py
21d5fd
@@ -117,11 +117,11 @@ def set_power_status_off(connection, options):
21d5fd
 	if status in [ "off" ]:
21d5fd
 		return
21d5fd
 
21d5fd
-	connection.services.disable(options["--plug"], 'nova-compute')
21d5fd
 	try:
21d5fd
 		# Until 2.53
21d5fd
 		connection.services.force_down(
21d5fd
 			options["--plug"], "nova-compute", force_down=True)
21d5fd
+		connection.services.disable(options["--plug"], 'nova-compute')
21d5fd
 	except Exception as e:
21d5fd
 		# Something went wrong when we tried to force the host down.
21d5fd
 		# That could come from either an incompatible API version