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