Phase 3: unattended install, seed ISOs and VM lifecycle
autounattend template (q35/AHCI/e1000, no virtio injection), per-VM seed ISOs with a bootstrap that configures the static IP, enables WinRM/RDP and chains into the role script. build --dry-run, up/down/status/vnc verbs. Static addressing happens in PowerShell rather than in the unattend file: Microsoft-Windows-TCPIP matches adapters by connection name and fails silently when the name differs.
This commit is contained in:
@@ -79,6 +79,23 @@ load_vms() {
|
||||
(( ${#VM_NAMES[@]} > 0 )) || die "no VMs defined in VMS (lab.conf)"
|
||||
}
|
||||
|
||||
vm_index() {
|
||||
local name=$1 i
|
||||
for i in "${!VM_NAMES[@]}"; do
|
||||
if [[ ${VM_NAMES[$i]} == "$name" ]]; then
|
||||
printf '%s\n' "$i"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
# Bash-native TCP probe: no nc dependency, 1 s timeout.
|
||||
tcp_open() {
|
||||
local host=$1 port=$2
|
||||
timeout 1 bash -c "exec 3<>/dev/tcp/${host}/${port}" 2>/dev/null
|
||||
}
|
||||
|
||||
sum_vm_ram_mb() {
|
||||
local total=0 r
|
||||
for r in "${VM_RAM[@]}"; do total=$(( total + r )); done
|
||||
|
||||
Reference in New Issue
Block a user