From 93d6ff3a7d0dc6438e3ab3f36f184becf8ef3a60 Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Fri, 15 Aug 2025 16:02:57 +0200 Subject: [PATCH] Proxmox: fix restore snapshot with memory (#11450) --- extensions/Proxmox/proxmox.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/extensions/Proxmox/proxmox.sh b/extensions/Proxmox/proxmox.sh index dbfdae1b972..7f363a6b9a0 100755 --- a/extensions/Proxmox/proxmox.sh +++ b/extensions/Proxmox/proxmox.sh @@ -334,7 +334,11 @@ restore_snapshot() { execute_and_wait POST "/nodes/${node}/qemu/${vmid}/snapshot/${snap_name}/rollback" - execute_and_wait POST "/nodes/${node}/qemu/${vmid}/status/start" + status_response=$(call_proxmox_api GET "/nodes/${node}/qemu/${vmid}/status/current") + vm_status=$(echo "$status_response" | jq -r '.data.status') + if [ "$vm_status" = "stopped" ];then + execute_and_wait POST "/nodes/${node}/qemu/${vmid}/status/start" + fi echo '{"status": "success", "message": "Instance Snapshot restored"}' }