Files
portfolio/infra-run/scripts/bash/veritas/03_freeze_vcs_group.sh
T

30 lines
842 B
Bash
Raw Normal View History

#!/usr/bin/env bash
2026-05-08 21:18:22 +00:00
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# shellcheck source=00_env.sh
source "$SCRIPT_DIR/00_env.sh"
parse_common_args "$@"
require_inputs sg
missing=0
for cmd in hagrp grep; do
require_cmd "$cmd" || missing=1
done
if (( missing != 0 )); then
exit 2
fi
ok "Current service group state"
capture_cmd "hagrp state for $SERVICE_GROUP" hagrp -state "$SERVICE_GROUP"
warning "Freezing a VCS service group prevents automatic failover actions while the freeze is active"
confirm_execute "This will persistently freeze VCS service group '$SERVICE_GROUP'."
run_cmd "Freeze VCS service group persistently" hagrp -freeze "$SERVICE_GROUP" -persistent
ok "Freeze state check"
hagrp -display "$SERVICE_GROUP" 2>&1 | tee -a "$LOG_FILE" | grep -i "Frozen" || true
ok "freeze step completed"