How to update a (VM) template?

proxwolfe

Active Member
Jun 20, 2020
449
38
33
49
Hi,

I created a VM, installed the OS, added docker and made it all a template. From this template, I have spawned numerous new VMs. Apart from the fact that they all share the same fingerprint for SSH, this works fine for me.

But the older the template gets, the more updates I need to run in every new VM I spawn from it.

Now what I can do is, make a new VM from it, update it and make a new template and delete the old one.

But might there be a quicker, more elegant way to do update my template? Or is this the best practice?

Thanks
 
Hi,
you can create a full clone from the template, update that, and convert it to template again. If the other VMs spawned from the old template are linked clones, the original template still needs to be kept around (because the VMs disks will reference the disk of the original template then). Otherwise, you can remove the old template afterwards.
 
you can create a full clone from the template, update that, and convert it to template again.

Thanks - that's exactly what I am doing:

Now what I can do is, make a new VM from it, update it and make a new template and delete the old one.

I just find this cumbersome and was wondering whether there might be a more elegant, potentially more automated, way to achieve the same result.
 
I just find this cumbersome and was wondering whether there might be a more elegant, potentially more automated, way to achieve the same result.
In theory, it could be supported to temporarily start a template if there are no linked clones. But it's at odds with the design: templates are supposed to be static (the disks are even marked as immutable on storages that support it), and they are very often used for linked clones.
 
The best idea I've come across implemented was a template with updates scripted into it, so each clone has the script running keeping them current.

Every so often -- when the admin feels updates from the base take too long, they clone the base template, update it, and make a new clone with the update-to date in the name. All new VMs are made off of this.

It has it's pro's and cons but it was something that may help you. I liked how one template mistake couldn't crash the whole tree (been there), but I also recognize that, at somepoint, the oldest vms will have to be migrated to a newer template (I feel this is natural anyway)
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!