diff --git a/bootstrap/provisioning/main.tf b/bootstrap/provisioning/main.tf index 63e8755..51f4bee 100644 --- a/bootstrap/provisioning/main.tf +++ b/bootstrap/provisioning/main.tf @@ -124,7 +124,7 @@ resource "null_resource" "pimox_template_vm_create" { pimox_user = var.pimox_user ssh_key_path = var.pimox_ssh_key_path qm_bin = var.pimox_qm_bin - builder_version = "8" + builder_version = "9" vmid = tostring(var.pimox_template_vmid) name = var.pimox_template_name cores = tostring(var.pimox_template_cores) @@ -205,6 +205,7 @@ sudo "$qm_cmd" create "$vmid" \ --sockets 1 \ --vga virtio +sudo "$qm_cmd" set "$vmid" --serial0 socket sudo "$qm_cmd" set "$vmid" --efidisk0 "${self.triggers.efidisk0}" sudo "$qm_cmd" set "$vmid" --scsi0 "${self.triggers.scsi0}" sudo "$qm_cmd" set "$vmid" --boot "order=net0;scsi0" @@ -242,7 +243,7 @@ resource "null_resource" "pimox_template_vm_seal" { guest_host = var.pimox_template_build_host guest_user = var.pimox_template_build_user guest_key_path = var.pimox_template_build_ssh_key_path - seal_version = "5" + seal_version = "6" timeout = var.pimox_template_build_timeout timeout_seconds = tostring(var.pimox_template_build_timeout_seconds) guest_ip_prefix = var.pimox_template_guest_ip_prefix @@ -267,6 +268,7 @@ vmid="${self.triggers.vmid}" known_hosts_file="${path.module}/../../.lab/pimox-template-known_hosts" last_known_hosts_ip="" last_ssh_output="" +next_debug=0 mkdir -p "$(dirname "$known_hosts_file")" touch "$known_hosts_file" @@ -292,7 +294,8 @@ sudo '$pimox_qm_bin' status '$vmid' echo 'Pimox VM $vmid config summary:' sudo '$pimox_qm_bin' config '$vmid' | grep -E '^(agent|bios|boot|efidisk0|net0|scsi0|serial0|vga):' || true echo 'Pimox VM $vmid guest-agent network-get-interfaces:' -sudo '$pimox_qm_bin' guest cmd '$vmid' network-get-interfaces" >&2 || true +sudo '$pimox_qm_bin' guest cmd '$vmid' network-get-interfaces +echo 'If this VM is still in the installer, inspect the serial console on the Pimox host with: sudo $pimox_qm_bin terminal $vmid'" >&2 || true } guest_ip_from_agent() { @@ -333,6 +336,7 @@ fi deadline=$((SECONDS + timeout_seconds)) next_log=$SECONDS +next_debug=$((SECONDS + 300)) while (( SECONDS < deadline )); do if [ -z "$guest_host" ]; then guest_host="$(guest_ip_from_agent || true)" @@ -358,6 +362,10 @@ while (( SECONDS < deadline )); do fi next_log=$((SECONDS + 60)) fi + if (( SECONDS >= next_debug )); then + debug_pimox_vm + next_debug=$((SECONDS + 300)) + fi sleep 15 done diff --git a/bootstrap/provisioning/templates/grub.cfg.tftpl b/bootstrap/provisioning/templates/grub.cfg.tftpl index 8222e9e..281c55e 100644 --- a/bootstrap/provisioning/templates/grub.cfg.tftpl +++ b/bootstrap/provisioning/templates/grub.cfg.tftpl @@ -2,6 +2,6 @@ set default=0 set timeout=5 menuentry 'Debian 13 arm64 homelab worker template' { - linux /debian-installer/arm64/linux auto=true priority=critical url=${preseed_url} interface=auto hostname=${template_hostname} domain=${template_domain} --- quiet + linux /debian-installer/arm64/linux auto=true priority=critical url=${preseed_url} interface=auto hostname=${template_hostname} domain=${template_domain} console=tty0 console=ttyS0,115200n8 --- console=tty0 console=ttyS0,115200n8 initrd /debian-installer/arm64/initrd.gz }