[pve-devel] rollback timeout
Dietmar Maurer
dietmar at proxmox.com
Wed Sep 19 07:27:09 CEST 2012
> I'm just testing rollback of a qcow2
>
> # time qm rollback 115 test2
> command '/usr/bin/qemu-img snapshot -a test2 /var/lib/vz/images/115/vm-
> 115-disk-1.qcow2' failed: got timeout
Well, you sent the patch which implements that. I have no idea why you
set such short timeout on all snapshot related commands?
commit 41dffa853d509b1d3de81270a348b1929fe57701
Author: Alexandre Derumier <aderumier at odiso.com>
Date: Thu Sep 6 10:27:59 2012 +0200
plugin : add volume_snapshot_rollback
Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
diff --git a/PVE/Storage/Plugin.pm b/PVE/Storage/Plugin.pm
index 6360aeb..315cded 100644
--- a/PVE/Storage/Plugin.pm
+++ b/PVE/Storage/Plugin.pm
@@ -520,6 +520,20 @@ sub volume_snapshot {
return undef;
}
+sub volume_snapshot_rollback {
+ my ($class, $scfg, $storeid, $volname, $snap) = @_;
+
+ die "can't rollback snapshot this image format" if $volname !~ m/\.(qcow2|qed)$/;
+
+ my $path = $class->path($scfg, $volname);
+
+ my $cmd = ['/usr/bin/qemu-img', 'snapshot','-a', $snap, $path];
+
+ run_command($cmd, timeout => 1);
+
+ return undef;
+}
More information about the pve-devel
mailing list