Files
proxmox/scripts/audit-proxmox-rpc-storage.sh.bak
defiQUG fbda1b4beb
Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
docs: Ledger Live integration, contract deploy learnings, NEXT_STEPS updates
- ADD_CHAIN138_TO_LEDGER_LIVE: Ledger form done; public code review repo bis-innovations/LedgerLive; init/push commands
- CONTRACT_DEPLOYMENT_RUNBOOK: Chain 138 gas price 1 gwei, 36-addr check, TransactionMirror workaround
- CONTRACT_*: AddressMapper, MirrorManager deployed 2026-02-12; 36-address on-chain check
- NEXT_STEPS_FOR_YOU: Ledger done; steps completable now (no LAN); run-completable-tasks-from-anywhere
- MASTER_INDEX, OPERATOR_OPTIONAL, SMART_CONTRACTS_INVENTORY_SIMPLE: updates
- LEDGER_BLOCKCHAIN_INTEGRATION_COMPLETE: bis-innovations/LedgerLive reference

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 15:46:57 -08:00

55 lines
1.6 KiB
Bash
Executable File

#!/usr/bin/env bash
# Audit storage node restrictions vs RPC VMID placement.
#
# Requires SSH access to a Proxmox node that can run pct/pvesm and see /etc/pve/storage.cfg.
#
# Usage:
# PROXMOX_HOST=192.168.11.10 ./scripts/audit-proxmox-rpc-storage.sh
set -euo pipefail
PROXMOX_HOST="${PROXMOX_HOST:-192.168.11.10}"
VMIDS=(2400 2401 2402 2500 2501 2502 2503 2504 2505 2506 2507 2508)
ssh_pve() {
ssh -o StrictHostKeyChecking=no -o BatchMode=yes -o ConnectTimeout=5 "root@${PROXMOX_HOST}" "$@"
}
echo "=== Proxmox RPC Storage Audit ==="
echo "Host: ${PROXMOX_HOST}"
echo
NODE="$(ssh_pve "hostname")"
echo "Node name: ${NODE}"
echo
echo "=== Storages active on this node (pvesm) ==="
ssh_pve "pvesm status" | sed 's/^/ /'
echo
echo "=== storage.cfg: storages with node restrictions ==="
ssh_pve "awk '
/^dir: /{s=\$2; t=\"dir\"; nodes=\"\"}
/^lvmthin: /{s=\$2; t=\"lvmthin\"; nodes=\"\"}
/^[[:space:]]*nodes /{nodes=\$2}
/^[[:space:]]*nodes /{print t \":\" s \" nodes=\" nodes}
' /etc/pve/storage.cfg" | sed 's/^/ /'
echo
echo "=== RPC VMID -> rootfs storage mapping ==="
for v in "${VMIDS[@]}"; do
echo "--- VMID ${v} ---"
ssh_pve "pct status ${v} 2>&1; pct config ${v} 2>&1 | egrep -i 'hostname:|rootfs:|memory:|swap:|cores:|net0:'" | sed 's/^/ /'
echo
done
cat <<'NOTE'
NOTE:
- If a VMID uses rootfs "local-lvm:*" on a node where storage.cfg restricts "local-lvm" to other nodes,
the container may fail to start after a shutdown/reboot.
- Fix is to update /etc/pve/storage.cfg nodes=... for that storage to include the node hosting the VMID,
or migrate the VMID to an allowed node/storage.
NOTE