From fbd7dcce4d03bfa94a7bb4d164ec5b1adda85c7f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fabian=20Gr=C3=BCnbichler?= Date: Wed, 25 Jan 2017 14:58:14 +0100 Subject: [PATCH] fix #1260: convert moved template disk to base MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit this was already possible manually via "qm template", but doing it automatically when moving a disk of a template makes more sense. Signed-off-by: Fabian Grünbichler --- PVE/API2/Qemu.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index 2c1e2c9..9b60081 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -2650,6 +2650,10 @@ __PACKAGE__->register_method({ PVE::QemuConfig->add_unused_volume($conf, $old_volid) if !$param->{delete}; + # convert moved disk to base if part of template + PVE::QemuServer::template_create($vmid, $conf, $disk) + if PVE::QemuConfig->is_template($conf); + PVE::QemuConfig->write_config($vmid, $conf); eval { -- 2.39.2