]> git.proxmox.com Git - qemu-server.git/blobdiff - PVE/API2/Qemu.pm
move assertion so that we have all checks at the same place.
[qemu-server.git] / PVE / API2 / Qemu.pm
index 8411293290e7aaba2daf7e792938ab06469d46cc..f6d4eaec738257025c891aa27ff50c0998809ff3 100644 (file)
@@ -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);
            };