[lxc-devel] [lxc/lxc] 9f99a3: lxc-checkpoint: enable dirty memory tracking in cr...

GitHub noreply at github.com
Tue Nov 15 15:56:56 UTC 2016


  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: 9f99a33fa97a81d395b6522fe7bd51e0ef6af454
      https://github.com/lxc/lxc/commit/9f99a33fa97a81d395b6522fe7bd51e0ef6af454
  Author: Adrian Reber <areber at redhat.com>
  Date:   2016-11-15 (Tue, 15 Nov 2016)

  Changed paths:
    M src/lxc/criu.c
    M src/lxc/tools/lxc_checkpoint.c

  Log Message:
  -----------
  lxc-checkpoint: enable dirty memory tracking in criu

CRIU supports dirty memory tracking to take incremental checkpoints.
Incremental checkpoints are one way of reducing downtime during
migration. The first checkpoint dumps all the memory pages and the
second (and third, and fourth, ...) only dumps pages which have changed.

Most of the necessary code has already been implemented. This just adds
the existing functionality to lxc-checkpoint:

  -p, --pre-dump            Only pre-dump the memory of the container.
                      Container keeps on running and following
                      checkpoints will only dump the changes.
  --predump-dir=DIR         path to images from previous dump (relative to -D)

The following is an example from a container running CentOS 7 with psql
and tomcat:

 # lxc-checkpoint -n c7 -D /tmp/cp -p
Container keeps on running
 # du -h /tmp/cp
 229M	/tmp/cp
Sync initial checkpoint to destination
 # rsync -a /tmp/cp host2:/tmp/
Sync file-system
 # rsync -a /var/lib/lxc/c7 host2:/var/lib/lxc/
Final dump; container is stopped
 # lxc-checkpoint -n c7 -D /tmp/cp --predump-dir=../cp -s
 # du -h /tmp/cp2
 90M	/tmp/cp2

After transferring the second (incremental checkpoint) and the changes
to the container's file system the container can be restored on the
second host by pointing lxc-checkpoint to the second checkpoint
directory:

 # lxc-checkpoint -n c7 -D /tmp/cp2 -r

Signed-off-by: Adrian Reber <areber at redhat.com>


  Commit: a8bae5522a2dd4b5064baae13492bae981e9e3ca
      https://github.com/lxc/lxc/commit/a8bae5522a2dd4b5064baae13492bae981e9e3ca
  Author: Stéphane Graber <stgraber at stgraber.org>
  Date:   2016-11-15 (Tue, 15 Nov 2016)

  Changed paths:
    M src/lxc/criu.c
    M src/lxc/tools/lxc_checkpoint.c

  Log Message:
  -----------
  Merge pull request #1299 from adrianreber/master

lxc-checkpoint: enable dirty memory tracking in criu


Compare: https://github.com/lxc/lxc/compare/748c52b52c6f...a8bae5522a2d


More information about the lxc-devel mailing list