update
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
action="${1:-}"
|
action="${1:-}"
|
||||||
FOLDER='/opt/idssys/ta-proxmenu'
|
FOLDER='/opt/idssys/ta-proxmenu'
|
||||||
VERS='2026.7.25-12'
|
VERS='2026.7.25-13'
|
||||||
|
|
||||||
noupdate=' '
|
noupdate=' '
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ set -u
|
|||||||
# Guests with local storage remain on this node and are gracefully shut down.
|
# Guests with local storage remain on this node and are gracefully shut down.
|
||||||
|
|
||||||
HA_WAIT_SECONDS=300
|
HA_WAIT_SECONDS=300
|
||||||
|
MAINTENANCE_WAIT_SECONDS=60
|
||||||
SHUTDOWN_TIMEOUT=180
|
SHUTDOWN_TIMEOUT=180
|
||||||
LOCAL_NODE="$(hostname -s)"
|
LOCAL_NODE="$(hostname -s)"
|
||||||
|
|
||||||
@@ -248,11 +249,29 @@ guest_status() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
if ! ha-manager status |
|
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 -F "$LOCAL_NODE" |
|
||||||
grep -q "maintenance mode"; then
|
grep -q "maintenance mode"; then
|
||||||
die "${LOCAL_NODE} is not in HA maintenance mode."
|
printf '\n'
|
||||||
fi
|
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 ||
|
wait_for_ha_evacuation ||
|
||||||
die "Resolve the remaining HA guests before continuing the evacuation."
|
die "Resolve the remaining HA guests before continuing the evacuation."
|
||||||
|
|||||||
Reference in New Issue
Block a user