-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathhow to use CRIU.txt
98 lines (55 loc) · 3.21 KB
/
how to use CRIU.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
1.complile the kernel to support CRIU.
->Config the kernel.
->Complile and get the kernel.
https://criu.org/Installation
version information:
vagrant@vm1:~$ uname -r
3.13.11-ckt22
vagrant@vm1:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.2 LTS
Release: 14.04
Codename: trusty
Issue:
About protobuf: search and install this:
libprotobuf-c1.deb
kernel version:
the handle book of criu shows that we need to patch the kernel for version 3.19.
https://criu.org/Docker
obviously , we need to apply the issue to the kernel before 3.19.
This need to be check more.And the upstream kernel patch also shows here.
https://criu.org/Upstream_kernel_commits
2.install CRIU and docker.
vagrant@vm1:~$ docker -v
Docker version 1.9.0-dev, build 792fc89, experimental
criu.deb: 2.0-2ubuntu1 (lastest version.)
--may not complie the criu by your own.There are some dependences.
3.After 1&2, we can user docker checkpoint and docker restore now.
docker checkpoint mytest
docker restore mytest.
Known Issue:
docker run --name=foo -d busybox tail -f /dev/null && docker rm -f foo
mytest case:
docker run \
-d \
--name mytest busybox:latest \
/bin/sh -c \
'i=0; while true; do echo $i; i=$(expr $i + 1); sleep 1; done'
4. limitation for this test case:
a.need the base image: in this test case,the two sides uses shares base image busybox which is a small container image.
b. use socket to transfer the image file. Maybe we could choose other good ways?
c.Maybe we can directly use python to call the docker, in this test, I just use python as a script to execute the docker command.
d. The test case donot have interaction with local file.
That is to say I donot copy the disk image now.
e.network: crurrently, I just use private network and the test case donot have interaction with the newtork.
5. Docker fork with CRIU support Known Issues:
Currently, networking is broken in this PR.
Although it's implemented at the libcontainer level, the method used no longer works since the introduction of libnetwork.
There are likely several networking related issues to work out, like:
- ensuring IPs are reserved across daemon restarts
- ensuring port maps are reserved
- deciding how to deal with network resources in the "new container" model.
Filesystem:
Note: The OverlayFS filesystem was merged into the upstream Linux kernel 3.18 and is now Docker's preferred filesystem (instead of AUFS). However, there is a bug in OverlayFS that reports the wrong mnt_id in /proc/<pid>/fdinfo/<fd> and the wrong symlink target path for /proc/<pid>/<fd>. Fortunately, these bugs have been fixed in the kernel v4.2-rc2.
That said, it is possible to manually migrate containers by not only copying the container image created by CRIU after checkpoint (as you have done) but also by copying the container directory created by Docker in /var/lib/docker/0.0/containers/$cid as well as the container's root filesystem in /var/lib/docker/0.0/image. Manually migrating container's filesystem is a bit tricky specially if you are using a union filesystem like AUFS or OverlayFS. Also, you need to restart the Docker daemon on the destination machine to see the container.