User`s guide
Advanced Tasks 183
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 Server 4 Bare Metal 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 applications 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 the Parallels
Command Line Reference Guide.
4 Install the customized EZ template on the server 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 (p. 118).
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 server.
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 server.
4 Execute the following command on the server 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 (e.g. /root/mysql-redhat-as4-x86-ez-4.0.0-
1.swsoft.noarch.rpm).
5 Install the mysql EZ template on the server:
# 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.










