Updated 2016-02-16

Overview

In order to create templates in Parallels (now Odin)(now Virtuozzo!) Cloud Server 6 (now called Virtuozzo Linux), you perform the following basic steps:

  • Download and install the vztt-build YUM package.
  • Create the required package description meta files and
  • Then run the vzmktmpl command with the appropriate command line parameters. The tool will build an RPM file which
  • You then install the RPM thats just been built with the vzpkg tool before pushing it to a container.

Tool Installation

Log into your server and Install the required tools using:

yum install vztt-build -y

Application Templates

To create an Application Template (not to be confused with an OS template), log into the hardware node, cd to /root and create a metafile for the application, in this example a “salt-minion” application template wil be created to install the client for the configuration manager SaltStack.

First the metafile......

cd /root
vi salt-minion.metafile
 
Then the pre-install script (in this example).....

cd /root 
vi salt-minion.pre-install-script

Finally we will create the post install file....
cd /root 
vi salt-minion.post-install-script
 

In the meta file (salt-minion.metafile), create the following entries and change as needed for the specific application, this example used the EPEL repository to retrieve the required package dependencies:

%appname
salt-minion
%version
1
%release
2
%osname
centos
%osver
7
%osarch
x86_64
%packages
salt-minion
%repositories
http://download.fedoraproject.org/pub/epel/7/x86_64
%description
Salt Minion for Centos 7

In this example we need have a pre-installation script (salt-minion.pre-install-script) which creates the EPEL repo in the container before trying to deploy the application, the file will be called salt-minion.pre-installation-script and contains 1 line:

vi salt-minion.pre-install-script
yum -y install epel-release
:wq!


vi salt-minion.post-install-script

sed -i 's/^#master: salt/master: salt.myhost.com/' /etc/salt/minion
systemctl enable salt-minion
systemctl start salt-minion
:wq!

Building the Application template

Once the required files are ready, use the build tool as follows (note this is one line):

vzmktmpl --pre-install salt-minion.pre-install.script
--post-install salt-minion.post-install.script 
salt-minion.metafile

This will create an RPM file crafted from the parameters in the metafile.

Install into local repo

vzpkg install template salt-minion-centos-7-x86_64-ez-1.2.noarch.rpm

If you are making changes to an already installed package, you should delete the old package using:

rpm -e salt-minion-centos-7-x86_64-ez-1.2

Deploying your package

To now deploy your new package to a container (in this example CTID is 115):

vzpkg install 115 salt-minion

Moving Forward

You can also specify post-installation option and a range of others as stated in the PDF guide mentioned below. I only needed to get the repo installed in the container and then this specific package and its dependencies.

You can also install this into PBA-S and it can be deployed by the Parallels Business Automation software during container creation.

 

-oOo-

Advertisements