resume: error out if VM is a template

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@proxmox.com>
Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2025-02-18 12:03:40 +01:00 committed by Thomas Lamprecht
parent 7a6c664fb2
commit 5c15c65f1d

View File

@ -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';