Remove duplicate qm set; show Cloud-Init output

Collapse duplicated qm set invocation into a single call when attaching the EFI and root disk, removing the duplicate conditional block. Also stop redirecting setup_cloud_init output (remove >/dev/null 2>&1) so Cloud-Init setup logs and errors are visible for debugging. Note: the previous conditional added a --scsi1 "${STORAGE}:cloudinit" only when USE_CLOUD_INIT=yes; that explicit scsi1 assignment is no longer present in this unified call.
This commit is contained in:
CanbiZ (MickLesk) 2026-02-03 12:17:01 +01:00
parent d894b74005
commit b7b988bc75

View File

@ -622,20 +622,11 @@ rm -f "$WORK_FILE"
# ============================================================================== # ==============================================================================
msg_info "Attaching EFI and root disk" msg_info "Attaching EFI and root disk"
if [ "$USE_CLOUD_INIT" = "yes" ]; then
qm set "$VMID" \
--efidisk0 "${STORAGE}:0,efitype=4m" \
--scsi0 "${DISK_REF_IMPORTED},${DISK_CACHE}${THIN%,}" \
--scsi1 "${STORAGE}:cloudinit" \
--boot order=scsi0 \
--serial0 socket >/dev/null
else
qm set "$VMID" \ qm set "$VMID" \
--efidisk0 "${STORAGE}:0,efitype=4m" \ --efidisk0 "${STORAGE}:0,efitype=4m" \
--scsi0 "${DISK_REF_IMPORTED},${DISK_CACHE}${THIN%,}" \ --scsi0 "${DISK_REF_IMPORTED},${DISK_CACHE}${THIN%,}" \
--boot order=scsi0 \ --boot order=scsi0 \
--serial0 socket >/dev/null --serial0 socket >/dev/null
fi
qm set $VMID --agent enabled=1 >/dev/null qm set $VMID --agent enabled=1 >/dev/null
@ -647,7 +638,7 @@ set_description
# Cloud-Init configuration # Cloud-Init configuration
if [ "$USE_CLOUD_INIT" = "yes" ]; then if [ "$USE_CLOUD_INIT" = "yes" ]; then
msg_info "Configuring Cloud-Init" msg_info "Configuring Cloud-Init"
setup_cloud_init "$VMID" "$STORAGE" "$HN" "yes" >/dev/null 2>&1 setup_cloud_init "$VMID" "$STORAGE" "$HN" "yes"
msg_ok "Cloud-Init configured" msg_ok "Cloud-Init configured"
fi fi