3

I'm trying to use the experimental checkpoint feature to implement container migration between machines. I've found many examples of checkpointing and restoring on the same machine but I've only found this documentation about migrating checkpoints between different machines:

https://circleci.com/blog/checkpoint-and-restore-docker-container-with-criu/

However, the commands it uses is outdated and docker checkpoint restore is not available anymore. Instead docker start --checkpoint syntax should be used. I've done my use case as follow:

Host 1: Has a docker container running which I do a checkpoint at a location in $CHECKPOINT_FOLDER which is a shared folder among different machines with docker checkpoint create --checkpoint-dir=$CHECKPOINT_FOLDER $NAME checkpoint-$NAME where $NAME is the name of the running container (one-13 in this case).

Host 2: Has access to $CHECKPOINT_FOLDER folder and I can see the created one. I run docker start --checkpoint-dir $CHECKPOINT_FOLDER --checkpoint checkpoint-$NAME $NAME where $NAME again is the same name of the container that was running at host 1 (one-13). However I get this error:

No such container: one-13

Which makes me think that I have to create a container before starting a checkpoint but then, how do I do so? isn't supposed to be created automatically from the checkpoint? If not, is there a way to pass the checkpoint to the docker create command? What's the workflow for this use case?

Thank you.

1 Answers1

0

Before restoring the container in the destination host, you have to create a container:

 sudo docker create --name $NAME <container-image>

Creating the container $NAME is to make sure that the base image is downloaded and the disk space is allocated, you can check in /var/lib/docker/containers/

Then you can restore it with the share dump files in $CHECKPOINT_FOLDER

 sudo docker start --checkpoint=checkpoint-$NAME --checkpoint-dir=$CHECKPOINT_FOLDER $NAME

or specifically with checkpoint-name

 sudo docker start --checkpoint=checkpoint-one-13 --checkpoint-dir=$CHECKPOINT_FOLDER $NAME
ngovanmao
  • 186
  • 2
  • 7
  • 1
    Unfortunately I get the error `Error response from daemon: custom checkpointdir is not supported` when running docker start with checkpoint-dir – Miguel Mota Jun 25 '18 at 22:05
  • @MiguelMota: I used docker 17.03.2-ce, CRIU v3.8 at the time writing this post. If you are using a newer version of docker, I think the option checkpoint-dir is removed (https://github.com/moby/moby/issues/34601). You can ignore the checkpoint-dir option and let docker stores at the default location. – ngovanmao Jun 26 '18 at 01:52