Files
loc_az_hci/scripts/troubleshooting/fix-template-os.sh
defiQUG c39465c2bd
Some checks failed
Test / test (push) Has been cancelled
Initial commit: loc_az_hci (smom-dbis-138 excluded via .gitignore)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-08 09:04:46 -08:00

83 lines
2.4 KiB
Bash
Executable File

#!/bin/bash
source ~/.bashrc
# Fix Template OS Installation
# Guides through installing Ubuntu on template VM 9000
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
log_info() {
echo -e "${GREEN}[INFO]${NC} $1"
}
log_warn() {
echo -e "${YELLOW}[WARN]${NC} $1"
}
log_error() {
echo -e "${RED}[ERROR]${NC} $1"
}
log_step() {
echo -e "\n${BLUE}=== $1 ===${NC}"
}
main() {
log_step "Template OS Installation Guide"
log_warn "Template VM 9000 has only 600M disk - likely no OS installed"
log_info "VMs cloned from this template won't boot properly"
echo ""
log_step "Solution Options"
echo "Option 1: Install Ubuntu via ISO (Recommended)"
echo " 1. Access Proxmox Web UI: https://192.168.1.206:8006"
echo " 2. Go to VM 9000 → Hardware → Add → CD/DVD Drive"
echo " 3. Select Ubuntu 24.04 ISO (upload if needed)"
echo " 4. Set boot order: CD/DVD first"
echo " 5. Start VM 9000 and open console"
echo " 6. Install Ubuntu 24.04"
echo " 7. Install cloud-init: sudo apt install cloud-init"
echo " 8. Install QEMU Guest Agent: sudo apt install qemu-guest-agent"
echo " 9. Enable services: sudo systemctl enable cloud-init qemu-guest-agent"
echo " 10. Convert to template: Right-click VM → Convert to Template"
echo ""
echo "Option 2: Use Ubuntu Cloud Image (Faster)"
echo " 1. Download Ubuntu 24.04 cloud image"
echo " 2. Upload to Proxmox storage"
echo " 3. Create VM from cloud image (see CREATE_VM_9000_STEPS.md)"
echo " 4. Convert to template"
echo ""
log_step "Quick Fix: Expand Template Disk First"
log_info "Template disk is too small. Expanding to 8GB..."
# This would require SSH, but document it
log_warn "To expand template disk (requires SSH to Proxmox host):"
echo " ssh root@192.168.1.206"
echo " qm resize 9000 scsi0 +8G"
echo ""
log_step "After OS Installation"
log_info "Once template has OS installed:"
echo " 1. Recreate VMs from updated template"
echo " 2. VMs will boot with Ubuntu and cloud-init will configure network"
echo ""
log_info "See docs/temporary/CREATE_VM_9000_STEPS.md for detailed instructions"
}
main "$@"