Created
May 18, 2026 18:07
-
-
Save aerodomigue/2cfbb6b8c37274c6d0d722817e96f631 to your computer and use it in GitHub Desktop.
Gracefully shutdown a single Proxmox VE node. Stops HA services (pve-ha-lrm, pve-ha-crm) before powering off to avoid HA fencing or VM recovery attempts. Supports --dry-run.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # cluster-shutdown - Properly shut down the local node by stopping the HA before | |
| # Usage: cluster-shutdown [--dry-run] | |
| DRY_RUN=false | |
| [ "$1" = "--dry-run" ] && DRY_RUN=true | |
| LOCAL=$(hostname) | |
| echo "=== cluster-shutdown (single node) ===" | |
| echo "Local node: $LOCAL" | |
| if $DRY_RUN; then | |
| echo "[DRY-RUN] Would stop pve-ha-lrm pve-ha-crm on $LOCAL" | |
| echo "[DRY-RUN] Would shutdown $LOCAL" | |
| echo "=== Dry run complete, no action taken ===" | |
| exit 0 | |
| fi | |
| echo "Stopping HA on $LOCAL..." | |
| systemctl stop pve-ha-lrm pve-ha-crm | |
| echo "Shutting down $LOCAL..." | |
| /sbin/shutdown -h now |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment