[lxc-devel] [lxc/lxc] 735f2c: Add support for checkpoint and restore via CRIU

GitHub noreply at github.com
Tue Aug 26 14:40:15 UTC 2014


  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: 735f2c6e504a541cbb2592a3f94858bf337a24ff
      https://github.com/lxc/lxc/commit/735f2c6e504a541cbb2592a3f94858bf337a24ff
  Author: Tycho Andersen <tycho.andersen at canonical.com>
  Date:   2014-08-26 (Tue, 26 Aug 2014)

  Changed paths:
    M .gitignore
    M configure.ac
    M doc/Makefile.am
    A doc/lxc-checkpoint.sgml.in
    M src/lxc/Makefile.am
    A src/lxc/lxc-restore-net
    A src/lxc/lxc_checkpoint.c
    M src/lxc/lxccontainer.c
    M src/lxc/lxccontainer.h
    M src/lxc/start.c
    M src/lxc/start.h
    M src/lxc/utils.c
    M src/lxc/utils.h
    M src/tests/Makefile.am
    A src/tests/lxc-test-checkpoint-restore

  Log Message:
  -----------
  Add support for checkpoint and restore via CRIU

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

v2: fixed some problems with the s/int/bool return code form api function
v3: added a testcase, fixed up the man page synopsis
v4: fix a small typo in lxc-test-checkpoint-restore
v5: remove a reference to the old CRIU_PATH, and a bad error about the same

Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>
Acked-by: Stéphane Graber <stgraber at ubuntu.com>




More information about the lxc-devel mailing list