Hi Guys
I used to have some documentation for Proxmox 3 that detailed how to convert an existing OpenVZ container into a template I could use for new containers. Since the move to LXC I feel I need to refresh things a bit.
I dont really want to use the containers available via `pveam` because they ship with packages I dont nessecrily care about (Although there are follow up questions on this point).
This got me looking into the underlying LXC template stuff.
I first started by downloading a template:
Upon success this seems to create a "STOPPED" LXC container (that proxmox has no knowledge of via pct) with its rootfs in /var/lib/vz/private/ubuntu-test. I've then proceeded to tar up that folder and use the resulting tarball as a template for new containers.
Is there anything I need to consider with this? I do notice when I create a new container via gui using this new "template", it does seem to create new SSH host keys for me and I presume proxmox deals with the rest such as hostname, dns, networking and root password etc.
A tangential question here - If I were to use one of the templates available via `pveam`, created a container and booted it up, removed all the packages I dont need and then vzdumped that container - I could theoretically use the tarball for new containers in a similar method as above? So I guess the same question applies - Do I need to consider anything (such as UUIDs) when doing this? I recall reading somewhere that container settings (RAM/CPU allocation etc) are included in the tarbal, do i need to remove these? (If so, where are they)
(Or is there a better way I can get "minimal" images for use with Proxmox - just the bare essentials to have a running container which I can then grab what I need via apt)
I used to have some documentation for Proxmox 3 that detailed how to convert an existing OpenVZ container into a template I could use for new containers. Since the move to LXC I feel I need to refresh things a bit.
I dont really want to use the containers available via `pveam` because they ship with packages I dont nessecrily care about (Although there are follow up questions on this point).
This got me looking into the underlying LXC template stuff.
I first started by downloading a template:
Code:
lxc-create -t download -n ubuntu-test -- --dist ubuntu --release xenial --arch amd64
Upon success this seems to create a "STOPPED" LXC container (that proxmox has no knowledge of via pct) with its rootfs in /var/lib/vz/private/ubuntu-test. I've then proceeded to tar up that folder and use the resulting tarball as a template for new containers.
Is there anything I need to consider with this? I do notice when I create a new container via gui using this new "template", it does seem to create new SSH host keys for me and I presume proxmox deals with the rest such as hostname, dns, networking and root password etc.
A tangential question here - If I were to use one of the templates available via `pveam`, created a container and booted it up, removed all the packages I dont need and then vzdumped that container - I could theoretically use the tarball for new containers in a similar method as above? So I guess the same question applies - Do I need to consider anything (such as UUIDs) when doing this? I recall reading somewhere that container settings (RAM/CPU allocation etc) are included in the tarbal, do i need to remove these? (If so, where are they)
(Or is there a better way I can get "minimal" images for use with Proxmox - just the bare essentials to have a running container which I can then grab what I need via apt)
Last edited: