How to choose between containers and virtual machines

Containers vs. VMs isn't always an all-or-nothing question, except when it is. Here is good advice for how to decide which to use.

containers.jpg

Image: chuyu, Getty Images/iStockphoto

When you're convinced that it is time to move business applications away from bare metal servers, should you choose virtual machines (VMs) or containers and why?

Experts say it's important to understand that virtual machines and containers aren't mutually exclusive. The basic difference is that virtual machines are entire operating systems, whereas containers are sandboxes within an operating system, but many of each can live on a single physical server.

"So, the answer is more complex than it may seem," said Amalgam Insights analyst Tom Petrocelli. "First, you may not choose one or the other but both. A lot of applications are built on containers in a cloud instance, which is basically a VM, or a VM on bare metal. That's the dominant way of doing containers. That's how it works in Cloud Foundry as well and a lot of Red Hat OpenShift installs. Managed Kubernetes services from cloud providers are picking up steam and they are, from a DevOps perspective, 'pure' containers though we really know they are running in a VM."

"Perhaps the real question is, how do we decide to use containers or not? It comes down to these seven criteria: Isolation, resource overhead, capacity utilization, system architecture, portability, deployment speed, [and] data persistence," Petrocelli continued.

But if you have to pick one, "To me it's as simple as IT operations drive virtual machines, containers are driven by developers," explained analyst Mark Bowker, of Enterprise Strategy Group.

SEE: Implementing DevOps: A guide for IT pros (free PDF) (TechRepublic)

Bowker said microservices are an important key reason to choose containers. Software that's based on microservices used to require new hardware and middleware, but now cloud providers take away much of that burden. That makes containers an attractive option because you no longer need a dedicated operating system, he noted.

Of course, for every pro there's a con. "The way that containers get protected, backed up, and secured is just different. It may require different processes, different training," Bowker said, so while there's less operating system management, that means developers have to talk to IT departments after all.

Responses to our question of which to choose came out overwhelmingly in favor of containers, but it's also notable that all of these responses were from startups, with one major exception--Eric Drobisewski, a senior architect at Liberty Mutual Insurance. Drobisewski is well-known as a Docker advocate, but it's a safe bet that a company as big as Liberty Mutual isn't going to take chances on fads.

"Whether you're a large organization or a startup, organizations can greatly benefit from a container-first mindset for all their workload needs," he stated. "For our greenfield development, microservice-based architectures, or ML/AI-based applications at Liberty Mutual, we have found that there is no reason to not start that journey using containers."

However, "With the many significant advancements organizations can gain from container technology, there are still reasons to consider a VM for certain needs. VMs are still optimal for certain persistent workloads such as large transactional databases that require a resilient persistent backend, low tolerance for data loss, and high I/O requirements."

"Other considerations for VMs include commercial off-the-shelf-based products and maintaining vendor support for these solutions. There are still some providers that haven't fully adopted containers and won't certify their solutions for future maintenance and support, so that is something that should be explored and verified by organizations considering containerization."

Also see