From 3a07a8a9ffb1a1577ed89c219bc37e658a5404c5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fabian=20Gr=C3=BCnbichler?= Date: Thu, 15 Sep 2016 13:23:12 +0200 Subject: [PATCH] forbid restore into existing template --- PVE/API2/Qemu.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index 60d653f..482b8cd 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -490,6 +490,10 @@ __PACKAGE__->register_method({ die "unable to restore vm $vmid - vm is running\n" if PVE::QemuServer::check_running($vmid); + + die "unable to restore vm $vmid - vm is a template\n" + if PVE::QemuConfig->is_template($conf); + } else { die "unable to restore vm $vmid - already existing on cluster node '$current_node'\n"; } -- 2.39.2