Skip to content

Instantly share code, notes, and snippets.

@aerodomigue
aerodomigue / cluster-shutdown.sh
Created May 18, 2026 18:07
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.
#!/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) ==="
@aerodomigue
aerodomigue / cluster-shutdown-all.sh
Created May 18, 2026 18:05
Gracefully shutdown an entire Proxmox VE cluster. Stops HA services (pve-ha-lrm, pve-ha-crm) on all nodes first, then shuts down remote nodes before the local node. Supports --dry-run. Requires SSH key exchange between nodes (default in Proxmox clusters) and node hostnames resolvable via /etc/hosts or DNS.
#!/bin/bash
# cluster-shutdown-all - Éteint proprement tout le cluster Proxmox
# Stoppe le HA sur tous les nœuds puis les éteint un par un
# Requiert les clés SSH root échangées entre nœuds (par défaut dans un cluster Proxmox)
# Usage: cluster-shutdown-all [--dry-run]
set -e
DRY_RUN=false
[ "$1" = "--dry-run" ] && DRY_RUN=true
@aerodomigue
aerodomigue / upgrade_debian_12_to_13.sh
Created August 17, 2025 11:15
Upgrade LXC Debian 12 to 13 (copy/paste solution)
#!/bin/bash
# Update source from bookworm to trixie
sed -i 's/bookworm/trixie/g' /etc/apt/sources.list
apt-get update
# Upgrade to trixie
DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confold" dist-upgrade -y
# Disable services that break in LXC / containers (harmless if not present)
systemctl disable --now systemd-networkd-wait-online.service || true