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:
parent
d894b74005
commit
b7b988bc75
@ -622,20 +622,11 @@ rm -f "$WORK_FILE"
|
||||
# ==============================================================================
|
||||
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" \
|
||||
--efidisk0 "${STORAGE}:0,efitype=4m" \
|
||||
--scsi0 "${DISK_REF_IMPORTED},${DISK_CACHE}${THIN%,}" \
|
||||
--boot order=scsi0 \
|
||||
--serial0 socket >/dev/null
|
||||
fi
|
||||
|
||||
qm set $VMID --agent enabled=1 >/dev/null
|
||||
|
||||
@ -647,7 +638,7 @@ set_description
|
||||
# Cloud-Init configuration
|
||||
if [ "$USE_CLOUD_INIT" = "yes" ]; then
|
||||
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"
|
||||
fi
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user