This commit is contained in:
David Schroeder
2026-07-25 11:12:00 -05:00
parent dc48f1a8af
commit f2a6bce8f8
2 changed files with 25 additions and 6 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
action="${1:-}"
FOLDER='/opt/idssys/ta-proxmenu'
VERS='2026.7.25-12'
VERS='2026.7.25-13'
noupdate=' '
+24 -5
View File
@@ -6,6 +6,7 @@ set -u
# Guests with local storage remain on this node and are gracefully shut down.
HA_WAIT_SECONDS=300
MAINTENANCE_WAIT_SECONDS=60
SHUTDOWN_TIMEOUT=180
LOCAL_NODE="$(hostname -s)"
@@ -248,11 +249,29 @@ guest_status() {
fi
}
if ! ha-manager status |
grep -F "$LOCAL_NODE" |
grep -q "maintenance mode"; then
die "${LOCAL_NODE} is not in HA maintenance mode."
fi
wait_for_maintenance_mode() {
local deadline=$((SECONDS + MAINTENANCE_WAIT_SECONDS))
log "Waiting for ${LOCAL_NODE} to enter HA maintenance mode."
while true; do
if ha-manager status |
grep -F "$LOCAL_NODE" |
grep -q "maintenance mode"; then
printf '\n'
return
fi
if (( SECONDS >= deadline )); then
die "${LOCAL_NODE} did not enter HA maintenance mode within ${MAINTENANCE_WAIT_SECONDS} seconds."
fi
printf '\r Waiting for HA maintenance mode... '
sleep 2
done
}
wait_for_maintenance_mode
wait_for_ha_evacuation ||
die "Resolve the remaining HA guests before continuing the evacuation."