Previous page

Next page

Locate page in Contents

Print this page

Using Customized Application Template

If the number of customized applications inside your Containers is relatively small, you can also use the following way of creating customized Containers:

  1. Create a metafile that will serve as the basis for your customized application EZ template.

    Note: Detailed information on how to create metafile is given in the Creating Metafile for EZ Template subsection of the Parallels Virtuozzo Containers Templates Management Guide.

  2. Create one or more scripts that will be executed on different stages of the application EZ template lifecycle and customize your application(s) to meet your demands. For example, you can create a postinstall script with the name of post_install.bash and make it perform a number of customization operations on your application after installing this application in your Container.
  3. Create a customized application EZ template by running the vzmktmpl utility and passing the corresponding options to it. So, you can use the --post-install option and specify the path to the post_install.bash script from the example above to customize your application in accordance with your needs after installing it in your Container.

    Note: The full list of options allowing you to specify what scripts are to be executed on what stage of the EZ template lifecycle is provided in the vzmktmpl subsection of Parallels Virtuozzo Containers Reference Guide.

  4. Install the customized EZ template on the Hardware Node by using the rpm -i command.
  5. Create a new Container configuration sample file and include the customized EZ template in this file. Detailed information on Container configuration sample files is provided in the Managing Container Resources Configuration section.
  6. Create a customized Container on the basis of the configuration sample.

The following example demonstrates how to create Container 101 which will run Red Hat Enterprise Linux 4 and have the customized mysql application installed inside it right after its creation:

  1. Create a metafile for the mysql application, name it mysql.metafile, and save in the /usr/mysql directory on the Hardware Node.
  2. Make a script that will perform a number of custom operations after applying the mysql EZ template to the Container and name it post_install.bash.
  3. Copy the script to the /usr/mysql directory on the Hardware Node.
  4. Execute the following command on the Node to create the mysql EZ template:

    # vzmktmpl /usr/mysql/mysql.metafile \

    --post-install /usr/mysql/post_install.bash

    This command will create an EZ template for the mysql application and put it to the /root directory on the Hardware Node (e.g. /root/mysql-redhat-as4-x86-ez-4.0.0-1.swsoft.noarch.rpm).

  5. Install the mysql EZ template on the Hardware Node:

    # rpm -ihv /root/mysql-redhat-as4-x86-ez-4.0.0-1.swsoft.noarch.rpm

  6. Create a new Container configuration sample file and add the mysql EZ template to a list of templates that will be installed in Containers created on the basis of this configuration sample file. For example, you can create a new configuration sample with the mysql name by running the Create Configuration Sample Wizard in Parallels Management Console and add the mysql EZ template to a list of templates on the Select Application Templates step of this wizard.
  7. Create Container 101 by using the vzctl create command and the mysql sample file:

    # vzctl create 101 --ostemplate redhat-as4-x86 -–config mysql

    Creating Container private area (redhat-as4-x86)

    Container is mounted

    Postcreate action done

    Container is unmounted

    Container private area was created

    Delete port redirection

    Adding port redirection to Container(1): 4643 8443

So, you have just created Container 101 having the customized mysql application installed inside it.

Please send us your feedback on this help page