Open main menu

OpenVZ Virtuozzo Containers Wiki β

Changes

Using vzpkg and vzyum on x86 64

1,742 bytes added, 19:53, 19 March 2012
m
{{Warning|These are not official installation instructions. Do not follow this article, use [[Quick installation]] instead!
 
'''Please also note that template tools (vzpkg/vzyum) are unsupported and obsoleted.'''}}
 
This document describes a way to install OpenVZ in a x86_64 computer, so that it can create cache templates, use vzyum and vzrpm.
This is intended to work in a host with Centos-4, Centos-5, Fedora Core 5, Fedora Core 6, RHEL 4 or any other RPM based based system with python 2.2, 2.3 or 2.4 version. Last Revision: 04:10, 28 Feb 2009 (EST)
Last Revision: [[User:Mcarreira|Mcarreira]] 18:07, 30 January 2011 (UTC)
== THE PROBLEM ==
Until now there is only one <i>side effect</i> detected in this solution:
* The yum cache is not common to all [[container]]s. Instead, each [[container]] has it's its own yum cache in the directory <code>/var/cache/yum-cache</code>.
This is a consequence from using the modified vzyum.
 
== INSTALL Openvz ==
* 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.
* Download the file [http://linux.carreira.com.pt/ovzutils/setx86_64-0.46.tar.gz setx86_64-0.46] and then untar and run the script:
<pre>
tar xzvf setx86_64-0.46.tar.gz
sh setx86_64
</pre>
</code>
{{ Note: |In setx86-0.3 setx86_64 script, all the vztemplates available in openvz.org site are downloaded and used to build x86_64 templates, ready to be used.}}
:<code>cachedir=/var/cache/yum-cache</code>
{{Note| <b>1)</b> With this these changes, vzyum is not going to won´t be able to use a common cache directory to all [[container]]s as it was used to do. Each [[container]] will have it's its own cache directory.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.}}
<b>2)</b> To set up a common cache directory, you can use the autofs/automounter daemon together with [[Bind_mounts]] as described in <b>step 12</b>. Using a shared cache may save a lot of network traffic when installing new VPSs.}}
In other Operating Systems or other versions, you must verify which python version is installed in the host system.
Depending on that, the 32 bit files to be replaced are different (read the setx86_64-0.3 script, line 320 334 to line 345358, to understand how it is done).
Change the next lines:
<b> -Line 97:</b>
{{Note| '''ve-vps.basic.conf-sample''' is now renamed '''ve-basic.conf-sample''' }}
(see [http://bugzilla.openvz.org/show_bug.cgi?id=1694 bug 1694] )
 
<pre>
change: VECFGSAMPLE=$VECFGDIR/ve-vps.basic.conf-sample
to: VECFGSAMPLE=$VECFGDIR/ve-basic.conf-sample
append: if ! [ -f "$VECFGSAMPLE" ]; then VECFGSAMPLE="$VECGFDIR/ve-vps.basic.conf-sample"; fi
</pre>
<b> -Line 136:</b>
<b> -Line 154:</b>
<pre>
append: mkdir -p $VE_ROOT/proc var/lib/yum/ || abort "Can't create dir $VE_ROOT/procvar/lib/yum"
</pre>
Edit the file /usr/share/vzpkg/<b>functions</b><br>
Change the next lines:
 
 
<b> -Line 20:</b>
<pre>
change: VZLIB_SCRIPTDIR=/usr/lib/vzctl/scripts
to: VZLIB_SCRIPTDIR=/usr/lib64/vzctl/scripts
</pre>
===== STEP 12 =====
 
To share the vzyum cache directory between various [[containers]], <b>after all is set up</b>, edit your /etc/auto.master to include the following:
:<code>/vz/root/{vpsid}/var/cache/yum-cache /etc/auto.vzyum</code>
Include one line for each installed or planned VPS, replacing {vpsid} with the adequate value.
 
Then, create a /etc/auto.vzyum file with only this line:
:<code>* -bind,ro,nosuid,nodev :/var/cache/yum-cache/&</code>
This file won´t need to be changed, even after you add more containers.
Restart the automounter daemon.
 
{{Note| Make sure these changes won´t interfere with other automounts you may already have set up. If you don´t already use autofs/automount, it is safe to comment out other settings in auto.master.}}
== TESTING THE NEW CODE ==