Browse Source

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
changes/30/782930/1
Damien Ciabrini 2 months ago
parent
commit
3da1e76610
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      deployment/pacemaker/pacemaker-baremetal-puppet.yaml

+ 1
- 1
deployment/pacemaker/pacemaker-baremetal-puppet.yaml View File

@ -349,7 +349,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


Loading…
Cancel
Save