Docker Community Forums

Share and learn in the Docker community.

Live migration in 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'

   anik@anikVB:~$ sudo mkdir -p /tmp1/looper_checkpoint/
   anik@anikVB:~$ sudo docker checkpoint create --checkpoint-dir=/tmp1/looper_checkpoint looper 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@
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'

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/

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