agent
agent copied to clipboard
Research on CRIU for container migration
CRIU is a project to implement checkpoint/restore functionality for Linux. CRIU started as a project of Virtuozzo and grew with tremendous help from the community. It is currently used by (integrated into) OpenVZ, LXC/LXD, Docker, and other software, and CRIU packages is included into many Linux distributions.
Some lxd (which uses lxc underneath) write-up about CRIU: https://stgraber.org/2016/04/25/lxd-2-0-live-migration-912/
First step is to see if we can use it with Subutai to move a container manually from one RH to another RH in the same peer. Also experiment with transferring a container from one RH in one peer to another RH in another peer.
Resulting documentation:
https://github.com/subutai-io/agent/wiki/Live-Migration
As for implementation, suggest we take an approach including several parts:
- Add dump to file & restore from file functions to Agent, when dump happens the container is stopped, and restore happens the container is resumed.
- Make Console/Bazaar to be migration-aware, so that it can take an active part in following parts
- Set up tunnel between peers for transferring container dumps and configurations
- Resolve any conflicts happen when a mapping already exist on the destination peer
- Migrate TCP connections that are in ESTABLISHED status. We can support this only when migrating among peers in the same LAN as a first step, and think about how to implement it for migrating containers around the world which may involves re-routing traffic.