Skip to content

Commit b0d74fe

Browse files
Merge branch '4.22'
2 parents 2600965 + a0ba2aa commit b0d74fe

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

agent/src/main/java/com/cloud/agent/Agent.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,13 +1332,14 @@ public void doTask(final Task task) throws TaskExecutionException {
13321332
}
13331333
} else if (task.getType() == Task.Type.DISCONNECT) {
13341334
try {
1335-
// an issue has been found if reconnect immediately after disconnecting. please refer to https://github.com/apache/cloudstack/issues/8517
1335+
// an issue has been found if reconnect immediately after disconnecting.
13361336
// wait 5 seconds before reconnecting
1337+
logger.debug("Wait for 5 secs before reconnecting, disconnect task - {}", () -> getLinkLog(task.getLink()));
13371338
Thread.sleep(5000);
13381339
} catch (InterruptedException e) {
13391340
}
13401341
shell.setConnectionTransfer(false);
1341-
logger.debug("Executing disconnect task - {}", () -> getLinkLog(task.getLink()));
1342+
logger.debug("Executing disconnect task - {} and reconnecting", () -> getLinkLog(task.getLink()));
13421343
reconnect(task.getLink());
13431344
} else if (task.getType() == Task.Type.OTHER) {
13441345
processOtherTask(task);

extensions/Proxmox/proxmox.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ parse_json() {
3939
"template_id": (.externaldetails.virtualmachine.template_id // ""),
4040
"template_type": (.externaldetails.virtualmachine.template_type // ""),
4141
"iso_path": (.externaldetails.virtualmachine.iso_path // ""),
42+
"iso_os_type": (.externaldetails.virtualmachine.iso_os_type // "l26"),
43+
"disk_size_gb": (.externaldetails.virtualmachine.disk_size_gb // "64"),
44+
"storage": (.externaldetails.virtualmachine.storage // "local-lvm"),
45+
"is_full_clone": (.externaldetails.virtualmachine.is_full_clone // "false"),
4246
"snap_name": (.parameters.snap_name // ""),
4347
"snap_description": (.parameters.snap_description // ""),
4448
"snap_save_memory": (.parameters.snap_save_memory // ""),
@@ -212,9 +216,9 @@ create() {
212216
local data="vmid=$vmid"
213217
data+="&name=$vm_name"
214218
data+="&ide2=$(urlencode "$iso_path,media=cdrom")"
215-
data+="&ostype=l26"
219+
data+="&ostype=$iso_os_type"
216220
data+="&scsihw=virtio-scsi-single"
217-
data+="&scsi0=$(urlencode "local-lvm:64,iothread=on")"
221+
data+="&scsi0=$(urlencode "$storage:$disk_size_gb,iothread=on")"
218222
data+="&sockets=1"
219223
data+="&cores=$vmcpus"
220224
data+="&numa=0"
@@ -228,6 +232,8 @@ create() {
228232
check_required_fields template_id
229233
local data="newid=$vmid"
230234
data+="&name=$vm_name"
235+
clone_flag=$(( is_full_clone == "true" ))
236+
data+="&storage=$storage&full=$clone_flag"
231237
execute_and_wait POST "/nodes/${node}/qemu/${template_id}/clone" "$data"
232238
cleanup_vm=1
233239

0 commit comments

Comments
 (0)