Learn how to migrate and modernize stateless applications and run them in a Kubernetes cluster.

Just recently, InfoQ published the revealing article, authored by Jelastic CEO Ruslan Synytsky, where talks about the live migration of containers, how it really works, and the major bottlenecks and possible solutions.

We decided to share a brief summary of this article for you to discover what opportunities live migration unlocks, as well as to find out what kind of freedom in application lifecycle management it provides.

What Is Live Migration?

Live migration means moving applications between different physical machines/clouds without disconnecting the client. Memory, file system, and network connectivity of the containers running on top of bare metal hardware are transferred from the original host machine to the destination without downtime.

Live migration solves three main challenges:

Downtime during hardware maintenance.

Unbalanced cluster load.

Troubles within a cloud.

How It Works

In order to visualize the live migration process, we'd like to share the scheme below.

Source Node: where a container is placed before live migration.

Destination Node: where a container will be placed after live migration.

For performing the migration, the platform needs to:

Freeze the container at the source node blocking memory, processes, file system and network connections, and get the state of this container.

Copy the state to the destination node.

Restore the state and unfreeze the container at this node.

Execute a quick cleanup process at the source node.

Note, that there is a freeze timeframe, so you should consider this during the application architecture design.

There are two kinds of live migration solutions: pre-copy memory and post-copy memory (lazy migration). The difference between these two options is in the time period of freeze time (more details are in the full version of the article).

Four Use Cases of Live Migration

Hardware Maintenance Without Downtime

Live migration prevents the downtime — you can migrate containers in a live mode from one node to another inside one data center.

Load Rebalancing

Live migration helps to rebalance the load by migrating containers from one hardware node to another. You can even automate it by implementing specific algorithm and triggers.

High Availability

A cloud service provider can choose what set of hardware availability zones to provide. As result, end users get more options for high availability by performing the containers' live migration without the involvement of system administrators.

Switching Vendors

With live migration, end users are no longer locked to a specific cloud infrastructure vendor. From now on, customers can migrate their applications to an alternative cloud service provider without any reconfigurations and redeployments

Conclusion

It is hard to overcount the key benefits of containers live migration for the businesses and DevOps teams, as it provides a revolutionary new level of automation and optimization. No more maintenance downtimes, unneeded human efforts, and complaints from dissatisfied customers: Live migration was invented to rescue hosting providers and their users, enabling high availability, and supermassive flexibility. Find out more details in the full version of the article.