[pve-devel] [PATCH v2 qemu-server] fix #3369: auto-start vm after failed stopmode backup

Dylan Whyte d.whyte at proxmox.com
Tue Apr 20 15:14:37 CEST 2021


Fixes an issue in which a VM/CT fails to automatically restart after a
failed stop-mode backup.

Also fixes a minor typo in a comment

Signed-off-by: Dylan Whyte <d.whyte at proxmox.com>
---

Note:

v1->v2:
- Fix the issue from within PVE::VZDump::QemuServer, rather than adding
  tedious sleep call and state checking in PVE::VZDump.

 PVE/VZDump/QemuServer.pm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/PVE/VZDump/QemuServer.pm b/PVE/VZDump/QemuServer.pm
index 8920ac1f..42a60fc7 100644
--- a/PVE/VZDump/QemuServer.pm
+++ b/PVE/VZDump/QemuServer.pm
@@ -551,6 +551,7 @@ sub archive_pbs {
     if ($err) {
 	$self->logerr($err);
 	$self->mon_backup_cancel($vmid);
+	$self->resume_vm_after_job_start($task, $vmid);
     }
     $self->restore_vm_power_state($vmid);
 
@@ -729,6 +730,7 @@ sub archive_vma {
     if ($err) {
 	$self->logerr($err);
 	$self->mon_backup_cancel($vmid);
+	$self->resume_vm_after_job_start($task, $vmid);
     }
 
     $self->restore_vm_power_state($vmid);
@@ -815,7 +817,7 @@ sub enforce_vm_running_for_backup {
     die $@ if $@;
 }
 
-# resume VM againe once we got in a clear state (stop mode backup of running VM)
+# resume VM again once in a clear state (stop mode backup of running VM)
 sub resume_vm_after_job_start {
     my ($self, $task, $vmid) = @_;
 
-- 
2.20.1





More information about the pve-devel mailing list