Combating VM Sprawl with Containers

27 Aug 2015

VM sprawl is something app developers know all too well. Having multiple instances of an application running quickly turns into a mess when your realise how many different staging environments you actually have. Between testing, Q&A, active development, and bug squashing—it’s easy to get lost in the tangled web of VM sprawl.

Using containers and a PaaS like Deis Workflow lets you move past the need for running seven different VMs for one application. Instead, boot one VM and have multiple containers. Why? Because containers need less system resources, so you can more on the same machine. You can easily clone your containers, version them, and so on. Stop and start them in minutes. Sail past dependency hell and ensure a perfect copy of your app runs in all your environments.

How Containers Help Combat VM Sprawl

Working with VMs can be stressful. Base images are often large, with hypervisors hog all your valuable system resources. This can result in slow or nearly impossible to operate VMs, meaning coding is sluggish and you end up spending additional time trying to tweak for performance, rather than developing what’s useful for your app in production. Lost time is a common problem when working with VMs.

Working with containers eliminates the primary pain points associated with hypervisors. Since containers run system calls directly on the host kernel, they can boot very quickly and don’t require additional CPU cycles. And because they share resources, they don’t require massive amounts of disk space or additional CPU cycles. Containers share a base operating system, allowing you to spin up multiple instances of your application without them having to have their own kernel, OS, and library files.

Having a single VM running multiple containers means you’ll spend less time managing cumbersome VMs, and more time actively developing. Standard VMs will often have a debugging build, a testing build, and a forward-facing build to show to potential clients. In a standard VM setup, each instance of the application then has its own libraries, operating system, and dependencies manage. This can result in a significant performance loss, depending on the specs of your dev machine.

Many applications require a large number of libraries and dependencies. For an application that requires SSL certificates, or locale information, these shared libraries can quickly bog down a system running a traditional VM environment, as multiple instances of /lib have to be created and managed. This makes applications dependent on their OS, requiring the same OS set up in the same way. Containers side-step all of this.

How Containers Benefit Developers

Containers make it possible for teams to fully duplicate their production environments. This wasn’t always possible, and is a radical idea for many people just be learning about container technology. Using containers allows for developers to see what needs to be in a container to ensure the best user experience, while also helping with security.

With developers piecing together precisely that which they need to run their application in a container, this minimalist approach can make it harder for ne'er-do-wells to gain access. Docker containers ship with RedHat and AppArmor, adding an extra layer of protection to your container. Docker containers run on a Linux-based kernel, allowing for users familiar with the Linux OS to put other security systems to work, such as SELinux.

Since containers allow full reproduction of your production environment, and are very lightweight to use, any person in the company can be running a copy of your app. Enabling this sort of workflow for everybody means that the app should function identically in all environments. So "it worked on my computer" type bugs become less common.

Containers make team collaboration simpler, since applications can be cloned and spun up in minutes, even on slow dev machines. Traditional workflows often require shared staging environments for collaboration. These are complex to set up, come with organisational overhead, and can be difficult to access away from the office, such as at a conference.

Containers In Production

Using containers in conjunction with the 12-factor approach means your application will be ready for horizontal scaling. And using a PaaS like Deis PRO is a great way to deploy your containerized app to the cloud.

Containers also mean better customer experiences. When support staff can a full copy of your app on their local machine, customers will spend less time waiting for your to to duplicate their issue. Containers (in a redundant 12-factor configuration) also allow for more easily achievable high-availability and fault-tolerance, meaning less frustrated customers during peak load or outages. And because you’re using a PaaS, your infrastructure (and your financial outlay) is flexible.

Production deployments are simplified with containers. New set of dependencies for the latest rollout? Add it to your container configuration, reboot your 10 identical app instances, and you’re good to go! Easily upgrade your stack and keep up with new technology, so you’re not left behind as your application and business grows.

Using containers in production also saves money for your business, because you don’t have to hire people to configure your application stack. This is already done for you with off-the-shelf configurations. The money saved from eliminating these costs can be funnelled back into your project, allowing you to do more of what’s important.


VMs require a hypervisor and large image files, meaning full hard disks and pegged CPUs.This can be a nightmare to work with, unless your laptop is top-of-the range. And it can put off contributors, if you’re working on an OSS product. Consequently, many people eschew VMs entirely.

Containers make it easier for your development team to work with your developer advocates and other areas of your business, improving collaboration throughout the app development pipeline. Whether at one’s desk, or working remotely--containers allow for your team to boot a perfect copy of a full application in minutes. Developers can also work together with security teams to catch possible issues before they become exploits, which means more protection for your application’s users.

Deploying containers to a PaaS saves money and lets you forget about the headaches of constantly upgrading your stack. Containers encourage the 12-factor approach, which is perfect for horizontally-scalable, highly-available, fault-tolerant cloud applications. All of this means less money wasted, with the savings being funnelled back into your project.

Deploying apps with containers on a PaaS benefits your developer team, company, and your bottom line.

Posted in Containers, Perspective

triangle square circle

Did you enjoy this post?