From de98fdb208dac1cf01d474c4363f6e2177e22c7e Mon Sep 17 00:00:00 2001 From: Damien Ciabrini Date: Thu, 25 Mar 2021 10:23:48 +0100 Subject: [PATCH] HA: fix race when moving VIP during minor update During a minor update of a controller node, we list the VIP hosted on the node and we force them to move away with a pcs command. The way we call the pcs command is racy, so change the action to make sure the VIP move is performed only if the VIP is still hosted on the node when we run the action. Change-Id: Id379f4fe1668d01fdd5f91b46e2f75d7cdb577ae Closes-Bug: #1921351 (cherry picked from commit 3da1e7661036a73c9f222bcdcc489912502d23cb) --- deployment/pacemaker/pacemaker-baremetal-puppet.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/pacemaker/pacemaker-baremetal-puppet.yaml b/deployment/pacemaker/pacemaker-baremetal-puppet.yaml index 447706960e..4e3fc1acbb 100644 --- a/deployment/pacemaker/pacemaker-baremetal-puppet.yaml +++ b/deployment/pacemaker/pacemaker-baremetal-puppet.yaml @@ -358,7 +358,7 @@ outputs: VIPS_TO_MOVE=$(crm_mon --as-xml | xmllint --xpath '//resource[@resource_agent = "ocf::heartbeat:IPaddr2" and @role = "Started" and @managed = "true" and ./node[@name = "'${CLUSTER_NODE}'"]]/@id' - | sed -e 's/id=//g' -e 's/"//g') for v in ${VIPS_TO_MOVE}; do echo "Moving VIP $v on another node" - pcs resource move $v --wait=300 + pcs resource ban $v ${CLUSTER_NODE} --wait=300 done echo "Removing the location constraints that were created to move the VIPs" for v in ${VIPS_TO_MOVE}; do