From 6f49e7a01ed42cb1227e5070f5d1095342e9bc29 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 29 Dec 2024 20:10:29 +0800 Subject: debian12-support --- others/vm3/compute/create.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'others/vm3/compute/create.sh') 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 \ -- cgit v1.2.3-70-g09d2