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
5 changed files with 19 additions and 71 deletions

No files matched your search

+6 -38
View File
@@ -31,41 +31,12 @@ function update_script() {
exit
fi
if [[ ! -f /etc/systemd/system/kan-api.service ]]; then
msg_info "Creating API Service"
cat <<EOF >/etc/systemd/system/kan-api.service
[Unit]
Description=Kan API
After=network.target postgresql.service
Requires=postgresql.service
[Service]
Type=simple
User=root
WorkingDirectory=/opt/kan/apps/api/dist
EnvironmentFile=/opt/kan/.env
ExecStart=/usr/bin/node main.mjs
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
if [[ -f /opt/kan/apps/api/build.mjs ]]; then
cd /opt/kan/apps/api
$STD node build.mjs
systemctl enable -q --now kan-api
fi
msg_ok "Created API Service"
fi
if check_for_gh_tag "kan" "kanbn/kan"; then
NODE_VERSION="24" NODE_MODULE="pnpm" setup_nodejs
msg_info "Stopping Services"
systemctl stop kan kan-api
msg_ok "Stopped Services"
msg_info "Stopping Service"
systemctl stop kan
msg_ok "Stopped Service"
create_backup /opt/kan/.env
CLEAN_INSTALL=1 fetch_and_deploy_gh_tag "kan" "kanbn/kan" "latest"
@@ -79,8 +50,6 @@ EOF
export CI=true
find /opt/kan/packages /opt/kan/apps -name 'tsconfig.json' -exec sed -i 's|"@kan/tsconfig/|"../../tooling/typescript/|g' {} +
$STD pnpm build --filter=@kan/web
cd /opt/kan/apps/api
$STD node build.mjs
unset NEXT_PUBLIC_USE_STANDALONE_OUTPUT CI
msg_ok "Built Application"
@@ -95,10 +64,9 @@ EOF
$STD pnpm exec drizzle-kit migrate
msg_ok "Ran Database Migrations"
msg_info "Starting Services"
systemctl enable -q --now kan-api
msg_info "Starting Service"
systemctl start kan
msg_ok "Started Services"
msg_ok "Started Service"
msg_ok "Updated successfully!"
fi
exit
+5 -28
View File
@@ -34,11 +34,9 @@ BETTER_AUTH_TRUSTED_ORIGINS=http://${LOCAL_IP}:3000
POSTGRES_URL=postgres://${PG_DB_USER}:${PG_DB_PASS}@localhost:5432/${PG_DB_NAME}
NEXT_PUBLIC_ALLOW_CREDENTIALS=true
TRELLO_APP_API_KEY=
TRELLO_APP_SECRET=
TRELLO_APP_API_SECRET=
HOSTNAME=0.0.0.0
PORT=3000
API_PORT=4000
KAN_API_URL=http://127.0.0.1:4000
NODE_ENV=production
EOF
msg_ok "Configured Application"
@@ -51,8 +49,6 @@ $STD pnpm install --ignore-scripts --prod=false
export CI=true
find /opt/kan/packages /opt/kan/apps -name 'tsconfig.json' -exec sed -i 's|"@kan/tsconfig/|"../../tooling/typescript/|g' {} +
$STD pnpm build --filter=@kan/web
cd /opt/kan/apps/api
$STD node build.mjs
unset NEXT_PUBLIC_USE_STANDALONE_OUTPUT CI
msg_ok "Built Application"
@@ -67,31 +63,12 @@ cd /opt/kan/packages/db
POSTGRES_URL="postgres://${PG_DB_USER}:${PG_DB_PASS}@localhost:5432/${PG_DB_NAME}" $STD pnpm exec drizzle-kit migrate
msg_ok "Ran Database Migrations"
msg_info "Creating Services"
cat <<EOF >/etc/systemd/system/kan-api.service
[Unit]
Description=Kan API
After=network.target postgresql.service
Requires=postgresql.service
[Service]
Type=simple
User=root
WorkingDirectory=/opt/kan/apps/api/dist
EnvironmentFile=/opt/kan/.env
ExecStart=/usr/bin/node main.mjs
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/kan.service
[Unit]
Description=Kan Board
After=network.target postgresql.service kan-api.service
After=network.target postgresql.service
Requires=postgresql.service
Wants=kan-api.service
[Service]
Type=simple
@@ -105,8 +82,8 @@ RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now kan-api kan
msg_ok "Created Services"
systemctl enable -q --now kan
msg_ok "Created Service"
motd_ssh
customize
+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} \