Book Image

Containerization with LXC

By : Konstantin Ivanov
Book Image

Containerization with LXC

By: Konstantin Ivanov

Overview of this book

In recent years, containers have gained wide adoption by businesses running a variety of application loads. This became possible largely due to the advent of kernel namespaces and better resource management with control groups (cgroups). Linux containers (LXC) are a direct implementation of those kernel features that provide operating system level virtualization without the overhead of a hypervisor layer. This book starts by introducing the foundational concepts behind the implementation of LXC, then moves into the practical aspects of installing and configuring LXC containers. Moving on, you will explore container networking, security, and backups. You will also learn how to deploy LXC with technologies like Open Stack and Vagrant. By the end of the book, you will have a solid grasp of how LXC is implemented and how to run production applications in a highly available and scalable way.
Table of Contents (17 chapters)
Containerization with LXC
About the Author
About the Reviewer
Customer Feedback


LXC supports various backing stores for its filesystem. In this chapter, we explored how to use the LVM, Btrfs, and ZFS backing stores to create COW snapshots. We also looked into how to create block devices from regular files for testing purposes.

We demonstrated how to autostart containers, create hooks that will execute programs during the life cycle of the instance, and how to expose directories and files from the host OS to LXC.

LXC uses the cgroup mechanism for controlling and allocating resources to containers. Changes to these resources are stored in the config file and can be persisted if the need arises. We explored ways of doing that with the provided toolset.

Finally, we introduced a different way of creating and managing LXC with libvirt and the virsh command.

In the next chapter, you'll have a look at how to create and manage containers using the LXC APIs and libvirt bindings for Python.