A template (or a package set) in OpenVZ is a set of original application files repackaged for use by OpenVZ. Usually, it is just a set of RPM packages for Red Hat like systems. OpenVZ provides tools for creating templates, installing, upgrading, adding them to and removing them from a container.
Using templates lets you:
- Share RAM among similar applications running in different containers to save hundreds of megabytes of memory.
- Deploy applications simultaneously in many containers.
- Use different versions of an application in different containers (for example, perform upgrades only in certain containers).
There are two types of templates: OS and application.
- An OS template is an operating system and the standard set of applications to be found right after the installation. OpenVZ uses OS templates to create new containers with a preinstalled operating system.
- An application template is a set of repackaged software packages optionally accompanied with configuration scripts. Application templates are used to add extra software to existing containers.
For example, you can create a container on the basis of the redhat
OS template and add the MySQL application to it with the help of the mysql
template.