Compare commits

..
Author SHA1 Message Date
MickLesk 9ac1176ceb HAOS VM: take the imported disk from vm_import_disk
PVE 9.2 reports the import as 'Successfully imported disk as unused0:...', which the local parser missed, and its pvesm fallback matched the VMID column, so imports on local-zfs ended in 'Unable to determine imported disk reference'.
2026-10-31 18:49:07 +01:00
3 changed files with 3 additions and 26 deletions

No files matched your search

-6
View File
@@ -581,12 +581,6 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
- MatterJS-Server: Add time sync [@tomfrenzel](https://github.com/tomfrenzel) ([#18330](https://github.com/community-scripts/ProxmoxVE/pull/18330))
### 💾 Core
- feat: add setup_java_memory: size Java services from the CT's RAM on Proxmox [@MickLesk](https://github.com/MickLesk) ([core#181](https://github.com/community-scripts/core/pull/181))
- analytics: name the Proxmox tasks when a container stops mid-install [@MickLesk](https://github.com/MickLesk) ([core#184](https://github.com/community-scripts/core/pull/184))
- PVE: do not abort when the spinner PID file cannot be written [@MickLesk](https://github.com/MickLesk) ([core#183](https://github.com/community-scripts/core/pull/183))
### 📂 Github
- Drop the legacy engine copies from misc/ [@MickLesk](https://github.com/MickLesk) ([#18294](https://github.com/community-scripts/ProxmoxVE/pull/18294))
+1 -4
View File
@@ -191,10 +191,7 @@ if [ "$USE_CLOUD_INIT" == "yes" ] && declare -f setup_cloud_init >/dev/null 2>&1
"${CLOUDINIT_GW:-}" \
"${CLOUDINIT_DNS:-${CLOUDINIT_DNS_SERVERS:-1.1.1.1 8.8.8.8}}"
if [[ "${CLOUDINIT_NETWORK_MODE:-dhcp}" == "static" && -z "${CLOUDINIT_SNIPPET_STORAGE:-}" ]] &&
! pvesm status -content snippets 2>/dev/null | awk 'NR > 1 && $3 == "active" {found = 1} END {exit !found}'; then
msg_warn "No storage with 'snippets' content: the static IP uses Proxmox's own cloud-init network config"
elif [[ "${CLOUDINIT_NETWORK_MODE:-dhcp}" == "static" ]]; then
if [[ "${CLOUDINIT_NETWORK_MODE:-dhcp}" == "static" ]]; then
setup_cloud_init_network_no_rename \
"$VMID" \
"$MAC" \
+2 -16
View File
@@ -128,28 +128,14 @@ msg_ok "Created VM shell"
vm_extract_image "$CACHE_FILE" || exit 115
FILE_IMG="$VM_IMAGE_FILE"
msg_info "Importing disk into storage ($STORAGE)"
if qm disk import --help >/dev/null 2>&1; then
IMPORT_CMD=(qm disk import)
else
IMPORT_CMD=(qm importdisk)
fi
IMPORT_OUT="$("${IMPORT_CMD[@]}" "$VMID" "$FILE_IMG" "$STORAGE" --format raw 2>&1 || true)"
DISK_REF="$(printf '%s\n' "$IMPORT_OUT" | sed -n "s/.*successfully imported disk '\([^']\+\)'.*/\1/p" | tr -d "\r\"'")"
[[ -z "$DISK_REF" ]] && DISK_REF="$(pvesm list "$STORAGE" | awk -v id="$VMID" '$5 ~ ("vm-"id"-disk-") {print $1":"$5}' | sort | tail -n1)"
[[ -z "$DISK_REF" ]] && {
msg_error "Unable to determine imported disk reference."
echo "$IMPORT_OUT"
exit 226
}
msg_ok "Imported disk (${CL}${BL}${DISK_REF}${CL})"
vm_import_disk "$VMID" "$FILE_IMG" "$STORAGE" raw || exit 226
rm -f "$FILE_IMG"
msg_info "Attaching EFI and root disk"
qm set $VMID \
--efidisk0 ${STORAGE}:0,efitype=4m \
--scsi0 ${DISK_REF},${DISK_CACHE}ssd=1,discard=on \
--scsi0 ${VM_IMPORTED_DISK},${DISK_CACHE}ssd=1,discard=on \
--boot order=scsi0 \
--serial0 socket >/dev/null
qm set $VMID --agent enabled=1 >/dev/null