]> git.proxmox.com Git - qemu-server.git/blob - PVE/VZDump/QemuServer.pm
fix pbs backups of templates/vms without disks
[qemu-server.git] / PVE / VZDump / QemuServer.pm
1 package PVE::VZDump::QemuServer;
2
3 use strict;
4 use warnings;
5
6 use File::Basename;
7 use File::Path;
8 use IO::File;
9 use IPC::Open3;
10
11 use PVE::Cluster qw(cfs_read_file);
12 use PVE::INotify;
13 use PVE::IPCC;
14 use PVE::JSONSchema;
15 use PVE::QMPClient;
16 use PVE::Storage::Plugin;
17 use PVE::Storage::PBSPlugin;
18 use PVE::Storage;
19 use PVE::Tools;
20 use PVE::VZDump;
21
22 use PVE::QemuConfig;
23 use PVE::QemuServer;
24 use PVE::QemuServer::Machine;
25 use PVE::QemuServer::Monitor qw(mon_cmd);
26
27 use base qw (PVE::VZDump::Plugin);
28
29 sub new {
30 my ($class, $vzdump) = @_;
31
32 PVE::VZDump::check_bin('qm');
33
34 my $self = bless { vzdump => $vzdump }, $class;
35
36 $self->{vmlist} = PVE::QemuServer::vzlist();
37 $self->{storecfg} = PVE::Storage::config();
38
39 return $self;
40 };
41
42 sub type {
43 return 'qemu';
44 }
45
46 sub vmlist {
47 my ($self) = @_;
48 return [ keys %{$self->{vmlist}} ];
49 }
50
51 sub prepare {
52 my ($self, $task, $vmid, $mode) = @_;
53
54 $task->{disks} = [];
55
56 my $conf = $self->{vmlist}->{$vmid} = PVE::QemuConfig->load_config($vmid);
57
58 $self->loginfo("VM Name: $conf->{name}")
59 if defined($conf->{name});
60
61 $self->{vm_was_running} = 1;
62 if (!PVE::QemuServer::check_running($vmid)) {
63 $self->{vm_was_running} = 0;
64 }
65
66 $task->{hostname} = $conf->{name};
67
68 my $hostname = PVE::INotify::nodename();
69
70 my $vollist = [];
71 my $drivehash = {};
72 PVE::QemuConfig->foreach_volume($conf, sub {
73 my ($ds, $drive) = @_;
74
75 return if PVE::QemuServer::drive_is_cdrom($drive);
76
77 my $volid = $drive->{file};
78
79 if (defined($drive->{backup}) && !$drive->{backup}) {
80 $self->loginfo("exclude disk '$ds' '$volid' (backup=no)");
81 return;
82 } elsif ($self->{vm_was_running} && $drive->{iothread}) {
83 if (!PVE::QemuServer::Machine::runs_at_least_qemu_version($vmid, 4, 0, 1)) {
84 die "disk '$ds' '$volid' (iothread=on) can't use backup feature with running QEMU " .
85 "version < 4.0.1! Either set backup=no for this drive or upgrade QEMU and restart VM\n";
86 }
87 } elsif ($ds =~ m/^efidisk/ && (!defined($conf->{bios}) || $conf->{bios} ne 'ovmf')) {
88 $self->loginfo("excluding '$ds' (efidisks can only be backed up when BIOS is set to 'ovmf')");
89 return;
90 } else {
91 my $log = "include disk '$ds' '$volid'";
92 if (defined $drive->{size}) {
93 my $readable_size = PVE::JSONSchema::format_size($drive->{size});
94 $log .= " $readable_size";
95 }
96 $self->loginfo($log);
97 }
98
99 my ($storeid, $volname) = PVE::Storage::parse_volume_id($volid, 1);
100 push @$vollist, $volid if $storeid;
101 $drivehash->{$ds} = $drive;
102 });
103
104 PVE::Storage::activate_volumes($self->{storecfg}, $vollist);
105
106 foreach my $ds (sort keys %$drivehash) {
107 my $drive = $drivehash->{$ds};
108
109 my $volid = $drive->{file};
110 my ($storeid, $volname) = PVE::Storage::parse_volume_id($volid, 1);
111
112 my $path = $volid;
113 if ($storeid) {
114 $path = PVE::Storage::path($self->{storecfg}, $volid);
115 }
116 next if !$path;
117
118 my ($size, $format) = eval { PVE::Storage::volume_size_info($self->{storecfg}, $volid, 5) };
119 die "no such volume '$volid'\n" if $@;
120
121 my $diskinfo = {
122 path => $path,
123 volid => $volid,
124 storeid => $storeid,
125 format => $format,
126 virtdev => $ds,
127 qmdevice => "drive-$ds",
128 };
129
130 if (-b $path) {
131 $diskinfo->{type} = 'block';
132 } else {
133 $diskinfo->{type} = 'file';
134 }
135
136 push @{$task->{disks}}, $diskinfo;
137 }
138 }
139
140 sub vm_status {
141 my ($self, $vmid) = @_;
142
143 my $running = PVE::QemuServer::check_running($vmid) ? 1 : 0;
144
145 return wantarray ? ($running, $running ? 'running' : 'stopped') : $running;
146 }
147
148 sub lock_vm {
149 my ($self, $vmid) = @_;
150
151 PVE::QemuConfig->set_lock($vmid, 'backup');
152 }
153
154 sub unlock_vm {
155 my ($self, $vmid) = @_;
156
157 PVE::QemuConfig->remove_lock($vmid, 'backup');
158 }
159
160 sub stop_vm {
161 my ($self, $task, $vmid) = @_;
162
163 my $opts = $self->{vzdump}->{opts};
164
165 my $wait = $opts->{stopwait} * 60;
166 # send shutdown and wait
167 $self->cmd ("qm shutdown $vmid --skiplock --keepActive --timeout $wait");
168 }
169
170 sub start_vm {
171 my ($self, $task, $vmid) = @_;
172
173 $self->cmd ("qm start $vmid --skiplock");
174 }
175
176 sub suspend_vm {
177 my ($self, $task, $vmid) = @_;
178
179 $self->cmd ("qm suspend $vmid --skiplock");
180 }
181
182 sub resume_vm {
183 my ($self, $task, $vmid) = @_;
184
185 $self->cmd ("qm resume $vmid --skiplock");
186 }
187
188 sub assemble {
189 my ($self, $task, $vmid) = @_;
190
191 my $conffile = PVE::QemuConfig->config_file($vmid);
192
193 my $outfile = "$task->{tmpdir}/qemu-server.conf";
194 my $firewall_src = "/etc/pve/firewall/$vmid.fw";
195 my $firewall_dest = "$task->{tmpdir}/qemu-server.fw";
196
197 my $outfd = IO::File->new (">$outfile") ||
198 die "unable to open '$outfile'";
199 my $conffd = IO::File->new ($conffile, 'r') ||
200 die "unable open '$conffile'";
201
202 my $found_snapshot;
203 my $found_pending;
204 while (defined (my $line = <$conffd>)) {
205 next if $line =~ m/^\#vzdump\#/; # just to be sure
206 next if $line =~ m/^\#qmdump\#/; # just to be sure
207 if ($line =~ m/^\[(.*)\]\s*$/) {
208 if ($1 =~ m/PENDING/i) {
209 $found_pending = 1;
210 } else {
211 $found_snapshot = 1;
212 }
213 }
214 next if $found_snapshot || $found_pending; # skip all snapshots and pending changes config data
215
216 if ($line =~ m/^unused\d+:\s*(\S+)\s*/) {
217 $self->loginfo("skip unused drive '$1' (not included into backup)");
218 next;
219 }
220 next if $line =~ m/^lock:/ || $line =~ m/^parent:/;
221
222 print $outfd $line;
223 }
224
225 foreach my $di (@{$task->{disks}}) {
226 if ($di->{type} eq 'block' || $di->{type} eq 'file') {
227 my $storeid = $di->{storeid} || '';
228 my $format = $di->{format} || '';
229 print $outfd "#qmdump#map:$di->{virtdev}:$di->{qmdevice}:$storeid:$format:\n";
230 } else {
231 die "internal error";
232 }
233 }
234
235 if ($found_snapshot) {
236 $self->loginfo("snapshots found (not included into backup)");
237 }
238 if ($found_pending) {
239 $self->loginfo("pending configuration changes found (not included into backup)");
240 }
241
242 PVE::Tools::file_copy($firewall_src, $firewall_dest) if -f $firewall_src;
243 }
244
245 sub archive {
246 my ($self, $task, $vmid, $filename, $comp) = @_;
247
248 my $opts = $self->{vzdump}->{opts};
249 my $scfg = $opts->{scfg};
250
251 if ($self->{vzdump}->{opts}->{pbs}) {
252 $self->archive_pbs($task, $vmid);
253 } else {
254 $self->archive_vma($task, $vmid, $filename, $comp);
255 }
256 }
257
258 my $query_backup_status_loop = sub {
259 my ($self, $vmid, $job_uuid) = @_;
260
261 my $starttime = time ();
262 my $last_time = $starttime;
263 my ($last_percent, $last_total, $last_zero, $last_transferred) = (-1, 0, 0, 0);
264 my $transferred;
265
266 my $get_mbps = sub {
267 my ($mb, $delta) = @_;
268 return ($mb > 0) ? int(($mb / $delta) / (1000 * 1000)) : 0;
269 };
270
271 while(1) {
272 my $status = mon_cmd($vmid, 'query-backup');
273
274 my $total = $status->{total} || 0;
275 $transferred = $status->{transferred} || 0;
276 my $percent = $total ? int(($transferred * 100)/$total) : 0;
277 my $zero = $status->{'zero-bytes'} || 0;
278 my $zero_per = $total ? int(($zero * 100)/$total) : 0;
279
280 die "got unexpected uuid\n" if !$status->{uuid} || ($status->{uuid} ne $job_uuid);
281
282 my $ctime = time();
283 my $duration = $ctime - $starttime;
284
285 my $rbytes = $transferred - $last_transferred;
286 my $wbytes = $rbytes - ($zero - $last_zero);
287
288 my $timediff = ($ctime - $last_time) || 1; # fixme
289 my $mbps_read = $get_mbps->($rbytes, $timediff);
290 my $mbps_write = $get_mbps->($wbytes, $timediff);
291
292 my $statusline = "status: $percent% ($transferred/$total), sparse ${zero_per}% ($zero), duration $duration, read/write $mbps_read/$mbps_write MB/s";
293
294 my $res = $status->{status} || 'unknown';
295 if ($res ne 'active') {
296 $self->loginfo($statusline);
297 if ($res ne 'done') {
298 die (($status->{errmsg} || "unknown error") . "\n") if $res eq 'error';
299 die "got unexpected status '$res'\n";
300 } elsif ($total != $transferred) {
301 die "got wrong number of transfered bytes ($total != $transferred)\n";
302 }
303 last;
304 }
305 if ($percent != $last_percent && ($timediff > 2)) {
306 $self->loginfo($statusline);
307 $last_percent = $percent;
308 $last_total = $total if $total;
309 $last_zero = $zero if $zero;
310 $last_transferred = $transferred if $transferred;
311 $last_time = $ctime;
312 }
313 sleep(1);
314 }
315
316 my $duration = time() - $starttime;
317 if ($transferred && $duration) {
318 my $mb = int($transferred / (1000 * 1000));
319 my $mbps = $get_mbps->($transferred, $duration);
320 $self->loginfo("transferred $mb MB in $duration seconds ($mbps MB/s)");
321 }
322 };
323
324 sub archive_pbs {
325 my ($self, $task, $vmid) = @_;
326
327 my $conffile = "$task->{tmpdir}/qemu-server.conf";
328 my $firewall = "$task->{tmpdir}/qemu-server.fw";
329
330 my $opts = $self->{vzdump}->{opts};
331 my $scfg = $opts->{scfg};
332
333 my $starttime = time();
334
335 my $server = $scfg->{server};
336 my $datastore = $scfg->{datastore};
337 my $username = $scfg->{username} // 'root@pam';
338 my $fingerprint = $scfg->{fingerprint};
339
340 my $repo = "$username\@$server:$datastore";
341 my $password = PVE::Storage::PBSPlugin::pbs_get_password($scfg, $opts->{storage});
342
343 my $diskcount = scalar(@{$task->{disks}});
344 if (PVE::QemuConfig->is_template($self->{vmlist}->{$vmid}) || !$diskcount) {
345 my @pathlist;
346 foreach my $di (@{$task->{disks}}) {
347 if ($di->{type} eq 'block' || $di->{type} eq 'file') {
348 push @pathlist, "$di->{qmdevice}.img:$di->{path}";
349 } else {
350 die "implement me (type $di->{type})";
351 }
352 }
353
354 if (!$diskcount) {
355 $self->loginfo("backup contains no disks");
356 }
357
358 local $ENV{PBS_PASSWORD} = $password;
359 local $ENV{PBS_FINGERPRINT} = $fingerprint if defined($fingerprint);
360 my $cmd = [
361 '/usr/bin/proxmox-backup-client',
362 'backup',
363 '--repository', $repo,
364 '--backup-type', 'vm',
365 '--backup-id', "$vmid",
366 '--backup-time', $task->{backup_time},
367 ];
368
369 push @$cmd, "qemu-server.conf:$conffile";
370 push @$cmd, "fw.conf:$firewall" if -e $firewall;
371 push @$cmd, @pathlist if scalar(@pathlist);
372
373 $self->loginfo("starting template backup");
374 $self->loginfo(join(' ', @$cmd));
375
376 $self->cmd($cmd);
377
378 return;
379 }
380
381 # get list early so we die on unkown drive types before doing anything
382 my $devlist = _get_task_devlist($task);
383
384 $self->enforce_vm_running_for_backup($vmid);
385
386 my $backup_job_uuid;
387 eval {
388 $SIG{INT} = $SIG{TERM} = $SIG{QUIT} = $SIG{HUP} = $SIG{PIPE} = sub {
389 die "interrupted by signal\n";
390 };
391
392 my $fs_frozen = $self->qga_fs_freeze($task, $vmid);
393
394 my $params = {
395 format => "pbs",
396 'backup-file' => $repo,
397 'backup-id' => "$vmid",
398 'backup-time' => $task->{backup_time},
399 password => $password,
400 devlist => $devlist,
401 'config-file' => $conffile,
402 };
403 $params->{fingerprint} = $fingerprint if defined($fingerprint);
404 $params->{'firewall-file'} = $firewall if -e $firewall;
405
406 my $res = eval { mon_cmd($vmid, "backup", %$params) };
407 my $qmperr = $@;
408 $backup_job_uuid = $res->{UUID} if $res;
409
410 if ($fs_frozen) {
411 $self->qga_fs_thaw($vmid);
412 }
413
414 die $qmperr if $qmperr;
415 die "got no uuid for backup task\n" if !defined($backup_job_uuid);
416
417 $self->loginfo("started backup task '$backup_job_uuid'");
418
419 $self->resume_vm_after_job_start($task, $vmid);
420
421 $query_backup_status_loop->($self, $vmid, $backup_job_uuid);
422 };
423 my $err = $@;
424 if ($err) {
425 $self->logerr($err);
426 $self->mon_backup_cancel($vmid) if defined($backup_job_uuid);
427 }
428 $self->restore_vm_power_state($vmid);
429
430 die $err if $err;
431 }
432
433 my $fork_compressor_pipe = sub {
434 my ($self, $comp, $outfileno) = @_;
435
436 my @pipefd = POSIX::pipe();
437 my $cpid = fork();
438 die "unable to fork worker - $!" if !defined($cpid) || $cpid < 0;
439 if ($cpid == 0) {
440 eval {
441 POSIX::close($pipefd[1]);
442 # redirect STDIN
443 my $fd = fileno(STDIN);
444 close STDIN;
445 POSIX::close(0) if $fd != 0;
446 die "unable to redirect STDIN - $!"
447 if !open(STDIN, "<&", $pipefd[0]);
448
449 # redirect STDOUT
450 $fd = fileno(STDOUT);
451 close STDOUT;
452 POSIX::close (1) if $fd != 1;
453
454 die "unable to redirect STDOUT - $!"
455 if !open(STDOUT, ">&", $outfileno);
456
457 exec($comp);
458 die "fork compressor '$comp' failed\n";
459 };
460 if (my $err = $@) {
461 $self->logerr($err);
462 POSIX::_exit(1);
463 }
464 POSIX::_exit(0);
465 kill(-9, $$);
466 } else {
467 POSIX::close($pipefd[0]);
468 $outfileno = $pipefd[1];
469 }
470
471 return ($cpid, $outfileno);
472 };
473
474 sub archive_vma {
475 my ($self, $task, $vmid, $filename, $comp) = @_;
476
477 my $conffile = "$task->{tmpdir}/qemu-server.conf";
478 my $firewall = "$task->{tmpdir}/qemu-server.fw";
479
480 my $opts = $self->{vzdump}->{opts};
481
482 my $starttime = time();
483
484 my $speed = 0;
485 if ($opts->{bwlimit}) {
486 $speed = $opts->{bwlimit}*1024;
487 }
488
489 my $diskcount = scalar(@{$task->{disks}});
490 if (PVE::QemuConfig->is_template($self->{vmlist}->{$vmid}) || !$diskcount) {
491 my @pathlist;
492 foreach my $di (@{$task->{disks}}) {
493 if ($di->{type} eq 'block' || $di->{type} eq 'file') {
494 push @pathlist, "$di->{qmdevice}=$di->{path}";
495 } else {
496 die "implement me";
497 }
498 }
499
500 if (!$diskcount) {
501 $self->loginfo("backup contains no disks");
502 }
503
504 my $outcmd;
505 if ($comp) {
506 $outcmd = "exec:$comp";
507 } else {
508 $outcmd = "exec:cat";
509 }
510
511 $outcmd .= " > $filename" if !$opts->{stdout};
512
513 my $cmd = ['/usr/bin/vma', 'create', '-v', '-c', $conffile];
514 push @$cmd, '-c', $firewall if -e $firewall;
515 push @$cmd, $outcmd, @pathlist;
516
517 $self->loginfo("starting template backup");
518 $self->loginfo(join(' ', @$cmd));
519
520 if ($opts->{stdout}) {
521 $self->cmd($cmd, output => ">&" . fileno($opts->{stdout}));
522 } else {
523 $self->cmd($cmd);
524 }
525
526 return;
527 }
528
529 my $devlist = _get_task_devlist($task);
530
531 $self->enforce_vm_running_for_backup($vmid);
532
533 my $cpid;
534 my $backup_job_uuid;
535
536 eval {
537 $SIG{INT} = $SIG{TERM} = $SIG{QUIT} = $SIG{HUP} = $SIG{PIPE} = sub {
538 die "interrupted by signal\n";
539 };
540
541 my $outfh;
542 if ($opts->{stdout}) {
543 $outfh = $opts->{stdout};
544 } else {
545 $outfh = IO::File->new($filename, "w") ||
546 die "unable to open file '$filename' - $!\n";
547 }
548 my $outfileno = fileno($outfh);
549
550 if ($comp) {
551 ($cpid, $outfileno) = $fork_compressor_pipe->($self, $comp, $outfileno);
552 }
553
554 my $qmpclient = PVE::QMPClient->new();
555 my $backup_cb = sub {
556 my ($vmid, $resp) = @_;
557 $backup_job_uuid = $resp->{return}->{UUID};
558 };
559 my $add_fd_cb = sub {
560 my ($vmid, $resp) = @_;
561
562 my $params = {
563 'backup-file' => "/dev/fdname/backup",
564 speed => $speed,
565 'config-file' => $conffile,
566 devlist => $devlist
567 };
568 $params->{'firewall-file'} = $firewall if -e $firewall;
569
570 $qmpclient->queue_cmd($vmid, $backup_cb, 'backup', %$params);
571 };
572
573 $qmpclient->queue_cmd($vmid, $add_fd_cb, 'getfd', fd => $outfileno, fdname => "backup");
574
575 my $fs_frozen = $self->qga_fs_freeze($task, $vmid);
576
577 eval { $qmpclient->queue_execute(30) };
578 my $qmperr = $@;
579
580 if ($fs_frozen) {
581 $self->qga_fs_thaw($vmid);
582 }
583
584 die $qmperr if $qmperr;
585 die $qmpclient->{errors}->{$vmid} if $qmpclient->{errors}->{$vmid};
586
587 if ($cpid) {
588 POSIX::close($outfileno) == 0 ||
589 die "close output file handle failed\n";
590 }
591
592 die "got no uuid for backup task\n" if !defined($backup_job_uuid);
593
594 $self->loginfo("started backup task '$backup_job_uuid'");
595
596 $self->resume_vm_after_job_start($task, $vmid);
597
598 $query_backup_status_loop->($self, $vmid, $backup_job_uuid);
599 };
600 my $err = $@;
601 if ($err) {
602 $self->logerr($err);
603 $self->mon_backup_cancel($vmid) if defined($backup_job_uuid);
604 }
605
606 $self->restore_vm_power_state($vmid);
607
608 if ($err) {
609 if ($cpid) {
610 kill(9, $cpid);
611 waitpid($cpid, 0);
612 }
613 die $err;
614 }
615
616 if ($cpid && (waitpid($cpid, 0) > 0)) {
617 my $stat = $?;
618 my $ec = $stat >> 8;
619 my $signal = $stat & 127;
620 if ($ec || $signal) {
621 die "$comp failed - wrong exit status $ec" .
622 ($signal ? " (signal $signal)\n" : "\n");
623 }
624 }
625 }
626
627 sub _get_task_devlist {
628 my ($task) = @_;
629
630 my $devlist = '';
631 foreach my $di (@{$task->{disks}}) {
632 if ($di->{type} eq 'block' || $di->{type} eq 'file') {
633 $devlist .= ',' if $devlist;
634 $devlist .= $di->{qmdevice};
635 } else {
636 die "implement me (type '$di->{type}')";
637 }
638 }
639 return $devlist;
640 }
641
642 sub qga_fs_freeze {
643 my ($self, $task, $vmid) = @_;
644 return if !$self->{vmlist}->{$vmid}->{agent} || $task->{mode} eq 'stop' || !$self->{vm_was_running};
645
646 if (!PVE::QemuServer::qga_check_running($vmid, 1)) {
647 $self->loginfo("skipping guest-agent 'fs-freeze', agent configured but not running?");
648 return;
649 }
650
651 $self->loginfo("issuing guest-agent 'fs-freeze' command");
652 eval { mon_cmd($vmid, "guest-fsfreeze-freeze") };
653 $self->logerr($@) if $@;
654
655 return 1; # even on mon command error, ensure we always thaw again
656 }
657
658 # only call if fs_freeze return 1
659 sub qga_fs_thaw {
660 my ($self, $vmid) = @_;
661
662 $self->loginfo("issuing guest-agent 'fs-thaw' command");
663 eval { mon_cmd($vmid, "guest-fsfreeze-thaw") };
664 $self->logerr($@) if $@;
665 }
666
667 # we need a running QEMU/KVM process for backup, starts a paused (prelaunch)
668 # one if VM isn't already running
669 sub enforce_vm_running_for_backup {
670 my ($self, $vmid) = @_;
671
672 if (PVE::QemuServer::check_running($vmid)) {
673 $self->{vm_was_running} = 1;
674 return;
675 }
676
677 eval {
678 $self->loginfo("starting kvm to execute backup task");
679 # start with skiplock
680 my $params = {
681 skiplock => 1,
682 paused => 1,
683 };
684 PVE::QemuServer::vm_start($self->{storecfg}, $vmid, $params);
685 };
686 die $@ if $@;
687 }
688
689 # resume VM againe once we got in a clear state (stop mode backup of running VM)
690 sub resume_vm_after_job_start {
691 my ($self, $task, $vmid) = @_;
692
693 return if !$self->{vm_was_running};
694
695 if (my $stoptime = $task->{vmstoptime}) {
696 my $delay = time() - $task->{vmstoptime};
697 $task->{vmstoptime} = undef; # avoid printing 'online after ..' twice
698 $self->loginfo("resuming VM again after $delay seconds");
699 } else {
700 $self->loginfo("resuming VM again");
701 }
702 mon_cmd($vmid, 'cont');
703 }
704
705 # stop again if VM was not running before
706 sub restore_vm_power_state {
707 my ($self, $vmid) = @_;
708
709 # we always let VMs keep running
710 return if $self->{vm_was_running};
711
712 eval {
713 my $resp = mon_cmd($vmid, 'query-status');
714 my $status = $resp && $resp->{status} ? $resp->{status} : 'unknown';
715 if ($status eq 'prelaunch') {
716 $self->loginfo("stopping kvm after backup task");
717 PVE::QemuServer::vm_stop($self->{storecfg}, $vmid, 1);
718 } else {
719 $self->loginfo("kvm status changed after backup ('$status') - keep VM running");
720 }
721 };
722 warn $@ if $@;
723 }
724
725 sub mon_backup_cancel {
726 my ($self, $vmid) = @_;
727
728 $self->loginfo("aborting backup job");
729 eval { mon_cmd($vmid, 'backup-cancel') };
730 $self->logerr($@) if $@;
731 }
732
733 sub snapshot {
734 my ($self, $task, $vmid) = @_;
735
736 # nothing to do
737 }
738
739 sub cleanup {
740 my ($self, $task, $vmid) = @_;
741
742 # nothing to do ?
743 }
744
745 1;