vm to template to vm conversion

aristosv

Active Member
Mar 3, 2018
7
1
43
46
I'm coming from years working on a vmware environment so excuse the ignorance.

On proxmox 5.1-41, I created a Debian machine and converted it to template. Now I want to convert it back to a normal VM, to patch it and convert it back to template again.

After reading around I found that this is not possible, and the only way to do this, is to clone the template to vm, patch it, and convert the clone to template again.

On vmware, template patching is something we do at least every 2 months and this is the process we follow. Convert template to vm, patch, convert to template again.

So you can understand why this seems so strange to me. Not to have the flexibility to go from template to vm.

Is there any way of converting a template to vm, without having to clone it? Even a manual way? Maybe edit the vm's file (vmx for vmware)?
 
Don't convert it to a template in the first place :-D I do this with windows VM templates all the time. They need a lot of patching, additional cleanup and zeroing the free space.

All Linux-based VMs are created on via automatic network installation and are then equipped with the newest patches and company settings, so no need to update them.
 
Well yeah. If I had known I can't go back to vm, I would never had converter it to template. Question is, what do I do now? Is there any way to go back to vm?
 
  • Like
Reactions: dcsapak
This is no longer working as of 3/20/24 PVE8.1.4
Just tested with PVE 8.1.5 and still works like it should. What did you exactly do? I just removed - as described the line template: 1 from the VM configuration file and after a few seconds the VM was converted back to non-template version in the PVE GUI.
 
Better still, change line to read template: 0 to turn template off and revert back to VM :)
 
Last edited:
Work as expected in PVE 8.1.10 with cluster and HA as well. It took about ~30 seconds for the state to propagate through the cluster, but otherwise, worked as expected.
 
This is no longer working as of 3/20/24 PVE8.1.4
I agreed. For ZFS, once convert from VM to Template, not only one line "template: 1" has been added into <VMID>.conf file, the VM Disk also has been rename from vm-<VMID>-disk-0 to base-<VMID>-disk-0, and it will caused \WebGUI refused to create ZFS snapshot.
I was tested if it needs convert Template back to VM, one additional step that rename VM Disk back to vm-<VMID>-disk-0 is required. the step can reference to Moving disk image from one KVM machine to another. but I do not know does this additional step requires for LVM, Directory ether Ceph, just FYR.1718697840567.png1718697889645.png
 
Last edited:
Just run the following command in order to convert a VM template back to VM

Code:
qm set <ID> --template 0

this was the easiest way (using v8.3.2)

UPDATE: well... I spoke too soon... maybe not the easiest way...
It did make the icon change in the GUI so I thought it was working better than the comments about changing template: 1 to template: 0 in the conf file.

However, I still couldn't start the VM. It tried and then errored "kvm: -device virtio-blk-pci,drive=drive-virtio0,id=virtio0,bus=pci.0,addr=0xa,bootindex=100: The device is not writable: Permission denied"
 
Last edited: