subutai-io / agent

Subutai Agent is a tool that provides CLI to control Subutai infrastructure, and is a daemon that receives and performs Management commands through secured channels
https://subutai.io
15 stars 15 forks source link

Research on CRIU for container migration #597

Open happyaron opened 6 years ago

happyaron commented 6 years ago

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 commented 6 years ago

Resulting documentation:

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

happyaron commented 6 years ago

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.