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.gruenbich...@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



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to