Changes

Jump to: navigation, search

Migration from Linux-VServer to OpenVZ

902 bytes added, 09:34, 4 August 2010
Issues
=== Updating different configurations ===
Move Get the existing guest OSs to the right place:
# cd /vz
# mkdir private/345
# mv /vservers/v345 /vz/private/345
In Debian Lenny the path is /var/lib/vz/private/345 instead.
In any case it is a good idea to have the guest file system in a dedicated partition or lvm container (shown in the example below) and just mount it there
instead of moving:
# mkdir /var/lib/vz/private/345
# mount /dev/mapper/vg01-lvol5 /var/lib/vz/private/345
Now it is time for creating configuration files for OpenVZ container. Use the basic sample
# cd /etc/sysconfig/vz-scripts
# cp ve-vps.basic.conf-sample 345.conf
In Debian Lenny the configuration is located in /etc/vz/conf/ , in this case type:
# cd /etc/vz/conf
# cp ve-vps.basic.conf-sample 345.conf
Now, let's set some parameters for the new container.
First, we need to tell which distro the container is running:
# echo "OSTEMPLATE=\"fedora-core-4\"" >> 345.conf # echo "OSTEMPLATE=\"debian\"" >> 345.conf (for Debian Lenny)
Then we set a few more parameters:
== Issues ==
 
=== Starting ===
 
If starting fails with a message '''Unable to start init, probably incorrect template''' either the /sbin/init file is missing in the guest file system, or just not executable. Or the guest file system is completely absent or dislocated. The proper path where you must place is specified in the vz.conf file, namely the parameter VE_PRIVATE. For Debian this file can be found in /etc/vz.
=== Networking ===
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):
cd /etc/rcS.d ln update-s ../initrc.d/networking S40networkingdefaults
==== Migrating your VServer Shorewall setup ====
Additionally, Ubuntu based vservers have the udev package installed which prevents access to the console in openvz. This error message is an example of the problem:
<code> # vzctl enter 101345 enter into CT 101 345 failed Unable to open pty: No such file or directory</code>
The fix is to remove the udev package from the guest:
<code> # vzctl exec 101 345 'dpkg --force-depends --purge udev' (Reading database ... dpkg: udev: dependency problems, but removing anyway as you request: initramfs-tools depends on udev (>= 117-5). 15227 files and directories currently installed.) Removing udev ... Purging configuration files for udev ... dpkg - warning: while removing udev, directory `/lib/udev/devices/net' not empty so not removed. dpkg - warning: while removing udev, directory `/lib/udev/devices' not empty so not removed.</code>
Now restart the container, you should now be able to use the console.
<code>
# vzctl restart 101
Restarting container
...
<SNIP>
...
Container start in progress...
# vzctl restart 345 Restarting container ... <SNIP> ... Container start in progress...  # vzctl enter 101345 entered into CT 101345 root@test:/#</code>
=== /proc ===
Anonymous user

Navigation menu