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

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