Container template in Virtuozzo Server 6.0 is a set of application and configuration files installed on a Virtuozzo Server in such a way as to be usable by any Container.
Virtuozzo Server uses OS templates to create new Containers with a pre-installed operating system. And application templates are used to add extra software to existing Containers.
This article contains information and instructions for OS and App templates management in Virtuozzo 6.
OS templates supported by Virtuozzo Server 6.0
|Distribution||32-bit (x86)||64-bit (x86_64)||CentOS||centos-6 centos-5||centos-7 centos-6 centos-5|
|Debian||debian-8.0 debian-7.0 debian-6.0||debian-8.0 debian-7.0 debian-6.0|
|Fedora||fedora-20||fedora-22 fedora-21 fedora-20|
|RHEL||redhat-el6 redhat-el5||redhat-el7 redhat-el6 redhat-el5|
|Ubuntu||ubuntu-15.04 ubuntu-14.10 ubuntu-14.04 ubuntu-10.04.4||ubuntu-15.04 ubuntu-14.10 ubuntu-14.04 ubuntu-10.04.4|
Obtaining OS and App templates
- As all other components of Virtuozzo, OS templates as well as application templates can be installed through yum
- Templates Management Guide - Installing Application EZ Templates on the Server
All EZ templates and the software packages included in them and installed on the Parallels server are located in the so-called template area the path to which is set as the value of the TEMPLATE variable in the
/etc/vz/vz.conf file. By default, the
/vz/template directory is used.
Container cache is presented by the tar archive compressed in lzrw format of the potential private area of a Container based on the corresponding OS EZ template. Each new container is created by copying the cache to the container private image, thus template cache must exist for a container creation. If there is no template cache yet, it will be created automatically on the first container creation.
Cache update may be necessary to implement packages or configuration changes to the new containers.
Updating EZ Templates Packages Inside a Container
To apply the changes(updates) added to the EZ templates for existing container
vzpkg update tool can be used
Application templates provide additional software for already created Containers based on the OS template used.
OS template upgrade
In a ploop-based container operating system can be upgraded manually from inside the container using native way, recommended by OS distribution authors. Thus upgrade functionality was deprecated and no longer provided for OS Templates released after 2012.
Templates for VZFS containers
VZFS containers use the same templates as ploop containers.
But unlike ploop containers, VZFS containers require binary files for packages included to the OS template. The binary files are stored in folders like:
[root@vz6 ~]# ls -la /vz/template/debian/6.0/x86_64/openssh-* /vz/template/debian/6.0/x86_64/openssh-client_1.3a5.5p1-6+squeeze4_amd64: total 32K drwxr-xr-t 4 root root 4.0K Feb 8 2014 . drwxr-xr-x 300 root root 20K Jul 2 19:00 .. drwxr-xr-x 3 root root 4.0K Mar 6 2013 etc drwxr-xr-x 5 root root 4.0K Mar 6 2013 usr /vz/template/debian/6.0/x86_64/openssh-server_1.3a5.5p1-6+squeeze4_amd64: total 32K drwxr-xr-t 4 root root 4.0K Feb 8 2014 . drwxr-xr-x 300 root root 20K Jul 2 19:00 .. drwxr-xr-x 7 root root 4.0K Mar 6 2013 etc drwxr-xr-x 5 root root 4.0K Mar 6 2013 usr [root@vz6 ~]# ls -lah /vz/template/debian/6.0/x86_64/openssh-server_1.3a5.5p1-6+squeeze4_amd64/usr/sbin/ total 476K drwxr-xr-x 2 root root 4.0K Mar 6 2013 . drwxr-xr-x 5 root root 4.0K Mar 6 2013 .. -rwxr-xr-x 1 root root 465K Mar 6 2013 sshd
VZFS containers use vzlinks to point on files in the template area. If corresponding binary files are missing in the template area, broken vzlinks are responsible for FS inconsistency inside VZFS containers. Usually, this happens after VZFS container migration to the new node where there are no binaries with required version.
In case if the VZFS container was migrated from PVC node, its template area can be copied to the Virtuozzo 6 server. Copy of packages required for VZFS containers in the template area will not affect the work of ploop containers.
The following KB article provides the troubleshooting instructions for broken vzlinks:
/vz/template on an NFS share
In a very large Virtuozzo environment you may want to export templates via NFS to other nodes to avoid multiple cache updates when an EZ template update is being performed.
For VZFS containers, the following limitation should be taken into consideration:
For ploop containers NFSv3 should be used.
Change default mirrors list for a template
Create an RHN proxy/mirror server for creating cache of Redhat OS templates
Copy EZ templates from one VZ node to another
vzmtemplate tool can be used to copy templates between the nodes. Please note that template cache is not being copied with this utility.
Cache creation troubleshooting
- Error: Cannot retrieve repository metadata