Open main menu

OpenVZ Virtuozzo Containers Wiki β

Changes

Centos Upgrade 4.x to 5.x

4 bytes added, 13:53, 28 May 2011
formatted 17 steps
follow these steps:
1 - ==Create a container using centos-4-i386-minimal and set a valid nameserver ==
<pre>
vzctl create CTID --ostemplate centos-4-i386-minimal --config CONFIG_TEMPLATE --ipadd container_IP --hostname temp
vzctl set CTID --nameserver NAMESERVER_IP --save
</pre>
2 - ==Enter in container==
<pre>
vzctl enter CTID
</pre>
3 - ==Install centos-5-release packages==
<pre>
rpm -Uvh http://mirror.centos.org/centos/5/os/i386/CentOS/centos-release-notes-5.5-0.i386.rpm
Note: centos-release-5 depends on notes-package, start with that one.
4 - ==Backup your /dev/, since initscripts need udev and will remove vzdev you'll net the backup==
<pre>
tar -cf dev.tar ./dev
</pre>
5 - ==Install initscripts package (forced and with no deps)==
<pre>
rpm -Uvh http://mirror.centos.org/centos/5/os/i386/CentOS/initscripts-8.45.30-2.el5.centos.i386.rpm --force --nodeps
</pre>
6 - ==Exit from container==
<pre>
exit
</pre>
7 - ==In /etc/vz/conf/CSID.conf replace==
<pre>
OSTEMPLATE="centos-4-i386-minimal"
OSTEMPLATE="centos-5-i386-minimal"
</pre>
8 - ==Copy existing template from==
<pre>
/vz/template/centos/4
/vz/template/centos/5
</pre>
9 - In /vz/template/centos/4/i386/config/yum.conf change mirrors to CentOS 5
10 - ==In /vz/template/centos/4/i386/config/yum.conf change mirrors to CentOS 5== ==Upgrade container packages using vzyum (32bit only)==
<pre>
vzyum CTID upgrade
Note: If yum db-version complains do "rm /vz/root/VZNUM/var/lib/rpm/__*" to delete conflicting db.
11 - ==Stop your VE==
<pre>
vzctl stop CTID
</pre>
12 - ==Replace the new /dev/ with the old one==
<pre>
cd /vz/private/CTID
tar -xvf dev.tar
</pre>
13 - ==Leave the container private dir (or it will not start)==
<pre>
cd
</pre>
14 - ==Start the container==
<pre>
vzctl start CTID
</pre>
15 - ==Remove container IP==
<pre>
vzctl set --ipdel container_IP
</pre>
16 - ==Stop container==
<pre>
vzctl stop CTID
</pre>
17 - ==Create the template==
<pre>
cd /vz/private/CTID
tar --numeric-owner -zcf /vz/template/cache/centos-5.5-i386-minimal.tar.gz .
</pre>
27
edits