]> git.ipfire.org Git - thirdparty/lxc.git/commit
lxc-checkpoint: enable dirty memory tracking in criu 1299/head
authorAdrian Reber <areber@redhat.com>
Mon, 14 Nov 2016 14:44:04 +0000 (14:44 +0000)
committerAdrian Reber <areber@redhat.com>
Tue, 15 Nov 2016 14:10:03 +0000 (14:10 +0000)
commit9f99a33fa97a81d395b6522fe7bd51e0ef6af454
treeed8c5f526c2e89bcee9147dc9c824d625eb3b2fe
parenta3524e91471f25f3c7409bf38dfe4a6c6606249f
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@redhat.com>
src/lxc/criu.c
src/lxc/tools/lxc_checkpoint.c