Editing
Migrating from OpenVZ to Linux-Vserver
From Linix VServer
Jump to navigation
Jump to search
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.
Anti-spam check. Do
not
fill this in!
So, you've repeatedely heard that [http://openvz.org/ OpenVZ] was hip, better than [http://linux-vserver.org/ Linux-Vserver] even, and thought you'd give it a try? So did we! However, you weren't as pleased as you were supposed to be, and kept thinking back about how Linux-Vserver was cool for you? Well, if that's your case too, here's how we moved back to Linux-Vserver in a few simple keystrokes. == System info == === Kernels === We are running [http://debian.org/ Debian GNU/Linux], in its testing flavour (pre-release Lenny, frozen package base). For OpenVZ, we were using [http://packages.debian.org/sid/linux-image-2.6.26-1-openvz-686 Debian kernel 2.6.26 with OpenVZ patches]. For Linux-Vserver, we are using [http://packages.debian.org/lenny/linux-image-2.6.25-2-vserver-686 Debian kernel 2.6.25 with Linux-Vserver patches]. === Paths === We created our OpenVZ CTs under ''/srv/vps/$VEID/{private,root}/'', and our vservers under ''/srv/vservers/''. == Migrating == === Copying data === After rebooting under the -vserver kernel, here's how we migrated each VPS, using the 'rsync method': <pre> [sudo] vserver $vname build -m rsync \ --hostname $vhostname \ --interface $interface:$ip \ --context $ctx -- \ --source /srv/vps/$veid/private/ -o -va </pre> So, for migrating an OpenVZ CT named [http://en.wikipedia.org/wiki/Seitan 'seitan'] using '192.168.66.6' on 'eth0', in context '666', the command would look like: <pre> sudo vserver seitan build -m rsync \ --hostname seitan \ --interface eth0:192.168.66.6/24 \ --context 666 -- \ --source /srv/vps/seitan/private/ -o -va </pre> Note the trailing ''-o -va'', which allows us to follow rsync as it goes. === Fix daemons === When rsync is done, we can't start our vservers yet, because some of the system daemons that OpenVZ allows are not compatible with a Vserver environment. Let's remove their startup links, then! To do so, let's chroot into our freshly migrated vserver: <pre>sudo chroot /srv/vservers/seitan/</pre> Once inside, let's unlink all the undesired daemons: <pre> for undesired in klogd hwclock.sh setserial urandom networking umountfs halt reboot ; do update-rc.d -f $undesired remove ; done </pre> === Enjoy === Let's log out of the chroot, and start our vserver! <pre> exit sudo vserver seitan start </pre> It should work fine, provided some of your daemons don't depend upon bind mounts from host, which then need to be integrated into the fstab for each of your vservers. Welcome back! [[Category:Migration]]
Summary:
Please note that all contributions to Linix VServer may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Linix VServer:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Page actions
Page
Discussion
Read
Edit
History
Page actions
Page
Discussion
More
Tools
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
About
Overview
Paper
News
Developers
Donations
Search
Getting Started
Downloads
FAQs
Documentation
Support
Participate
How to participate
Report a Bug
Communicate
Teams/Projects
Hall of Fame
Resources
Archives
Recent Wiki Changes
Pastebin
Related Projects
VServer Hosting
Happy VServer Users
Tools
What links here
Related changes
Special pages
Page information