Compare commits

..

5 Commits

Author SHA1 Message Date
CanbiZ (MickLesk)
a088ed335d
Merge pull request #1366 from juronja/truenas-vm-import-disk-serial-fix
Some checks failed
Update GitHub Versions (New) / update-github-versions (push) Has been cancelled
Fix Truenas VM import disk serial
2026-01-30 11:34:34 +01:00
juronja
162f62daa2 reversed the disk placeholder size 2026-01-30 10:07:10 +00:00
juronja
05416f9fe5 removing iothread and adding serial ID trim for robustness 2026-01-30 09:39:52 +00:00
juronja
e43427548e added disk size placeholder and changed boot diks to sata 2026-01-30 09:31:47 +00:00
juronja
773e748d95 imported disks now have a serial ID. TrueNAS needs it. 2026-01-30 09:18:42 +00:00

View File

@ -522,7 +522,7 @@ msg_info "Creating TrueNAS VM shell"
qm create "$VMID" -machine q35 -bios ovmf -agent enabled=1 -tablet 0 -localtime 1 -cpu "$CPU_TYPE" \
-cores "$CORE_COUNT" -memory "$RAM_SIZE" -balloon 0 -name "$HN" -tags community-script \
-net0 "virtio,bridge=$BRG,macaddr=$MAC$VLAN$MTU" -onboot 1 -ostype l26 \
-efidisk0 $STORAGE:1,efitype=4m,pre-enrolled-keys=0 -scsi0 $STORAGE:$DISK_SIZE,ssd=1,iothread=on \
-efidisk0 $STORAGE:1,efitype=4m,pre-enrolled-keys=0 -sata0 $STORAGE:$DISK_SIZE,ssd=1 \
-scsihw virtio-scsi-single -cdrom local:iso/$ISO_NAME -vga virtio >/dev/null
msg_ok "Created VM shell"
@ -539,7 +539,11 @@ if [ "$IMPORT_DISKS" == "yes" ]; then
for SELECTION in $SELECTIONS; do
((++SCSI_NR))
qm set $VMID --scsi$SCSI_NR /dev/disk/by-id/$SELECTION
ID_SERIAL=$(echo "$SELECTION" | rev | cut -d'_' -f1 | rev)
ID_SERIAL=${ID_SERIAL:0:20}
qm set $VMID --scsi$SCSI_NR /dev/disk/by-id/$SELECTION,serial=$ID_SERIAL
done
msg_ok "Disks imported successfully"
fi