Moving disks between templates

romainl

New Member
Jul 4, 2026
2
0
1
Hi,

I'm trying to automate the creation of templates. I start from a preinstalled Ubuntu server ISO (for example noble-server-cloudimg-amd64.img), then import it in a pre-existing template and use Packer with proxmox-clone to create a template that has my tools and configuration installed.

The problem is that I can't move the disk from the created template to my existing template, because the "move_disk" API call doesn't support moving a disk if the origin or destination is a template. I found the line in the API source code that prevents moving disks between templates (here) but I don't understand the reasoning of why I can't move a disk simply because the origin or destination is a template.

I understand that I could manually edit the .conf files to assign the disk to the other template, but that seems a lot more dangerous if I'm not careful, and it's also more difficult to automate.

Is there any other way to easily move a disk from a template to another one? Or is it possible for Proxmox to remove this restriction?

Thanks in advance for your responses!
 
You can clone or convert to a regular VM, perform the disk import or move there, then convert the result back into a template with `qm template <VMID>`. Because templates are treated as immutable base images for cloning.
 
I wouldn't even think of doing that, but wouldn't a virtual machine created from a linked clone of that virtual machine become corrupted if I did that?

When I think about it that way, I feel like I shouldn't even consider editing something that's been turned into a template.
 
My use case might be a little unusual, but we never use linked clones as they prevent migrating VMs when using local storage (along with other limitations). Our goal is explicitly to keep the same template but change the disk inside of the template so users can always create a clone from the same template, with the same VMID. For now I'm using an ansible script that moves the disk manually by editing the templates .conf files on the physical hosts, but that's really not an elegant solution. It would be nice if Proxmox could allow changing the owner of a disk even if the old or the new owner is a template.

Even in the case of linked clones, it's possible to keep the old disks as unused disks on the templates, as only the referenced disks are used when cloning a template. So it's possible to keep old versions of your base disk image as unused disks in your template and always have the "scsi0" disk be the newest base image.
 
yeah, full clone only setups reduce the risk, but templates can back linked clones, so the API stays conservative. Editing config files may work, but it bypasses normal checks and it unsupported.