Convert LXC container to Template - where is the converted template?

apmuthu

Renowned Member
Feb 26, 2009
868
11
83
Chennai - India & Singapore
github.com
Created a Container based on an LXC template.
started the container and after an apt update && apt dist-upgrade stopped it.
Right-clicked on the stopped container in the left pane of the proxmox control panel and chose Convert to Template.
Could not find the updated template in the /var/lib/vz/template/cache folder.
Found that in the local-lvm (pve) on the left panel of the Proxmox interface we find that vm-104-disk-0 is now base-104-disk-0 but cannot locate the disk image.
Trying to create a new container does not list the updated template in the select list.
How does one use the converted image of the template as it get used by the existing container when it is started?
Must we revert to the old method of mounting it and tarring the fileset after removing specific files like etc/hosts, etc/resolv.conf, /tmp/*, .ssh/* etc ?

Should the container be kept in hibernation and used to generate a cloned Container?
If so, how do we migrate this "template" to another proxmox machine?

The wiki does not yet have much info on the Convert to Template feature.

The Convert to Template log is as follows:
Code:
  Renamed "vm-104-disk-0" to "base-104-disk-0" in volume group "pve"
  Logical volume pve/base-104-disk-0 changed.
  WARNING: Combining activation change with other commands is not advised.
TASK OK
 
Last edited:
I believe you are confusing the 2 terms used for Template. (Maybe Proxmox should be clearer about this). The template you have created from an LXC (as opposed to the prebuilt ones) will use the underlying Storage that that container used, but will prefix the volumes with base-CTID. The config is stored in /etc/pve/.

Hope this helps you.
 
You are right that Proxmox should distinguish between them - Convert to Template Image as opposed to merely backing the container and renaming it to the Proxmox format for directly deployable Template like pre-built ones.

Also the log should show the image config location too.

The question that remains is how do we migrate the Template Image to another machine as it resides as in a LV.
 
The question that remains is how do we migrate the Template Image to another machine as it resides as in a LV
You should be able to migrate it like a regular CT/LXC with the obvious regular conditions (storage location etc.) AFAIK you should also be able to move the volume/s of the template to another storage in the regular way, (Hardware & Move Disk).
 

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!