Editing Migration from Linux-VServer to OpenVZ
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: | ||
{{Roughstub}} | {{Roughstub}} | ||
− | + | 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 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 | # vserver-info | ||
Versions: | Versions: | ||
Line 17: | Line 21: | ||
VS-API: 0x00020002 | VS-API: 0x00020002 | ||
util-vserver: 0.30.211; Dec 5 2006, 17:10:21 | util-vserver: 0.30.211; Dec 5 2006, 17:10:21 | ||
− | + | ||
Features: | Features: | ||
CC: gcc, gcc (GCC) 3.4.3 20041212 (Red Hat 3.4.3-9.EL4) | CC: gcc, gcc (GCC) 3.4.3 20041212 (Red Hat 3.4.3-9.EL4) | ||
Line 32: | Line 36: | ||
syscall(2) invocation: alternative | syscall(2) invocation: alternative | ||
vserver(2) syscall#: 273/glibc | vserver(2) syscall#: 273/glibc | ||
− | + | ||
Paths: | Paths: | ||
prefix: /usr/local | prefix: /usr/local | ||
Line 41: | Line 45: | ||
vserver-Rootdir: /vservers | vserver-Rootdir: /vservers | ||
# | # | ||
+ | </code> | ||
VServer v345 was built using vserver vX build utility and populated by using the tarballed template of Fedora Core 4. | VServer v345 was built using vserver vX build utility and populated by using the tarballed template of Fedora Core 4. | ||
+ | <code> | ||
# vserver v345 start | # vserver v345 start | ||
Starting system logger: [ OK ] | Starting system logger: [ OK ] | ||
Line 70: | Line 76: | ||
sh-2.05b# | sh-2.05b# | ||
......... | ......... | ||
+ | </code> | ||
As a result we obtain running virtual environment v345: | As a result we obtain running virtual environment v345: | ||
+ | <code> | ||
# vserver-stat | # vserver-stat | ||
− | + | ||
CTX PROC VSZ RSS userTIME sysTIME UPTIME NAME | CTX PROC VSZ RSS userTIME sysTIME UPTIME NAME | ||
0 51 90.9M 26.3M 0m58s75 2m42s57 33m45s93 root server | 0 51 90.9M 26.3M 0m58s75 2m42s57 33m45s93 root server | ||
49153 4 10.2M 2.8M 0m00s00 0m00s11 21m45s42 v345 | 49153 4 10.2M 2.8M 0m00s00 0m00s11 21m45s42 v345 | ||
− | + | ||
# | # | ||
+ | </code> | ||
− | + | 2. Starting migration to OpenVZ: downloading and installing the stable OpenVZ kernel. | |
− | + | Install the OpenVZ kernel, as described in [[quick installation]]. | |
− | |||
− | Install the OpenVZ kernel, as described in [[ | ||
After the kernel is installed, reboot the machine. After rebooting and logging in you will see the following reply on vserver-stat call: | 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 | # vserver-stat | ||
can not change context: migrate kernel feature missing and 'compat' API disabled: Function not implemented | 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 | 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. | 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]]. | OpenVZ solution requires installing a set of tools: vzctl and vzquota packages. Download and install it, as described in [[quick installation]]. | ||
Line 102: | Line 112: | ||
Then launch the OpenVZ: | Then launch the OpenVZ: | ||
+ | <code> | ||
# /sbin/service vz start | # /sbin/service vz start | ||
Starting OpenVZ: [ OK ] | Starting OpenVZ: [ OK ] | ||
Bringing up interface venet0: [ OK ] | Bringing up interface venet0: [ OK ] | ||
Configuring interface venet0: [ OK ] | Configuring interface venet0: [ OK ] | ||
+ | # | ||
+ | </code> | ||
Currently vzlist utility is unable to find any containers: | Currently vzlist utility is unable to find any containers: | ||
+ | |||
+ | <code> | ||
# vzlist | # vzlist | ||
Containers not found | 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 | # cd /vz | ||
# mkdir private | # mkdir private | ||
− | # mkdir | + | # mkdir 345 |
# mv /vservers/v345 /vz/private/345 | # mv /vservers/v345 /vz/private/345 | ||
− | + | </code> | |
− | |||
− | |||
− | |||
− | |||
Now it is time for creating configuration files for OpenVZ container. Use the basic sample | 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: | configuration presented in /etc/sysconfig/vz-scripts/ve-vps.basic.conf-sample file: | ||
+ | <code> | ||
# cd /etc/sysconfig/vz-scripts | # cd /etc/sysconfig/vz-scripts | ||
# cp ve-vps.basic.conf-sample 345.conf | # cp ve-vps.basic.conf-sample 345.conf | ||
− | + | </code> | |
− | |||
− | |||
− | + | Update the ON_BOOT string in 345.conf file by typing: | |
− | + | <code> | |
− | + | ..... | |
− | + | ONBOOT="yes" | |
+ | ..... | ||
+ | </code> | ||
+ | to make it boot on node restart, and add a couple of strings related to the | ||
+ | particular container 345: | ||
+ | <code> | ||
+ | ..... | ||
+ | VE_ROOT="/vz/root/345" | ||
+ | VE_PRIVATE="/vz/private/345" | ||
+ | ORIGIN_SAMPLE="vps.basic" | ||
+ | HOSTNAME="test345.my.org" | ||
+ | IP_ADDRESS="192.168.0.145" | ||
+ | ..... | ||
+ | </code> | ||
− | + | And reboot the machine: | |
− | |||
− | |||
− | |||
− | + | <code> | |
+ | # reboot | ||
+ | </code> | ||
− | + | 5. Testing how the guest OSs successfully work over OpenVZ. Reference to Users Guide of OpenVZ (vzctl). | |
− | + | After rebooting you will be able to see running container 345 that have been | |
+ | migrated from vserver: | ||
− | + | <code> | |
# vzlist -a | # vzlist -a | ||
CTID NPROC STATUS IP_ADDR HOSTNAME | CTID NPROC STATUS IP_ADDR HOSTNAME | ||
345 5 running 192.168.0.145 test345.my.org | 345 5 running 192.168.0.145 test345.my.org | ||
+ | # | ||
+ | </code> | ||
− | + | And run commands on it: | |
+ | <code> | ||
# vzctl exec 345 ls -l | # vzctl exec 345 ls -l | ||
total 48 | total 48 | ||
Line 176: | Line 205: | ||
drwxr-xr-x 15 root root 4096 Jul 27 2004 usr | drwxr-xr-x 15 root root 4096 Jul 27 2004 usr | ||
drwxr-xr-x 17 root root 4096 Oct 26 2004 var | drwxr-xr-x 17 root root 4096 Oct 26 2004 var | ||
+ | # | ||
+ | </code> | ||
− | + | Potential issues: | |
− | + | This work has in progress status. Some issues may take place with tuning the network for containers. To be continued. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
[[Category:HOWTO]] | [[Category:HOWTO]] |