Discover LXC awesomeness!

Now that we know how it works let's look at a few use cases that illustrate the fantastic flexibility of LXC.

Moving or upgrading servers
With applications deployed in VMs or servers upgrading or moving to a new server can be a chore. With containers, moving your applications and workloads becomes a simple matter of cloning your containers and sending it across which would take literally seconds to do. So you are not tied to any hardware or provider. This is what decoupling does. No more elaborate backup and transition strategies. Just pack and move whether it's a new server, location or provider.

Testing and rolling out changes
When you want to test, make changes to your applications or test upgrades, you can simple do it on a clone which takes seconds to create and when satisfied roll out the clone and delete the original instance.

No downtime for upgrades or changes
You don't need to plan any downtime for upgrades or take down your servers. Just work on the clone and roll it out as required.

Distribution and rapid provisioning
By cloning containers you can replicate and distribute exact copies of workloads and applications across environments. You can roll out specific configurations across your systems or organizations with minimal fuss. Since a new instance is as simple as a clone operation provisioning can be cut down to seconds.

Run multiple version of applications and web stacks
With LXC you can quickly launch new instances and test, experiment or run multiple version of applications and web stacks. Maybe you need specific versions of PHP, Ruby or Python for one particular app, need to use a different version of Nginx or Apache or would like to test new versions of your applications before upgrading.

Portable cloud instances
A lot of end users use KVM instances from public cloud providers like Amazon, Digital Ocean, Linode etc. But after expending significant effort to install and configure their apps and build their websites, users are wedded to these providers. Moving can be a elaborate effort of planning and execution. Not with containers. If you deploy your apps in containers you are basically free to take your apps and workloads and move across providers with minimum fuss.

Easy backups
With LXC backing up is as simple as cloning your container. Add an advanced file systems like Btrfs to the equation and LXC morphs into a powerful tool for snapshots, backup and resilience.

Test applications on or run multiple Linux distributions
You can run containers with different Linux distributions. LXC offers a wide choice of container OS templates. For instance a Debian host can run a CentOS, Fedora or Ubuntu container. This allows you to to test applications in different Linux environments, and in cases where applications support a particular Linux variant you can deploy your application in that OS container.

Easy file systems access
With VMs you don't have easy access to the VM data in virtual disk images. LXC containers are a just a file system on your host and can be accessed easily both ways. Apart from the portability of moving around these file systems across hosts which we already covered, you can bind mount folders on the host to the container so they are available in the containers so you could for instance be sharing /var/www or even /var/lib/mysql between host and container, host and multiple containers or container and container. You can copy any data from the host to a running container and vice versa just like a normal filesystem transfer. It adds a whole new layer of flexibility.

The speed, flexibility and efficiency of LXC enables new possibilities across a range of use cases.

Further reading and resources

LXC getting started guide
Lxc advanced guide
LXC networking guide

Flockport get started guide
Flockport guide

Recommended Posts

Leave a Comment


Register | Lost your password?