summaryrefslogtreecommitdiff
path: root/others/vm3/compute
diff options
context:
space:
mode:
authorYour Name <you@example.com>2024-12-29 20:10:29 +0800
committerYour Name <you@example.com>2024-12-29 20:10:29 +0800
commit6f49e7a01ed42cb1227e5070f5d1095342e9bc29 (patch)
treed7f46b53cdd0b0ea70855c364ee5f4f58521923b /others/vm3/compute
parent26d1a94dfd4eeb91b259bfd9d4b8f8d1cdfabd98 (diff)
debian12-support
Diffstat (limited to 'others/vm3/compute')
-rwxr-xr-xothers/vm3/compute/create.sh13
-rwxr-xr-xothers/vm3/compute/ls.sh (renamed from others/vm3/compute/list.sh)0
2 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 \
diff --git a/others/vm3/compute/list.sh b/others/vm3/compute/ls.sh
index b62ef14..b62ef14 100755
--- a/others/vm3/compute/list.sh
+++ b/others/vm3/compute/ls.sh