die "you can't convert a vm to template if vm is running vm\n" if $running;
my $storecfg = PVE::Storage::config();
- my $i = 0;
foreach_drive($conf, sub {
my ($ds, $drive) = @_;
$drive->{file} = $voliddst;
$conf->{$ds} = PVE::QemuServer::print_drive($vmid, $drive);
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;
- PVE::QemuServer::update_config_nolock($vmid, $conf, 1);
}
sub is_template {