1. 15 Nov, 2016 2 commits
    • Merge pull request #1299 from adrianreber/master · a8bae552
      Stéphane Graber authored
      lxc-checkpoint: enable dirty memory tracking in criu
    • lxc-checkpoint: enable dirty memory tracking in criu · 9f99a33f
      Adrian Reber authored
      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: 's avatarAdrian Reber <areber@redhat.com>
  2. 14 Nov, 2016 4 commits
  3. 13 Nov, 2016 1 commit
  4. 12 Nov, 2016 6 commits
  5. 11 Nov, 2016 1 commit
  6. 10 Nov, 2016 5 commits
  7. 09 Nov, 2016 3 commits
    • cgroups: remove isolated cpus from cpuset.cpus · a54694f8
      Christian Brauner authored
      In case the system was booted with
      
          isolcpus=n_i-n_j,n_k,n_m
      
      we cannot simply copy the cpuset.cpus file from our parent cgroup. For example,
      in the root cgroup cpuset.cpus will contain all of the cpus including the
      isolated cpus. Copying the values of the root cgroup into a child cgroup will
      lead to a wrong view in /proc/self/status: For the root cgroup
      /sys/fs/cgroup/cpuset /proc/self/status will correctly show
      
          Cpus_allowed_list:      0-1,3
      
      even though cpuset.cpus will show
      
          0-3
      
      However, initializing a subcgroup in the cpuset controller by copying the
      cpuset.cpus setting from the root cgroup will cause /proc/self/status to
      incorrectly show
      
          Cpus_allowed_list:      0-3
      
      Hence, we need to make sure to remove the isolated cpus from cpuset.cpus. Seth
      has argued that this is not a kernel bug but by design. So let us be the smart
      guys and fix this in liblxc.
      
      The solution is straightforward: To avoid having to work with raw cpulist
      strings we create cpumasks based on uint32_t bit arrays.
      Signed-off-by: 's avatarChristian Brauner <christian.brauner@canonical.com>
    • utils: add lxc_append_string() · 000dfda7
      Christian Brauner authored
      lxc_append_string() appends strings without separator. This is mostly useful
      for reading in whole files line-by-line.
      Signed-off-by: 's avatarChristian Brauner <christian.brauner@canonical.com>
    • Merge pull request #1286 from mgariepy/patch-1 · 5e8b7746
      Stéphane Graber authored
      create symlink for /var/run
  8. 08 Nov, 2016 1 commit
  9. 07 Nov, 2016 1 commit
  10. 03 Nov, 2016 7 commits
  11. 02 Nov, 2016 6 commits
  12. 31 Oct, 2016 3 commits
    • Merge pull request #1266 from tych0/do-mount-rewriting · 52e12945
      Stéphane Graber authored
      Do mount rewriting
    • log: bump LXC_LOG_BUFFER_SIZE to 4096 · ed408e66
      Tycho Andersen authored
      We need to log longer lines due to CRIU arguments.
      Signed-off-by: 's avatarTycho Andersen <tycho.andersen@canonical.com>
    • c/r: explicitly emit bind mounts as criu arguments · 5f4e44a2
      Tycho Andersen authored
      We switched to --ext-mount-map auto because of "system" (liblxc) added
      mounts like the cgmanager socket that weren't in the config file. This had
      the added advantage that we could drop all the mount processing code,
      because we no longer needed an --ext-mount-map argument.
      
      The problem here is that mounts can move between hosts. While
      --ext-mount-map auto does its best to detect this situation, it explicitly
      disallows moves that change the path name. In LXD, we bind mount
      /var/lib/lxd/shmounts/$container to /dev/.lxd-mounts for each container,
      and so when a container is renamed in a migration, the name changes.
      --ext-mount-map auto won't detect this, and so the migration fails.
      
      We *could* implement mount rewriting in CRIU, but my experience with cgroup
      and apparmor rewriting is that this is painful and error prone. Instead, it
      is much easier to go back to explicitly listing --ext-mount-map arguments
      from the config file, and allow the source of the bind to change. We leave
      --ext-mount-map auto to catch any stragling (or future) system added
      mounts.
      
      I believe this should fix Launchpad Bug 1580765
      Signed-off-by: 's avatarTycho Andersen <tycho.andersen@canonical.com>