Compare commits

...
Author SHA1 Message Date
MickLesk 8009e55063 VMs: allocate the EFI disk through vm_alloc_efi_disk
allstarlink, alpine and opnsense still called pvesm alloc themselves and
attached the zero-filled volume as efidisk0. On efitype=4m (Btrfs, or
i440fx on any storage) OVMF's Secure Boot build faults on it and the VM
never boots (#19205). The engine's helper now lets Proxmox allocate and
initialize the disk; opnsense keeps its retry on zfs timeouts.
2026-11-30 12:56:02 +01:00
3 changed files with 8 additions and 5 deletions

No files matched your search

+1 -1
View File
@@ -181,7 +181,7 @@ fi
msg_info "Creating a AllStarLink VM"
qm create $VMID -agent 1${MACHINE} -tablet 0 -localtime 1 -bios ovmf${CPU_TYPE} -cores $CORE_COUNT -memory $RAM_SIZE \
-name $HN -tags community-script,debian${var_version},radio -net0 virtio,bridge=$BRG,macaddr=$MAC$VLAN$MTU -onboot 1 -ostype l26 -scsihw virtio-scsi-pci
pvesm alloc $STORAGE $VMID $DISK0 4M 1>&/dev/null
vm_alloc_efi_disk "$DISK0"
qm importdisk $VMID ${FILE} $STORAGE ${DISK_IMPORT:-} 1>&/dev/null
qm set $VMID \
-efidisk0 ${DISK0_REF}${FORMAT} \
+1 -1
View File
@@ -142,7 +142,7 @@ fi
msg_info "Creating an Alpine VM"
qm create "$VMID" -agent 1${MACHINE} -tablet 0 -localtime 1 -bios ovmf${CPU_TYPE} -cores "$CORE_COUNT" -memory "$RAM_SIZE" \
-name "$HN" -tags community-script -net0 virtio,bridge="$BRG",macaddr="$MAC""$VLAN""$MTU" -onboot 1 -ostype l26 -scsihw virtio-scsi-pci
pvesm alloc "$STORAGE" "$VMID" "$DISK0" 4M 1>&/dev/null
vm_alloc_efi_disk "$DISK0"
pvesm alloc "$STORAGE" "$VMID" "$DISK2" 4M 1>&/dev/null
qm importdisk "$VMID" "$WORK_FILE" "$STORAGE" -format "$DISK_IMPORT_FORMAT" 1>&/dev/null
qm set "$VMID" \
+6 -3
View File
@@ -395,14 +395,16 @@ qm create $VMID -agent 1${MACHINE} -tablet 0 -bios ovmf${CPU_TYPE} -cores $CORE_
-name $HN -tags community-script -net0 virtio,bridge=$BRG,macaddr=$MAC,firewall=0,queues=$CORE_COUNT$VLAN$MTU -onboot 1 -ostype l26 -scsihw virtio-scsi-pci
vm_mark_created
# Retry pvesm alloc on transient zfs_request "got timeout" errors (#14127)
# Retry on transient zfs_request "got timeout" errors (#14127)
alloc_attempt=1
alloc_max=4
alloc_delay=5
while :; do
alloc_err=$(pvesm alloc $STORAGE $VMID $DISK0 4M 2>&1 >/dev/null) && break
# Not in $( ): vm_alloc_efi_disk sets DISK0_REF to the volume Proxmox made.
vm_alloc_efi_disk "$DISK0" 2>"/tmp/opnsense-efi-$$.err" && break
alloc_err="$(<"/tmp/opnsense-efi-$$.err")"
if [[ "$alloc_err" == *"got timeout"* && $alloc_attempt -lt $alloc_max ]]; then
echo -e "${YW}[WARN]${CL} pvesm alloc hit zfs timeout (attempt $alloc_attempt/$alloc_max), retrying in ${alloc_delay}s..."
echo -e "${YW}[WARN]${CL} EFI disk allocation hit zfs timeout (attempt $alloc_attempt/$alloc_max), retrying in ${alloc_delay}s..."
pvesm free "${DISK0_REF}" &>/dev/null || true
sleep "$alloc_delay"
alloc_attempt=$((alloc_attempt + 1))
@@ -412,6 +414,7 @@ while :; do
msg_error "Could not allocate the EFI disk on ${STORAGE}: ${alloc_err}"
exit 220
done
rm -f "/tmp/opnsense-efi-$$.err"
vm_import_disk "$VMID" "$FILE" "$STORAGE"
qm set $VMID \
-efidisk0 ${DISK0_REF}${FORMAT} \