mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-15 18:12:35 +01:00
Merge branch '4.22'
This commit is contained in:
commit
b0d74fe00c
@ -1332,13 +1332,14 @@ public class Agent implements HandlerFactory, IAgentControl, AgentStatusUpdater
|
||||
}
|
||||
} else if (task.getType() == Task.Type.DISCONNECT) {
|
||||
try {
|
||||
// an issue has been found if reconnect immediately after disconnecting. please refer to https://github.com/apache/cloudstack/issues/8517
|
||||
// an issue has been found if reconnect immediately after disconnecting.
|
||||
// wait 5 seconds before reconnecting
|
||||
logger.debug("Wait for 5 secs before reconnecting, disconnect task - {}", () -> getLinkLog(task.getLink()));
|
||||
Thread.sleep(5000);
|
||||
} catch (InterruptedException e) {
|
||||
}
|
||||
shell.setConnectionTransfer(false);
|
||||
logger.debug("Executing disconnect task - {}", () -> getLinkLog(task.getLink()));
|
||||
logger.debug("Executing disconnect task - {} and reconnecting", () -> getLinkLog(task.getLink()));
|
||||
reconnect(task.getLink());
|
||||
} else if (task.getType() == Task.Type.OTHER) {
|
||||
processOtherTask(task);
|
||||
|
||||
@ -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