-
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
P.Haul currently assumes, that container's private are is shared between the nodes you migrate it between. This can be achieved e.g. by mounting the same NFS export on /vz directory on both nodes.
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.
/etc/sysconfig/network-scripts/ifcfg-br0
DEVICE=br0 TYPE=Bridge BOOTPROTO=dhcp ONBOOT=yes DELAY=0
To /etc/sysconfig/network-scripts/ifcfg-$link add 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).
This should be so on both nodes -- source and destination!
- 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.
# vzctl start 100
Check that networking is up and running in IT by getting its IP address and pinging it from some node
# vzctl exec ip a l eth0 # ping $ct_ip
- Start CRIU service on both nodes
# criu service -v4 -o $log_file --daemon
- Start P.Haul service on destination node
# p.haul-service
- Do live migration
# p.haul ovz $id $dst_node_ip -v4