From 5c15c65f1dda2e85aa89e65fe0352b60c2e92759 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Tue, 18 Feb 2025 12:03:40 +0100 Subject: [PATCH] resume: error out if VM is a template MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Template-VMs might be started in 'prelaunch' state when creating a backup, but they must never be actually started fully, to avoid modifying their disks. Signed-off-by: Fabian Grünbichler Reviewed-by: Fiona Ebner Signed-off-by: Thomas Lamprecht --- PVE/QemuServer.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 808c0e1c..673ae3d9 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -6392,6 +6392,9 @@ sub vm_resume { $conf = PVE::QemuConfig->load_config($vmid); } + die "VM $vmid is a template and cannot be resumed!\n" + if PVE::QemuConfig->is_template($conf); + if ($res->{status}) { return if $res->{status} eq 'running'; # job done, go home $resume_cmd = 'system_wakeup' if $res->{status} eq 'suspended';