Files
proxmox/scripts/create-missing-containers-2506-2508.sh
defiQUG 0d29343941 chore: update .env.master.example with new deployment scripts and treasury manager parameters; enhance AGENTS.md with GRU reference primacy details
- Added new deployment script references for Aave quote-push and treasury manager in .env.master.example.
- Updated AGENTS.md to include information on GRU reference primacy versus public PMM mesh execution model.
- Minor updates to various documentation files to reflect changes in policy and operational guidelines.

Made-with: Cursor
2026-04-12 18:20:41 -07:00

84 lines
3.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# Create only the 3 missing containers (2506, 2507, 2508) per MISSING_CONTAINERS_LIST.md.
# Use this for W2-6 when 1504, 2503-2505, etc. already exist on other hosts.
#
# Usage: PROXMOX_HOST=192.168.11.11 bash scripts/create-missing-containers-2506-2508.sh [--dry-run]
# HISTORICAL SCRIPT
# VMIDs 2506-2508 were part of a retired migration plan and are documented as destroyed/decommissioned.
# This file remains for reference only.
set -euo pipefail
if [[ "${HISTORICAL_ALLOW_RUN:-0}" != "1" ]]; then
echo "HISTORICAL: create-missing-containers-2506-2508.sh is not a current provisioning runbook." >&2
echo "See docs/04-configuration/ALL_VMIDS_ENDPOINTS.md for the live inventory before creating any CTs." >&2
echo "Set HISTORICAL_ALLOW_RUN=1 only if you intentionally need this legacy script." >&2
exit 1
fi
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
source "${PROJECT_ROOT}/config/ip-addresses.conf" 2>/dev/null || true
PROXMOX_HOST="${PROXMOX_HOST:-${PROXMOX_HOST_R630_01:-192.168.11.11}}"
TEMPLATE="${TEMPLATE:-local:vztmpl/debian-12-standard_12.12-1_amd64.tar.zst}"
STORAGE="${STORAGE:-local-lvm}"
NETWORK="${NETWORK:-vmbr0}"
GATEWAY="${NETWORK_GATEWAY:-192.168.11.1}"
DRY_RUN=false
[[ "${1:-}" == "--dry-run" ]] && DRY_RUN=true
log() { echo -e "\033[0;34m[INFO]\033[0m $1"; }
success() { echo -e "\033[0;32m[✓]\033[0m $1"; }
warn() { echo -e "\033[0;33m[WARN]\033[0m $1"; }
error() { echo -e "\033[0;31m[ERROR]\033[0m $1"; }
exists() {
local vmid=$1
ssh -o StrictHostKeyChecking=no -o ConnectTimeout=5 root@"${PROXMOX_HOST}" "pct list 2>/dev/null | grep -q '^$vmid ' && echo yes || echo no"
}
create() {
local vmid=$1 hostname=$2 ip=$3 mem=$4 cores=$5 disk=$6 desc="$7"
if [[ "$(exists $vmid)" == "yes" ]]; then
warn "Container $vmid already exists, skipping."
return 0
fi
log "Creating $vmid: $hostname ($ip) — ${mem}GB RAM, ${cores} cores, ${disk}GB disk..."
if [[ "$DRY_RUN" == true ]]; then
echo " [DRY-RUN] ssh root@${PROXMOX_HOST} pct create $vmid ..."
return 0
fi
ssh -o StrictHostKeyChecking=no root@"${PROXMOX_HOST}" <<EOF
pct create $vmid $TEMPLATE \
--hostname $hostname \
--memory $((mem * 1024)) \
--cores $cores \
--rootfs $STORAGE:${disk} \
--net0 name=eth0,bridge=$NETWORK,ip=$ip/24,gw=$GATEWAY \
--description "$desc" \
--start 1 \
--onboot 1 \
--unprivileged 0
EOF
if [[ "$(exists $vmid)" == "yes" ]]; then
success "Container $vmid created."
return 0
else
error "Failed to create container $vmid"
return 1
fi
}
log "Creating only missing 2506, 2507, 2508 on $PROXMOX_HOST"
echo ""
# Use valid IPv4 in .200-.243 range (per NETWORK_CONFIGURATION_MASTER). Doc had .256/.257/.258 which are invalid.
create 2506 "besu-rpc-luis" "${IP_SERVICE_202:-192.168.11.202}" 16 4 200 "Besu RPC Node - Luis (0x1 identity)"
create 2507 "besu-rpc-putu" "${IP_SERVICE_203:-192.168.11.203}" 16 4 200 "Besu RPC Node - Putu (0x8a identity)"
create 2508 "besu-rpc-putu" "${IP_SERVICE_204:-192.168.11.204}" 16 4 200 "Besu RPC Node - Putu (0x1 identity)"
echo ""
success "Done. See docs/03-deployment/MISSING_CONTAINERS_LIST.md for post-create config (JWT, discovery disabled)."