Previous page

Next page

Locate page in Contents

Print this page

EZ Template Directory Structure

All EZ templates and the software packages included in them and installed on the host 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. The template area includes two main subdirectories:

  • The cache subdirectory where the tar archive of the potential private area of a Container based on the corresponding OS EZ template is stored. The tar archive is created during the OS EZ template caching. Keep in mind that the OS EZ template should be obligatorily cached before you can start creating Containers on its basis.
  • The template directory having the name of <os_name>/<os_version>/<arch> where:
    • <os_name> denotes the name of the Linux distribution for which the OS EZ template is created (e.g. redhat, centos).
    • <os_version> is the version of the Linux distribution specified as <os_name> (e.g., 5 or 6).
    • <arch> denotes the microprocessor architecture where the OS EZ template is to be run (x86, x86-64, ia64).

    For example, after installing the 32-bit version of the Centos 6 EZ template, the /vz/template/centos/6/x86 directory on the host is created.

In its turn, the <arch> directory contains the following subdirectories and areas:

  • The template configuration subdirectory including:
    • The config/os/default directory where the appropriate configuration files for the base OS EZ template are stored.
    • The config/os/<setname> directory where the appropriate configuration files for non-base OS EZ templates, if any, are stored.
    • The config/app/<app_name>/default directory where the appropriate configuration files for the base application EZ template are stored. This directory is created if at least one application EZ template for the given OS EZ template is installed on the host.
    • The config/app/<app_name>/<setname> directory where the appropriate configuration files for non-base application EZ templates, if any, are stored.
  • The packages area containing a number of software packages downloaded from the repository and installed on the host. An installed package has the following structure:

    <name>-<epoch>:<version>-<release>.<arch>

    where:

    • <name> is the package name.
    • <epoch> denotes the package epoch.
    • <version> indicates the package version.
    • <release> is the package release.
    • <arch> denotes the microprocessor architecture where the package is to be used.
  • One or several subdirectories containing the packages comprising the corresponding OS EZ template. The directories have the following names:
    • baseN for the base OS template
    • <setname>N for the non-base OS template with the name of <setname>, if any
    • <appname>N for the base application template
    • <appname>-<setname>N for the application template with the name of <setname>, if any

    N denotes the index number of the URL specified in the repositories/mirrorlist file (see the information on the repositories/mirrorlist file below).

As has been mentioned above, the configuration directory (i.e. /<template_area>/<template_directory>/config) contains a number of subdirectories storing 'EZ templates'-related configuration files. The contents of these subdirectories can vary depending on whether it is a base OS EZ template or a non-base one and on the EZ template type (OS or application template). The most important configuration files are listed below:

  • Data files:
    • packages: contains a list of software packages names included in the corresponding EZ template.
    • package_manager: specifies the packaging system used to handle the EZ template.
    • repositories: a list of repositories where the packages comprising the EZ template are stored.
    • mirrorlist: one or several URLs to the file containing a list of repositories from where the packages comprising the EZ template are to be downloaded.
    • distribution: the name of the Linux distribution for which the EZ template is created. This file should be absent for application EZ templates.
    • summary: brief information on the EZ template.
    • description: detailed information on the EZ template. As distinct from the summary file, it can contain additional data relevant for the EZ template.
    • environment: a list of environment variables set in the form of key=value.
  • Scripts:
    • pre-cache: this script is executed before installing the packages included in the EZ template on the host.
    • post-cache: this script is executed after installing the packages included in the EZ template on the host.
    • pre-install: this script is executed before adding the EZ template to or installing the package inside the Container.
    • post-install: this script is executed after adding the EZ template to or installing the package inside the Container.
    • pre-upgrade: this script is executed before updating the packages inside the Container.
    • post-upgrade: this script is executed updating the packages inside the Container.
    • pre-remove: this script is executed before removing the application EZ template/package from the Container.
    • post-remove: this script is executed after removing the application EZ template/package from the Container.
  • Document files: one or several files with arbitrary names containing the information on the EZ template (e.g. README).

Note: Detailed information on the files contained in the OS template configuration directory is provided in the Virtuozzo 6 Command Line Reference Guide.

While working with EZ template configuration files, keep in mind the following:

  • The packages file should be specified for all EZ templates.
  • The packages, package_manager, and repositories/mirrorlist files should be specified for all base OS EZ templates.
  • The package_manager and distribution files should be specified for all base OS EZ templates and absent for non-base OS EZ templates and all application EZ templates.

The information from the repositories/mirrorlist files created for non-base OS and all application EZ templates is added to that in the repositories/mirrorlist files for the base OS EZ template.