diff options
| author | Your Name <you@example.com> | 2024-12-29 20:10:29 +0800 |
|---|---|---|
| committer | Your Name <you@example.com> | 2024-12-29 20:10:29 +0800 |
| commit | 6f49e7a01ed42cb1227e5070f5d1095342e9bc29 (patch) | |
| tree | d7f46b53cdd0b0ea70855c364ee5f4f58521923b /others/vm3/compute/create.sh | |
| parent | 26d1a94dfd4eeb91b259bfd9d4b8f8d1cdfabd98 (diff) | |
debian12-support
Diffstat (limited to 'others/vm3/compute/create.sh')
| -rwxr-xr-x | others/vm3/compute/create.sh | 13 |
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 | |||
| 88 | ostype="generic" | 88 | ostype="generic" |
| 89 | fi | 89 | fi |
| 90 | 90 | ||
| 91 | # Define the disk options based on OS type | ||
| 92 | if [ "$os" = "debian12" ]; then | ||
| 93 | disk_opts="--disk path=$new_vm,format=qcow2" | ||
| 94 | else | ||
| 95 | disk_opts="--disk path=$new_vm,format=qcow2 --disk path=$seed_iso,device=cdrom" | ||
| 96 | fi | ||
| 97 | |||
| 98 | # Use the conditional disk options in virt-install | ||
| 91 | sudo virt-install --name $vmname \ | 99 | sudo virt-install --name $vmname \ |
| 92 | --vcpus $vcpu \ | 100 | --vcpus $vcpu \ |
| 93 | --memory "$((ram_gb * 1024))"\ | 101 | --memory "$((ram_gb * 1024))" \ |
| 94 | --disk path=$new_vm,format=qcow2 \ | 102 | $disk_opts \ |
| 95 | --disk path=$seed_iso,device=cdrom \ | ||
| 96 | --os-type $ostype \ | 103 | --os-type $ostype \ |
| 97 | --os-variant $os \ | 104 | --os-variant $os \ |
| 98 | --virt-type kvm \ | 105 | --virt-type kvm \ |
