Openvz_Migration
This page describes what steps to follow, in order to migrate an OpenVZ container in Emulab.
Source machine(pc341,e.g.):
a). Copy new vnodesetup, mkvnode.pl and libvnode_openvz.pm
sudo cp ~/emulab/new/* /usr/local/etc/emulab/
b). Kill and restart the container(pcvm341-1,e.g.)
sudo /usr/local/etc/emulab/vnodesetup -jk pcvm341-1 sudo /usr/local/etc/emulab/vnodesetup -bjVtd pcvm341-1
c). Login pcvm341-1 and run nfs writes test program
sudo vzctl enter 5 cd /users/utos/test/nfs_w/ make clean;make ./run & exit
d). Check the files are in different sizes(optional)
cd /mnt/pcvm341-1/private/tmp/ ls -l cd ~
e). Checkpoint the container
ps -ef | grep vnodesetup sudo kill -sigusr1 PID
Boss database changes
a). Update nodes table
- Show old mapping
select node_id,phys_nodeid from nodes where type='pcvm';
- Change v2p mapping
update nodes set phys_nodeid='pc358' where node_id='pcvm341-1';
- Show new mapping
select node_id,phys_nodeid from nodes where type='pcvm';
b). Update vinterfaces table
- Show old mapping
select node_id,vnode_id,unit,iface from vinterfaces order by vnode_id;
- Change unit and node_id for pcvm341-1. (Also check whether pcvm341-1 use the same iface as pcvm358-1. If not, change it to the same iface as pcvm358-1.)
update vinterfaces set unit=5 where vnode_id='pcvm341-1'; update vinterfaces set node_id='pc358' where vnode_id='pcvm341-1';
- Show new mapping
select node_id,vnode_id,unit,iface from vinterfaces order by vnode_id;
Destination machine
a). Copy new vnodesetup, mkvnode.pl and libvnode_openvz.pm
sudo cp ~/emulab/new/* /usr/local/etc/emulab/
b). Restore the container
sudo /usr/local/etc/emulab/vnodesetup -bjVtdm pcvm341-1
For experimental network, check whether the other end for pcvm341-1 uses the same iface as pcvm358-1. If not, delete that veth from the old bridge and add it to the appropriate bridge.
a). Check ifaces by IP address
select node_id,vnode_id,unit,iface,ip from vinterfaces order by vnode_id; +---------+-----------+------+-------+----------+ | node_id | vnode_id | unit | iface | ip | +---------+-----------+------+-------+----------+ | pc334 | pcvm334-1 | 1 | eth4 | 10.1.8.2 | | pc334 | pcvm334-1 | 5 | eth4 | 10.1.6.2 | | pc358 | pcvm341-1 | 5 | eth4 | 10.1.8.3 | | pc358 | pcvm358-1 | 1 | eth4 | 10.1.6.3 | +---------+-----------+------+-------+----------+
b). If pcvm334-1 uses two different eths, then adjust the bridge for pcvm341-1.
brctl delif pbreth_o veth brctl addif pbreth_n veth