Proxmox: fix restore snapshot with memory (#11450)

This commit is contained in:
Wei Zhou 2025-08-15 16:02:57 +02:00 committed by GitHub
parent 03da8cbd3e
commit 93d6ff3a7d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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"}'
}