Changes

Jump to: navigation, search

OS template cache preparation

1,068 bytes added, 06:27, 23 October 2011
m
Protected "OS template cache preparation": Excessive vandalism ([edit=autoconfirmed] (indefinite) [move=autoconfirmed] (indefinite))
This article describes the procedure of an OS template cache creationpreparation. Is It assumes you already have OpenVZ installed and running. The steps needed to achieve it are documented in the [[Quick installation]] document. == Precreated templates == Use precreated templates taken from [http://openvz.org/download/template/cache Downloads » Templates » Precreated], or directly from [http://download.openvz.org/template/precreated/ download.openvz.org/template/precreated], or from one of the [[Download mirrors|mirrors]]. Precreated templates can be easily updated using the following algorithm:# create temporary [[container]] based on template# update [[container]] using OS-specific tools (yum, apt or similar)# pack [[container]] as a new templateExamples of this procedure are described in details at [[Updating Ubuntu template]], [[Updating Debian template]], [[Fedora template update]] 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 (for Debian/Ubuntu it might be <tt>/var/lib/vz/template/cache</tt>). == Next step == Follow on to the [[container creation]] article. = Obsoleted: use template tools = {{Warning|The rest of this document is obsoleted and is kept here for historical purposes only. Template utilities (vzpkg/vzyum) are no longer supported. Use [[Download/template/precreated|precreated templates]].}}
== Terminology ==
Please make sure you understand these the following 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 is 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).  ==== Using yum ====<pre># yum install vzpkg vzyum vzrpm43-python vzrpm44-python vzctl-lib</pre> ==== Using rpm ====Packages are available from [http://openvz.org/download/template/utils/ Download » Templates » Utilities]. You need both <tt>vzpkg</tt> and <tt>vzyum</tt> packages, as well as one of (or both) <tt>vzrpm43</tt>/<tt>vzrpm44</tt> (including their <tt>-python</tt> counterparts), depending on the OS templates being used.
Install these utilities using rpm:
<pre>
#rpm -ihv vzpkg*.rpm vzyum*.rpm vzrpm44*.rpm
</pre>
 
In Red Hat Enterprise Linux, to install <tt>vzyum</tt> you will need <tt>[http://rpmfind.net/linux/rpm2html/search.php?query=python-elementtree&system=redhat python-elementtree]</tt>, <tt>[http://rpmfind.net/linux/rpm2html/search.php?query=python-sqlite&system=redhat python-sqlite]</tt>, and <tt>[http://rpmfind.net/linux/rpm2html/search.php?query=python-urlgrabber&system=redhat python-urlgrabber]</tt>. These packages might have dependencies of their own. For example, <tt>python-sqlite</tt> needs <tt>[http://rpmfind.net/linux/rpm2html/search.php?query=sqlite&system=redhat sqlite]</tt>.
=== 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:
==== Using yum ====
To see which templates are available, run
<pre>
# rpm -ihv yum search vztmpl-*.rpm
</pre>
=== Installing repository cache (optional) ===To install some of the templates, run<pre># yum install vztmpl-XXX [...]</pre>
Optionally, you may want to get a snapshot of the local copy of the package repository for ==== Using rpm ====Get the chosen OS template(s). This is not required but might speed up the initial OS template cache creation considerably. The tarballs are available <tt>vztmpl-*</tt> packages from [http://openvz.org/download/template/repocachemetadata/ Downloads » Templates » Repo CacheMetadata]; (or directly from [http://download and untar them to the <tt>.openvz.org/template/metadata/vzdownload.openvz.org/template</tt> directory on your OpenVZ metadata] or one of the [[Hardware NodeDownload mirrors|mirrors]]. If you choose to skip this step, all the needed files will be downloaded from the Internet automatically when needed.and install them:
=== Running <ttpre>vzpkgcache# rpm -ihv vztmpl-*.rpm</ttpre> ===
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:=== Running <tt>vzpkgcache<//openvz.org/download/template/cache Downloads » Templates » Precreated], or directly from [http://download.openvz.org/template/precreated/ download.openvz.org/template/precreated], or from one of the [[Download mirrors|mirrors]].tt> ===
However, this option is not recommended Run the <tt>vzpkgcache</tt> utility; see the vzpkgcache(8) man page for production systems since without installing template metadata you details. It will not be able to create or update your template the caches of all the templates for which the corresponding metadata exist. Before cachecreation be sure that you are set up all necessary locales for rpm (see [[Locales inside VE]]).
In order to use precreated template cache files, download files for chosen OS distributions and place them as # vzpkgcache centos-is (no unpacking needed) to the <tt>/vz/template/cache</tt> directory. == Next step ==4-i386-minimal
Follow on to the [[VE creation]] article.
[[Category: Installation]]
[[Category: Templates]]

Navigation menu