diff --git a/PVE/CLI/qm.pm b/PVE/CLI/qm.pm index fd4688b5..bce87020 100755 --- a/PVE/CLI/qm.pm +++ b/PVE/CLI/qm.pm @@ -624,7 +624,13 @@ __PACKAGE__->register_method ({ }, ); - print "Successfully imported disk as '$drive_id:$volid'\n"; + $vm_conf = PVE::QemuConfig->load_config($vmid); + + # change imported _used_ disk to a base volume in case the VM is a template + PVE::QemuServer::template_create($vmid, $vm_conf, $drive_id) + if is_valid_drivename($drive_id) && PVE::QemuConfig->is_template($vm_conf); + + print "$drive_id: successfully imported disk '$vm_conf->{$drive_id}'\n"; return; }});