Next Previous Contents

1. The Template Directory

This section explains the template directory and how to configure it using virt_template.pl and virt_template.conf.

1.1 Why do I need a template directory?

To save hard drive space and for better, faster execution Virtfs uses a template directory. This is explained more in the Virtfs User Guide but what this does is create a directory (/virtual/template) which contains system files copied over from the main server.

Each time a virtual server is created, the files for the server are hard linked from the template directory.

1.2 How do I configure which files should be copied over from the main server to the template directory?

Within the virt_template.conf you can edit which files should be copied over. Each directory has a list of files seperated by a single space. For example for the /etc/ directory:

bin_files = ls echo bash cat hostname cp chgrp chown chmod tcsh grep gawk more sed \
sleep pwd ping ps mkdir mail ln rmdir rm sh su tar touch vi fgrep 

Any other directories which are not listed can be copied over by editing the <Custom Template> section of virt_template.pl. You can do this by using !!template. Similar to virt.conf, !!template represents the template directory path. For example, if you were to enter:

cp -a /lib !!template
cp -dp  /usr/lib/* !!template/usr/lib
this translates to:
cp -a /lib /virtual/template
cp -dp /usr/lib/* /virtual/template/usr/lib

(If you have set up /virtual/template as the template directory - the above example is in the default virt_template.conf)


Next Previous Contents