[CRIU] Not able to checkpoint docker container with criu-1.3-rc2

Saied Kazemi saied at google.com
Wed Aug 6 10:24:30 PDT 2014


That's because your command line is incomplete.  Also, note that you need
to bind mount the root before doing "criu restore".  Below is how I do it.
 You can optionally run "sudo tail -f
/var/lib/docker/vfs/dir/b3438bf5d19d241058659d3e56b7b516100a7db9720c6869a04b36528d297fe3/foo"
and actually see the output stop after dump and restart after restore.

--Saied

# docker run -d busybox:latest /bin/sh -c 'i=1; while true; do echo $i >>
/foo; i=`expr $i + 1`; sleep 3; done'
b3438bf5d19d241058659d3e56b7b516100a7db9720c6869a04b36528d297fe3
#
# ps -efl | grep /bin/sh
4 S root     30210 29160  0  80   0 -   791 wait   10:08 ?        00:00:00
/bin/sh -c i=0; while true; do echo $i >> /foo; i=`expr $i + 1`; sleep 3;
done
0 S root     30247 26797  0  80   0 -  2936 pipe_w 10:08 pts/2    00:00:00
grep --color=auto /bin/sh
#
# criu dump -D /tmp/img.vfs -o dump.log -v4 --ext-mount-map
/etc/resolv.conf:/etc/resolv.conf --ext-mount-map
/etc/hostname:/etc/hostname --ext-mount-map /etc/hosts:/etc/hosts
--evasive-devices -t 30210
#
# echo $?
0
#
# ps -efl | grep /bin/sh
0 S root     30425 26797  0  80   0 -  2936 pipe_w 10:11 pts/2    00:00:00
grep --color=auto /bin/sh
#
# mount --rbind
/var/lib/docker/vfs/dir/b3438bf5d19d241058659d3e56b7b516100a7db9720c6869a04b36528d297fe3
/var/lib/docker/vfs/dir/b3438bf5d19d241058659d3e56b7b516100a7db9720c6869a04b36528d297fe3
#
# criu restore -D /tmp/img.vfs -o restore.log -v4 -d --pidfile
/tmp/img.vfs/restore.pid \
        --root
/var/lib/docker/vfs/dir/b3438bf5d19d241058659d3e56b7b516100a7db9720c6869a04b36528d297fe3
\
        --ext-mount-map /etc/resolv.conf:/etc/resolv.conf \
        --ext-mount-map
/etc/hostname:/var/lib/docker/containers/b3438bf5d19d241058659d3e56b7b516100a7db9720c6869a04b36528d297fe3/hostname
\
        --ext-mount-map
/etc/hosts:/var/lib/docker/containers/b3438bf5d19d241058659d3e56b7b516100a7db9720c6869a04b36528d297fe3/hosts
#
# echo $?
0
#
# umount
/var/lib/docker/vfs/dir/b3438bf5d19d241058659d3e56b7b516100a7db9720c6869a04b36528d297fe3
#
#
# ps -efl | grep /bin/sh
5 S root     30478     1  0  80   0 -   791 wait   10:12 ?        00:00:00
/bin/sh -c i=0; while true; do echo $i >> /foo; i=`expr $i + 1`; sleep 3;
done
0 S root     30524 26797  0  80   0 -  2936 pipe_w 10:12 pts/2    00:00:00
grep --color=auto /bin/sh
#



On Tue, Aug 5, 2014 at 10:47 PM, Pradeep Padala <ppadala at gmail.com> wrote:

> Hi Saied,
>
> Thanks for your detailed reply. I changed the storage driver to vfs, but
> still getting the same error. Am I missing something here?
>
> $ ./criu --version
> Version: 1.3-rc2
> GitID: 5cb0c0d
>
> $ docker info
> Containers: 2
> Images: 3
> Storage Driver: vfs
> Execution Driver: native-0.2
> Kernel Version: 3.15.7-200.fc20.x86_64
>
> $ ./criu dump -t 1473 -D /tmp/docker
> Error (mount.c:449): 147:./dev/console doesn't have a proper root mount
> Error (cr-dump.c:1914): Dumping FAILED.
>
> Regards,
> Pradeep
>
>
> On Tue, Aug 5, 2014 at 9:35 PM, Saied Kazemi <saied at google.com> wrote:
>
>> Hi Pradeep,
>>
>> The official response should come from the CRIU development team but
>> since I have been looking at this issue I can provide some info.
>>
>> Dumping and restoring Docker containers using CRIU as-is is not possible
>> at the moment.
>>
>> As you noted, work is in progress, but it will take some time to finish.
>>  So far, support for external bind mounts (e.g., /etc/hosts for Docker
>> containers) and restoration of control groups has been added and is already
>> available in 1.3-rc2.
>>
>> If you use the VFS graph driver (as opposed to the default AUFS), it's
>> possible to dump and restore a container with CRIU using the external bind
>> mount options.  However, currently there is no way to tell Docker that a
>> container was restored, so "docker ps" would show its status as exited.
>>
>> Work is underway to add AUFS support to CRIU as well as
>> checkpoint/restore support in libcontainer and Docker.  Ultimately
>> checkpointing and restoring Docker containers should be done by Docker
>> itself (e.g., docker checkpoint, docker restore) with a call to CRIU for
>> doing the actual checkpoint and restore operation.
>>
>> Hope this helps...
>>
>> --Saied
>>
>>
>>
>>
>> On Tue, Aug 5, 2014 at 3:19 PM, Pradeep Padala <ppadala at gmail.com> wrote:
>>
>>> Hi,
>>>
>>> I tried checkpointing the docker container with the latest version of
>>> criu and got the following error.
>>>
>>> ./criu dump -t 15814 --images-dir /tmp/docker
>>> Error (mount.c:449): 225:./dev/console doesn't have a proper root mount
>>> Error (cr-dump.c:1882): Dumping FAILED.
>>>
>>> I saw that there's been some progress on this lately and was not sure,
>>> if this has been fixed yet. Is there a timeframe on when the docker
>>> container c/r will be supported?
>>>
>>> Let me know.
>>>
>>> Thanks,
>>> Pradeep
>>>
>>> _______________________________________________
>>> 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/20140806/e559f3c8/attachment-0001.html>


More information about the CRIU mailing list