Previous page

Next page

Locate page in Contents

Print this page

Creating Customized Containers

If you wish to use one or more custom applications in many identical Containers, you may want to create Containers with necessary applications already preinstalled and tuned to meet your demands.

Virtuozzo offers several ways to create customized Containers with preinstalled applications:

  • By creating an OS EZ template cache with preinstalled application templates.
  • By making a customized base OS EZ template and using it as the basis for Containers.
  • By making a non-base OS EZ template and using it as the basis for Containers.
  • By making a customized application EZ template, adding it to a new configuration sample file, and using this sample file as the basis for Containers.

All these operations are described in the following subsections in detail.

Using OS Template Caches with Preinstalled Application Templates

You can use an OS EZ template cache with preinstalled application templates to quickly create multiple identical Containers without having to install applications manually or wait until they are installed automatically to each Container after its creation. The best way to create such a cache is:

  1. Make a custom sample configuration file with information on the OS EZ template to cache and application EZ templates to preinstall. For example:

    # cp /etc/vz/conf/ve-basic.conf-sample /etc/vz/conf/ve-centos-6-x86-mysql-devel.conf-sample

    Note: If you already have a custom sample configuration file created in Parallels Server Bare Metal 5 or earlier and having application EZ templates specified in it, you can reuse it instead of creating a new one.

  2. Add the OS EZ template and application EZ template information to the new configuration file. Each OS and application template name must be preceded by a dot. Multiple consecutive application EZ template names must be separated by white spaces. For example:

    # cd /etc/vz/conf

    # echo 'OSTEMPLATE=".centos-6-x86"' >> ve-centos-6-x86-mysql-devel.conf-sample

    # echo 'TEMPLATES=".mysql .devel"' >> ve-centos-6-x86-mysql-devel.conf-sample

  3. Run the vzpkg create appcache command with your configuration file as an option. For example:

    # vzpkg create appcache --config centos-6-x86-mysql-devel

    Note: If the resulting cache already exists, it will not be recreated and you will see a corresponding message.

The resulting archive can be found in the /vz/template/cache directory on the Hardware Node. You can check that it exists and includes necessary application templates with the following command:

# vzpkg list appcache

centos-6-x86 2012-07-20 16:51:36

mysql

devel

Disabling Golden Image Functionality

The Golden Image functionality allows you to preinstall application templates to OS EZ template caches to speed up creating multiple Containers based on the same set of OS and application templates. Previously, you could either install application templates to each Container after creating it or embed them directly into a custom OS template. Golden Image is currently the easiest and fastest way to create Containers with preinstalled applications.

The Golden Image functionality is enabled by default in the /etc/sysconfig/vz/vz.conf global configuration file. Should you wish to disable it, do one of the following:

  • Set the GOLDEN_IMAGE option to "no" in the Virtuozzo global configuration file.

    The Golden Image functionality will be disabled globally.

  • Set the GOLDEN_IMAGE option to "no" in the Container sample configuration file.

    The Golden Image functionality will be disabled for commands that use this specific sample configuration file.

  • Create a file named golden_image containing "no" in the OS EZ template’s configuration directory.

    The Golden Image functionality will be disabled for this specific OS EZ template.

  • Create a file named golden_image containing "no" in the application template’s configuration directory.

    The Golden Image functionality will be disabled for this specific application template, so it will not be preinstalled into any OS EZ template caches.