[lxc-devel] [PATCH] Add support for checkpoint and restore via CRIU

Tycho Andersen tycho.andersen at canonical.com
Wed Aug 20 12:32:34 UTC 2014


Hi Stéphane,

On Tue, Aug 19, 2014 at 10:40:15PM -0500, Stéphane Graber wrote:
> On Tue, Aug 19, 2014 at 10:14:03PM -0500, Tycho Andersen wrote:
> > This patch adds support for checkpointing and restoring containers via CRIU.
> > It adds two api calls, ->checkpoint and ->restore, which are wrappers around
> > the CRIU CLI. CRIU has an RPC API, but reasons for preferring exec() are
> > discussed in [1].
> > 
> > To checkpoint, users specify a directory to dump the container metadata (CRIU
> > dump files, plus some additional information about veth pairs and which
> > bridges they are attached to) into this directory. On restore, this
> > information is read out of the directory, a CRIU command line is constructed,
> > and CRIU is exec()d. CRIU uses the lxc-restore-net callback (which in turn
> > inspects the image directory with the NIC data) to properly restore the
> > network.
> > 
> > This will only work with the current git master of CRIU; anything as of
> > a152c843 should work. There is a known bug where containers which have been
> > restored cannot be checkpointed [2].
> > 
> > [1]: http://lists.openvz.org/pipermail/criu/2014-July/015117.html
> > [2]: http://lists.openvz.org/pipermail/criu/2014-August/015876.html
> > 
> 
> Thanks for that work!
> 
> Just one comment before I dive in a bit closer, I'd really rather we
> just have one command, say lxc-checkpoint which does both the dumping
> and the restarting rather than have the extremely confusing lxc-restart
> (which to most user will sound like an equivalent to c->reboot(c).

It is lxc-restore (vs. -restart), not sure if that changes your mind
at all.

> Would you mind merging lxc-restart into lxc-checkpoint?

Sure, what should it be called? I guess the CLI would be something
like:

lxc-foo checkpoint [checkpoint opts]
lxc-foo restore [restore opts]

?

Tycho


More information about the lxc-devel mailing list