From f78fe36ece4960a84fffaa03d11ca56253bc76c3 Mon Sep 17 00:00:00 2001 From: Alexandre Derumier Date: Thu, 14 Feb 2013 11:58:55 +0100 Subject: [PATCH] forbid snapshot create if current it's a template Signed-off-by: Alexandre Derumier --- PVE/QemuServer.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index e8697b34..32d2a871 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -2886,6 +2886,10 @@ sub qemu_block_resize { sub qemu_volume_snapshot { my ($vmid, $deviceid, $storecfg, $volid, $snap) = @_; + my $conf = PVE::QemuServer::load_config($vmid); + + die "you can't take a snapshot if it's a template" if is_template($conf); + my $running = check_running($vmid); return if !PVE::Storage::volume_snapshot($storecfg, $volid, $snap, $running);