VM's vs. Containers
VM's vs. Containers
Both VMs and containers can help get the most out of available computer
hardware and software resources. Containers are the new kids on the block,
but VMs have been, and continue to be, tremendously popular in data
centers of all sizes.
If you’re looking for the best solution for running your own services in the
cloud, you need to understand these virtualization technologies, how they
compare to each other, and what are the best uses for each. Here’s our
quick introduction.
VMs, however, can take up a lot of system resources. Each VM runs not just
a full copy of an operating system, but a virtual copy of all the hardware
that the operating system needs to run. This quickly adds up to a lot of
RAM and CPU cycles. That’s still economical compared to running separate
actual computers, but for some applications it can be overkill, which led to
the development of containers.
Benefits of VMs
Popular VM Providers
VMware vSphere
VirtualBox
Xen
Hyper-V
KVM
Containers sit on top of a physical server and its host OS — typically Linux
or Windows. Each container shares the host OS kernel and, usually, the
binaries and libraries, too. Shared components are read-only. Sharing OS
resources such as libraries significantly reduces the need to reproduce the
operating system code, and means that a server can run multiple workloads
with a single operating system installation. Containers are thus
exceptionally light — they are only megabytes in size and take just seconds
to start. Compared to containers, VMs take minutes to run and are an order
of magnitude larger than an equivalent container.
In contrast to VMs, all that a container requires is enough of an operating
system, supporting programs and libraries, and system resources to run a
specific program. What this means in practice is you can put two to three
times as many as applications on a single server with containers than you
can with a VM. In addition, with containers you can create a portable,
consistent operating environment for development, testing, and
deployment.
Types of Containers
Benefits of Containers
Linux Containers
o LXC
o LXD
o CGManager
Docker
Windows Server Containers
Both containers and VMs have benefits and drawbacks, and the ultimate
decision will depend on your specific needs, but there are some general
rules of thumb.
VMs are a better choice for running apps that require all of the
operating system’s resources and functionality, when you need to run
multiple applications on servers, or have a wide variety of operating
systems to manage.
Containers are a better choice when your biggest priority is
maximizing the number of applications running on a minimal number
of servers.
VMs Containers
Heavyweight Lightweight
Fully isolated and hence more secure Process-level isolation, possibly less secure
For most, the ideal setup is likely to include both. With the current state of
virtualization technology, the flexibility of VMs and the minimal resource
requirements of containers work together to provide environments with
maximum functionality.
Roderick Bauer
Content Director at Backblaze