User`s guide
Managing Templates 43
List of packages this template comprises
Locations of (network) package repositories
Scripts needed to be executed on various stages of template installation
Public GPG key(s) needed to check signatures of packages
Additional OpenVZ-specific packages
In order to operate with a template, you should first create its metadata (available from
http://openvz.org/download/template/metadata/). The the vzpkgcache utility should be run in
order to actually create the template cache. It downloads all the packages this template
comprises from the network repositories for the given distribution and installs these packages to
a temporary VPS, which is then packed into a tar archive to be used later during the creation of
new VPSs.
Since this process involves downloading a lot of files (about 400 files, up to 200 Mb in total for
a typical distribution) from the Internet, it might be sped up using a snapshot of an already
fetched repository for a given distribution. Such snapshots are available from
http://openvz.org/download/template/repocache/, they are to be unpacked into the
/vz/template directory. Please note that this step is optional.
In case a template cache (i.e. a tar archive) already exists,
vzpkgcache tries to bring it up to
date by applying the latest updates available from a distribution repository. Since nowadays
Linux distributions are updated quite frequently, it makes sense to run this utility from time to
time, or at least before doing mass VPS creation.
If there is no need to process all templates, template names can be specified after vzpkgcache
in the command line, e.g. the following command creates or updates the cache for the Fedora
Core 4 template only:
# vzpkgcache fedora-core-4
When the template cache is ready, it can be installed into a VPS or, in other words, a VPS can
be created on the basis of a template. This is performed by the
vzctl create --
ostemplate name
command, where name is template name (e.g. fedora-core-4).