This is an automated email from the ASF dual-hosted git repository.

shwstppr pushed a commit to branch 4.22
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.22 by this push:
     new 4379666fb62 Proxmox Extension : Make settings such as storage, 
disk_size,... (#12174)
4379666fb62 is described below

commit 4379666fb62ded6aa4e102ebba7eada1243421c9
Author: Abhisar Sinha <[email protected]>
AuthorDate: Wed Dec 3 17:05:22 2025 +0530

    Proxmox Extension : Make settings such as storage, disk_size,... (#12174)
    
    Make storage, disk-size and os-type configurable in the Proxmox extension
    
    Doc PR: apache/cloudstack-documentation#601
    
    ---------
    
    Co-authored-by: dahn <[email protected]>
---
 extensions/Proxmox/proxmox.sh | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/extensions/Proxmox/proxmox.sh b/extensions/Proxmox/proxmox.sh
index 23f30311e2b..fc27f2f3075 100755
--- a/extensions/Proxmox/proxmox.sh
+++ b/extensions/Proxmox/proxmox.sh
@@ -39,6 +39,10 @@ parse_json() {
         "template_id":      (.externaldetails.virtualmachine.template_id // 
""),
         "template_type":    (.externaldetails.virtualmachine.template_type // 
""),
         "iso_path":         (.externaldetails.virtualmachine.iso_path // ""),
+        "iso_os_type":      (.externaldetails.virtualmachine.iso_os_type // 
"l26"),
+        "disk_size_gb":     (.externaldetails.virtualmachine.disk_size_gb // 
"64"),
+        "storage":          (.externaldetails.virtualmachine.storage // 
"local-lvm"),
+        "is_full_clone":    (.externaldetails.virtualmachine.is_full_clone // 
"false"),
         "snap_name":        (.parameters.snap_name // ""),
         "snap_description": (.parameters.snap_description // ""),
         "snap_save_memory": (.parameters.snap_save_memory // ""),
@@ -212,9 +216,9 @@ create() {
         local data="vmid=$vmid"
         data+="&name=$vm_name"
         data+="&ide2=$(urlencode "$iso_path,media=cdrom")"
-        data+="&ostype=l26"
+        data+="&ostype=$iso_os_type"
         data+="&scsihw=virtio-scsi-single"
-        data+="&scsi0=$(urlencode "local-lvm:64,iothread=on")"
+        data+="&scsi0=$(urlencode "$storage:$disk_size_gb,iothread=on")"
         data+="&sockets=1"
         data+="&cores=$vmcpus"
         data+="&numa=0"
@@ -228,6 +232,8 @@ create() {
         check_required_fields template_id
         local data="newid=$vmid"
         data+="&name=$vm_name"
+        clone_flag=$(( is_full_clone == "true" ))
+        data+="&storage=$storage&full=$clone_flag"
         execute_and_wait POST "/nodes/${node}/qemu/${template_id}/clone" 
"$data"
         cleanup_vm=1
 

Reply via email to