Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
100 lines (64 sloc) 2.63 KB
This HOWTO describes how to live-migrate a memory-touching process
from one node ot another (nodes can be VMs).
0. The following pkgs are needed to compile and run CRIU and p.haul
a) CRIU
* gcc
* protobuf
* protobuf-c
* protobuf-c-devel
b) p.haul
* python
* python-rpyc
* protobuf-python
1. Create a shared NFS mount on both nodes
NFS is required since p.haul currently doesn't handle FS migration,
so any file used by migrating task should be available on both nodes.
Note, that absolute paths to files on that NFS mount should concide
on both nodes. E.g. you mount NFS on _both_ nodes on the same path,
or you share some directory from one node and mount it on the same
path on another.
2. Prepare CRIU and p.haul on _both_ nodes
a) CRIU
* Clone CRIU repository from git://github.com/xemul/criu
and compile it with 'make'
* Make _local_ directory for service ($csdir)
* Start CRIU service by root user
# criu service -o $csdir/log -v4 --daemon
b) p.haul
* Compile and install CRIU RPC bindings with 'make install'
* Create _local_ directory for images
# mkdir -p /var/local/p.haul-fs/
The path above is for now hard-coded in p_haul_img.py
* On destination node start the p.haul service
[dst]# ./p.haul-service
Starting p.haul rpyc service
It will not go daemon and will print logs on the terminals
3. Run the test process on source node
Copy p.haul/test/mtouch/ directory on $nfs and launch memory toucher
with the run.sh script
[src]# cd $nfs/mtouch/ && ./run.sh
...
Child 12345 done, code O
The 12345 is the pid of the started process ($pid), the O (not 0,
but O) is the child start result. If it's not O, then somehting
went wrong, you can check the mem-touch.log file for details.
The run.sh script launches the memory toucher
- in pid namespace, to avoid pids conflict on target
- linked with libs copied on nfs to make them be the same on destination
- with decent memory consumption size and rate
4. Migrate memory toucher from source node
[src]# ./p.haul pid $test_pid $destination_node_ip
...
Migration succeeded
total time is ~4.12 sec
frozen time is ~1.61 sec
restore time is ~1.06 sec
5. Check that test works OK on destination node
[dst]# cd $nfs/mtouch/
[dst]# touch mem-touch-stop
[dst]# tail mem-touch.log
...
Finish
6. CRIU logs and image files used durin migration are left by p.haul in the
/var/local/p.haul-fs/<temp-name>/ directories on both nodes.
To explore the images use the 'criu show -f <image_file>' command.
You can’t perform that action at this time.