Open main menu

OpenVZ Virtuozzo Containers Wiki β

Editing Using vzpkg and vzyum on x86 64

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
{{Warning|These are not official installation instructions. Do not follow this article, use [[Quick installation]] instead!
+
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.
'''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.
+
Last Revision: 08:10, 3 March 2008 (EST)
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 system with python 2.2, 2.3 or 2.4 version.
 
  
Last Revision: [[User:Mcarreira|Mcarreira]] 18:07, 30 January 2011 (UTC)
 
  
 
== THE PROBLEM ==
 
== THE PROBLEM ==
Line 48: Line 45:
  
 
Until now there is only one <i>side effect</i> detected in this solution:
 
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 its own yum cache in the directory <code>/var/cache/yum-cache</code>.
+
* The yum cache is not common to all [[container]]s. Instead, each [[container]] has it's own yum cache in the directory <code>/var/cache/yum-cache</code>.
 
This is a consequence from using the modified vzyum.
 
This is a consequence from using the modified vzyum.
 +
  
 
== INSTALL Openvz ==
 
== INSTALL Openvz ==
Line 72: Line 70:
  
 
* 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.
 
* 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.6.tar.gz setx86_64-0.6] and then untar and run the script:
+
* Download the file [http://linux.carreira.com.pt/ovzutils/setx86_64-0.3.tar.gz setx86_64-0.3] and then untar and run the script:
  
 
<pre>
 
<pre>
tar xzvf setx86_64-0.6.tar.gz
+
tar xzvf setx86_64-0.3.tar.gz
 
sh setx86_64
 
sh setx86_64
 
</pre>
 
</pre>
  
 +
{{Warning|Please note that the setx86_64 script currently may not install the vzquota.x86_64 package and only include the vzquota.i386... which has been noted to cause disk quota issues when creating containers.  To avoid this issue it is recommended you manually install the vzquota.x86_64 package until the script is updated:
 +
yum install vzquota.x86_64}}
  
 
Press Enter and some tests are made to know if you can go on with the installation.
 
Press Enter and some tests are made to know if you can go on with the installation.
Line 122: Line 122:
 
</code>
 
</code>
  
{{ Note |In setx86_64 script, all the vztemplates available in openvz.org site are downloaded and used to build x86_64 templates, ready to be used.}}
+
Note: In setx86-0.3 script, all the vztemplates available in openvz.org site are downloaded and used to build x86_64 templates, ready to be used.
  
  
Line 153: Line 153:
 
:<code>cachedir=/var/cache/yum-cache</code>
 
:<code>cachedir=/var/cache/yum-cache</code>
  
{{Note| <b>1)</b> With these changes, vzyum won´t be able to use a common cache directory to all [[container]]s as it used to do. Each [[container]] will have its own cache directory.
+
{{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.
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.
+
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.}}
 
  
  
Line 229: Line 228:
  
 
In other Operating Systems or other versions, you must verify which python version is installed in the host system.  
 
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 script, line 334 to line 358, to understand how it is done).
+
Depending on that, the 32 bit files to be replaced are different (read the setx86_64-0.3 script, line 320 to line 345, to understand how it is done).
  
  
Line 257: Line 256:
 
Change the next lines:
 
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 136:</b>
Line 273: Line 263:
 
</pre>
 
</pre>
  
<b> -Line 154:</b>
 
<pre>
 
append: mkdir -p $VE_ROOT/var/lib/yum/ || abort "Can't create /var/lib/yum"
 
</pre>
 
  
 
<b> -Line 185:</b>
 
<b> -Line 185:</b>
Line 289: Line 275:
 
Edit the file /usr/share/vzpkg/<b>functions</b><br>
 
Edit the file /usr/share/vzpkg/<b>functions</b><br>
 
Change the next lines:
 
Change the next lines:
 
 
<b> -Line 20:</b>
 
<pre>
 
change: VZLIB_SCRIPTDIR=/usr/lib/vzctl/scripts
 
to: VZLIB_SCRIPTDIR=/usr/lib64/vzctl/scripts
 
</pre>
 
  
  
Line 392: Line 371:
  
  
===== 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 ==
 
== TESTING THE NEW CODE ==

Please note that all contributions to OpenVZ Virtuozzo Containers Wiki may be edited, altered, or removed by other contributors. If you don't want your writing to be edited mercilessly, then don't submit it here.
If you are going to add external links to an article, read the External links policy first!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)

Templates used on this page: