live container migration: opportunities and challenges
TRANSCRIPT
![Page 1: Live Container Migration: Opportunities and Challenges](https://reader033.vdocument.in/reader033/viewer/2022042415/625f16d3660fae2ddd6d7a74/html5/thumbnails/1.jpg)
Live Container Migration: Opportunities and Challenges
Niroj Pokhrel
![Page 2: Live Container Migration: Opportunities and Challenges](https://reader033.vdocument.in/reader033/viewer/2022042415/625f16d3660fae2ddd6d7a74/html5/thumbnails/2.jpg)
Agenda
● Introduction and Background
● Different Migration methods
● Case Study: OpenVZ and Docker
● Conclusion
![Page 3: Live Container Migration: Opportunities and Challenges](https://reader033.vdocument.in/reader033/viewer/2022042415/625f16d3660fae2ddd6d7a74/html5/thumbnails/3.jpg)
● Powerful CPUs● Minimal utilization● Run multiple vms
in same server
Introduction
![Page 4: Live Container Migration: Opportunities and Challenges](https://reader033.vdocument.in/reader033/viewer/2022042415/625f16d3660fae2ddd6d7a74/html5/thumbnails/4.jpg)
Container Vs Virtual Machine
![Page 5: Live Container Migration: Opportunities and Challenges](https://reader033.vdocument.in/reader033/viewer/2022042415/625f16d3660fae2ddd6d7a74/html5/thumbnails/5.jpg)
Conventional Cold Migration
● Stop a container
● Copy filesystem to destination server.
● Start the container at destination
★ Involves a downtime
★ Prior Planning Required
![Page 6: Live Container Migration: Opportunities and Challenges](https://reader033.vdocument.in/reader033/viewer/2022042415/625f16d3660fae2ddd6d7a74/html5/thumbnails/6.jpg)
Live Migration
● Move a running container from one server to another without a reboot
● Transparent to user, container source and container destination
![Page 7: Live Container Migration: Opportunities and Challenges](https://reader033.vdocument.in/reader033/viewer/2022042415/625f16d3660fae2ddd6d7a74/html5/thumbnails/7.jpg)
Why Live Migration?
● Load Balancing
● Update Kernel/OS
● Replace or Maintain Hardware
● High availability
● Fault tolerance
![Page 8: Live Container Migration: Opportunities and Challenges](https://reader033.vdocument.in/reader033/viewer/2022042415/625f16d3660fae2ddd6d7a74/html5/thumbnails/8.jpg)
Live Migration
● Memory Migration
○ Precopy
○ Postcopy
● Network Migration
● Disk Migration
![Page 9: Live Container Migration: Opportunities and Challenges](https://reader033.vdocument.in/reader033/viewer/2022042415/625f16d3660fae2ddd6d7a74/html5/thumbnails/9.jpg)
Precopy Migration
![Page 10: Live Container Migration: Opportunities and Challenges](https://reader033.vdocument.in/reader033/viewer/2022042415/625f16d3660fae2ddd6d7a74/html5/thumbnails/10.jpg)
Postcopy Migration
![Page 11: Live Container Migration: Opportunities and Challenges](https://reader033.vdocument.in/reader033/viewer/2022042415/625f16d3660fae2ddd6d7a74/html5/thumbnails/11.jpg)
Comparison
Precopy Postcopy
Destination Node Failure ++ --
Downtime -- ++
Up state after migration ++ --
Write Intensive Application --
Read Intensive Application ++
![Page 12: Live Container Migration: Opportunities and Challenges](https://reader033.vdocument.in/reader033/viewer/2022042415/625f16d3660fae2ddd6d7a74/html5/thumbnails/12.jpg)
Suspend/Resume Migration
● More Secured
● Destination host is inactive during transfer
● Network connections dropped and reestablished at
destination
● Disk transfer optimization with disk deltas
● Disconnected operations
![Page 13: Live Container Migration: Opportunities and Challenges](https://reader033.vdocument.in/reader033/viewer/2022042415/625f16d3660fae2ddd6d7a74/html5/thumbnails/13.jpg)
Record/Replay Migration● Used for Recovering state● Repeat events from log to get to desired state● Log only non-deterministic events● Compute deterministic events on rerun
➢ Maximizing trace completeness➢ Reduce Performance overhead➢ Reduce log file size
![Page 14: Live Container Migration: Opportunities and Challenges](https://reader033.vdocument.in/reader033/viewer/2022042415/625f16d3660fae2ddd6d7a74/html5/thumbnails/14.jpg)
Case study: OpenVZ
● Checkpointing and Restoring
● Container an isolated entity
● Complete state can be saved on disk
![Page 15: Live Container Migration: Opportunities and Challenges](https://reader033.vdocument.in/reader033/viewer/2022042415/625f16d3660fae2ddd6d7a74/html5/thumbnails/15.jpg)
Checkpointing and Restoring (C/R)Source Destination
Copy File system
Checkpoint and save to disk
Transfer Checkpoint
Restart
![Page 16: Live Container Migration: Opportunities and Challenges](https://reader033.vdocument.in/reader033/viewer/2022042415/625f16d3660fae2ddd6d7a74/html5/thumbnails/16.jpg)
Prerequisite for CR
● PID Virtualization
● Process group isolation
● Network isolation and virtualization
● Resource virtualization
![Page 17: Live Container Migration: Opportunities and Challenges](https://reader033.vdocument.in/reader033/viewer/2022042415/625f16d3660fae2ddd6d7a74/html5/thumbnails/17.jpg)
Important Notes on C/R● First step in Checkpointing and last
step in Restoring is process freezing● Process freezing is done by
TIF_FREEZE signal● Different dependencies should be
saved● hook() is added on top of process
stack for restoring● Roll back possible
![Page 18: Live Container Migration: Opportunities and Challenges](https://reader033.vdocument.in/reader033/viewer/2022042415/625f16d3660fae2ddd6d7a74/html5/thumbnails/18.jpg)
Implementation in Linux
● Save and Restore state
● Memory Precopy or Postcopy
● Perform checks
● Implement C/R steps
● Deal with filesystems
![Page 19: Live Container Migration: Opportunities and Challenges](https://reader033.vdocument.in/reader033/viewer/2022042415/625f16d3660fae2ddd6d7a74/html5/thumbnails/19.jpg)
Case study: Docker
● CRIU and P.Haul for live migration
![Page 20: Live Container Migration: Opportunities and Challenges](https://reader033.vdocument.in/reader033/viewer/2022042415/625f16d3660fae2ddd6d7a74/html5/thumbnails/20.jpg)
Conclusion
● Live migration essential for high availability and load balancing
● Many live migration methods present
● Different methods have different opportunities and challenges
● Precopy and postcopy prominent memory migration techniques
● OpenVZ and Docker use C/R technique
![Page 21: Live Container Migration: Opportunities and Challenges](https://reader033.vdocument.in/reader033/viewer/2022042415/625f16d3660fae2ddd6d7a74/html5/thumbnails/21.jpg)
References● Brendan Burns, Brian Grant, David Oppenheimer, Eric Brewer, and John Wilkes, "Borg, Omega,
and Kubernetes", Communications of the ACM 59(5):50-57, April 2016● Medina, Violeta ; Garcia, Juan Manuel; “A Survey of Migration Mechanisms of Virtual Machines”
ACM Computing Surveys Fall, 2014, Vol.46(3), p.30(33)● Felter, Wes; Ferreira, Alexandre; Rajamony, Ram ; Rubio, Juan; “An Updated Performance
Comparison of Virtual Machines and Linux Containers” Performance Analysis of Systems and Software (ISPASS), 2015 IEEE International Symposium on 2015 IEEE International Symposium on Performance Analysis of Systems and Software, March 29-31 2015, pp.171-172
● Bussmann, Jens; Grzadkowski, Filip; “Containers with Google: from Borg to Kubernetes” available at http://www.redhatonline.com/pl/wp-content/uploads/2016/05/RH-GOOG_WAW_JensBussmann.pdf
● Emelyanov, Pavel; “Live migrating a container: pros, cons and gotchas” available at http://www.slideshare.net/Docker/live-migrating-a-container-pros-cons-and-gotchas
● Mirkin, Andrey; Kuznetsov, Alexey; Kolyshkin, Kir; “Containers checkpointing and live migration” available at https://landley.net/kdocs/ols/2008/ols2008v2-pages-85-90.pdf
![Page 22: Live Container Migration: Opportunities and Challenges](https://reader033.vdocument.in/reader033/viewer/2022042415/625f16d3660fae2ddd6d7a74/html5/thumbnails/22.jpg)
Questions?
![Page 23: Live Container Migration: Opportunities and Challenges](https://reader033.vdocument.in/reader033/viewer/2022042415/625f16d3660fae2ddd6d7a74/html5/thumbnails/23.jpg)
Container Features
● Namespace
● Control Groups (cgroups)
● Layered filesystem (Docker specific)