Docker Community Forums

Share and learn in the Docker community.

Live migration in docker

docker

(Anibar) #1

Hi, I am trying to learn live migration in Docker using checkpoint. I want to run a looper in the host, then use checkpoint, send and then continue it in the server or another host. For now, I have been able to do all the things, but when I start the container in the server, I get OCI runtime error. I exactly cannot figure out what’s wrong here. I am using UBUNTU 16.04 LTS with experimental feature enabled in docker. Here, I explain you what I have done.

Server 1: Creating looper container, checkpoint and make tarball

    anik@anikVB:~$ sudo docker run -d --name looper busybox \
        > /bin/sh -c 'i=0; while true; do echo $i; i=$(expr $i + 1); sleep 1; done'
        8d52551604d879e264dad97dcf2a8f1ae9d7e70af649274831fd13f1d851a401

   anik@anikVB:~$ sudo mkdir -p /tmp1/looper_checkpoint/
   anik@anikVB:~$ sudo docker checkpoint create --checkpoint-dir=/tmp1/looper_checkpoint looper checkpoint1
    checkpoint1


    anik@anikVB:~$ cp_dir=`find /tmp1/looper_checkpoint/ -name checkpoints`
    anik@anikVB:~$ sudo tar -czvf looper_cp.tgz -C $cp_dir .

Server 2: Copy the file into the server 2, making directory, creating container and trying to start from the checkpoint

root@UbuntuServer:~# scp looper_cp.tgz root@159.65.91.121:./
looper_cp.tgz 100% 33KB 33.1KB/s 00:00

root@UbuntuServer:~# mkdir -p /tmp2/looper_checkpoint
root@UbuntuServer:~# sudo tar -zxvf looper_cp.tgz -C /tmp2/looper_checkpoint/

root@UbuntuServer:~# docker create --name looper-clone busybox \
> /bin/sh -c 'i=0; while true; do echo $i; i=$(expr $i + 1); sleep 1; done'
961fcf4c4ceece17b260a00aa97aa78d2913a313cdd86964869e1ab37dc2fd91

root@UbuntuServer:~# docker ps -a
CONTAINER ID        IMAGE               COMMAND                 CREATED             STATUS              PORTS               NAMES
961fcf4c4cee        busybox             "/bin/sh -c 'i=0; ..."   10 seconds ago     Created                                 looper-clone

root@UbuntuServer:~# docker start --checkpoint-dir=/tmp2/looper_checkpoint --checkpoint=checkpoint1 looper-clone
Error response from daemon: oci runtime error: criu failed: type RESTORE errno 0
log file: /tmp2/looper_checkpoint/checkpoint1/criu.work/restore-2018-03-18T21:34:34.492327082Z/restore.log

I cannot understand why CRIU if failing here, so your help will be very great for me.