mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-06-14 11:47:33 +00:00
set template flag earlier
This commit is contained in:
parent
0402a80b77
commit
75e7e997e7
@ -2401,9 +2401,11 @@ __PACKAGE__->register_method({
|
||||
my $realcmd = sub {
|
||||
PVE::QemuServer::template_create($vmid, $conf, $disk);
|
||||
};
|
||||
return $rpcenv->fork_worker('qmtemplate', $vmid, $authuser, $realcmd);
|
||||
|
||||
$conf->{template} = 1;
|
||||
PVE::QemuServer::update_config_nolock($vmid, $conf, 1);
|
||||
|
||||
return $rpcenv->fork_worker('qmtemplate', $vmid, $authuser, $realcmd);
|
||||
};
|
||||
|
||||
PVE::QemuServer::lock_config($vmid, $updatefn);
|
||||
|
@ -4445,7 +4445,6 @@ sub template_create {
|
||||
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) = @_;
|
||||
@ -4460,10 +4459,7 @@ sub template_create {
|
||||
$drive->{file} = $voliddst;
|
||||
$conf->{$ds} = PVE::QemuServer::print_drive($vmid, $drive);
|
||||
PVE::QemuServer::update_config_nolock($vmid, $conf, 1);
|
||||
|
||||
});
|
||||
$conf->{template} = 1;
|
||||
PVE::QemuServer::update_config_nolock($vmid, $conf, 1);
|
||||
}
|
||||
|
||||
sub is_template {
|
||||
|
Loading…
Reference in New Issue
Block a user