[pve-devel] [PATCH qemu-server] resume: error out if VM is a template

Fabian Grünbichler f.gruenbichler at proxmox.com
Tue Feb 18 12:03:40 CET 2025


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 <f.gruenbichler at proxmox.com>
---
 PVE/QemuServer.pm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index c1fbd468..b23b79e1 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -6403,6 +6403,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';
-- 
2.39.5





More information about the pve-devel mailing list