From ad090f94cccd050240d7e9293830994da44d0683 Mon Sep 17 00:00:00 2001 From: Damien Ciabrini Date: Wed, 19 Aug 2020 15:40:00 +0200 Subject: [PATCH] minor update: only migrate HA VIP away when needed When update tasks runs in a HA controller node, pacemaker is stopped, along with all HA resources hosted on the node. If any VIP is hosted on that node, it is moved to another node prior to stopping pacemaker to limit service downtime. If the HA controller node doesn't manage VIP (no HAProxy) or the control plane only has 1 node, there is no need to try and move VIP away before stopping pacemaker. Tested on a 1-node HA control plane, and also on a control plane with external balancer (no HAproxy service, thus no VIP managed in pacemaker). The dedicated ansible task no longer tries to move VIP if it doesn't need to. Closes-Bug: #1892570 Change-Id: Id9b9c413ee37dcda422e69ebef4aca81e4877156 (cherry picked from commit 164fac75a0fbff2130f39a5f4d7c5931f5ea3b08) (cherry picked from commit cc17467c5018d4f05b53af0a0046def5c5a8633e) --- deployment/pacemaker/pacemaker-baremetal-puppet.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deployment/pacemaker/pacemaker-baremetal-puppet.yaml b/deployment/pacemaker/pacemaker-baremetal-puppet.yaml index fd5cc90042..c5fb6966b3 100644 --- a/deployment/pacemaker/pacemaker-baremetal-puppet.yaml +++ b/deployment/pacemaker/pacemaker-baremetal-puppet.yaml @@ -322,7 +322,9 @@ outputs: async: 30 poll: 4 - name: Move virtual IPs to another node before stopping pacemaker - when: step|int == 1 + when: + - step|int == 1 + - hostvars[inventory_hostname]["haproxy_node_names"]|default([])|length > 1 shell: | CLUSTER_NODE=$(crm_node -n) echo "Retrieving all the VIPs which are hosted on this node"