Changes

Jump to: navigation, search

OS template cache preparation

756 bytes removed, 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. 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 ==
</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.
Note - The cache may be out of date meaning you end up downloading them all again anyway.
=== 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. Before cache creation be sure that you are set up all necessary locales for rpm (see [[Locales inside VE]]).
# vzpkgcache centos-4-i386-minimal
== 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], 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 template
Examples 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.
 
'''NOTE:''' If you use precreated CentOS-4 templates and wish to install software using vzyum, you will probably run into error like this:
 
[root@localhost tmp]# vzyum CTID install mypackage
[root@localhost tmp]# ERROR: No such OS template: install
 
This might apply to Fedora also. To fix this problem, install the appropriate [[OS template metadata]] on the OpenVZ host, for example
 
yum install vztmpl-centos-4
 
== Next step ==
 
Follow on to the [[VE creation]] article.
[[Category: Installation]]
[[Category: Templates]]

Navigation menu