mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-07-05 08:00:45 +00:00
backup: prepare: cancel previous job if still running
This can happen after a hard failure, e.g. if the vzdump task was killed. The next backup (after unlocking the VM) would then fail with > ERROR: VM 125 qmp command 'backup' failed - previous backup not finished During the failure path of that attempt, 'backup-cancel' is executed and the subsequent attempt would then work again. Do it up-front with a warning instead of relying on this behavior. Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
This commit is contained in:
parent
67d9ef4c5d
commit
800ceed2c1
@ -59,6 +59,13 @@ sub prepare {
|
||||
|
||||
my $running = PVE::QemuServer::Helpers::vm_running_locally($vmid);
|
||||
|
||||
if ($running && (my $status = mon_cmd($vmid, 'query-backup'))) {
|
||||
if ($status->{status} && $status->{status} eq 'active') {
|
||||
$self->log('warn', "left-over backup job still running inside QEMU - canceling now");
|
||||
mon_cmd($vmid, 'backup-cancel');
|
||||
}
|
||||
}
|
||||
|
||||
$task->{disks} = [];
|
||||
|
||||
my $conf = $self->{vmlist}->{$vmid} = PVE::QemuConfig->load_config($vmid);
|
||||
|
Loading…
Reference in New Issue
Block a user