Live Docker container migration between clouds

    We continue to talk about solution companies (ISVs) using the Microsoft Azure cloud. In this issue, we continue the story of the Jelastic platform with the theme of live migration of Docker containers between cloud providers. You can always find the previous articles of a cycle on Habr at the link #isvcloudstory . - Vladimir Yunev
    Recent IDC research in the cloud has shown that 57% of companies have already implemented various forms of cloud services, 44% plan or already use a private cloud, and 64% of companies are focused on a hybrid cloud. This creates the need to move work sites from one cloud to another, while maintaining high performance and data integrity. One way to seamlessly move running applications between different physical servers or data centers is through live migration of containers .


    Usually, you need to repackage containers with work platforms each time you move the application from one cloud or data center to another. In this case, the main problem becomes the issue of automation and uninterrupted migration.

    In our article, we will show how you can solve the main problems of DevOps teams using live migration, and also consider an example of practical application of this solution.

    Solution: Live Migration


    Live migration in the Jelastic cloud occurs by freezing containers on one server and restoring them on another without downtime or loss of data and incoming connections. Such migration allows you to:

    • improve productivity
    • optimize the load distribution in the cluster, which provides more efficient use of data centers
    • quickly and easily migrate applications to a more powerful infrastructure without interruption of service
    • Improve the process of continuous integration and deployment of Docker containers without the need to further reconfigure the environment

    Thus, thanks to container migration, DevOps are able to more effectively manage the application life cycle. The Jelastic platform supports live and autonomous container migration: you can easily move an application from one region to another without having to reconfigure containers and redeploy the application.

    In addition to this, users can move their applications between different cloud vendors using the multi-cloud Jelastic solution. Hosting providers and large companies can combine private and public cloud within their data centers, as well as external cloud vendors. This integration provides high availability, prevents data loss or unplanned downtime, improves performance and helps reduce costs.

    How it works?


    In order to migrate your applications using the Jelastic platform, simply click on the region icon next to your application (or you can click Change environment topology and select the Migrate option from the list in the upper right corner) and select the desired region in the drop-down list.

    The availability of the live migration option is indicated by the LM icon (live migration) under the name of the corresponding region.


    During a live migration, the application container is copied to the server of the selected region. Of course, during the migration, changes to the already copied data may occur, therefore they will be marked as modified in order to be re-copied. After that, the container will freeze for a few seconds and is activated already on the new server.

    At the same time, all TCP connections will be reinstalled on the new host using the TCP recovery mode in the Linux kernel. This will allow maintaining a constant connection for client-server applications that run on migrating containers by reassigning IP addresses to newly assigned hosts. Previously configured connection settings will be resumed in the same state as they were before the migration. Freezing lasts only a few seconds, after which the desired application continues to work.

    See in action


    Let's see how live migration works on the example of SeisComP - seismological software for collecting and processing data, as well as interactive earthquake analysis in real time.

    In order to easily deploy the aforementioned application, we will use the Docker container support in Jelastic:

    Open the Jelastic environment setup wizard using the New environment button in the upper right corner of the toolbar and go to the Docker tab.

    Select the unigeocloud / seiscomp container in the corresponding block (for details, see the Adding a Docker container to the Jelastic environment instructions ) and add it to the Application section of the topology.


    Then, determine the limit of the amount of resources consumed for the container, select the region to host the environment (in our case, it is AWS), name it and confirm the creation.

    Now you can instantly launch the application using the Open in browser button. On the page that opens, connect to the remote desktop using your credentials (which you received earlier by email).

    Launch the Seiscomp waveforms application with graphical visualization of data received from specific seismic stations, which allows you to monitor the seismological situation in real time.


    While tracking is automatically performed in the background, return to the control panel and migrate your application to another region (in our case, it is Azure) using the appropriate option in the environment settings:


    Pay attention to the green LM label near the selected region - this means that now you can start live migration using the appropriate switch to move the selected environment without downtime.

    Click the Verify & Migrate button and confirm the start of the process.

    Wait until the migration is completed - you will see a corresponding notification on the toolbar, and also receive an email with new application data (for example, IP addresses). The region label next to the application will also change.


    During the migration, the application continues to work and receive geo data.


    As you can see, the graphs continue to be stably and continuously displayed - this means that live migration does not in any way affect the operation of the application and ensures stable performance.

    Network setup: in order to implement this solution, some additional platform configurations were involved, namely, we united all the regions under a common network for access through a single entry point ( Shared LB ). This made it possible for the application to work under the same domain with respect to the selected hardware so that nothing would be reconfigured after migration. Moreover, this implementation method implies that not a single environment container has an external IP address.

    Watch the video how it works in reality:



    Conclusion


    The process of live migration cannot be overestimated, since it provides freedom of choice in such parameters as price / performance / support among different vendors and helps to avoid downtime during maintenance work on the infrastructure. During a live migration, applications continue to run without downtime and receive the necessary resources.

    Register and try it yourself. More real cases of using cross-cloud migration can be seen in the following videos:


    Azure marketplace


    Azure users can quickly access the Jelastic platform through the convenient Azure Marketplace. Get started with Jelastic today!

    Also popular now: