<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openvz.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Gjanssens</id>
	<title>OpenVZ Virtuozzo Containers Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openvz.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Gjanssens"/>
	<link rel="alternate" type="text/html" href="https://wiki.openvz.org/Special:Contributions/Gjanssens"/>
	<updated>2026-05-15T13:47:05Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.1</generator>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Fedora_template_update&amp;diff=4166</id>
		<title>Fedora template update</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Fedora_template_update&amp;diff=4166"/>
		<updated>2008-02-26T11:12:52Z</updated>

		<summary type="html">&lt;p&gt;Gjanssens: VE-&amp;gt;container&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article describes the procedure of manual template update, using Fedora template as an example.&lt;br /&gt;
&lt;br /&gt;
This is useful in the case you have some precreated template which is a bit old, and you want to create many [[container]]s based on it. To escape the updating of all those new [[container]]s right after their creation, it makes sense to update the template itself.&lt;br /&gt;
&lt;br /&gt;
The idea is simple: you create a temporary [[container]], start it, run the update cycle and then pack the results into a tarball. Some caution must be taken in order for this tarball to be clean though.&lt;br /&gt;
&lt;br /&gt;
The below instructions are for updating Fedora 7 template for PPC architecture, using VEIDs 111 and 222 as temporary [[container]]s. Please substitute your own VEIDs and template names.&lt;br /&gt;
&lt;br /&gt;
== Creating/starting a temporary container ==&lt;br /&gt;
&lt;br /&gt;
You should create a temporary [[container]] first.&lt;br /&gt;
&lt;br /&gt;
 # vzctl create 111 --ostemplate fedora-7-ppc-minimal &lt;br /&gt;
&lt;br /&gt;
Next you should assign a proper IP address to it. This IP does not have to be public -- see [[Using NAT for VE with private IPs]].&lt;br /&gt;
 # vzctl set 111 --ipadd 10.0.0.111 --save&lt;br /&gt;
&lt;br /&gt;
Finally, start your new [[container]]:&lt;br /&gt;
 # vzctl start 111&lt;br /&gt;
&lt;br /&gt;
== Updating a container ==&lt;br /&gt;
&lt;br /&gt;
First, enter a [[container]]:&lt;br /&gt;
 # vzctl enter 111&lt;br /&gt;
&lt;br /&gt;
Check that you can access Internet:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# ping -c 1 www.ru &lt;br /&gt;
PING www.ru (194.87.0.50) 56(84) bytes of data.&lt;br /&gt;
64 bytes from www.ru (194.87.0.50): icmp_seq=1 ttl=56 time=1.92 ms&lt;br /&gt;
&lt;br /&gt;
--- www.ru ping statistics ---&lt;br /&gt;
1 packets transmitted, 1 received, 0% packet loss, time 0ms&lt;br /&gt;
rtt min/avg/max/mdev = 1.920/1.920/1.920/0.000 ms&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, run the update procedure:&lt;br /&gt;
 # yum -y update&lt;br /&gt;
&lt;br /&gt;
As this can take a few minutes or even hours, this is good time to go make some coffee.&lt;br /&gt;
&lt;br /&gt;
== Clean up ==&lt;br /&gt;
&lt;br /&gt;
Сlean the yum repository inside a [[container]] to minimize:&lt;br /&gt;
 # yum clean all&lt;br /&gt;
&lt;br /&gt;
Еxit from a [[container]] and stop it:&lt;br /&gt;
&lt;br /&gt;
 # logout&lt;br /&gt;
 exited from VE 111&lt;br /&gt;
 # vzctl stop 111&lt;br /&gt;
&lt;br /&gt;
Remove the IP from the [[container]]:&lt;br /&gt;
 # vzctl set 111 --ipdel all --save&lt;br /&gt;
&lt;br /&gt;
== Packing a new template cache ==&lt;br /&gt;
&lt;br /&gt;
Now, rename or remove the existing template cache:&lt;br /&gt;
 # mv /vz/template/cache/fedora-7-ppc-minimal.tar.gz /vz/template/cache/fedora-7-ppc-minimal.tar.gz-old&lt;br /&gt;
&lt;br /&gt;
Now create a new tarball:&lt;br /&gt;
 # cd /vz/private/111&lt;br /&gt;
 # tar czf /vz/template/cache/fedora-7-ppc-minimal.tar.gz .&lt;br /&gt;
&lt;br /&gt;
Clean up:&lt;br /&gt;
 # vzctl destroy 111&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
First, compare the sizes of the old and the new template caches:&lt;br /&gt;
 # ls -lh /vz/template/cache/fedora-7-ppc-minimal*&lt;br /&gt;
 -rw-r--r-- 1 root root  99M 2007-11-13 18:11 /vz/template/cache/fedora-7-ppc-minimal.tar.gz&lt;br /&gt;
 -rw-r--r-- 1 root root  91M 2007-08-31 02:46 /vz/template/cache/fedora-7-ppc-minimal.tar.gz-old&lt;br /&gt;
The sizes should not differ much.&lt;br /&gt;
&lt;br /&gt;
Try to create and start [[container]] made from your new template:&lt;br /&gt;
 # vzctl create 222 --ostemplate fedora-7-ppc-minimal&lt;br /&gt;
 # vzctl set 222 --ipadd 10.0.0.222 --save&lt;br /&gt;
 # vzctl start 222&lt;br /&gt;
 # vzctl enter 222&lt;br /&gt;
&lt;br /&gt;
Now execute a few basic commands to check [[container]] is fine. Examples are: ps ax, rpm -qa, etc.&lt;br /&gt;
&lt;br /&gt;
Finally, clean up the testing [[container]]:&lt;br /&gt;
 # vzctl stop 222&lt;br /&gt;
 # vzctl destroy 222&lt;br /&gt;
 # rm /etc/vz/conf/222.conf.destroyed&lt;br /&gt;
&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Templates]]&lt;/div&gt;</summary>
		<author><name>Gjanssens</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Basic_operations_in_OpenVZ_environment&amp;diff=4163</id>
		<title>Basic operations in OpenVZ environment</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Basic_operations_in_OpenVZ_environment&amp;diff=4163"/>
		<updated>2008-02-25T21:43:13Z</updated>

		<summary type="html">&lt;p&gt;Gjanssens: VE-&amp;gt;container&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article assumes you have already [[Quick installation|installed OpenVZ]] and prepared the [[OS template cache]](s). If not, follow the links to perform the steps needed.&lt;br /&gt;
&lt;br /&gt;
== Create and start a container ==&lt;br /&gt;
&lt;br /&gt;
To create and start a [[container]], run the following commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[host-node]# vzctl create VEID --ostemplate osname&lt;br /&gt;
[host-node]# vzctl set VEID --ipadd a.b.c.d --save&lt;br /&gt;
[host-node]# vzctl set VEID --nameserver a.b.c.d --save&lt;br /&gt;
[host-node]# vzctl start VEID&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here &amp;lt;tt&amp;gt;VEID&amp;lt;/tt&amp;gt; is the numeric ID for the [[container]]; &amp;lt;tt&amp;gt;osname&amp;lt;/tt&amp;gt; is the name of the OS template for the [[container]], and &amp;lt;tt&amp;gt;a.b.c.d&amp;lt;/tt&amp;gt; is the IP address to be assigned to the [[container]].&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[host-node]# vzctl create 101 --ostemplate fedora-core-5-minimal&lt;br /&gt;
[host-node]# vzctl set 101 --ipadd 10.1.2.3 --save&lt;br /&gt;
[host-node]# vzctl set 101 --nameserver 10.0.2.1 --save&lt;br /&gt;
[host-node]# vzctl start 101&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your freshly-created [[container]] should be up and running now; you can see its processes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[host-node]# vzctl exec VEID ps ax&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Enter to and exit from the container ==&lt;br /&gt;
&lt;br /&gt;
To enter [[container]] give the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[host-node]# vzctl enter VEID&lt;br /&gt;
entered into VPS VEID&lt;br /&gt;
[ve]#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To exit from [[container]], just type &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt; and press enter:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[ve]# exit&lt;br /&gt;
exited from VPS VEID&lt;br /&gt;
&lt;br /&gt;
[host-node]#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Stop and destroy the container ==&lt;br /&gt;
&lt;br /&gt;
To stop [[container]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[host-node]# vzctl stop VEID&lt;br /&gt;
Stopping VPS ...&lt;br /&gt;
VPS was stopped&lt;br /&gt;
VPS is unmounted&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to destroy [[container]]:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[host-node]# vzctl destroy VEID&lt;br /&gt;
Destroying VPS private area: /vz/private/VEID&lt;br /&gt;
VPS private area was destroyed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, when you know how to manage your [[container]], learn about [[Resource management]].&lt;br /&gt;
&lt;br /&gt;
[[Category: Installation]]&lt;br /&gt;
[[Category: HOWTO]]&lt;/div&gt;</summary>
		<author><name>Gjanssens</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=OS_template_cache_preparation&amp;diff=4162</id>
		<title>OS template cache preparation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=OS_template_cache_preparation&amp;diff=4162"/>
		<updated>2008-02-25T21:41:01Z</updated>

		<summary type="html">&lt;p&gt;Gjanssens: VE-&amp;gt;container&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article describes the procedure of an OS template cache creation.  It assumes you already have OpenVZ installed and running. The steps needed to achieve it are documented in the [[Quick installation]] document.&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
&lt;br /&gt;
Please make sure you understand these terms:&lt;br /&gt;
&lt;br /&gt;
* [[OS template]]&lt;br /&gt;
* [[OS template metadata]]&lt;br /&gt;
* [[OS template cache]]&lt;br /&gt;
&lt;br /&gt;
== Creating an OS template cache ==&lt;br /&gt;
You can create an [[OS template cache]] using template utilities and [[OS template metadata]] right on your [[hardware node]]. The process 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.&lt;br /&gt;
&lt;br /&gt;
=== Installing template utilities ===&lt;br /&gt;
&lt;br /&gt;
You have to install a few packages in order to be able to create/update OS template cache(s).&lt;br /&gt;
&lt;br /&gt;
==== Using yum ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# yum install vzpkg vzyum vzrpm43-python vzrpm44-python&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Using rpm ====&lt;br /&gt;
Packages are available from [http://openvz.org/download/template/utils/ Download » Templates » Utilities]. You need both &amp;lt;tt&amp;gt;vzpkg&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;vzyum&amp;lt;/tt&amp;gt; packages, as well as one or both &amp;lt;tt&amp;gt;vzrpm43&amp;lt;/tt&amp;gt;/&amp;lt;tt&amp;gt;vzrpm44&amp;lt;/tt&amp;gt; (including their &amp;lt;tt&amp;gt;-python&amp;lt;/tt&amp;gt; counterparts), depending on the OS templates being used.&lt;br /&gt;
&lt;br /&gt;
Install these utilities using rpm:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# rpm -ihv vzpkg*.rpm vzyum*.rpm vzrpm44*.rpm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Red Hat Enterprise Linux, to install &amp;lt;tt&amp;gt;vzyum&amp;lt;/tt&amp;gt; you will need &amp;lt;tt&amp;gt;[http://rpmfind.net/linux/rpm2html/search.php?query=python-elementtree&amp;amp;system=redhat python-elementtree]&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;[http://rpmfind.net/linux/rpm2html/search.php?query=python-sqlite&amp;amp;system=redhat python-sqlite]&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;[http://rpmfind.net/linux/rpm2html/search.php?query=python-urlgrabber&amp;amp;system=redhat python-urlgrabber]&amp;lt;/tt&amp;gt;. These packages might have dependencies of their own. For example, &amp;lt;tt&amp;gt;python-sqlite&amp;lt;/tt&amp;gt; needs &amp;lt;tt&amp;gt;[http://rpmfind.net/linux/rpm2html/search.php?query=sqlite&amp;amp;system=redhat sqlite]&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Installing OS template metadata ===&lt;br /&gt;
&lt;br /&gt;
To create an [[OS template cache]], you need to get the [[OS template metadata|metadata]] for the chosen OS template(s).&lt;br /&gt;
&lt;br /&gt;
==== Using yum ====&lt;br /&gt;
To see which templates are available, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# yum search vztmpl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To install some of the templates, run&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# yum install vztmpl-XXX [...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Using rpm ====&lt;br /&gt;
Get the chosen &amp;lt;tt&amp;gt;vztmpl-*&amp;lt;/tt&amp;gt; packages from [http://openvz.org/download/template/metadata/ Downloads » Templates » Metadata] (or directly from [http://download.openvz.org/template/metadata/ download.openvz.org/template/metadata] or one of the [[Download mirrors|mirrors]] and install them:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# rpm -ihv vztmpl-*.rpm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installing repository cache (optional) ===&lt;br /&gt;
&lt;br /&gt;
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 &amp;lt;tt&amp;gt;/vz/template&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
Note - The cache may be out of date meaning you end up downloading them all again anyway.&lt;br /&gt;
&lt;br /&gt;
=== Running &amp;lt;tt&amp;gt;vzpkgcache&amp;lt;/tt&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Run the &amp;lt;tt&amp;gt;vzpkgcache&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
 # vzpkgcache centos-4-i386-minimal&lt;br /&gt;
&lt;br /&gt;
== Alternative: use precreated template cache ==&lt;br /&gt;
&lt;br /&gt;
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]].&lt;br /&gt;
&lt;br /&gt;
Precreated templates can be easily updated using the following algorithm:&lt;br /&gt;
# create temporary [[container]] based on template&lt;br /&gt;
# update [[container]] using OS-specific tools (yum, apt or similar)&lt;br /&gt;
# pack [[container]] as a new template&lt;br /&gt;
Examples of this procedure are described in details at [[Updating Ubuntu template]], [[Updating Debian template]], [[Fedora template update]]&lt;br /&gt;
&lt;br /&gt;
In order to use precreated template cache files, download files for chosen OS distributions and place them as-is (no unpacking needed) to the &amp;lt;tt&amp;gt;/vz/template/cache&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' If you use precreated CentOS-4 templates and wish to install software using vzyum, you will probably run into error like this:&lt;br /&gt;
&lt;br /&gt;
 [root@localhost tmp]# vzyum MYVPSID install mypackage&lt;br /&gt;
 [root@localhost tmp]# ERROR: No such OS template: install&lt;br /&gt;
&lt;br /&gt;
This might apply to Fedora also. To fix this problem, install the appropriate [[OS template metadata]] on the OpenVZ host, for example&lt;br /&gt;
&lt;br /&gt;
 yum install vztmpl-centos-4&lt;br /&gt;
&lt;br /&gt;
== Next step ==&lt;br /&gt;
&lt;br /&gt;
Follow on to the [[VE creation]] article.&lt;br /&gt;
&lt;br /&gt;
[[Category: Installation]]&lt;br /&gt;
[[Category: Templates]]&lt;/div&gt;</summary>
		<author><name>Gjanssens</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Using_vzpkg_and_vzyum_on_x86_64&amp;diff=4161</id>
		<title>Using vzpkg and vzyum on x86 64</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Using_vzpkg_and_vzyum_on_x86_64&amp;diff=4161"/>
		<updated>2008-02-25T21:04:03Z</updated>

		<summary type="html">&lt;p&gt;Gjanssens: Simplify copy step&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document describes a way to install OpenVZ in a x86_64 computer, so that it can create cache templates, use vzyum and vzrpm.&lt;br /&gt;
This is intended to work in a Centos-4 (tested) or a Fedora Core distribution (not tested).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== THE PROBLEM ==&lt;br /&gt;
&lt;br /&gt;
There is a known problem with &amp;lt;b&amp;gt;vzpkg-2.7.0&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;vzyum-2.4.0&amp;lt;/b&amp;gt; in x86_64 computers:&lt;br /&gt;
Vzyum, vzpkgcache and vzrpm are broken in 64 bit systems, so we are unable to create new cache templates in a x86_64 computer or update each [[container]] using vzyum or vzrpm.&lt;br /&gt;
This text describes a work around and a few hacks to get it work flawless.&lt;br /&gt;
&lt;br /&gt;
{{Note| The basic idea is to change the code in such a way that vzyum and vzrpm use the real yum and rpm to do the job, and also create new x86_64 paths required by the system.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== REQUIREMENTS ==&lt;br /&gt;
&lt;br /&gt;
* - A x86_64 computer&lt;br /&gt;
* - Centos-4 distribution (or Fedora Core 3, 4 or 5 - not tested).&lt;br /&gt;
* - Yum package installed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SIDE EFFECTS ==&lt;br /&gt;
&lt;br /&gt;
Until now there is only one &amp;lt;i&amp;gt;side effect&amp;lt;/i&amp;gt; detected in this solution:&lt;br /&gt;
* The yum cache is not common to all [[container]]s. Instead, each [[container]] has it's own yum cache in the directory &amp;lt;code&amp;gt;/var/cache/yum-cache&amp;lt;/code&amp;gt;.&lt;br /&gt;
This is a consequence from using the modified vzyum.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== INSTALL Openvz ==&lt;br /&gt;
&lt;br /&gt;
There are two ways to install it:&lt;br /&gt;
&lt;br /&gt;
* A - AUTOMATIC INSTALL (FASTEST)&lt;br /&gt;
* B - MANUAL INSTALL - STEP BY STEP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== A - AUTOMATIC INSTALL (FASTEST) ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;u&amp;gt;General considerations&amp;lt;/u&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* This is a fastest way to install openvz utilities, and template utilities, ready to use in a x86_64 system.&lt;br /&gt;
* You can only use the automatic install IF YOU HAVE YUM AND RPM PACKAGES INSTALLED IN YOUR SYSTEM, and if you want to install a Centos-4 cache template.&lt;br /&gt;
* This process uses a bash script that automatizes all the hard work made by hand in the manual install.&lt;br /&gt;
* If something goes wrong, or if you want to install a diferent cache template, it's better to do the manual install, and try to adapt it to your needs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;u&amp;gt;Procedure&amp;lt;/u&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Read carefully the [[Quick installation]] page and install the openvz kernel, configure the bootloader, change sysctl.conf, and finally reboot your system the way it is described there.&lt;br /&gt;
* Download the file [http://linux.carreira.com.pt/ovzutils/setx86_64-0.2.tar.gz setx86_64] and then untar and run the script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tar xzvf setx86_64.tar.gz&lt;br /&gt;
./setx86_64&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Press Enter and let the script to do all the job for you.&lt;br /&gt;
&lt;br /&gt;
When it finishes with the message &amp;quot;END INSTALL&amp;quot;, you can go on reading this document jumping to the undermentioned &amp;lt;b&amp;gt;[[#STEP_10|STEP 10]]&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;u&amp;gt;Note&amp;lt;/u&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
This script will almost work for CentOS-5, however it's not quite right (you will get some errors). You will also need to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm /usr/share/vzpkgtools/vzrpm43/lib/python2.4/site-packages/rpmmodule.so&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
which will cause it to resolve a dependency using your system wide python implementation&lt;br /&gt;
&lt;br /&gt;
=== B - MANUAL INSTALL -STEP BY STEP ===&lt;br /&gt;
&lt;br /&gt;
If for any reason you prefer manual installation, you may start your install process the same way as described in [[Quick installation]].&lt;br /&gt;
In x86_64, the packages vzpkg, vzyum and vztmpl-* are broken. So, let's install them this way, to avoid problems:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 yum install vzrpm*&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can't &amp;quot;yum install vzyum&amp;quot; because it breaks with an error:&lt;br /&gt;
Error: Missing Dependency: cElementTree.so is needed by package vzyum&lt;br /&gt;
&lt;br /&gt;
So we must download it first and then install it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 wget -c http://download.openvz.org/template/utils/vzyum/2.4.0-11/vzyum-2.4.0-11.noarch.rpm&lt;br /&gt;
 rpm --nodeps -Uvh vzyum*.rpm&lt;br /&gt;
 yum install vztmpl-centos-4 vzpkg*&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== TWEAKING THE CODE ====&lt;br /&gt;
&lt;br /&gt;
Now let's tweak the code doing it step by step.&lt;br /&gt;
You can do a copy-paste from the next command lines to your system.&lt;br /&gt;
The example is using &amp;lt;b&amp;gt;Centos-4&amp;lt;/b&amp;gt; distribution (tested), but &amp;lt;b&amp;gt;Fedore Core&amp;lt;/b&amp;gt; or other distribution with yum and rpm installed, may be tried, if you change the reference name and version in STEPS 1 to 4 (this was not tested).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 1 =====&lt;br /&gt;
&lt;br /&gt;
If you didn't instal yet &amp;quot;vztmpl-centos-4&amp;quot;, do it now:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 yum install vztmpl-centos-4&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 2 =====&lt;br /&gt;
&lt;br /&gt;
The template installed is a i386 template. So, we need to create a x86_64 template from the i386.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 cd /vz/template/centos/4/&lt;br /&gt;
 cp -a i386 x86_64&lt;br /&gt;
 cd /vz/template/centos/4/x86_64/config&lt;br /&gt;
 sed -i.tmp 's/i386/x86_64/g' yum.conf&lt;br /&gt;
 rm -f yum.conf.tmp&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we have a x86_64 centos template installed.&lt;br /&gt;
&lt;br /&gt;
===== STEP 3 =====&lt;br /&gt;
&lt;br /&gt;
Edit the file &amp;lt;code&amp;gt;/vz/template/centos/4/x86_64/config/yum.conf&amp;lt;/code&amp;gt; with your editor.&lt;br /&gt;
Change the line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cachedir=/vz/template/centos/4/x86_64/yum-cache&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cachedir=/var/cache/yum-cache&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note| With this changes, vzyum is not going to be able to use a common cache directory to all [[container]]s as it was used to do. Each [[container]] will have it's own cache directory.&lt;br /&gt;
To avoid to have a directory named /vz/template/centos/4/x86_64/yum-cache in each [[container]], it is preferable to use the correct cache directory /var/cache/yum-cache.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 4 =====&lt;br /&gt;
&lt;br /&gt;
If you list the directory vz-addons like this:&lt;br /&gt;
&lt;br /&gt;
 ls -l /vz/template/centos/4/x86_64/vz-addons&lt;br /&gt;
&lt;br /&gt;
probably you will see the file MAKEDEV-3.3.13-1.3.swsoft.i386.rpm.&lt;br /&gt;
This &amp;quot;ls&amp;quot; allows us to confirm which MAKEDEV version we need to use in this step.&lt;br /&gt;
&lt;br /&gt;
Edit the files &amp;lt;b&amp;gt;minimal.list&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;default.list&amp;lt;/b&amp;gt; in /vz/template/centos/4/x86_64/config directory, and change the line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MAKEDEV&lt;br /&gt;
&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
MAKEDEV-3.3.13 (or the version you saw in the &amp;quot;ls&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 5 =====&lt;br /&gt;
&lt;br /&gt;
Verify if you have &amp;lt;b&amp;gt;rpm-python&amp;lt;/b&amp;gt; installed in your system, because it has 64 bit module needed:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpm -q rpm-python&lt;br /&gt;
rpm-python-4.3.3-18_nonptl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install it if you didn't do it already:&lt;br /&gt;
 yum install rpm-python&lt;br /&gt;
&lt;br /&gt;
Substitute 32 bit module &amp;quot;rpmmodule.so&amp;quot; from vzrpm43-python to the 64 bit module that rpm-python-x86_64 provides, using this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /usr/share/vzpkgtools/vzrpm43/lib/python2.3/site-packages/&lt;br /&gt;
cp /usr/lib64/python2.3/site-packages/rpmmodule.so .&lt;br /&gt;
cp: overwrite `./rpmmodule.so'? y&lt;br /&gt;
cd /usr/share/vzpkgtools/vzrpm43/lib/python2.3/site-packages/rpmdb&lt;br /&gt;
cp /usr/lib64/python2.3/site-packages/rpmdb/_rpmdb.so .&lt;br /&gt;
cp: overwrite `./_rpmdb.so'? y&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For CentOS-5, you will need to do something a bit different. &amp;quot;rpmmodule.so&amp;quot; is provided in your sitewide python distribution, so instead of copying it across, you need to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm /usr/share/vzpkgtools/vzrpm43/lib/python2.4/site-packages/rpmmodule.so&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we must edit and change these 3 files described in the next steps:&lt;br /&gt;
&lt;br /&gt;
/usr/share/vzpkg/&amp;lt;b&amp;gt;cache-os&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/usr/share/vzpkg/&amp;lt;b&amp;gt;functions&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/usr/bin/&amp;lt;b&amp;gt;vzyum&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== STEP 6 =====&lt;br /&gt;
&lt;br /&gt;
Edit the file /usr/share/vzpkg/&amp;lt;b&amp;gt;cache-os&amp;lt;/b&amp;gt;&lt;br /&gt;
Change the next lines:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 136:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: --vps=$VEID check-update&lt;br /&gt;
to: check-update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 185:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: YUM_CMD=&amp;quot;--installroot=$VE_ROOT --vps=$VEID $YUM_CONF_FILE -y $YUM_CMD&amp;quot;&lt;br /&gt;
to: YUM_CMD=&amp;quot;--installroot=$VE_ROOT $YUM_CONF_FILE -y $YUM_CMD&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 7 =====&lt;br /&gt;
&lt;br /&gt;
Edit the file /usr/share/vzpkg/&amp;lt;b&amp;gt;functions&amp;lt;/b&amp;gt;&lt;br /&gt;
Change the next lines:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 21:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: YUM=/usr/share/vzyum/bin/yum&lt;br /&gt;
to: YUM=`which yum`&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 22:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: ARCHES=&amp;quot;x86 i386 x86_64 ia64&amp;quot;&lt;br /&gt;
to: ARCHES=&amp;quot;i386 x86_64 ia64 x86&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 111:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: export RPM=`get_rpm $tdir`&lt;br /&gt;
to: export RPM=`which rpm`&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 450:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: rpm=`get_rpm $tdir`&lt;br /&gt;
to: rpm=`which rpm`&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 8 =====&lt;br /&gt;
&lt;br /&gt;
Edit the file /usr/bin/&amp;lt;b&amp;gt;vzyum&amp;lt;/b&amp;gt;&lt;br /&gt;
Change the next line:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 51:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: YUM_ARGS=&amp;quot;$YUM_ARGS --installroot $VE_ROOT --vps=$VEID&amp;quot;&lt;br /&gt;
to: YUM_ARGS=&amp;quot;$YUM_ARGS --installroot $VE_ROOT&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 9 =====&lt;br /&gt;
&lt;br /&gt;
Edit file /usr/bin/&amp;lt;b&amp;gt;vzrpm&amp;lt;/b&amp;gt;&lt;br /&gt;
Change the next line:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 40:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: RPM_ARGS=&amp;quot;--root $VE_ROOT --veid $VEID&amp;quot;&lt;br /&gt;
to: RPM_ARGS=&amp;quot;--root $VE_ROOT&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 52:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: RPM=`get_rpm $TDIR`&lt;br /&gt;
to: RPM=`which rpm`&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 10 =====&lt;br /&gt;
&lt;br /&gt;
If you want your [[container]]s to have other country locales&lt;br /&gt;
edit &amp;lt;code&amp;gt;/vz/template/centos/4/x86_64/config/.rpmmacros&amp;lt;/code&amp;gt; and change the line &amp;lt;b&amp;gt;%_install_langs C&amp;lt;/b&amp;gt;&lt;br /&gt;
to the language you want, for example:&lt;br /&gt;
&lt;br /&gt;
%_install_langs C:pt_PT:pt_PT.UTF-8:en_US:en_US.UTF-8&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== TESTING THE NEW CODE ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you can create your own template caches from your own templates.&lt;br /&gt;
Let's test it!&lt;br /&gt;
&lt;br /&gt;
Make my first two template caches:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 vzpkgcache -f centos-4-x86_64-default&lt;br /&gt;
 vzpkgcache -f centos-4-x86_64-minimal&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They finish with complaints about &amp;lt;i&amp;gt;cron.daily&amp;lt;/i&amp;gt;, but don't worry about it.&lt;br /&gt;
Now &amp;lt;b&amp;gt;minimal&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;default&amp;lt;/b&amp;gt; cache are created. Confirm if they are created:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 vzpkgls -c&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you see the cache list, then you can create your first [[container]]:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 vzctl create 200 --ostemplate centos-4-x86_64-minimal&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To change the &amp;lt;i&amp;gt;locales&amp;lt;/i&amp;gt;, copy &amp;lt;code&amp;gt;/etc/sysconfig/i18n&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/vz/private/200/etc/sysconfig&amp;lt;/code&amp;gt;, if you wish to use another language and have done STEP 10 previously.&lt;br /&gt;
&lt;br /&gt;
Now start [[container]] 200 previously created:&lt;br /&gt;
&lt;br /&gt;
 vzctl start 200&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then test also &amp;quot;vzyum&amp;quot; and see if it works. Try to install &amp;quot;nano editor&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 vzyum 200 install nano&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Try to use vzrpm, to list all rpm's installed in [[container]] 200:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 vzrpm 200 -qa&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you didn't have any errors, the changes are fine.&lt;br /&gt;
&lt;br /&gt;
If something went wrong, probably you made a mistake in those previous steps. &lt;br /&gt;
Carefully verify if you did it well, step by step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Templates]]&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Troubleshooting]]&lt;/div&gt;</summary>
		<author><name>Gjanssens</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Using_vzpkg_and_vzyum_on_x86_64&amp;diff=4160</id>
		<title>Using vzpkg and vzyum on x86 64</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Using_vzpkg_and_vzyum_on_x86_64&amp;diff=4160"/>
		<updated>2008-02-25T20:33:28Z</updated>

		<summary type="html">&lt;p&gt;Gjanssens: Punctuation correction&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document describes a way to install OpenVZ in a x86_64 computer, so that it can create cache templates, use vzyum and vzrpm.&lt;br /&gt;
This is intended to work in a Centos-4 (tested) or a Fedora Core distribution (not tested).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== THE PROBLEM ==&lt;br /&gt;
&lt;br /&gt;
There is a known problem with &amp;lt;b&amp;gt;vzpkg-2.7.0&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;vzyum-2.4.0&amp;lt;/b&amp;gt; in x86_64 computers:&lt;br /&gt;
Vzyum, vzpkgcache and vzrpm are broken in 64 bit systems, so we are unable to create new cache templates in a x86_64 computer or update each [[container]] using vzyum or vzrpm.&lt;br /&gt;
This text describes a work around and a few hacks to get it work flawless.&lt;br /&gt;
&lt;br /&gt;
{{Note| The basic idea is to change the code in such a way that vzyum and vzrpm use the real yum and rpm to do the job, and also create new x86_64 paths required by the system.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== REQUIREMENTS ==&lt;br /&gt;
&lt;br /&gt;
* - A x86_64 computer&lt;br /&gt;
* - Centos-4 distribution (or Fedora Core 3, 4 or 5 - not tested).&lt;br /&gt;
* - Yum package installed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SIDE EFFECTS ==&lt;br /&gt;
&lt;br /&gt;
Until now there is only one &amp;lt;i&amp;gt;side effect&amp;lt;/i&amp;gt; detected in this solution:&lt;br /&gt;
* The yum cache is not common to all [[container]]s. Instead, each [[container]] has it's own yum cache in the directory &amp;lt;code&amp;gt;/var/cache/yum-cache&amp;lt;/code&amp;gt;.&lt;br /&gt;
This is a consequence from using the modified vzyum.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== INSTALL Openvz ==&lt;br /&gt;
&lt;br /&gt;
There are two ways to install it:&lt;br /&gt;
&lt;br /&gt;
* A - AUTOMATIC INSTALL (FASTEST)&lt;br /&gt;
* B - MANUAL INSTALL - STEP BY STEP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== A - AUTOMATIC INSTALL (FASTEST) ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;u&amp;gt;General considerations&amp;lt;/u&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* This is a fastest way to install openvz utilities, and template utilities, ready to use in a x86_64 system.&lt;br /&gt;
* You can only use the automatic install IF YOU HAVE YUM AND RPM PACKAGES INSTALLED IN YOUR SYSTEM, and if you want to install a Centos-4 cache template.&lt;br /&gt;
* This process uses a bash script that automatizes all the hard work made by hand in the manual install.&lt;br /&gt;
* If something goes wrong, or if you want to install a diferent cache template, it's better to do the manual install, and try to adapt it to your needs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;u&amp;gt;Procedure&amp;lt;/u&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Read carefully the [[Quick installation]] page and install the openvz kernel, configure the bootloader, change sysctl.conf, and finally reboot your system the way it is described there.&lt;br /&gt;
* Download the file [http://linux.carreira.com.pt/ovzutils/setx86_64-0.2.tar.gz setx86_64] and then untar and run the script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tar xzvf setx86_64.tar.gz&lt;br /&gt;
./setx86_64&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Press Enter and let the script to do all the job for you.&lt;br /&gt;
&lt;br /&gt;
When it finishes with the message &amp;quot;END INSTALL&amp;quot;, you can go on reading this document jumping to the undermentioned &amp;lt;b&amp;gt;[[#STEP_10|STEP 10]]&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;u&amp;gt;Note&amp;lt;/u&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
This script will almost work for CentOS-5, however it's not quite right (you will get some errors). You will also need to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm /usr/share/vzpkgtools/vzrpm43/lib/python2.4/site-packages/rpmmodule.so&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
which will cause it to resolve a dependency using your system wide python implementation&lt;br /&gt;
&lt;br /&gt;
=== B - MANUAL INSTALL -STEP BY STEP ===&lt;br /&gt;
&lt;br /&gt;
If for any reason you prefer manual installation, you may start your install process the same way as described in [[Quick installation]].&lt;br /&gt;
In x86_64, the packages vzpkg, vzyum and vztmpl-* are broken. So, let's install them this way, to avoid problems:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 yum install vzrpm*&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can't &amp;quot;yum install vzyum&amp;quot; because it breaks with an error:&lt;br /&gt;
Error: Missing Dependency: cElementTree.so is needed by package vzyum&lt;br /&gt;
&lt;br /&gt;
So we must download it first and then install it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 wget -c http://download.openvz.org/template/utils/vzyum/2.4.0-11/vzyum-2.4.0-11.noarch.rpm&lt;br /&gt;
 rpm --nodeps -Uvh vzyum*.rpm&lt;br /&gt;
 yum install vztmpl-centos-4 vzpkg*&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== TWEAKING THE CODE ====&lt;br /&gt;
&lt;br /&gt;
Now let's tweak the code doing it step by step.&lt;br /&gt;
You can do a copy-paste from the next command lines to your system.&lt;br /&gt;
The example is using &amp;lt;b&amp;gt;Centos-4&amp;lt;/b&amp;gt; distribution (tested), but &amp;lt;b&amp;gt;Fedore Core&amp;lt;/b&amp;gt; or other distribution with yum and rpm installed, may be tried, if you change the reference name and version in STEPS 1 to 4 (this was not tested).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 1 =====&lt;br /&gt;
&lt;br /&gt;
If you didn't instal yet &amp;quot;vztmpl-centos-4&amp;quot;, do it now:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 yum install vztmpl-centos-4&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 2 =====&lt;br /&gt;
&lt;br /&gt;
The template installed is a i386 template. So, we need to create a x86_64 template from the i386.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 cd /vz/template/centos/4/&lt;br /&gt;
 mkdir x86_64&lt;br /&gt;
 cp -a /vz/template/centos/4/i386/* /vz/template/centos/4/x86_64&lt;br /&gt;
 cd /vz/template/centos/4/x86_64/config&lt;br /&gt;
 sed -i.tmp 's/i386/x86_64/g' yum.conf&lt;br /&gt;
 rm -f yum.conf.tmp&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we have a x86_64 centos template installed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 3 =====&lt;br /&gt;
&lt;br /&gt;
Edit the file &amp;lt;code&amp;gt;/vz/template/centos/4/x86_64/config/yum.conf&amp;lt;/code&amp;gt; with your editor.&lt;br /&gt;
Change the line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cachedir=/vz/template/centos/4/x86_64/yum-cache&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cachedir=/var/cache/yum-cache&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note| With this changes, vzyum is not going to be able to use a common cache directory to all [[container]]s as it was used to do. Each [[container]] will have it's own cache directory.&lt;br /&gt;
To avoid to have a directory named /vz/template/centos/4/x86_64/yum-cache in each [[container]], it is preferable to use the correct cache directory /var/cache/yum-cache.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 4 =====&lt;br /&gt;
&lt;br /&gt;
If you list the directory vz-addons like this:&lt;br /&gt;
&lt;br /&gt;
 ls -l /vz/template/centos/4/x86_64/vz-addons&lt;br /&gt;
&lt;br /&gt;
probably you will see the file MAKEDEV-3.3.13-1.3.swsoft.i386.rpm.&lt;br /&gt;
This &amp;quot;ls&amp;quot; allows us to confirm which MAKEDEV version we need to use in this step.&lt;br /&gt;
&lt;br /&gt;
Edit the files &amp;lt;b&amp;gt;minimal.list&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;default.list&amp;lt;/b&amp;gt; in /vz/template/centos/4/x86_64/config directory, and change the line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MAKEDEV&lt;br /&gt;
&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
MAKEDEV-3.3.13 (or the version you saw in the &amp;quot;ls&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 5 =====&lt;br /&gt;
&lt;br /&gt;
Verify if you have &amp;lt;b&amp;gt;rpm-python&amp;lt;/b&amp;gt; installed in your system, because it has 64 bit module needed:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpm -q rpm-python&lt;br /&gt;
rpm-python-4.3.3-18_nonptl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install it if you didn't do it already:&lt;br /&gt;
 yum install rpm-python&lt;br /&gt;
&lt;br /&gt;
Substitute 32 bit module &amp;quot;rpmmodule.so&amp;quot; from vzrpm43-python to the 64 bit module that rpm-python-x86_64 provides, using this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /usr/share/vzpkgtools/vzrpm43/lib/python2.3/site-packages/&lt;br /&gt;
cp /usr/lib64/python2.3/site-packages/rpmmodule.so .&lt;br /&gt;
cp: overwrite `./rpmmodule.so'? y&lt;br /&gt;
cd /usr/share/vzpkgtools/vzrpm43/lib/python2.3/site-packages/rpmdb&lt;br /&gt;
cp /usr/lib64/python2.3/site-packages/rpmdb/_rpmdb.so .&lt;br /&gt;
cp: overwrite `./_rpmdb.so'? y&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For CentOS-5, you will need to do something a bit different. &amp;quot;rpmmodule.so&amp;quot; is provided in your sitewide python distribution, so instead of copying it across, you need to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm /usr/share/vzpkgtools/vzrpm43/lib/python2.4/site-packages/rpmmodule.so&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we must edit and change these 3 files described in the next steps:&lt;br /&gt;
&lt;br /&gt;
/usr/share/vzpkg/&amp;lt;b&amp;gt;cache-os&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/usr/share/vzpkg/&amp;lt;b&amp;gt;functions&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/usr/bin/&amp;lt;b&amp;gt;vzyum&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== STEP 6 =====&lt;br /&gt;
&lt;br /&gt;
Edit the file /usr/share/vzpkg/&amp;lt;b&amp;gt;cache-os&amp;lt;/b&amp;gt;&lt;br /&gt;
Change the next lines:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 136:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: --vps=$VEID check-update&lt;br /&gt;
to: check-update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 185:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: YUM_CMD=&amp;quot;--installroot=$VE_ROOT --vps=$VEID $YUM_CONF_FILE -y $YUM_CMD&amp;quot;&lt;br /&gt;
to: YUM_CMD=&amp;quot;--installroot=$VE_ROOT $YUM_CONF_FILE -y $YUM_CMD&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 7 =====&lt;br /&gt;
&lt;br /&gt;
Edit the file /usr/share/vzpkg/&amp;lt;b&amp;gt;functions&amp;lt;/b&amp;gt;&lt;br /&gt;
Change the next lines:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 21:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: YUM=/usr/share/vzyum/bin/yum&lt;br /&gt;
to: YUM=`which yum`&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 22:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: ARCHES=&amp;quot;x86 i386 x86_64 ia64&amp;quot;&lt;br /&gt;
to: ARCHES=&amp;quot;i386 x86_64 ia64 x86&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 111:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: export RPM=`get_rpm $tdir`&lt;br /&gt;
to: export RPM=`which rpm`&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 450:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: rpm=`get_rpm $tdir`&lt;br /&gt;
to: rpm=`which rpm`&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 8 =====&lt;br /&gt;
&lt;br /&gt;
Edit the file /usr/bin/&amp;lt;b&amp;gt;vzyum&amp;lt;/b&amp;gt;&lt;br /&gt;
Change the next line:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 51:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: YUM_ARGS=&amp;quot;$YUM_ARGS --installroot $VE_ROOT --vps=$VEID&amp;quot;&lt;br /&gt;
to: YUM_ARGS=&amp;quot;$YUM_ARGS --installroot $VE_ROOT&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 9 =====&lt;br /&gt;
&lt;br /&gt;
Edit file /usr/bin/&amp;lt;b&amp;gt;vzrpm&amp;lt;/b&amp;gt;&lt;br /&gt;
Change the next line:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 40:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: RPM_ARGS=&amp;quot;--root $VE_ROOT --veid $VEID&amp;quot;&lt;br /&gt;
to: RPM_ARGS=&amp;quot;--root $VE_ROOT&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 52:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: RPM=`get_rpm $TDIR`&lt;br /&gt;
to: RPM=`which rpm`&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 10 =====&lt;br /&gt;
&lt;br /&gt;
If you want your [[container]]s to have other country locales&lt;br /&gt;
edit &amp;lt;code&amp;gt;/vz/template/centos/4/x86_64/config/.rpmmacros&amp;lt;/code&amp;gt; and change the line &amp;lt;b&amp;gt;%_install_langs C&amp;lt;/b&amp;gt;&lt;br /&gt;
to the language you want, for example:&lt;br /&gt;
&lt;br /&gt;
%_install_langs C:pt_PT:pt_PT.UTF-8:en_US:en_US.UTF-8&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== TESTING THE NEW CODE ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you can create your own template caches from your own templates.&lt;br /&gt;
Let's test it!&lt;br /&gt;
&lt;br /&gt;
Make my first two template caches:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 vzpkgcache -f centos-4-x86_64-default&lt;br /&gt;
 vzpkgcache -f centos-4-x86_64-minimal&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They finish with complaints about &amp;lt;i&amp;gt;cron.daily&amp;lt;/i&amp;gt;, but don't worry about it.&lt;br /&gt;
Now &amp;lt;b&amp;gt;minimal&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;default&amp;lt;/b&amp;gt; cache are created. Confirm if they are created:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 vzpkgls -c&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you see the cache list, then you can create your first [[container]]:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 vzctl create 200 --ostemplate centos-4-x86_64-minimal&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To change the &amp;lt;i&amp;gt;locales&amp;lt;/i&amp;gt;, copy &amp;lt;code&amp;gt;/etc/sysconfig/i18n&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/vz/private/200/etc/sysconfig&amp;lt;/code&amp;gt;, if you wish to use another language and have done STEP 10 previously.&lt;br /&gt;
&lt;br /&gt;
Now start [[container]] 200 previously created:&lt;br /&gt;
&lt;br /&gt;
 vzctl start 200&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then test also &amp;quot;vzyum&amp;quot; and see if it works. Try to install &amp;quot;nano editor&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 vzyum 200 install nano&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Try to use vzrpm, to list all rpm's installed in [[container]] 200:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 vzrpm 200 -qa&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you didn't have any errors, the changes are fine.&lt;br /&gt;
&lt;br /&gt;
If something went wrong, probably you made a mistake in those previous steps. &lt;br /&gt;
Carefully verify if you did it well, step by step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Templates]]&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Troubleshooting]]&lt;/div&gt;</summary>
		<author><name>Gjanssens</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Using_vzpkg_and_vzyum_on_x86_64&amp;diff=4159</id>
		<title>Using vzpkg and vzyum on x86 64</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Using_vzpkg_and_vzyum_on_x86_64&amp;diff=4159"/>
		<updated>2008-02-25T20:32:42Z</updated>

		<summary type="html">&lt;p&gt;Gjanssens: Change wording: &amp;quot;cache template&amp;quot; -&amp;gt; &amp;quot;template cache&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document describes a way to install OpenVZ in a x86_64 computer, so that it can create cache templates, use vzyum and vzrpm.&lt;br /&gt;
This is intended to work in a Centos-4 (tested) or a Fedora Core distribution (not tested).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== THE PROBLEM ==&lt;br /&gt;
&lt;br /&gt;
There is a known problem with &amp;lt;b&amp;gt;vzpkg-2.7.0&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;vzyum-2.4.0&amp;lt;/b&amp;gt; in x86_64 computers:&lt;br /&gt;
Vzyum, vzpkgcache and vzrpm are broken in 64 bit systems, so we are unable to create new cache templates in a x86_64 computer or update each [[container]] using vzyum or vzrpm.&lt;br /&gt;
This text describes a work around and a few hacks to get it work flawless.&lt;br /&gt;
&lt;br /&gt;
{{Note| The basic idea is to change the code in such a way that vzyum and vzrpm use the real yum and rpm to do the job, and also create new x86_64 paths required by the system.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== REQUIREMENTS ==&lt;br /&gt;
&lt;br /&gt;
* - A x86_64 computer&lt;br /&gt;
* - Centos-4 distribution (or Fedora Core 3, 4 or 5 - not tested).&lt;br /&gt;
* - Yum package installed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SIDE EFFECTS ==&lt;br /&gt;
&lt;br /&gt;
Until now there is only one &amp;lt;i&amp;gt;side effect&amp;lt;/i&amp;gt; detected in this solution:&lt;br /&gt;
* The yum cache is not common to all [[container]]s. Instead, each [[container]] has it's own yum cache in the directory &amp;lt;code&amp;gt;/var/cache/yum-cache&amp;lt;/code&amp;gt;.&lt;br /&gt;
This is a consequence from using the modified vzyum.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== INSTALL Openvz ==&lt;br /&gt;
&lt;br /&gt;
There are two ways to install it:&lt;br /&gt;
&lt;br /&gt;
* A - AUTOMATIC INSTALL (FASTEST)&lt;br /&gt;
* B - MANUAL INSTALL - STEP BY STEP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== A - AUTOMATIC INSTALL (FASTEST) ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;u&amp;gt;General considerations&amp;lt;/u&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* This is a fastest way to install openvz utilities, and template utilities, ready to use in a x86_64 system.&lt;br /&gt;
* You can only use the automatic install IF YOU HAVE YUM AND RPM PACKAGES INSTALLED IN YOUR SYSTEM, and if you want to install a Centos-4 cache template.&lt;br /&gt;
* This process uses a bash script that automatizes all the hard work made by hand in the manual install.&lt;br /&gt;
* If something goes wrong, or if you want to install a diferent cache template, it's better to do the manual install, and try to adapt it to your needs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;u&amp;gt;Procedure&amp;lt;/u&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Read carefully the [[Quick installation]] page and install the openvz kernel, configure the bootloader, change sysctl.conf, and finally reboot your system the way it is described there.&lt;br /&gt;
* Download the file [http://linux.carreira.com.pt/ovzutils/setx86_64-0.2.tar.gz setx86_64] and then untar and run the script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tar xzvf setx86_64.tar.gz&lt;br /&gt;
./setx86_64&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Press Enter and let the script to do all the job for you.&lt;br /&gt;
&lt;br /&gt;
When it finishes with the message &amp;quot;END INSTALL&amp;quot;, you can go on reading this document jumping to the undermentioned &amp;lt;b&amp;gt;[[#STEP_10|STEP 10]]&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;u&amp;gt;Note&amp;lt;/u&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
This script will almost work for CentOS-5, however it's not quite right (you will get some errors). You will also need to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm /usr/share/vzpkgtools/vzrpm43/lib/python2.4/site-packages/rpmmodule.so&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
which will cause it to resolve a dependency using your system wide python implementation&lt;br /&gt;
&lt;br /&gt;
=== B - MANUAL INSTALL -STEP BY STEP ===&lt;br /&gt;
&lt;br /&gt;
If for any reason you prefer manual installation, you may start your install process the same way as described in [[Quick installation]].&lt;br /&gt;
In x86_64, the packages vzpkg, vzyum and vztmpl-* are broken. So, let's install them this way, to avoid problems:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 yum install vzrpm*&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can't &amp;quot;yum install vzyum&amp;quot; because it breaks with an error:&lt;br /&gt;
Error: Missing Dependency: cElementTree.so is needed by package vzyum&lt;br /&gt;
&lt;br /&gt;
So we must download it first and then install it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 wget -c http://download.openvz.org/template/utils/vzyum/2.4.0-11/vzyum-2.4.0-11.noarch.rpm&lt;br /&gt;
 rpm --nodeps -Uvh vzyum*.rpm&lt;br /&gt;
 yum install vztmpl-centos-4 vzpkg*&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== TWEAKING THE CODE ====&lt;br /&gt;
&lt;br /&gt;
Now let's tweak the code doing it step by step.&lt;br /&gt;
You can do a copy-paste from the next command lines to your system.&lt;br /&gt;
The example is using &amp;lt;b&amp;gt;Centos-4&amp;lt;/b&amp;gt; distribution (tested), but &amp;lt;b&amp;gt;Fedore Core&amp;lt;/b&amp;gt; or other distribution with yum and rpm installed, may be tried, if you change the reference name and version in STEPS 1 to 4 (this was not tested).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 1 =====&lt;br /&gt;
&lt;br /&gt;
If you didn't instal yet &amp;quot;vztmpl-centos-4&amp;quot;, do it now:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 yum install vztmpl-centos-4&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 2 =====&lt;br /&gt;
&lt;br /&gt;
The template installed is a i386 template. So, we need to create a x86_64 template from the i386.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 cd /vz/template/centos/4/&lt;br /&gt;
 mkdir x86_64&lt;br /&gt;
 cp -a /vz/template/centos/4/i386/* /vz/template/centos/4/x86_64&lt;br /&gt;
 cd /vz/template/centos/4/x86_64/config&lt;br /&gt;
 sed -i.tmp 's/i386/x86_64/g' yum.conf&lt;br /&gt;
 rm -f yum.conf.tmp&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we have a x86_64 centos template installed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 3 =====&lt;br /&gt;
&lt;br /&gt;
Edit the file &amp;lt;code&amp;gt;/vz/template/centos/4/x86_64/config/yum.conf&amp;lt;/code&amp;gt; with your editor.&lt;br /&gt;
Change the line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cachedir=/vz/template/centos/4/x86_64/yum-cache&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cachedir=/var/cache/yum-cache&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note| With this changes, vzyum is not going to be able to use a common cache directory to all [[container]]s as it was used to do. Each [[container]] will have it's own cache directory.&lt;br /&gt;
To avoid to have a directory named /vz/template/centos/4/x86_64/yum-cache in each [[container]], it is preferable to use the correct cache directory /var/cache/yum-cache.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 4 =====&lt;br /&gt;
&lt;br /&gt;
If you list the directory vz-addons like this:&lt;br /&gt;
&lt;br /&gt;
 ls -l /vz/template/centos/4/x86_64/vz-addons&lt;br /&gt;
&lt;br /&gt;
probably you will see the file MAKEDEV-3.3.13-1.3.swsoft.i386.rpm.&lt;br /&gt;
This &amp;quot;ls&amp;quot; allows us to confirm which MAKEDEV version we need to use in this step.&lt;br /&gt;
&lt;br /&gt;
Edit the files &amp;lt;b&amp;gt;minimal.list&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;default.list&amp;lt;/b&amp;gt; in /vz/template/centos/4/x86_64/config directory, and change the line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MAKEDEV&lt;br /&gt;
&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
MAKEDEV-3.3.13 (or the version you saw in the &amp;quot;ls&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 5 =====&lt;br /&gt;
&lt;br /&gt;
Verify if you have &amp;lt;b&amp;gt;rpm-python&amp;lt;/b&amp;gt; installed in your system, because it has 64 bit module needed:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpm -q rpm-python&lt;br /&gt;
rpm-python-4.3.3-18_nonptl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install it if you didn't do it already:&lt;br /&gt;
 yum install rpm-python&lt;br /&gt;
&lt;br /&gt;
Substitute 32 bit module &amp;quot;rpmmodule.so&amp;quot; from vzrpm43-python to the 64 bit module that rpm-python-x86_64 provides, using this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /usr/share/vzpkgtools/vzrpm43/lib/python2.3/site-packages/&lt;br /&gt;
cp /usr/lib64/python2.3/site-packages/rpmmodule.so .&lt;br /&gt;
cp: overwrite `./rpmmodule.so'? y&lt;br /&gt;
cd /usr/share/vzpkgtools/vzrpm43/lib/python2.3/site-packages/rpmdb&lt;br /&gt;
cp /usr/lib64/python2.3/site-packages/rpmdb/_rpmdb.so .&lt;br /&gt;
cp: overwrite `./_rpmdb.so'? y&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For CentOS-5, you will need to do something a bit different. &amp;quot;rpmmodule.so&amp;quot; is provided in your sitewide python distribution, so instead of copying it across, you need to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm /usr/share/vzpkgtools/vzrpm43/lib/python2.4/site-packages/rpmmodule.so&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we must edit and change these 3 files described in the next steps:&lt;br /&gt;
&lt;br /&gt;
/usr/share/vzpkg/&amp;lt;b&amp;gt;cache-os&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/usr/share/vzpkg/&amp;lt;b&amp;gt;functions&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/usr/bin/&amp;lt;b&amp;gt;vzyum&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== STEP 6 =====&lt;br /&gt;
&lt;br /&gt;
Edit the file /usr/share/vzpkg/&amp;lt;b&amp;gt;cache-os&amp;lt;/b&amp;gt;&lt;br /&gt;
Change the next lines:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 136:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: --vps=$VEID check-update&lt;br /&gt;
to: check-update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 185:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: YUM_CMD=&amp;quot;--installroot=$VE_ROOT --vps=$VEID $YUM_CONF_FILE -y $YUM_CMD&amp;quot;&lt;br /&gt;
to: YUM_CMD=&amp;quot;--installroot=$VE_ROOT $YUM_CONF_FILE -y $YUM_CMD&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 7 =====&lt;br /&gt;
&lt;br /&gt;
Edit the file /usr/share/vzpkg/&amp;lt;b&amp;gt;functions&amp;lt;/b&amp;gt;&lt;br /&gt;
Change the next lines:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 21:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: YUM=/usr/share/vzyum/bin/yum&lt;br /&gt;
to: YUM=`which yum`&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 22:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: ARCHES=&amp;quot;x86 i386 x86_64 ia64&amp;quot;&lt;br /&gt;
to: ARCHES=&amp;quot;i386 x86_64 ia64 x86&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 111:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: export RPM=`get_rpm $tdir`&lt;br /&gt;
to: export RPM=`which rpm`&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 450:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: rpm=`get_rpm $tdir`&lt;br /&gt;
to: rpm=`which rpm`&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 8 =====&lt;br /&gt;
&lt;br /&gt;
Edit the file /usr/bin/&amp;lt;b&amp;gt;vzyum&amp;lt;/b&amp;gt;&lt;br /&gt;
Change the next line:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 51:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: YUM_ARGS=&amp;quot;$YUM_ARGS --installroot $VE_ROOT --vps=$VEID&amp;quot;&lt;br /&gt;
to: YUM_ARGS=&amp;quot;$YUM_ARGS --installroot $VE_ROOT&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 9 =====&lt;br /&gt;
&lt;br /&gt;
Edit file /usr/bin/&amp;lt;b&amp;gt;vzrpm&amp;lt;/b&amp;gt;&lt;br /&gt;
Change the next line:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 40:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: RPM_ARGS=&amp;quot;--root $VE_ROOT --veid $VEID&amp;quot;&lt;br /&gt;
to: RPM_ARGS=&amp;quot;--root $VE_ROOT&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 52:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: RPM=`get_rpm $TDIR`&lt;br /&gt;
to: RPM=`which rpm`&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 10 =====&lt;br /&gt;
&lt;br /&gt;
If you want your [[container]]s to have other country locales&lt;br /&gt;
edit &amp;lt;code&amp;gt;/vz/template/centos/4/x86_64/config/.rpmmacros&amp;lt;/code&amp;gt; and change the line &amp;lt;b&amp;gt;%_install_langs C&amp;lt;/b&amp;gt;&lt;br /&gt;
to the language you want, for example:&lt;br /&gt;
&lt;br /&gt;
%_install_langs C:pt_PT:pt_PT.UTF-8:en_US:en_US.UTF-8&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== TESTING THE NEW CODE ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you can create your own template caches from your own templates&lt;br /&gt;
Let's test it!&lt;br /&gt;
&lt;br /&gt;
Make my first two template caches:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 vzpkgcache -f centos-4-x86_64-default&lt;br /&gt;
 vzpkgcache -f centos-4-x86_64-minimal&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They finish with complaints about &amp;lt;i&amp;gt;cron.daily&amp;lt;/i&amp;gt;, but don't worry about it.&lt;br /&gt;
Now &amp;lt;b&amp;gt;minimal&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;default&amp;lt;/b&amp;gt; cache are created. Confirm if they are created:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 vzpkgls -c&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you see the cache list, then you can create your first [[container]]:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 vzctl create 200 --ostemplate centos-4-x86_64-minimal&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To change the &amp;lt;i&amp;gt;locales&amp;lt;/i&amp;gt;, copy &amp;lt;code&amp;gt;/etc/sysconfig/i18n&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/vz/private/200/etc/sysconfig&amp;lt;/code&amp;gt;, if you wish to use another language and have done STEP 10 previously.&lt;br /&gt;
&lt;br /&gt;
Now start [[container]] 200 previously created:&lt;br /&gt;
&lt;br /&gt;
 vzctl start 200&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then test also &amp;quot;vzyum&amp;quot; and see if it works. Try to install &amp;quot;nano editor&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 vzyum 200 install nano&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Try to use vzrpm, to list all rpm's installed in [[container]] 200:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 vzrpm 200 -qa&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you didn't have any errors, the changes are fine.&lt;br /&gt;
&lt;br /&gt;
If something went wrong, probably you made a mistake in those previous steps. &lt;br /&gt;
Carefully verify if you did it well, step by step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Templates]]&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Troubleshooting]]&lt;/div&gt;</summary>
		<author><name>Gjanssens</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Using_vzpkg_and_vzyum_on_x86_64&amp;diff=4155</id>
		<title>Using vzpkg and vzyum on x86 64</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Using_vzpkg_and_vzyum_on_x86_64&amp;diff=4155"/>
		<updated>2008-02-25T18:12:17Z</updated>

		<summary type="html">&lt;p&gt;Gjanssens: Setup glossary link for &amp;quot;container&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document describes a way to install OpenVZ in a x86_64 computer, so that it can create cache templates, use vzyum and vzrpm.&lt;br /&gt;
This is intended to work in a Centos-4 (tested) or a Fedora Core distribution (not tested).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== THE PROBLEM ==&lt;br /&gt;
&lt;br /&gt;
There is a known problem with &amp;lt;b&amp;gt;vzpkg-2.7.0&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;vzyum-2.4.0&amp;lt;/b&amp;gt; in x86_64 computers:&lt;br /&gt;
Vzyum, vzpkgcache and vzrpm are broken in 64 bit systems, so we are unable to create new cache templates in a x86_64 computer or update each [[container]] using vzyum or vzrpm.&lt;br /&gt;
This text describes a work around and a few hacks to get it work flawless.&lt;br /&gt;
&lt;br /&gt;
{{Note| The basic idea is to change the code in such a way that vzyum and vzrpm use the real yum and rpm to do the job, and also create new x86_64 paths required by the system.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== REQUIREMENTS ==&lt;br /&gt;
&lt;br /&gt;
* - A x86_64 computer&lt;br /&gt;
* - Centos-4 distribution (or Fedora Core 3, 4 or 5 - not tested).&lt;br /&gt;
* - Yum package installed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SIDE EFFECTS ==&lt;br /&gt;
&lt;br /&gt;
Until now there is only one &amp;lt;i&amp;gt;side effect&amp;lt;/i&amp;gt; detected in this solution:&lt;br /&gt;
* The yum cache is not common to all [[container]]s. Instead, each [[container]] has it's own yum cache in the directory &amp;lt;code&amp;gt;/var/cache/yum-cache&amp;lt;/code&amp;gt;.&lt;br /&gt;
This is a consequence from using the modified vzyum.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== INSTALL Openvz ==&lt;br /&gt;
&lt;br /&gt;
There are two ways to install it:&lt;br /&gt;
&lt;br /&gt;
* A - AUTOMATIC INSTALL (FASTEST)&lt;br /&gt;
* B - MANUAL INSTALL - STEP BY STEP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== A - AUTOMATIC INSTALL (FASTEST) ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;u&amp;gt;General considerations&amp;lt;/u&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* This is a fastest way to install openvz utilities, and template utilities, ready to use in a x86_64 system.&lt;br /&gt;
* You can only use the automatic install IF YOU HAVE YUM AND RPM PACKAGES INSTALLED IN YOUR SYSTEM, and if you want to install a Centos-4 cache template.&lt;br /&gt;
* This process uses a bash script that automatizes all the hard work made by hand in the manual install.&lt;br /&gt;
* If something goes wrong, or if you want to install a diferent cache template, it's better to do the manual install, and try to adapt it to your needs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;u&amp;gt;Procedure&amp;lt;/u&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Read carefully the [[Quick installation]] page and install the openvz kernel, configure the bootloader, change sysctl.conf, and finally reboot your system the way it is described there.&lt;br /&gt;
* Download the file [http://linux.carreira.com.pt/ovzutils/setx86_64-0.2.tar.gz setx86_64] and then untar and run the script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tar xzvf setx86_64.tar.gz&lt;br /&gt;
./setx86_64&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Press Enter and let the script to do all the job for you.&lt;br /&gt;
&lt;br /&gt;
When it finishes with the message &amp;quot;END INSTALL&amp;quot;, you can go on reading this document jumping to the undermentioned &amp;lt;b&amp;gt;[[#STEP_10|STEP 10]]&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;u&amp;gt;Note&amp;lt;/u&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
This script will almost work for CentOS-5, however it's not quite right (you will get some errors). You will also need to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm /usr/share/vzpkgtools/vzrpm43/lib/python2.4/site-packages/rpmmodule.so&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
which will cause it to resolve a dependency using your system wide python implementation&lt;br /&gt;
&lt;br /&gt;
=== B - MANUAL INSTALL -STEP BY STEP ===&lt;br /&gt;
&lt;br /&gt;
If for any reason you prefer manual installation, you may start your install process the same way as described in [[Quick installation]].&lt;br /&gt;
In x86_64, the packages vzpkg, vzyum and vztmpl-* are broken. So, let's install them this way, to avoid problems:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 yum install vzrpm*&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can't &amp;quot;yum install vzyum&amp;quot; because it breaks with an error:&lt;br /&gt;
Error: Missing Dependency: cElementTree.so is needed by package vzyum&lt;br /&gt;
&lt;br /&gt;
So we must download it first and then install it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 wget -c http://download.openvz.org/template/utils/vzyum/2.4.0-11/vzyum-2.4.0-11.noarch.rpm&lt;br /&gt;
 rpm --nodeps -Uvh vzyum*.rpm&lt;br /&gt;
 yum install vztmpl-centos-4 vzpkg*&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== TWEAKING THE CODE ====&lt;br /&gt;
&lt;br /&gt;
Now let's tweak the code doing it step by step.&lt;br /&gt;
You can do a copy-paste from the next command lines to your system.&lt;br /&gt;
The example is using &amp;lt;b&amp;gt;Centos-4&amp;lt;/b&amp;gt; distribution (tested), but &amp;lt;b&amp;gt;Fedore Core&amp;lt;/b&amp;gt; or other distribution with yum and rpm installed, may be tried, if you change the reference name and version in STEPS 1 to 4 (this was not tested).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 1 =====&lt;br /&gt;
&lt;br /&gt;
If you didn't instal yet &amp;quot;vztmpl-centos-4&amp;quot;, do it now:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 yum install vztmpl-centos-4&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 2 =====&lt;br /&gt;
&lt;br /&gt;
The template installed is a i386 template. So, we need to create a x86_64 template from the i386.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 cd /vz/template/centos/4/&lt;br /&gt;
 mkdir x86_64&lt;br /&gt;
 cp -a /vz/template/centos/4/i386/* /vz/template/centos/4/x86_64&lt;br /&gt;
 cd /vz/template/centos/4/x86_64/config&lt;br /&gt;
 sed -i.tmp 's/i386/x86_64/g' yum.conf&lt;br /&gt;
 rm -f yum.conf.tmp&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we have a x86_64 centos template installed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 3 =====&lt;br /&gt;
&lt;br /&gt;
Edit the file &amp;lt;code&amp;gt;/vz/template/centos/4/x86_64/config/yum.conf&amp;lt;/code&amp;gt; with your editor.&lt;br /&gt;
Change the line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cachedir=/vz/template/centos/4/x86_64/yum-cache&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cachedir=/var/cache/yum-cache&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note| With this changes, vzyum is not going to be able to use a common cache directory to all [[container]]s as it was used to do. Each [[container]] will have it's own cache directory.&lt;br /&gt;
To avoid to have a directory named /vz/template/centos/4/x86_64/yum-cache in each [[container]], it is preferable to use the correct cache directory /var/cache/yum-cache.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 4 =====&lt;br /&gt;
&lt;br /&gt;
If you list the directory vz-addons like this:&lt;br /&gt;
&lt;br /&gt;
 ls -l /vz/template/centos/4/x86_64/vz-addons&lt;br /&gt;
&lt;br /&gt;
probably you will see the file MAKEDEV-3.3.13-1.3.swsoft.i386.rpm.&lt;br /&gt;
This &amp;quot;ls&amp;quot; allows us to confirm which MAKEDEV version we need to use in this step.&lt;br /&gt;
&lt;br /&gt;
Edit the files &amp;lt;b&amp;gt;minimal.list&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;default.list&amp;lt;/b&amp;gt; in /vz/template/centos/4/x86_64/config directory, and change the line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MAKEDEV&lt;br /&gt;
&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
MAKEDEV-3.3.13 (or the version you saw in the &amp;quot;ls&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 5 =====&lt;br /&gt;
&lt;br /&gt;
Verify if you have &amp;lt;b&amp;gt;rpm-python&amp;lt;/b&amp;gt; installed in your system, because it has 64 bit module needed:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpm -q rpm-python&lt;br /&gt;
rpm-python-4.3.3-18_nonptl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install it if you didn't do it already:&lt;br /&gt;
 yum install rpm-python&lt;br /&gt;
&lt;br /&gt;
Substitute 32 bit module &amp;quot;rpmmodule.so&amp;quot; from vzrpm43-python to the 64 bit module that rpm-python-x86_64 provides, using this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /usr/share/vzpkgtools/vzrpm43/lib/python2.3/site-packages/&lt;br /&gt;
cp /usr/lib64/python2.3/site-packages/rpmmodule.so .&lt;br /&gt;
cp: overwrite `./rpmmodule.so'? y&lt;br /&gt;
cd /usr/share/vzpkgtools/vzrpm43/lib/python2.3/site-packages/rpmdb&lt;br /&gt;
cp /usr/lib64/python2.3/site-packages/rpmdb/_rpmdb.so .&lt;br /&gt;
cp: overwrite `./_rpmdb.so'? y&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For CentOS-5, you will need to do something a bit different. &amp;quot;rpmmodule.so&amp;quot; is provided in your sitewide python distribution, so instead of copying it across, you need to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm /usr/share/vzpkgtools/vzrpm43/lib/python2.4/site-packages/rpmmodule.so&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we must edit and change these 3 files described in the next steps:&lt;br /&gt;
&lt;br /&gt;
/usr/share/vzpkg/&amp;lt;b&amp;gt;cache-os&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/usr/share/vzpkg/&amp;lt;b&amp;gt;functions&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/usr/bin/&amp;lt;b&amp;gt;vzyum&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== STEP 6 =====&lt;br /&gt;
&lt;br /&gt;
Edit the file /usr/share/vzpkg/&amp;lt;b&amp;gt;cache-os&amp;lt;/b&amp;gt;&lt;br /&gt;
Change the next lines:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 136:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: --vps=$VEID check-update&lt;br /&gt;
to: check-update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 185:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: YUM_CMD=&amp;quot;--installroot=$VE_ROOT --vps=$VEID $YUM_CONF_FILE -y $YUM_CMD&amp;quot;&lt;br /&gt;
to: YUM_CMD=&amp;quot;--installroot=$VE_ROOT $YUM_CONF_FILE -y $YUM_CMD&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 7 =====&lt;br /&gt;
&lt;br /&gt;
Edit the file /usr/share/vzpkg/&amp;lt;b&amp;gt;functions&amp;lt;/b&amp;gt;&lt;br /&gt;
Change the next lines:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 21:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: YUM=/usr/share/vzyum/bin/yum&lt;br /&gt;
to: YUM=`which yum`&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 22:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: ARCHES=&amp;quot;x86 i386 x86_64 ia64&amp;quot;&lt;br /&gt;
to: ARCHES=&amp;quot;i386 x86_64 ia64 x86&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 111:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: export RPM=`get_rpm $tdir`&lt;br /&gt;
to: export RPM=`which rpm`&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 450:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: rpm=`get_rpm $tdir`&lt;br /&gt;
to: rpm=`which rpm`&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 8 =====&lt;br /&gt;
&lt;br /&gt;
Edit the file /usr/bin/&amp;lt;b&amp;gt;vzyum&amp;lt;/b&amp;gt;&lt;br /&gt;
Change the next line:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 51:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: YUM_ARGS=&amp;quot;$YUM_ARGS --installroot $VE_ROOT --vps=$VEID&amp;quot;&lt;br /&gt;
to: YUM_ARGS=&amp;quot;$YUM_ARGS --installroot $VE_ROOT&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 9 =====&lt;br /&gt;
&lt;br /&gt;
Edit file /usr/bin/&amp;lt;b&amp;gt;vzrpm&amp;lt;/b&amp;gt;&lt;br /&gt;
Change the next line:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 40:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: RPM_ARGS=&amp;quot;--root $VE_ROOT --veid $VEID&amp;quot;&lt;br /&gt;
to: RPM_ARGS=&amp;quot;--root $VE_ROOT&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 52:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: RPM=`get_rpm $TDIR`&lt;br /&gt;
to: RPM=`which rpm`&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 10 =====&lt;br /&gt;
&lt;br /&gt;
If you want your [[container]]s to have other country locales&lt;br /&gt;
edit &amp;lt;code&amp;gt;/vz/template/centos/4/x86_64/config/.rpmmacros&amp;lt;/code&amp;gt; and change the line &amp;lt;b&amp;gt;%_install_langs C&amp;lt;/b&amp;gt;&lt;br /&gt;
to the language you want, for example:&lt;br /&gt;
&lt;br /&gt;
%_install_langs C:pt_PT:pt_PT.UTF-8:en_US:en_US.UTF-8&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== TESTING THE NEW CODE ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you can create your own cache your own cache templates&lt;br /&gt;
Let's test it!&lt;br /&gt;
&lt;br /&gt;
Make my first two cache templates:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 vzpkgcache -f centos-4-x86_64-default&lt;br /&gt;
 vzpkgcache -f centos-4-x86_64-minimal&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They finish with complaints about &amp;lt;i&amp;gt;cron.daily&amp;lt;/i&amp;gt;, but don't worry about it.&lt;br /&gt;
Now &amp;lt;b&amp;gt;minimal&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;default&amp;lt;/b&amp;gt; cache are created. Confirm if they are created:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 vzpkgls -c&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you see the cache list, then you can create your first [[container]]:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 vzctl create 200 --ostemplate centos-4-x86_64-minimal&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To change the &amp;lt;i&amp;gt;locales&amp;lt;/i&amp;gt;, copy &amp;lt;code&amp;gt;/etc/sysconfig/i18n&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/vz/private/200/etc/sysconfig&amp;lt;/code&amp;gt;, if you wish to use another language and have done STEP 10 previously.&lt;br /&gt;
&lt;br /&gt;
Now start [[container]] 200 previously created:&lt;br /&gt;
&lt;br /&gt;
 vzctl start 200&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then test also &amp;quot;vzyum&amp;quot; and see if it works. Try to install &amp;quot;nano editor&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 vzyum 200 install nano&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Try to use vzrpm, to list all rpm's installed in [[container]] 200:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 vzrpm 200 -qa&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you didn't have any errors, the changes are fine.&lt;br /&gt;
&lt;br /&gt;
If something went wrong, probably you made a mistake in those previous steps. &lt;br /&gt;
Carefully verify if you did it well, step by step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Templates]]&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Troubleshooting]]&lt;/div&gt;</summary>
		<author><name>Gjanssens</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Using_vzpkg_and_vzyum_on_x86_64&amp;diff=4154</id>
		<title>Using vzpkg and vzyum on x86 64</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Using_vzpkg_and_vzyum_on_x86_64&amp;diff=4154"/>
		<updated>2008-02-25T18:10:28Z</updated>

		<summary type="html">&lt;p&gt;Gjanssens: VE-&amp;gt;container&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document describes a way to install OpenVZ in a x86_64 computer, so that it can create cache templates, use vzyum and vzrpm.&lt;br /&gt;
This is intended to work in a Centos-4 (tested) or a Fedora Core distribution (not tested).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== THE PROBLEM ==&lt;br /&gt;
&lt;br /&gt;
There is a known problem with &amp;lt;b&amp;gt;vzpkg-2.7.0&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;vzyum-2.4.0&amp;lt;/b&amp;gt; in x86_64 computers:&lt;br /&gt;
Vzyum, vzpkgcache and vzrpm are broken in 64 bit systems, so we are unable to create new cache templates in a x86_64 computer or update each container using vzyum or vzrpm.&lt;br /&gt;
This text describes a work around and a few hacks to get it work flawless.&lt;br /&gt;
&lt;br /&gt;
{{Note| The basic idea is to change the code in such a way that vzyum and vzrpm use the real yum and rpm to do the job, and also create new x86_64 paths required by the system.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== REQUIREMENTS ==&lt;br /&gt;
&lt;br /&gt;
* - A x86_64 computer&lt;br /&gt;
* - Centos-4 distribution (or Fedora Core 3, 4 or 5 - not tested).&lt;br /&gt;
* - Yum package installed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SIDE EFFECTS ==&lt;br /&gt;
&lt;br /&gt;
Until now there is only one &amp;lt;i&amp;gt;side effect&amp;lt;/i&amp;gt; detected in this solution:&lt;br /&gt;
* The yum cache is not common to all containers. Instead, each container has it's own yum cache in the directory &amp;lt;code&amp;gt;/var/cache/yum-cache&amp;lt;/code&amp;gt;.&lt;br /&gt;
This is a consequence from using the modified vzyum.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== INSTALL Openvz ==&lt;br /&gt;
&lt;br /&gt;
There are two ways to install it:&lt;br /&gt;
&lt;br /&gt;
* A - AUTOMATIC INSTALL (FASTEST)&lt;br /&gt;
* B - MANUAL INSTALL - STEP BY STEP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== A - AUTOMATIC INSTALL (FASTEST) ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;u&amp;gt;General considerations&amp;lt;/u&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* This is a fastest way to install openvz utilities, and template utilities, ready to use in a x86_64 system.&lt;br /&gt;
* You can only use the automatic install IF YOU HAVE YUM AND RPM PACKAGES INSTALLED IN YOUR SYSTEM, and if you want to install a Centos-4 cache template.&lt;br /&gt;
* This process uses a bash script that automatizes all the hard work made by hand in the manual install.&lt;br /&gt;
* If something goes wrong, or if you want to install a diferent cache template, it's better to do the manual install, and try to adapt it to your needs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;u&amp;gt;Procedure&amp;lt;/u&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Read carefully the [[Quick installation]] page and install the openvz kernel, configure the bootloader, change sysctl.conf, and finally reboot your system the way it is described there.&lt;br /&gt;
* Download the file [http://linux.carreira.com.pt/ovzutils/setx86_64-0.2.tar.gz setx86_64] and then untar and run the script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tar xzvf setx86_64.tar.gz&lt;br /&gt;
./setx86_64&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Press Enter and let the script to do all the job for you.&lt;br /&gt;
&lt;br /&gt;
When it finishes with the message &amp;quot;END INSTALL&amp;quot;, you can go on reading this document jumping to the undermentioned &amp;lt;b&amp;gt;[[#STEP_10|STEP 10]]&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;u&amp;gt;Note&amp;lt;/u&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
This script will almost work for CentOS-5, however it's not quite right (you will get some errors). You will also need to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm /usr/share/vzpkgtools/vzrpm43/lib/python2.4/site-packages/rpmmodule.so&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
which will cause it to resolve a dependency using your system wide python implementation&lt;br /&gt;
&lt;br /&gt;
=== B - MANUAL INSTALL -STEP BY STEP ===&lt;br /&gt;
&lt;br /&gt;
If for any reason you prefer manual installation, you may start your install process the same way as described in [[Quick installation]].&lt;br /&gt;
In x86_64, the packages vzpkg, vzyum and vztmpl-* are broken. So, let's install them this way, to avoid problems:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 yum install vzrpm*&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can't &amp;quot;yum install vzyum&amp;quot; because it breaks with an error:&lt;br /&gt;
Error: Missing Dependency: cElementTree.so is needed by package vzyum&lt;br /&gt;
&lt;br /&gt;
So we must download it first and then install it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 wget -c http://download.openvz.org/template/utils/vzyum/2.4.0-11/vzyum-2.4.0-11.noarch.rpm&lt;br /&gt;
 rpm --nodeps -Uvh vzyum*.rpm&lt;br /&gt;
 yum install vztmpl-centos-4 vzpkg*&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== TWEAKING THE CODE ====&lt;br /&gt;
&lt;br /&gt;
Now let's tweak the code doing it step by step.&lt;br /&gt;
You can do a copy-paste from the next command lines to your system.&lt;br /&gt;
The example is using &amp;lt;b&amp;gt;Centos-4&amp;lt;/b&amp;gt; distribution (tested), but &amp;lt;b&amp;gt;Fedore Core&amp;lt;/b&amp;gt; or other distribution with yum and rpm installed, may be tried, if you change the reference name and version in STEPS 1 to 4 (this was not tested).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 1 =====&lt;br /&gt;
&lt;br /&gt;
If you didn't instal yet &amp;quot;vztmpl-centos-4&amp;quot;, do it now:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 yum install vztmpl-centos-4&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 2 =====&lt;br /&gt;
&lt;br /&gt;
The template installed is a i386 template. So, we need to create a x86_64 template from the i386.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 cd /vz/template/centos/4/&lt;br /&gt;
 mkdir x86_64&lt;br /&gt;
 cp -a /vz/template/centos/4/i386/* /vz/template/centos/4/x86_64&lt;br /&gt;
 cd /vz/template/centos/4/x86_64/config&lt;br /&gt;
 sed -i.tmp 's/i386/x86_64/g' yum.conf&lt;br /&gt;
 rm -f yum.conf.tmp&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we have a x86_64 centos template installed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 3 =====&lt;br /&gt;
&lt;br /&gt;
Edit the file &amp;lt;code&amp;gt;/vz/template/centos/4/x86_64/config/yum.conf&amp;lt;/code&amp;gt; with your editor.&lt;br /&gt;
Change the line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cachedir=/vz/template/centos/4/x86_64/yum-cache&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cachedir=/var/cache/yum-cache&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note| With this changes, vzyum is not going to be able to use a common cache directory to all containers as it was used to do. Each container will have it's own cache directory.&lt;br /&gt;
To avoid to have a directory named /vz/template/centos/4/x86_64/yum-cache in each container, it is preferable to use the correct cache directory /var/cache/yum-cache.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 4 =====&lt;br /&gt;
&lt;br /&gt;
If you list the directory vz-addons like this:&lt;br /&gt;
&lt;br /&gt;
 ls -l /vz/template/centos/4/x86_64/vz-addons&lt;br /&gt;
&lt;br /&gt;
probably you will see the file MAKEDEV-3.3.13-1.3.swsoft.i386.rpm.&lt;br /&gt;
This &amp;quot;ls&amp;quot; allows us to confirm which MAKEDEV version we need to use in this step.&lt;br /&gt;
&lt;br /&gt;
Edit the files &amp;lt;b&amp;gt;minimal.list&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;default.list&amp;lt;/b&amp;gt; in /vz/template/centos/4/x86_64/config directory, and change the line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MAKEDEV&lt;br /&gt;
&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
MAKEDEV-3.3.13 (or the version you saw in the &amp;quot;ls&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 5 =====&lt;br /&gt;
&lt;br /&gt;
Verify if you have &amp;lt;b&amp;gt;rpm-python&amp;lt;/b&amp;gt; installed in your system, because it has 64 bit module needed:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rpm -q rpm-python&lt;br /&gt;
rpm-python-4.3.3-18_nonptl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install it if you didn't do it already:&lt;br /&gt;
 yum install rpm-python&lt;br /&gt;
&lt;br /&gt;
Substitute 32 bit module &amp;quot;rpmmodule.so&amp;quot; from vzrpm43-python to the 64 bit module that rpm-python-x86_64 provides, using this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /usr/share/vzpkgtools/vzrpm43/lib/python2.3/site-packages/&lt;br /&gt;
cp /usr/lib64/python2.3/site-packages/rpmmodule.so .&lt;br /&gt;
cp: overwrite `./rpmmodule.so'? y&lt;br /&gt;
cd /usr/share/vzpkgtools/vzrpm43/lib/python2.3/site-packages/rpmdb&lt;br /&gt;
cp /usr/lib64/python2.3/site-packages/rpmdb/_rpmdb.so .&lt;br /&gt;
cp: overwrite `./_rpmdb.so'? y&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For CentOS-5, you will need to do something a bit different. &amp;quot;rpmmodule.so&amp;quot; is provided in your sitewide python distribution, so instead of copying it across, you need to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rm /usr/share/vzpkgtools/vzrpm43/lib/python2.4/site-packages/rpmmodule.so&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we must edit and change these 3 files described in the next steps:&lt;br /&gt;
&lt;br /&gt;
/usr/share/vzpkg/&amp;lt;b&amp;gt;cache-os&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/usr/share/vzpkg/&amp;lt;b&amp;gt;functions&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/usr/bin/&amp;lt;b&amp;gt;vzyum&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== STEP 6 =====&lt;br /&gt;
&lt;br /&gt;
Edit the file /usr/share/vzpkg/&amp;lt;b&amp;gt;cache-os&amp;lt;/b&amp;gt;&lt;br /&gt;
Change the next lines:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 136:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: --vps=$VEID check-update&lt;br /&gt;
to: check-update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 185:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: YUM_CMD=&amp;quot;--installroot=$VE_ROOT --vps=$VEID $YUM_CONF_FILE -y $YUM_CMD&amp;quot;&lt;br /&gt;
to: YUM_CMD=&amp;quot;--installroot=$VE_ROOT $YUM_CONF_FILE -y $YUM_CMD&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 7 =====&lt;br /&gt;
&lt;br /&gt;
Edit the file /usr/share/vzpkg/&amp;lt;b&amp;gt;functions&amp;lt;/b&amp;gt;&lt;br /&gt;
Change the next lines:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 21:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: YUM=/usr/share/vzyum/bin/yum&lt;br /&gt;
to: YUM=`which yum`&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 22:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: ARCHES=&amp;quot;x86 i386 x86_64 ia64&amp;quot;&lt;br /&gt;
to: ARCHES=&amp;quot;i386 x86_64 ia64 x86&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 111:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: export RPM=`get_rpm $tdir`&lt;br /&gt;
to: export RPM=`which rpm`&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 450:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: rpm=`get_rpm $tdir`&lt;br /&gt;
to: rpm=`which rpm`&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 8 =====&lt;br /&gt;
&lt;br /&gt;
Edit the file /usr/bin/&amp;lt;b&amp;gt;vzyum&amp;lt;/b&amp;gt;&lt;br /&gt;
Change the next line:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 51:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: YUM_ARGS=&amp;quot;$YUM_ARGS --installroot $VE_ROOT --vps=$VEID&amp;quot;&lt;br /&gt;
to: YUM_ARGS=&amp;quot;$YUM_ARGS --installroot $VE_ROOT&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 9 =====&lt;br /&gt;
&lt;br /&gt;
Edit file /usr/bin/&amp;lt;b&amp;gt;vzrpm&amp;lt;/b&amp;gt;&lt;br /&gt;
Change the next line:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 40:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: RPM_ARGS=&amp;quot;--root $VE_ROOT --veid $VEID&amp;quot;&lt;br /&gt;
to: RPM_ARGS=&amp;quot;--root $VE_ROOT&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; -Line 52:&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
change: RPM=`get_rpm $TDIR`&lt;br /&gt;
to: RPM=`which rpm`&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== STEP 10 =====&lt;br /&gt;
&lt;br /&gt;
If you want your containers to have other country locales&lt;br /&gt;
edit &amp;lt;code&amp;gt;/vz/template/centos/4/x86_64/config/.rpmmacros&amp;lt;/code&amp;gt; and change the line &amp;lt;b&amp;gt;%_install_langs C&amp;lt;/b&amp;gt;&lt;br /&gt;
to the language you want, for example:&lt;br /&gt;
&lt;br /&gt;
%_install_langs C:pt_PT:pt_PT.UTF-8:en_US:en_US.UTF-8&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== TESTING THE NEW CODE ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you can create your own cache your own cache templates&lt;br /&gt;
Let's test it!&lt;br /&gt;
&lt;br /&gt;
Make my first two cache templates:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 vzpkgcache -f centos-4-x86_64-default&lt;br /&gt;
 vzpkgcache -f centos-4-x86_64-minimal&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
They finish with complaints about &amp;lt;i&amp;gt;cron.daily&amp;lt;/i&amp;gt;, but don't worry about it.&lt;br /&gt;
Now &amp;lt;b&amp;gt;minimal&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;default&amp;lt;/b&amp;gt; cache are created. Confirm if they are created:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 vzpkgls -c&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you see the cache list, then you can create your first container:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 vzctl create 200 --ostemplate centos-4-x86_64-minimal&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To change the &amp;lt;i&amp;gt;locales&amp;lt;/i&amp;gt;, copy &amp;lt;code&amp;gt;/etc/sysconfig/i18n&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;/vz/private/200/etc/sysconfig&amp;lt;/code&amp;gt;, if you wish to use another language and have done STEP 10 previously.&lt;br /&gt;
&lt;br /&gt;
Now start container 20 previously created:&lt;br /&gt;
&lt;br /&gt;
 vzctl start 200&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then test also &amp;quot;vzyum&amp;quot; and see if it works. Try to install &amp;quot;nano editor&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 vzyum 200 install nano&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Try to use vzrpm, to list all rpm's installed in container 200:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 vzrpm 200 -qa&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you didn't have any errors, the changes are fine.&lt;br /&gt;
&lt;br /&gt;
If something went wrong, probably you made a mistake in those previous steps. &lt;br /&gt;
Carefully verify if you did it well, step by step.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Templates]]&lt;br /&gt;
[[Category: HOWTO]]&lt;br /&gt;
[[Category: Troubleshooting]]&lt;/div&gt;</summary>
		<author><name>Gjanssens</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=OS_template_cache&amp;diff=4153</id>
		<title>OS template cache</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=OS_template_cache&amp;diff=4153"/>
		<updated>2008-02-25T18:01:33Z</updated>

		<summary type="html">&lt;p&gt;Gjanssens: VE-&amp;gt;container&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;An '''OS template cache''' is an [[OS template]] installed into a [[container]] and then packed into a gzipped tarball. Using such a cache, a new [[container]] can be created in a matter of minutes, if not seconds.&lt;br /&gt;
&lt;br /&gt;
OS template cache can either be created from [[OS template metadata]] using vzpkg tools, or by other means.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[OS template]]&lt;br /&gt;
* [[OS template metadata]]&lt;br /&gt;
* [[OS template cache preparation]]&lt;br /&gt;
&lt;br /&gt;
[[Category: Definitions]]&lt;br /&gt;
[[Category: Templates]]&lt;/div&gt;</summary>
		<author><name>Gjanssens</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=OS_template&amp;diff=4152</id>
		<title>OS template</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=OS_template&amp;diff=4152"/>
		<updated>2008-02-25T17:59:21Z</updated>

		<summary type="html">&lt;p&gt;Gjanssens: VE-&amp;gt;container&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;An '''OS template''' is basically a set of packages from some Linux distribution used to populate a [[container]]. With OpenVZ, different distributions can co-exist on the same hardware box, so multiple OS templates can be available.&lt;br /&gt;
&lt;br /&gt;
An OS template consists of system programs, libraries, and scripts needed to boot up and run the system ([[container]]), as well as some very basic applications and utilities. Applications like a compiler and an SQL server are usually not included into an OS template.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[OS template metadata]]&lt;br /&gt;
* [[OS template cache]]&lt;br /&gt;
* [[OS template cache preparation]]&lt;br /&gt;
&lt;br /&gt;
[[Category: Definitions]]&lt;br /&gt;
[[Category: Templates]]&lt;/div&gt;</summary>
		<author><name>Gjanssens</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Different_kernel_flavors_(UP,_SMP,_ENTERPRISE,_ENTNOSPLIT)&amp;diff=4151</id>
		<title>Different kernel flavors (UP, SMP, ENTERPRISE, ENTNOSPLIT)</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Different_kernel_flavors_(UP,_SMP,_ENTERPRISE,_ENTNOSPLIT)&amp;diff=4151"/>
		<updated>2008-02-25T16:53:40Z</updated>

		<summary type="html">&lt;p&gt;Gjanssens: VE-&amp;gt;container&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;OpenVZ project releases several different precompiled kernels for each version. Which kernel to choose depends on what hardware do you have. The table below describes the cases when it is better to use each of these kernels.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+'''i686 kernel flavors list'''&lt;br /&gt;
! Kernel type !! Description !! Hardware !! Use case&lt;br /&gt;
|-&lt;br /&gt;
! UP&lt;br /&gt;
| uniprocessor&lt;br /&gt;
| up to 4GB of RAM&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! SMP&lt;br /&gt;
| symmetric multiprocessor&lt;br /&gt;
| up to 4 GB of RAM&lt;br /&gt;
| 10-20 [[Container]]s&lt;br /&gt;
|-&lt;br /&gt;
! entnosplit/PAE&lt;br /&gt;
| SMP + PAE support&lt;br /&gt;
| up to 64 GB of RAM&lt;br /&gt;
| 10-30 [[Container]]s&lt;br /&gt;
|-&lt;br /&gt;
! enterprise/ent&lt;br /&gt;
| SMP + PAE support + 4/4GB split&lt;br /&gt;
| up to 64 GB of RAM&lt;br /&gt;
| &amp;gt;20-30 [[Container]]s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These kernels are optimized for these types of hardware configurations and usage scenarios,&lt;br /&gt;
so choosing the right kernel can help to boost performance by about 5 to 15 per cent.&lt;br /&gt;
&lt;br /&gt;
{{Note|Use &amp;lt;tt&amp;gt;rpm -ihv&amp;lt;/tt&amp;gt; command for ovzkernel RPM installation. Please do not use the &amp;lt;tt&amp;gt;rpm -Uhv&amp;lt;/tt&amp;gt; command to install the kernel, otherwise all the previously installed kernels may be removed from your system.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|When using a &amp;lt;b&amp;gt;64-bit&amp;lt;/b&amp;gt; processor &amp;lt;b&amp;gt;and&amp;lt;/b&amp;gt; operating system, you need only select the SMP or non-SMP version.  64-bit linux can access the entire 64Gb of ram in ZONE_NORMAL (low memory).  PAE and 4GB/4GB splitting are only needed for 32-bit OS, and so are not necessary and are disabled by default in 64-bit kernels.}}&lt;br /&gt;
&lt;br /&gt;
New RHEL5 based kernel uses different flavors naming. I.e. &lt;br /&gt;
* '''UP''' kernel is no longer provided &lt;br /&gt;
* '''SMP''' kernel comes without any flavor (like old UP)&lt;br /&gt;
* '''entnosplit''' kernel comes as '''PAE '''&lt;br /&gt;
* '''enterprise''' kernel comes as '''ent'''&lt;br /&gt;
&lt;br /&gt;
[[Category: Kernel]]&lt;br /&gt;
[[Category: Installation]]&lt;/div&gt;</summary>
		<author><name>Gjanssens</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Quick_installation_(legacy)&amp;diff=4150</id>
		<title>Quick installation (legacy)</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Quick_installation_(legacy)&amp;diff=4150"/>
		<updated>2008-02-25T16:11:37Z</updated>

		<summary type="html">&lt;p&gt;Gjanssens: VE-&amp;gt;container&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document briefly describes the steps needed to install OpenVZ on your (RPM based) machine. For '''Debian''' based systems see [[Installation on Debian]].&lt;br /&gt;
&lt;br /&gt;
This document is also available in the following languages: [http://forum.openvz.org/index.php?t=tree&amp;amp;amp;goto=35&amp;amp;amp;#msg_35 French],  [http://forum.openvz.org/index.php?t=tree&amp;amp;amp;goto=1805&amp;amp;amp;#msg_1805 German],&lt;br /&gt;
[http://wiki.openvz.jp Japanese],&lt;br /&gt;
[[Quick_installation_(Spanish)|Spanish]].&lt;br /&gt;
&lt;br /&gt;
OpenVZ consists of a kernel, user-level tools, and VE templates. This guide tells how to install the kernel and the tools.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
This guide assumes you are running recent release of Fedora Core (like FC5) or RHEL/CentOS 4. Currently, OpenVZ kernel tries to support the same hardware that Red Hat kernels support. For full hardware compatibility list, see [http://www.swsoft.com/en/products/virtuozzo/hcl/ Virtuozzo HCL].&lt;br /&gt;
&lt;br /&gt;
=== Filesystems ===&lt;br /&gt;
It is recommended to use a separate partition for container's private directories (by default /vz/private/&amp;lt;veid&amp;gt;). The reason why you should do so is that if you wish to use OpenVZ per-container disk quota, you won't be able to use usual Linux disk quotas on the same partition. Bear in mind, that per-container quota in this context includes not only pure per-container quota, but also usual Linux disk quota used in containers, not on [[HN]].&lt;br /&gt;
&lt;br /&gt;
At least try to avoid using the root partition for containers, because the root user of a container will be able to overcome the 5% disk space barrier in some situations. This way the HN root partition can be completely filled and it will break the system.&lt;br /&gt;
&lt;br /&gt;
OpenVZ per-container disk quota is supported only for ext2/ext3 filesystems. So use one of these filesystems (ext3 is recommended) if you need per-container disk quota.&lt;br /&gt;
&lt;br /&gt;
=== rpm or yum? ===&lt;br /&gt;
&lt;br /&gt;
In case you have yum utility available on your system, you may want to use it effectively to install and update OpenVZ packages. In case you don't have yum, or don't want to use it, you can use plain old rpm. Instructions for both rpm and yum are provided below.&lt;br /&gt;
&lt;br /&gt;
=== yum pre-setup ===&lt;br /&gt;
If you want to use yum, you should set up OpenVZ yum repository first.&lt;br /&gt;
&lt;br /&gt;
Download [http://download.openvz.org/openvz.repo openvz.repo] file and put it to your &amp;lt;code&amp;gt;/etc/yum.repos.d/&amp;lt;/code&amp;gt; repository. This can be achieved by the following commands, as root:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cd /etc/yum.repos.d&lt;br /&gt;
# wget http://download.openvz.org/openvz.repo&lt;br /&gt;
# rpm --import  http://download.openvz.org/RPM-GPG-Key-OpenVZ&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case you can not cd to /etc/yum.repos.d, it means either yum is not installed on your system, or yum version is too old. In that case, just stick to rpm installation method.&lt;br /&gt;
&lt;br /&gt;
== Kernel installation ==&lt;br /&gt;
&lt;br /&gt;
{{Note|In case you want to recompile the kernel yourself rather than use the one provided by OpenVZ, see [[kernel build]].}}&lt;br /&gt;
&lt;br /&gt;
First, you need to choose what “flavor” of the kernel you want to install. Please refer to [[Kernel flavors]] for more information.&lt;br /&gt;
&lt;br /&gt;
=== Using yum ===&lt;br /&gt;
Run the following command&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# yum install ovzkernel[-flavor]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here &amp;lt;code&amp;gt;[-flavor]&amp;lt;/code&amp;gt; is optional, and can be &amp;lt;code&amp;gt;-smp&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-enterprise&amp;lt;/code&amp;gt;. Refer to [[kernel flavors]] for more info.&lt;br /&gt;
&lt;br /&gt;
=== Using rpm ===&lt;br /&gt;
Get the kernel binary RPM from the [http://openvz.org/download/kernel/ Download » Kernel] page, or directly from [http://download.openvz.org/kernel/ download.openvz.org/kernel], or from one of its [[Download mirrors|mirrors]]. You need only one kernel RPM so please [[Kernel flavors|choose the appropriate one]] depending on your hardware.&lt;br /&gt;
&lt;br /&gt;
Next, install the kernel RPM you chose:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# rpm -ihv ovzkernel[-flavor]*.rpm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here &amp;lt;code&amp;gt;[-flavor]&amp;lt;/code&amp;gt; is optional, and can be &amp;lt;code&amp;gt;-smp&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;-enterprise&amp;lt;/code&amp;gt;. Refer to [[kernel flavors]] for more info.&lt;br /&gt;
&lt;br /&gt;
{{Note|&amp;lt;tt&amp;gt;rpm -U&amp;lt;/tt&amp;gt; (where &amp;lt;tt&amp;gt;-U&amp;lt;/tt&amp;gt; stands for ''upgrade'') should '''not''' be used, otherwise all currently installed kernels will be uninstalled.}}&lt;br /&gt;
&lt;br /&gt;
== Configuring the bootloader ==&lt;br /&gt;
&lt;br /&gt;
In case GRUB is used as the boot loader, it will be configured automatically: lines similar to these will be added to the &amp;lt;tt&amp;gt;/boot/grub/grub.conf&amp;lt;/tt&amp;gt; file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
title Fedora Core (2.6.8-022stab029.1)&lt;br /&gt;
       root (hd0,0)&lt;br /&gt;
       kernel /vmlinuz-2.6.8-022stab029.1 ro root=/dev/sda5 quiet rhgb vga=0x31B&lt;br /&gt;
       initrd /initrd-2.6.8-022stab029.1.img&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Change &amp;lt;tt&amp;gt;Fedora Core&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;OpenVZ&amp;lt;/tt&amp;gt; (just for clarity reasons, so the OpenVZ kernels will not be mixed up with non-OpenVZ ones). Remove extra arguments from the kernel line, leaving only the &amp;lt;tt&amp;gt;root=...&amp;lt;/tt&amp;gt; parameter. The modifed portion of &amp;lt;tt&amp;gt;/etc/grub.conf&amp;lt;/tt&amp;gt; should look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
title OpenVZ (2.6.8-022stab029.1)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /vmlinuz-2.6.8-022stab029.1 ro root=/dev/sda5&lt;br /&gt;
        initrd /initrd-2.6.8-022stab029.1.img&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuring ==&lt;br /&gt;
&lt;br /&gt;
Please make sure the following steps are performed before rebooting into OpenVZ kernel.&lt;br /&gt;
&lt;br /&gt;
=== sysctl ===&lt;br /&gt;
&lt;br /&gt;
There are a number of kernel parameters that should be set for OpenVZ to work correctly. These parameters are stored in &amp;lt;tt&amp;gt;/etc/sysctl.conf&amp;lt;/tt&amp;gt; file. Here is the relevant part of the file; please edit it accordingly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# On Hardware Node we generally need&lt;br /&gt;
# packet forwarding enabled and proxy arp disabled&lt;br /&gt;
net.ipv4.ip_forward = 1&lt;br /&gt;
net.ipv4.conf.default.proxy_arp = 0&lt;br /&gt;
# Enables source route verification&lt;br /&gt;
net.ipv4.conf.all.rp_filter = 1&lt;br /&gt;
# Enables the magic-sysrq key&lt;br /&gt;
kernel.sysrq = 1&lt;br /&gt;
# TCP Explict Congestion Notification&lt;br /&gt;
#net.ipv4.tcp_ecn = 0&lt;br /&gt;
# we do not want all our interfaces to send redirects&lt;br /&gt;
net.ipv4.conf.default.send_redirects = 1&lt;br /&gt;
net.ipv4.conf.all.send_redirects = 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SELinux ===&lt;br /&gt;
&lt;br /&gt;
SELinux should be disabled. To that effect, put the following line to &amp;lt;code&amp;gt;/etc/sysconfig/selinux&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SELINUX=disabled&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Conntracks ===&lt;br /&gt;
&lt;br /&gt;
In the stable OpenVZ kernels (those that are 2.6.8-based) netfilter connection tracking for [[VE0]] is disabled by default. If you have a stateful firewall enabled on the host node (it is there by default) you should either disable it, or enable connection tracking for [[VE0]].&lt;br /&gt;
&lt;br /&gt;
To enable conntracks for VE0, add the following line to &amp;lt;code&amp;gt;/etc/modprobe.conf&amp;lt;/code&amp;gt; file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
options ip_conntrack ip_conntrack_enable_ve0=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|In kernels later than 2.6.8, connection tracking is enabled by default.}}&lt;br /&gt;
&lt;br /&gt;
== Rebooting into OpenVZ kernel ==&lt;br /&gt;
&lt;br /&gt;
Now reboot the machine and choose &amp;quot;OpenVZ&amp;quot; on the boot loader menu. If the OpenVZ kernel has been booted successfully, proceed to installing the user-level tools for OpenVZ. If you are installing on x86_64 CentOS or Fedora system, you may want to continue the setup process using the [[Install_OpenVZ_on_a_x86_64_system_Centos-Fedora|x86_64 guide]].&lt;br /&gt;
&lt;br /&gt;
== Installing the utilities ==&lt;br /&gt;
&lt;br /&gt;
OpenVZ needs some user-level tools installed. Those are:&lt;br /&gt;
&lt;br /&gt;
; vzctl&lt;br /&gt;
:    A utility to control OpenVZ VPSs (create, destroy, start, stop, set parameters etc.)&lt;br /&gt;
; vzquota&lt;br /&gt;
:    A utility to manage quotas for VPSs. Mostly used indirectly (by vzctl).&lt;br /&gt;
&lt;br /&gt;
=== Using yum ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# yum install vzctl vzquota&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Using rpm ===&lt;br /&gt;
&lt;br /&gt;
Download the binary RPMs of these utilities from [http://openvz.org/download/utils/ Download » Utils], or directly from [http://download.openvz.org/utils/ download.openvz.org/utils], or from one of its [[Download mirrors|mirrors]]. Install them:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# rpm -Uhv vzctl*.rpm vzquota*.rpm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If rpm complains about unresolved dependencies, you'll have to satisfy them first, then repeat the installation.&lt;br /&gt;
&lt;br /&gt;
When all the tools are installed, start the OpenVZ subsystem.&lt;br /&gt;
&lt;br /&gt;
== Starting OpenVZ ==&lt;br /&gt;
&lt;br /&gt;
As root, execute the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# /sbin/service vz start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will load all the needed OpenVZ kernel modules. This script should also start all the VPSs marked to be auto-started on machine boot (there aren't any yet).&lt;br /&gt;
&lt;br /&gt;
During the next reboot, this script should be executed automatically.&lt;br /&gt;
&lt;br /&gt;
== Next steps ==&lt;br /&gt;
&lt;br /&gt;
OpenVZ is now set up on your machine. To load OpenVZ kernel by default, edit the default line in the /boot/grub/grub.conf file to point to the OpenVZ kernel. For example, if the OpenVZ kernel is the first kernel mentioned in the file, put it as default 0. See man grub.conf for more details.&lt;br /&gt;
&lt;br /&gt;
The next step is to prepare the [[OS template]]: please continue to [[OS template cache preparation]] document.&lt;br /&gt;
&lt;br /&gt;
[[Category: Installation]]&lt;br /&gt;
[[Category: HOWTO]]&lt;/div&gt;</summary>
		<author><name>Gjanssens</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Features&amp;diff=4137</id>
		<title>Features</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Features&amp;diff=4137"/>
		<updated>2008-02-20T16:41:24Z</updated>

		<summary type="html">&lt;p&gt;Gjanssens: /* Checkpointing and live migration */  - fix small typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The architecture of OpenVZ is different from the traditional virtual machines architecture because it always runs the same OS kernel as the host system (while still allowing multiple Linux distributions in individual [[container]]s). This single-kernel implementation technology enables running [[container]]s with a near-zero overhead. Thus, OpenVZ offer an order of magnitude higher efficiency and manageability than traditional virtualization technologies.&lt;br /&gt;
&lt;br /&gt;
== OS Virtualization ==&lt;br /&gt;
From the point of view of applications and [[container]] users, each container is an independent system. This independence is provided by a virtualization layer in the kernel of the host OS. Note that only a negligible part of the CPU resources is spent on virtualization (around 1-2%). The main features of the virtualization layer implemented in OpenVZ are the following:&lt;br /&gt;
&lt;br /&gt;
* A [[container]] looks and behaves like a regular Linux system. It has standard startup scripts; software from vendors can run inside a container without OpenVZ-specific modifications or adjustment;&lt;br /&gt;
* A user can change any configuration file and install additional software;&lt;br /&gt;
* [[Containers]]s are completely isolated from each other (file system, processes, Inter Process Communication (IPC), sysctl variables);&lt;br /&gt;
* Processes belonging to a container are scheduled for execution on all available CPUs. Consequently, [[CT]]s are not bound to only one CPU and can use all available CPU power.&lt;br /&gt;
&lt;br /&gt;
== Network virtualization ==&lt;br /&gt;
&lt;br /&gt;
The OpenVZ network virtualization layer is designed to isolate [[CT]]s from each other and from the physical network:&lt;br /&gt;
&lt;br /&gt;
* Each [[CT]] has its own IP address; multiple IP addresses per CT are allowed;&lt;br /&gt;
* Network traffic of a CT is isolated from the other CTs. In other words, containers are protected from each other in the way that makes traffic snooping impossible;&lt;br /&gt;
* Firewalling may be used inside a CT (the user can create rules limiting access to some services using the canonical iptables tool inside a CT). In other words, it is possible to set up firewall rules from inside a CT;&lt;br /&gt;
* Routing table manipulations and advanced routing features are supported for individual containers. For example, setting different maximum transmission units (MTUs) for different destinations, specifying different source addresses for different destinations, and so on.&lt;br /&gt;
&lt;br /&gt;
== Resource Management ==&lt;br /&gt;
&lt;br /&gt;
OpenVZ [[resource management]] controls the amount of resources available for containers. The controlled resources include such parameters as CPU power, disk space, a set of memory-related parameters, etc. Resource management allows OpenVZ to:&lt;br /&gt;
&lt;br /&gt;
* Effectively share available [[host system]] resources among CTs&lt;br /&gt;
* Guarantee Quality-of-Service (QoS)&lt;br /&gt;
* Provide performance and resource isolation and protect from denial-of-service attacks&lt;br /&gt;
* Collect usage information for system health monitoring&lt;br /&gt;
&lt;br /&gt;
Resource management is much more important for OpenVZ than for a standalone computer since computer resource utilization in a OpenVZ-based system is considerably higher than that in a typical system.&lt;br /&gt;
As all the CTs are using the same kernel, resource management is of paramount importance. Really, each CT should stay within its boundaries and not affect other CTs in any way — and this is what resource management does.&lt;br /&gt;
&lt;br /&gt;
OpenVZ resource management consists of four main components: two-level disk quota, fair CPU scheduler, disk I/O scheduler, and user beancounters. Please note that all those resources can be changed during CT runtime, there is no need to reboot. Say, if you want to give your CT less memory, you just change the appropriate parameters on the fly. This is either very hard to do or not possible at all with other virtualization approaches such as VM or hypervisor.&lt;br /&gt;
&lt;br /&gt;
=== Two-Level Disk Quota ===&lt;br /&gt;
[[Host system]] administrator ([[HW]] root) can set up a per-container [[disk quota]]s, in terms of disk blocks and inodes (roughly number of files). This is the first level of disk quota. In addition to that, a container administrator ([[CT]] root) can employ usual quota tools inside own CT to set standard UNIX per-user and per-group [[disk quota]]s.&lt;br /&gt;
&lt;br /&gt;
If one want to give a CT more disk space, you just increase its disk quota. No need to resize disk partitions etc.&lt;br /&gt;
&lt;br /&gt;
=== Fair CPU scheduler ===&lt;br /&gt;
CPU scheduler in OpenVZ is a two-level implementation of [[fair-share scheduling]] strategy.&lt;br /&gt;
&lt;br /&gt;
On the first level scheduler decides which CT is give the CPU time slice to, based on per-CT cpuunits values. On the second level the standard Linux scheduler decides which process to run in that container, using standard Linux process priorities and such.&lt;br /&gt;
&lt;br /&gt;
OpenVZ administrator can set up different values of &amp;lt;code&amp;gt;cpuunits&amp;lt;/code&amp;gt; for different containers, and the CPU time will be given to those proportionally.&lt;br /&gt;
&lt;br /&gt;
Also there is a way to limit CPU time, e.g. say that this container is limited to, say, 10% of CPU time available.&lt;br /&gt;
&lt;br /&gt;
=== I/O scheduler ===&lt;br /&gt;
Similar to the Fair CPU scheduler described above, I/O scheduler in OpenVZ is also two-level, utilizing Jens Axboe's CFQ I/O scheduler on its second level.&lt;br /&gt;
&lt;br /&gt;
Each container is assigned an I/O priority, and the I/O scheduler distributes the available I/O bandwidth according to the priorities assigned. Thus no single container can saturate an I/O channel.&lt;br /&gt;
&lt;br /&gt;
=== User Beancounters ===&lt;br /&gt;
&lt;br /&gt;
[[User beancounters]] is a set of per-CT counters, limits, and guarantees. There is a set of about 20 parameters which are carefully chosen to cover all the aspects of CT operation, so no single container can abuse any resource which is limited for the whole node and thus do harm to another CTs.&lt;br /&gt;
&lt;br /&gt;
Resources accounted and controlled are mainly memory and various in-kernel objects such as IPC shared memory segments, network buffers etc. etc. Each resource can be seen from &amp;lt;code&amp;gt;/proc/user_beancounters&amp;lt;/code&amp;gt; and has five values assiciated with it: current usage, maximum usage (for the lifetime of a container), barrier, limit, and fail counter. The meaning of barrier and limit is parameter-dependant; in short, those can be thought of as a soft limit and a hard limit. If any resource hits the limit, fail counter for it is increased, so CT administrator can see if something bad is happening by analyzing the output of &amp;lt;code&amp;gt;/proc/user_beancounters&amp;lt;/code&amp;gt; in her container.&lt;br /&gt;
&lt;br /&gt;
== Checkpointing and live migration ==&lt;br /&gt;
&lt;br /&gt;
{{Main|Checkpointing and live migration}}&lt;br /&gt;
&lt;br /&gt;
A live migration and checkpointing feature was released for OpenVZ in the middle of April 2006. It allows to migrate a container from one physical server to another without a need to shutdown/restart a container. The process is known as checkpointing: a CT is frozen and its whole state is saved to the file on disk. This file can then be transferred to another machine and a CT can be unfrozen (restored) there. The delay is about a few seconds, and it is not a downtime, just a delay.&lt;br /&gt;
&lt;br /&gt;
Since every piece of the container state, including opened network connections, is saved, from the user's perspective it looks like a delay in response: say, one database transaction takes a longer time than usual, when it continues as normal and user doesn't notice that his database is already running on the another machine.&lt;br /&gt;
&lt;br /&gt;
That feature makes possible scenarios such as upgrading your server without any need to reboot it: if your database needs more memory or CPU resources, you just buy a newer better server and live migrate your container to it, then increase its limits. If you want to add more RAM to your server, you migrate all containers to another one, shut it down, add memory, start it again and migrate all containers back.&lt;br /&gt;
&lt;br /&gt;
[[Category: Concepts]]&lt;br /&gt;
[[Category: Technology]]&lt;/div&gt;</summary>
		<author><name>Gjanssens</name></author>
		
	</entry>
</feed>