summaryrefslogtreecommitdiff
path: root/others/vm3/compute/create.sh
diff options
context:
space:
mode:
Diffstat (limited to 'others/vm3/compute/create.sh')
-rwxr-xr-xothers/vm3/compute/create.sh13
1 files changed, 10 insertions, 3 deletions
diff --git a/others/vm3/compute/create.sh b/others/vm3/compute/create.sh
index 3e6c088..a1d84f6 100755
--- a/others/vm3/compute/create.sh
+++ b/others/vm3/compute/create.sh
@@ -88,11 +88,18 @@ if [[ ${os,,} == *"freebsd"* ]]; then
ostype="generic"
fi
+# Define the disk options based on OS type
+if [ "$os" = "debian12" ]; then
+ disk_opts="--disk path=$new_vm,format=qcow2"
+else
+ disk_opts="--disk path=$new_vm,format=qcow2 --disk path=$seed_iso,device=cdrom"
+fi
+
+# Use the conditional disk options in virt-install
sudo virt-install --name $vmname \
--vcpus $vcpu \
- --memory "$((ram_gb * 1024))"\
- --disk path=$new_vm,format=qcow2 \
- --disk path=$seed_iso,device=cdrom \
+ --memory "$((ram_gb * 1024))" \
+ $disk_opts \
--os-type $ostype \
--os-variant $os \
--virt-type kvm \