Changes

Jump to: navigation, search

OS template cache preparation

2,986 bytes added, 10:54, 14 June 2006
created
This article describes the procedure of an OS template cache creation. Is assumes you already have OpenVZ installed and running. The steps needed to achieve it are documented in the [[Quick installation]] document.

== Terminology ==

Please make sure you understand these terms:

* [[OS template]]
* [[OS template metadata]]
* [[OS template cache]]

== Creating an OS template cache ==
You can create an [[OS template cache]] using template utilities and [[OS template metadata]] right on your [[hardware node]]. The process it automated and will take from about 10 minutes to a few hours, depending on the network speed, and the result will be most up-to-date template cache.

=== Installing template utilities ===

You have to install a few packages in order to be able to create/update OS template cache(s). Packages are available from [http://openvz.org/download/template/utils/ Download » Templates » Utilities]. You need both vzpkg and vzyum packages, as well as one of (or both) vzrpm43/vzrpm44 (including their -python counterparts), depending on OS templates being used.

Install these utilities using rpm:

<pre>
#rpm -ihv vzpkg*.rpm vzyum*.rpm vzrpm44*.rpm
</pre>

=== Installing OS template metadata ===

To create an [[OS template cache]], you need to get the [[OS template metadata|metadata]] for the chosen OS template(s). Get the chosen <tt>vztmpl-*</tt> packages from [http://openvz.org/download/template/metadata/ Downloads » Templates » Metadata] and install them:

<pre>
# rpm -ihv vztmpl-*.rpm
</pre>

=== Installing repository cache (optional) ===

Optionally, you may want to get a snapshot of the local copy of the package repository for the chosen OS template(s). This is not required but might speed up the initial OS template cache creation considerably. The tarballs are available from [http://openvz.org/download/template/repocache/ Downloads » Templates » Repo Cache]; download and untar them to the <tt>/vz/template</tt> directory on your OpenVZ [[Hardware Node]]. If you choose to skip this step, all the needed files will be downloaded from the Internet automatically when needed.

=== Running <tt>vzpkgcache</tt> ===

Run the <tt>vzpkgcache</tt> utility; see the vzpkgcache(8) man page for details. It will create or update the caches of all the templates for which the corresponding metadata exist.

== Alternative: use precreated template cache ==

As an alternative to creating a cache using template metadata, you can use precreated template cache taken from [http://openvz.org/download/template/cache Downloads » Templates » Precreated]. However, this option is not recommended for production systems since without installing template metadata you will not be able to update your template cache.

In order to use precreated template cache files, download files for chosen OS distributions and place them as-is (no unpacking needed) to the <tt>/vz/template/cache</tt> directory.

== Next step ==

Follow on to the [[VE creation]] article.

Navigation menu