[CRIU] CRIU + Docker: can't restore into a new container

Andrei Tuicu andrei.tuicu at gmail.com
Wed Aug 10 02:46:13 PDT 2016


Hi Manuel,

You need to create the "looper2" container from the image container, before
restoring the criu image on top of it.

Best regards,
Andrei

Pe 10 aug. 2016 12:38, "Manuel Rodríguez Pascual" <
manuel.rodriguez.pascual at gmail.com> a scris:

> Hi,
>
> I am a newbie with CRIU and Docker. I am exploring the possibilities
> of docker migration with CRIU. However, I cannot restart the container
> with a different name, as stated in the documentation. I was wondering
> whether you could help me and point what I am doing wrong.
>
> Below there are some tests. I have included information on the
> versions of CRIU and docker, a successful  test on
> checkpointing/restarting an image, and a failed test on restarting it
> with a different name.
>
> Thanks for your help,
>
>
> Manuel
>
>
> ----
> ----
> system info
>
> $ uname -r
> 4.7.0-1.el7.elrepo.x86_64
>
> $ criu --version
> Version: 2.4
>
> $ docker --version
> Docker version 1.10.0-dev, build cec56b2, experimental
>
>
> ---
> ---
> Successful experiment
>
>
> [root at tecno15 tests]# docker run -d --name looper1 --security-opt
> seccomp:unconfined busybox /bin/sh -c 'i=0; while true; do echo $i;
> i=$(expr $i + 1); sleep 1; done'
> b6ade11e3202a86ac540240bca871b48c09fffa8d2432101ab3e36d75882437e
>
>
> [root at tecno15 tests]# docker run -d --name looper1 --security-opt
> seccomp:unconfined busybox /bin/sh -c 'i=0; while true; do echo $i;
> i=$(expr $i + 1); sleep 1; done'
> b6ade11e3202a86ac540240bca871b48c09fffa8d2432101ab3e36d75882437e
>
> [root at tecno15 tests]# docker ps
> CONTAINER ID        IMAGE               COMMAND
> CREATED             STATUS              PORTS               NAMES
> b6ade11e3202        busybox             "/bin/sh -c 'i=0; whi"   16
> seconds ago      Up 14 seconds                           looper1
>
> [root at tecno15 tests]# docker logs looper1
> 0
> 1
> 2
> 3
> 4
> 5
>
> [root at tecno15 tests]# docker checkpoint looper1
> looper1
>
> [root at tecno15 tests]# docker ps
> CONTAINER ID        IMAGE               COMMAND             CREATED
>          STATUS              PORTS               NAMES
>
> [root at tecno15 tests]# docker restore looper1
> looper1
>
> [root at tecno15 tests]# docker ps
> CONTAINER ID        IMAGE               COMMAND
> CREATED              STATUS              PORTS               NAMES
> b6ade11e3202        busybox             "/bin/sh -c 'i=0; whi"   About
> a minute ago   Up 1 seconds                            looper1
>
> [root at tecno15 tests]# docker logs looper1
> 0
> 1
> 2
> 3
> 4
> 5
> 6
> 7
> 8
> 9
> 10
> 36
> 37
> 38
> 39
> 40
>
> ---
> ---
> Failed experiment
>
>
> [root at tecno15 tests]# docker create --name looper-force --security-opt
> seccomp:unconfined busybox /bin/sh -c 'i=0; while true; do echo $i;
> i=$(expr $i + 1); sleep 1; done'
> d0ce905ea76fd63d544824e21cea7d5a7f8be953501b3551b0197f5b4e952c6b
>
> [root at tecno15 tests]# docker ps -a
> CONTAINER ID        IMAGE               COMMAND
> CREATED             STATUS              PORTS               NAMES
> d0ce905ea76f        busybox             "/bin/sh -c 'i=0; whi"   11
> seconds ago      Created                                 looper-force
> b6ade11e3202        busybox             "/bin/sh -c 'i=0; whi"   5
> minutes ago       Up 3 minutes                            looper1
>
> [root at tecno15 tests]# docker checkpoint looper1
> looper1
>
> [root at tecno15 tests]# docker ps -a
> CONTAINER ID        IMAGE               COMMAND
> CREATED             STATUS                        PORTS
> NAMES
> d0ce905ea76f        busybox             "/bin/sh -c 'i=0; whi"   51
> seconds ago      Created
> looper-force
> b6ade11e3202        busybox             "/bin/sh -c 'i=0; whi"   5
> minutes ago       Checkpointed 24 seconds ago
> looper1
>
> [root at tecno15 tests]# docker ps
> CONTAINER ID        IMAGE               COMMAND             CREATED
>          STATUS              PORTS               NAMES
>
> [root at tecno15 tests]#  docker restore --force=true
> --image-dir=/home/supermanue/Downloads/tests/checkpoint looper2
> Error response from daemon: No such container: looper2
> Error: failed to restore one or more containers
>
>
> ---
> ---
>
> Output from docker daemon (just last command)
>
> DEBU[76347] Calling POST /v1.22/containers/looper-force/restore
> DEBU[76347] POST /v1.22/containers/looper-force/restore?force=1
> DEBU[76347] form data:
> {"ImagesDirectory":"/home/supermanue/Downloads/tests/
> checkpoint","LeaveRunning":false,"WorkDirectory":""}
> DEBU[76347] devmapper:
> activateDeviceIfNeeded(4be7e83c48a3a448e1cc1a106b6517
> 2c9ac65c5e8385bcbcc58e69d65c1b9219)
> DEBU[76348] container mounted via layerStore:
> /var/lib/docker/0.0/devicemapper/mnt/4be7e83c48a3a448e1cc1a106b6517
> 2c9ac65c5e8385bcbcc58e69d65c1b9219/rootfs
> DEBU[76348] Assigning addresses for endpoint looper-force's interface
> on network bridge
> DEBU[76348] RequestAddress(LocalDefault/172.18.0.0/16, <nil>, map[])
> DEBU[76348] Assigning addresses for endpoint looper-force's interface
> on network bridge
> DEBU[76348] Releasing addresses for endpoint looper-force's interface
> on network bridge
> DEBU[76348] ReleaseAddress(LocalDefault/172.18.0.0/16, 172.18.0.4)
> DEBU[76348] devmapper:
> UnmountDevice(hash=4be7e83c48a3a448e1cc1a106b6517
> 2c9ac65c5e8385bcbcc58e69d65c1b9219)
> DEBU[76348] devmapper:
> Unmount(/var/lib/docker/0.0/devicemapper/mnt/
> 4be7e83c48a3a448e1cc1a106b65172c9ac65c5e8385bcbcc58e69d65c1b9219)
> DEBU[76348] devmapper: Unmount done
> DEBU[76348] devmapper:
> deactivateDevice(4be7e83c48a3a448e1cc1a106b6517
> 2c9ac65c5e8385bcbcc58e69d65c1b9219)
> DEBU[76348] devmapper: removeDevice
> START(docker-253:1-538129286-4be7e83c48a3a448e1cc1a106b6517
> 2c9ac65c5e8385bcbcc58e69d65c1b9219)
> DEBU[76368] devmapper: removeDevice
> END(docker-253:1-538129286-4be7e83c48a3a448e1cc1a106b6517
> 2c9ac65c5e8385bcbcc58e69d65c1b9219)
> DEBU[76368] devmapper: deactivateDevice
> END(4be7e83c48a3a448e1cc1a106b65172c9ac65c5e8385bcbcc58e69d65c1b9219)
> DEBU[76368] devmapper:
> UnmountDevice(hash=4be7e83c48a3a448e1cc1a106b6517
> 2c9ac65c5e8385bcbcc58e69d65c1b9219)
> END
> ERRO[76368] devmapper: Error unmounting device
> 4be7e83c48a3a448e1cc1a106b65172c9ac65c5e8385bcbcc58e69d65c1b9219:
> Device is Busy
> ERRO[76368] Error unmounting container
> d0ce905ea76fd63d544824e21cea7d5a7f8be953501b3551b0197f5b4e952c6b:
> Device is Busy
> WARN[76368] failed to cleanup ipc mounts:
> failed to umount
> /var/lib/docker/0.0/containers/d0ce905ea76fd63d544824e21cea7d
> 5a7f8be953501b3551b0197f5b4e952c6b/shm:
> invalid argument
> failed to umount
> /var/lib/docker/0.0/containers/d0ce905ea76fd63d544824e21cea7d
> 5a7f8be953501b3551b0197f5b4e952c6b/mqueue:
> invalid argument
> ERRO[76368] Error unmounting container
> d0ce905ea76fd63d544824e21cea7d5a7f8be953501b3551b0197f5b4e952c6b: not
> mounted
> ERRO[76368] Handler for POST /v1.22/containers/looper-force/restore
> returned error: Cannot restore container looper-force: CMDNOTFOUND
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvz.org/pipermail/criu/attachments/20160810/8e8737a6/attachment-0001.html>


More information about the CRIU mailing list