Recently I migrated two Gentoo based physical installations to Ubuntu based OpenVZ containers.
The should-be piece-of-cake process gave mi the hell of a headache. After the migration the container network did not work as expected. To be exact, it did not work at all…
OpenVZ uses one “bare” venet0 device on the host side, connected to a multi-IP (or multi-aliased) venet0 device on the container side with a twisted PTP connection. The IP-level communication is done via 192.0.2.1 virtual gateway. It’s clever. It works well. But it’s not straightforward to get running – especially with sparse documentation OpenVZ has.
After a few hours of fighting and cursing I finally got it to work.
- Create the container and migrate content as described in Physical to container doc.
- Tune it according to the above doc and Gentoo template creation doc.
- In the container remove all the network configuration scripts from runlevels:
rc-update del net.eth0; rc-update del net.eth1 ... - Create a script for venet0 device:
ln -s net.lo /etc/init.d/net.venet0and add it to default runlevel:rc-update add net.venet0 default. - Set up the /etc/conf.d/net the following way:
config_venet0=( "123.234.123.234/32" # the old eth0 address "10.0.0.1/24" # the old eth1 address ) routes_venet0=( "192.0.2.1 dev venet0" "default via 192.0.2.1" )
P.S. For the curious ones – yes, the “old” Chrome Platform (seikken+amenite) is crammed in a new shiny Dell 1U rack server. ^_^

0 Responses
Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.