Open main menu

OpenVZ Virtuozzo Containers Wiki β

Changes

Centos Upgrade 4.x to 5.x

58 bytes added, 11:13, 9 April 2008
vps, ve -> container
To create a centos CentOS 5 minimal template from centos-4-i386-minimal ,follow the next these steps:
1 - Create a vps container using centos-4-i386-minimal and set a valid nameserver
<pre>
vzctl create VEID CTID --ostemplate centos-4-i386-minimal --config CONFIG_TEMPLATE --ipadd VPS_IP container_IP --hostname tempvzctl set VEID CTID --nameserver NAMESERVER_IP --save
</pre>
2 - Enter in VPScontainer
<pre>
vzctl enter VEIDCTID
</pre>
3 - Install centos-5-release packages
rpm -Uvh http://mirror.centos.org/centos/5.0/os/i386/CentOS/initscripts-8.45.14.EL-1.el5.centos.1.i386.rpm --force --nodeps
</pre>
6 - Exit from VPScontainer
<pre>
exit
</pre>
7 - Upgrade vps container packages using vzyum (32bit only)
<pre>
vzyum VEID CTID upgrade
</pre>
Note: on 64-bit yum db-version might complain. Do "rm /vz/root/VZNUM/var/lib/rpm/__*" to delete conflicting DB.
8 - Stop your VE
<pre>
vzctl stop VEIDCTID
</pre>
9 - Replace the new /dev/ with the old one
<pre>
cd /vz/private/VEIDCTID
rm -rf dev
tar -xvf dev.tar
</pre>
10 - Leave the vps container private dir (or it will not stard)
<pre>
cd
</pre>
11 - Start the VPScontainer
<pre>
vzctl start VEIDCTID
</pre>
12 - Remove VPS container IP
<pre>
vzctl set --ipdel VPS_IPcontainer_IP
</pre>
13 - Stop VPScontainer
<pre>
vzctl stop VEIDCTID
</pre>
14 - Create the template
<pre>
cd /vz/private/VEIDCTID
tar -zcf /vz/template/cache/centos-5.0-i386-minimal.tar.gz .
</pre>