-
Notifications
You must be signed in to change notification settings - Fork 40
Live migrating OVZ mainstream container
This page describes how to create and live migrate and OVZ container on Fedora 20
There are two things to know before creating contianer.
CRIU can dump and restore container based on
- Centos-6-x86_64
- Ubuntu-10.04-x86_64
That said, create a container with this command
# vzctl create $id $template --local_uid 0 --local_gid 0
The easiest way to do it is via bridging. To do so, you should first have your host's main link attached (eth0/enp0sN) to bridge.
It's just and example of how to do it on Fedora-20, you can skip this section and do it in your own way.
- Disable NetworkManager and enable legacy networking
# chkconfig NetworkManager off # chkconfig network on # service NetworkManager stop # service network start
- Configure bridge and attach eth0 device to it.
- Create config file
/etc/sysconfig/network-scripts/ifcfg-br0
- Create config file
DEVICE=br0 TYPE=Bridge BOOTPROTO=dhcp ONBOOT=yes DELAY=0
-
/etc/sysconfig/network-scripts/ifcfg-$linkadd line
-
BRIDGE=br0
- Then do
# service network restart
After this you should have eth0/enp0sN be in bridge (seen by brctl show br0) and br0 have the ip address (seen by ip a l)
- Assign veth to container
# vzctl set $id --netif_add eth0,$ct_mac,veth$id.0,$host_mac,br0
Plz note, that if $host_mac is arithmetically less that the mac on your main link (eth0/enp0sN) after starting CT you would see some lag in networking due to br0's mac would change.
- Make sure you have eth0 config file in CT's
/etc/sysconfig/network-scripts/ifcfg-eth0.