<p dir="ltr">Hi Manuel,</p>
<p dir="ltr">You need to create the &quot;looper2&quot; container from the image container, before restoring the criu image on top of it.</p>
<p dir="ltr">Best regards,<br>
Andrei</p>
<div class="gmail_extra"><br><div class="gmail_quote">Pe 10 aug. 2016 12:38, &quot;Manuel Rodríguez Pascual&quot; &lt;<a href="mailto:manuel.rodriguez.pascual@gmail.com">manuel.rodriguez.pascual@gmail.com</a>&gt; a scris:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I am a newbie with CRIU and Docker. I am exploring the possibilities<br>
of docker migration with CRIU. However, I cannot restart the container<br>
with a different name, as stated in the documentation. I was wondering<br>
whether you could help me and point what I am doing wrong.<br>
<br>
Below there are some tests. I have included information on the<br>
versions of CRIU and docker, a successful  test on<br>
checkpointing/restarting an image, and a failed test on restarting it<br>
with a different name.<br>
<br>
Thanks for your help,<br>
<br>
<br>
Manuel<br>
<br>
<br>
----<br>
----<br>
system info<br>
<br>
$ uname -r<br>
4.7.0-1.el7.elrepo.x86_64<br>
<br>
$ criu --version<br>
Version: 2.4<br>
<br>
$ docker --version<br>
Docker version 1.10.0-dev, build cec56b2, experimental<br>
<br>
<br>
---<br>
---<br>
Successful experiment<br>
<br>
<br>
[root@tecno15 tests]# docker run -d --name looper1 --security-opt<br>
seccomp:unconfined busybox /bin/sh -c &#39;i=0; while true; do echo $i;<br>
i=$(expr $i + 1); sleep 1; done&#39;<br>
b6ade11e3202a86ac540240bca871b<wbr>48c09fffa8d2432101ab3e36d75882<wbr>437e<br>
<br>
<br>
[root@tecno15 tests]# docker run -d --name looper1 --security-opt<br>
seccomp:unconfined busybox /bin/sh -c &#39;i=0; while true; do echo $i;<br>
i=$(expr $i + 1); sleep 1; done&#39;<br>
b6ade11e3202a86ac540240bca871b<wbr>48c09fffa8d2432101ab3e36d75882<wbr>437e<br>
<br>
[root@tecno15 tests]# docker ps<br>
CONTAINER ID        IMAGE               COMMAND<br>
CREATED             STATUS              PORTS               NAMES<br>
b6ade11e3202        busybox             &quot;/bin/sh -c &#39;i=0; whi&quot;   16<br>
seconds ago      Up 14 seconds                           looper1<br>
<br>
[root@tecno15 tests]# docker logs looper1<br>
0<br>
1<br>
2<br>
3<br>
4<br>
5<br>
<br>
[root@tecno15 tests]# docker checkpoint looper1<br>
looper1<br>
<br>
[root@tecno15 tests]# docker ps<br>
CONTAINER ID        IMAGE               COMMAND             CREATED<br>
         STATUS              PORTS               NAMES<br>
<br>
[root@tecno15 tests]# docker restore looper1<br>
looper1<br>
<br>
[root@tecno15 tests]# docker ps<br>
CONTAINER ID        IMAGE               COMMAND<br>
CREATED              STATUS              PORTS               NAMES<br>
b6ade11e3202        busybox             &quot;/bin/sh -c &#39;i=0; whi&quot;   About<br>
a minute ago   Up 1 seconds                            looper1<br>
<br>
[root@tecno15 tests]# docker logs looper1<br>
0<br>
1<br>
2<br>
3<br>
4<br>
5<br>
6<br>
7<br>
8<br>
9<br>
10<br>
36<br>
37<br>
38<br>
39<br>
40<br>
<br>
---<br>
---<br>
Failed experiment<br>
<br>
<br>
[root@tecno15 tests]# docker create --name looper-force --security-opt<br>
seccomp:unconfined busybox /bin/sh -c &#39;i=0; while true; do echo $i;<br>
i=$(expr $i + 1); sleep 1; done&#39;<br>
d0ce905ea76fd63d544824e21cea7d<wbr>5a7f8be953501b3551b0197f5b4e95<wbr>2c6b<br>
<br>
[root@tecno15 tests]# docker ps -a<br>
CONTAINER ID        IMAGE               COMMAND<br>
CREATED             STATUS              PORTS               NAMES<br>
d0ce905ea76f        busybox             &quot;/bin/sh -c &#39;i=0; whi&quot;   11<br>
seconds ago      Created                                 looper-force<br>
b6ade11e3202        busybox             &quot;/bin/sh -c &#39;i=0; whi&quot;   5<br>
minutes ago       Up 3 minutes                            looper1<br>
<br>
[root@tecno15 tests]# docker checkpoint looper1<br>
looper1<br>
<br>
[root@tecno15 tests]# docker ps -a<br>
CONTAINER ID        IMAGE               COMMAND<br>
CREATED             STATUS                        PORTS<br>
NAMES<br>
d0ce905ea76f        busybox             &quot;/bin/sh -c &#39;i=0; whi&quot;   51<br>
seconds ago      Created<br>
looper-force<br>
b6ade11e3202        busybox             &quot;/bin/sh -c &#39;i=0; whi&quot;   5<br>
minutes ago       Checkpointed 24 seconds ago<br>
looper1<br>
<br>
[root@tecno15 tests]# docker ps<br>
CONTAINER ID        IMAGE               COMMAND             CREATED<br>
         STATUS              PORTS               NAMES<br>
<br>
[root@tecno15 tests]#  docker restore --force=true<br>
--image-dir=/home/supermanue/<wbr>Downloads/tests/checkpoint looper2<br>
Error response from daemon: No such container: looper2<br>
Error: failed to restore one or more containers<br>
<br>
<br>
---<br>
---<br>
<br>
Output from docker daemon (just last command)<br>
<br>
DEBU[76347] Calling POST /v1.22/containers/looper-<wbr>force/restore<br>
DEBU[76347] POST /v1.22/containers/looper-<wbr>force/restore?force=1<br>
DEBU[76347] form data:<br>
{&quot;ImagesDirectory&quot;:&quot;/home/<wbr>supermanue/Downloads/tests/<wbr>checkpoint&quot;,&quot;LeaveRunning&quot;:<wbr>false,&quot;WorkDirectory&quot;:&quot;&quot;}<br>
DEBU[76347] devmapper:<br>
activateDeviceIfNeeded(<wbr>4be7e83c48a3a448e1cc1a106b6517<wbr>2c9ac65c5e8385bcbcc58e69d65c1b<wbr>9219)<br>
DEBU[76348] container mounted via layerStore:<br>
/var/lib/docker/0.0/<wbr>devicemapper/mnt/<wbr>4be7e83c48a3a448e1cc1a106b6517<wbr>2c9ac65c5e8385bcbcc58e69d65c1b<wbr>9219/rootfs<br>
DEBU[76348] Assigning addresses for endpoint looper-force&#39;s interface<br>
on network bridge<br>
DEBU[76348] RequestAddress(LocalDefault/<a href="http://172.18.0.0/16" rel="noreferrer" target="_blank">17<wbr>2.18.0.0/16</a>, &lt;nil&gt;, map[])<br>
DEBU[76348] Assigning addresses for endpoint looper-force&#39;s interface<br>
on network bridge<br>
DEBU[76348] Releasing addresses for endpoint looper-force&#39;s interface<br>
on network bridge<br>
DEBU[76348] ReleaseAddress(LocalDefault/<a href="http://172.18.0.0/16" rel="noreferrer" target="_blank">17<wbr>2.18.0.0/16</a>, 172.18.0.4)<br>
DEBU[76348] devmapper:<br>
UnmountDevice(hash=<wbr>4be7e83c48a3a448e1cc1a106b6517<wbr>2c9ac65c5e8385bcbcc58e69d65c1b<wbr>9219)<br>
DEBU[76348] devmapper:<br>
Unmount(/var/lib/docker/0.0/<wbr>devicemapper/mnt/<wbr>4be7e83c48a3a448e1cc1a106b6517<wbr>2c9ac65c5e8385bcbcc58e69d65c1b<wbr>9219)<br>
DEBU[76348] devmapper: Unmount done<br>
DEBU[76348] devmapper:<br>
deactivateDevice(<wbr>4be7e83c48a3a448e1cc1a106b6517<wbr>2c9ac65c5e8385bcbcc58e69d65c1b<wbr>9219)<br>
DEBU[76348] devmapper: removeDevice<br>
START(docker-253:1-538129286-<wbr>4be7e83c48a3a448e1cc1a106b6517<wbr>2c9ac65c5e8385bcbcc58e69d65c1b<wbr>9219)<br>
DEBU[76368] devmapper: removeDevice<br>
END(docker-253:1-538129286-<wbr>4be7e83c48a3a448e1cc1a106b6517<wbr>2c9ac65c5e8385bcbcc58e69d65c1b<wbr>9219)<br>
DEBU[76368] devmapper: deactivateDevice<br>
END(<wbr>4be7e83c48a3a448e1cc1a106b6517<wbr>2c9ac65c5e8385bcbcc58e69d65c1b<wbr>9219)<br>
DEBU[76368] devmapper:<br>
UnmountDevice(hash=<wbr>4be7e83c48a3a448e1cc1a106b6517<wbr>2c9ac65c5e8385bcbcc58e69d65c1b<wbr>9219)<br>
END<br>
ERRO[76368] devmapper: Error unmounting device<br>
4be7e83c48a3a448e1cc1a106b6517<wbr>2c9ac65c5e8385bcbcc58e69d65c1b<wbr>9219:<br>
Device is Busy<br>
ERRO[76368] Error unmounting container<br>
d0ce905ea76fd63d544824e21cea7d<wbr>5a7f8be953501b3551b0197f5b4e95<wbr>2c6b:<br>
Device is Busy<br>
WARN[76368] failed to cleanup ipc mounts:<br>
failed to umount<br>
/var/lib/docker/0.0/<wbr>containers/<wbr>d0ce905ea76fd63d544824e21cea7d<wbr>5a7f8be953501b3551b0197f5b4e95<wbr>2c6b/shm:<br>
invalid argument<br>
failed to umount<br>
/var/lib/docker/0.0/<wbr>containers/<wbr>d0ce905ea76fd63d544824e21cea7d<wbr>5a7f8be953501b3551b0197f5b4e95<wbr>2c6b/mqueue:<br>
invalid argument<br>
ERRO[76368] Error unmounting container<br>
d0ce905ea76fd63d544824e21cea7d<wbr>5a7f8be953501b3551b0197f5b4e95<wbr>2c6b: not<br>
mounted<br>
ERRO[76368] Handler for POST /v1.22/containers/looper-<wbr>force/restore<br>
returned error: Cannot restore container looper-force: CMDNOTFOUND<br>
______________________________<wbr>_________________<br>
CRIU mailing list<br>
<a href="mailto:CRIU@openvz.org">CRIU@openvz.org</a><br>
<a href="https://lists.openvz.org/mailman/listinfo/criu" rel="noreferrer" target="_blank">https://lists.openvz.org/<wbr>mailman/listinfo/criu</a><br>
</blockquote></div></div>