Create a process tree – Restore SID, PGID – Restore objects, which should be inherited • Files, sockets, pipes, ... • Restore per-task properties. • Restore memory • Sim! Sala bim! • Awesome Namespaces Processes
a shared library • Plugins • Action scripts – lock, unlock network – setup name-spaces – etc • External resources – Bind-mounts of host file systems – One end of a socket pair or a tty pair – etc How to integrate with CRIU
host • Transfer images on the remote host A size of images can be quite big, so the downtime is too long. • Resume the container on the target host • Transfer memory in a few iterations without freezing processes • Freeze processes only on the last iteration
migration using CRIU • Iterative • Optimal • Customizable #./p.haul ovz 100 10.30.25.213 Migration succeeded total time is ~2.86 sec frozen time is ~1.99 sec ( ['0.27', '0.18', '1.55'] ) restore time is ~0.86 sec img sync time is ~0.32 sec
(by Tejun Heo) – Read task states, that are currently retrieved by a task only about itself • The kcmp() system call – Helps checking which kernel objects are shared between processes • Proc map_files directory – Find out what exact file is mapped – Mappings sharing info • A bunch of prctl extensions – Set various private stuff on task/mm objects (c/r-only feature) • Last-pid sysctl – Restore task with desired PID value
via netlink (sock_diag) – Extendable sockets state retrieving engine • TCP repair mode – Read intimate state of a TCP connection and reconstructs it from scratch on a freshly created socket • Virtual net devices indexes – Allows to restore network devices in a namespace • Socket peeking offset – Allows peeking sockets queues (reading without removing data from queue) • Task memory tracking – incremental snapshots, online migration
made by 44 contributors representing 85414 lines of code ... is mostly written in C with a very low number of source code comments ... has a young, but established codebase maintained by a large development team with stable Y-O-Y commits ... took an estimated 17 years of effort (COCOMO model) starting with its first commit in September, 2011 https://www.ohloh.net/p/criu#