mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-06-16 15:49:54 +00:00
do not allow template creation if there are snapshots.
This commit is contained in:
parent
bef4463b61
commit
0402a80b77
@ -2392,8 +2392,12 @@ __PACKAGE__->register_method({
|
|||||||
|
|
||||||
PVE::QemuServer::check_lock($conf);
|
PVE::QemuServer::check_lock($conf);
|
||||||
|
|
||||||
die "you can't convert a template to a template"
|
die "unable to create template, because VM contains snapshots\n"
|
||||||
|
if $conf->{snapshots};
|
||||||
|
|
||||||
|
die "you can't convert a template to a template\n"
|
||||||
if PVE::QemuServer::is_template($conf) && !$disk;
|
if PVE::QemuServer::is_template($conf) && !$disk;
|
||||||
|
|
||||||
my $realcmd = sub {
|
my $realcmd = sub {
|
||||||
PVE::QemuServer::template_create($vmid, $conf, $disk);
|
PVE::QemuServer::template_create($vmid, $conf, $disk);
|
||||||
};
|
};
|
||||||
|
@ -4462,11 +4462,6 @@ sub template_create {
|
|||||||
PVE::QemuServer::update_config_nolock($vmid, $conf, 1);
|
PVE::QemuServer::update_config_nolock($vmid, $conf, 1);
|
||||||
|
|
||||||
});
|
});
|
||||||
if($conf->{snapshots}){
|
|
||||||
delete $conf->{parent};
|
|
||||||
delete $conf->{snapshots};
|
|
||||||
#fixme : do we need to delete disks snapshots ?
|
|
||||||
}
|
|
||||||
$conf->{template} = 1;
|
$conf->{template} = 1;
|
||||||
PVE::QemuServer::update_config_nolock($vmid, $conf, 1);
|
PVE::QemuServer::update_config_nolock($vmid, $conf, 1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user