]> git.proxmox.com Git - qemu-server.git/commitdiff
fix #1260: convert moved template disk to base
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Wed, 25 Jan 2017 13:58:14 +0000 (14:58 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 26 Jan 2017 09:03:20 +0000 (10:03 +0100)
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 <f.gruenbichler@proxmox.com>
PVE/API2/Qemu.pm

index 2c1e2c991e427f061a41b1b6f5772cc4105649ee..9b60081e29b31b0dd4099d5e4ec635ccd482a9d4 100644 (file)
@@ -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 {