forbid snapshot create if current it's a template

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
Alexandre Derumier 2013-02-14 11:58:55 +01:00 committed by Dietmar Maurer
parent d560409207
commit f78fe36ece

View File

@ -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);