photoncloud-monorepo/baremetal/vm-cluster/deploy-all.sh
centra 5c6eb04a46 T036: Add VM cluster deployment configs for nixos-anywhere
- netboot-base.nix with SSH key auth
- Launch scripts for node01/02/03
- Node configuration.nix and disko.nix
- Nix modules for first-boot automation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-11 09:59:19 +09:00

59 lines
1.7 KiB
Bash
Executable file

#!/usr/bin/env bash
# T036 VM Cluster Deployment Script
# Deploys all VMs via nixos-anywhere after VNC network configuration
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
cd "$REPO_ROOT"
echo "=== T036 VM Cluster Deployment ==="
echo ""
echo "Prerequisites:"
echo " - PXE server booted and network configured (192.168.100.1)"
echo " - Node01 booted and network configured (192.168.100.11)"
echo " - Node02 booted and network configured (192.168.100.12)"
echo " - Node03 booted and network configured (192.168.100.13)"
echo ""
echo "Press Enter to start deployment..."
read
echo ""
echo "Step 1: Verify SSH connectivity to all VMs..."
for host in 192.168.100.1 192.168.100.11 192.168.100.12 192.168.100.13; do
echo -n " Checking $host... "
if ssh -o ConnectTimeout=5 -o StrictHostKeyChecking=no root@$host 'echo OK' 2>/dev/null; then
echo "✓"
else
echo "✗ FAILED"
echo "ERROR: Cannot connect to $host"
echo "Please verify network configuration via VNC"
exit 1
fi
done
echo ""
echo "Step 2: Deploy PXE Server (192.168.100.1)..."
nixos-anywhere --flake .#pxe-server root@192.168.100.1
echo ""
echo "Step 3: Deploy Node01 (192.168.100.11)..."
nixos-anywhere --flake .#node01 root@192.168.100.11
echo ""
echo "Step 4: Deploy Node02 (192.168.100.12)..."
nixos-anywhere --flake .#node02 root@192.168.100.12
echo ""
echo "Step 5: Deploy Node03 (192.168.100.13)..."
nixos-anywhere --flake .#node03 root@192.168.100.13
echo ""
echo "=== Deployment Complete ==="
echo ""
echo "All VMs have been provisioned. Systems will reboot from disk."
echo "Wait 2-3 minutes for boot, then validate cluster..."
echo ""
echo "Next: Run ./validate-cluster.sh"