mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-13 09:02:26 +01:00
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 <daan.hoogland@gmail.com>
This commit is contained in:
parent
2941b518ba
commit
4379666fb6
@ -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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user