Changes

Jump to: navigation, search

Migration from Linux-VServer to OpenVZ

389 bytes removed, 07:13, 22 August 2008
organized into sections, some fixes, improvements, cleanups.
Current document describes the migration from Linux-VServer based virtualization solution to OpenVZ.
== Description of challenge:==
The challenge is migration from Linux-Vserver to OpenVZ by booting the OpenVZ kernel and updating the existing configs of
utility level in purpose to make the existing guest OSes work over OpenVZ kernel.
== Details of migration process. Step by step:==
1. === Initial conditions: the === The following example of Linux-VServer based solution was used for the experiment:
* Kernel linux-2.6.17.13 was patched by the patch-2.6.17.13-vs2.0.2.1.diff and rebuild;
* Util-vserver-0.30.211 tools were used for creating containers;
<code>
# vserver-info
Versions:
vserver-Rootdir: /vservers
#
</code>
VServer v345 was built using vserver vX build utility and populated by using the tarballed template of Fedora Core 4.
<code>
# vserver v345 start
Starting system logger: [ OK ]
sh-2.05b#
.........
</code>
As a result we obtain running virtual environment v345:
<code>
# vserver-stat
#
</code>
2. === Starting migration to OpenVZ: downloading === Downloading and installing the stable OpenVZ kernel.
Install the OpenVZ kernel, as described in [[quick Quick installation]].
After the kernel is installed, reboot the machine. After rebooting and logging in you will see the following reply on vserver-stat call:
<code>
# vserver-stat
can not change context: migrate kernel feature missing and 'compat' API disabled: Function not implemented
#
</code>
It is a natural thing that now virtual environment v345 is unavailable. The following steps will be devoted to making it
work over OpenVZ kernel.
3. === Downloading and installing vzctl package===
OpenVZ solution requires installing a set of tools: vzctl and vzquota packages. Download and install it, as described in [[quick installation]].
Then launch the OpenVZ:
<code>
# /sbin/service vz start
Starting OpenVZ: [ OK ]
Bringing up interface venet0: [ OK ]
Configuring interface venet0: [ OK ]
#
</code>
Currently vzlist utility is unable to find any containers:
 
<code>
# vzlist
Containers not found
#
</code>
4. === Updating different configurations in purpose to make existing templates work ===
Move the existing templates of guest OSs to the right place:
<code>
# cd /vz
# mkdir private
# mkdir private/345
# mv /vservers/v345 /vz/private/345
</code>
Now it is time for creating configuration files for OpenVZ container. Use the basic sample
configuration presented in /etc/sysconfig/vz-scripts/ve-vps.basic.conf-sample file:
<code>
# cd /etc/sysconfig/vz-scripts
# cp ve-vps.basic.conf-sample 345.conf
</code>
Update Now, let's set some parameters for the ON_BOOT string in 345new container.conf file by typing:
<code> ..... ONBOOT="yes" .....</code>to make it boot on node restartFirst, and add a couple of strings related we need to tell which distro theparticular container 345is running:<code> ..... VE_ROOT# echo "OSTEMPLATE="/vz/root/345fedora-core-4" VE_PRIVATE="/vz/private/>> 345" ORIGIN_SAMPLE="vps.basic" HOSTNAME="test345.my.org" IP_ADDRESS="192.168.0.145" .....</code>conf
And Then we set a few more parameters: vzctl set 345 --onboot yes --save # to make it start upon reboot the machine: vzctl set 345 --ipadd 192.168.0.145 --save vzctl set 345 --hostname test345.my.org --save
<code> # reboot</code>== Testing how the guest OSs successfully work over OpenVZ ==
5. Testing how the guest OSs successfully work over OpenVZ. Reference to Users Guide of OpenVZ (vzctl).Now you can start a container:
After rebooting you will be able to see running container # vzctl start 345 that have beenmigrated from vserver:
<code>and see if it's running:
# vzlist -a
CTID NPROC STATUS IP_ADDR HOSTNAME
345 5 running 192.168.0.145 test345.my.org
#
</code>
And You can run commands on in it:
<code>
# vzctl exec 345 ls -l
total 48
drwxr-xr-x 15 root root 4096 Jul 27 2004 usr
drwxr-xr-x 17 root root 4096 Oct 26 2004 var
#
</code>
== Issues:==
1. The vserver-originating containers do not initialize network at all. Thus one needs to use following command to enable networking start (inside of the migrated container):
ln -s ../init.d/networking S40networking
2. Disk space information is empty. Openvz vserver containers have special scripts Do the following to gleanfix: rm /etc/mtabthe disk space information from underlying system, which needs to be migrated. ln -s /proc/mounts /etc/mtab
[[Category:HOWTO]]

Navigation menu