Skip to content

Commit 93d6ff3

Browse files
Proxmox: fix restore snapshot with memory (#11450)
1 parent 03da8cb commit 93d6ff3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

extensions/Proxmox/proxmox.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,11 @@ restore_snapshot() {
334334

335335
execute_and_wait POST "/nodes/${node}/qemu/${vmid}/snapshot/${snap_name}/rollback"
336336

337-
execute_and_wait POST "/nodes/${node}/qemu/${vmid}/status/start"
337+
status_response=$(call_proxmox_api GET "/nodes/${node}/qemu/${vmid}/status/current")
338+
vm_status=$(echo "$status_response" | jq -r '.data.status')
339+
if [ "$vm_status" = "stopped" ];then
340+
execute_and_wait POST "/nodes/${node}/qemu/${vmid}/status/start"
341+
fi
338342

339343
echo '{"status": "success", "message": "Instance Snapshot restored"}'
340344
}

0 commit comments

Comments
 (0)