Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
- 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>
73 lines
2.7 KiB
Bash
Executable File
73 lines
2.7 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]
|
|
|
|
set -euo pipefail
|
|
|
|
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)."
|