diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index 84112932..f6d4eaec 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -2398,6 +2398,9 @@ __PACKAGE__->register_method({ die "you can't convert a template to a template\n" if PVE::QemuServer::is_template($conf) && !$disk; + die "you can't convert a VM to template if VM is running\n" + if check_running($vmid); + my $realcmd = sub { PVE::QemuServer::template_create($vmid, $conf, $disk); }; diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 194b678d..4d2710aa 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -4441,9 +4441,6 @@ sub has_feature { sub template_create { my ($vmid, $conf, $disk) = @_; - my $running = check_running($vmid); - die "you can't convert a vm to template if vm is running vm\n" if $running; - my $storecfg = PVE::Storage::config(); foreach_drive($conf, sub {