agent icon indicating copy to clipboard operation
agent copied to clipboard

Research on CRIU for container migration

Open happyaron opened this issue 6 years ago • 2 comments

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.

happyaron avatar May 22 '18 06:05 happyaron

Resulting documentation:

https://github.com/subutai-io/agent/wiki/Live-Migration

happyaron avatar Jun 07 '18 07:06 happyaron

As for implementation, suggest we take an approach including several parts:

  1. Add dump to file & restore from file functions to Agent, when dump happens the container is stopped, and restore happens the container is resumed.
  2. Make Console/Bazaar to be migration-aware, so that it can take an active part in following parts
  3. Set up tunnel between peers for transferring container dumps and configurations
  4. Resolve any conflicts happen when a mapping already exist on the destination peer
  5. 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.

happyaron avatar Jun 07 '18 07:06 happyaron