Previous page

Next page

Locate page in Contents

Print this page

Creating a Template from Official Templates

The easiest way to create a template is to base it on one of the official templates shipped by Virtuozzo and adjust its configuration to meet your demands:

  1. Install the template you want to use as the basis for your new template (e.g., using the yum install command).
  2. Create a copy of the directory containing the template configuration files. Depending on whether you want to create a non-base template or a self-contained template, your steps slightly differ:
    • To create a non-base template, create a subdirectory in the /vz/template/os_name/os_version/arch/config/os directory and copy to this directory the contents of the /vz/template/os_name/os_version/arch/config/os/default subdirectory. For example, to make a non-base template for the official centos-6-x86_64 template and put its configuration files to the /customized directory, you can run this command:

      # cp -a /vz/template/centos/6/x86_64/config/os/{default,customized}

      Note: Non-base OS EZ templates inherit some properties from their base OS EZ templates. So, before installing a non-base OS EZ template, make sure that the corresponding base OS EZ template is installed on the server.

    • To create a self-contained template, create a subdirectory in the /vz/template/os_name directory and copy to this directory the contents of the subdirectory for the original template (/vz/template/os_name/os_version). For example, to make a self-contained template on the basis of the official centos-6-x86_64 template and put it to the /vz/template/centos/6-customized directory, you can run these commands:

      # mkdir -p /vz/template/centos-customized/6/x86_64/config

      # cp -a /vz/template/centos{,-customized}/6/x86_64/config/os

  3. Change to the directory containing the configuration files for the new template and adjust them to meet your demands. For example, you can change the list of packages to include in the template by editing the packages file or configure the list of mirrors by editing the mirrorlist file.