Virtual machine vs containers

Virtualization has been with us now for decades, but the most recent developments have been in the field of software containerization. Here we explain the key differences, contrast the benefits, and provide some best fit use cases.

Even if consider yourself an IT veteran it can be easy to think of server and storage virtualization as a fairy recent innovation, however, the reality is that IBM coined the phrase hypervisor for its 360/65 system in 1971 and effectively invented virtualization around that time with a virtual machine operating system known as VM/370. VMware, the new kid on the block, that have been the mainstay of modern hypervisor technology released its first product (VMware Workstation) back in 1999. It therefore comes as no surprise that after 50 years of innovation the IT industry may have reached a point of saturation in server virtualisation. More recent advances have been focused on OS-level virtualization known as “containers”. Here we will consider the pros and cons of the virtual machine vs container and offer some best fit use cases for each technology.

What is virtualization?

Virtualization is a process whereby software is used to create an abstraction layer that allows elements of a single computer, including CPU, memory, storage, and networking to be divided into multiple virtual computers. Virtualization is not possible without a hypervisor, a small software layer that enables multiple operating systems to run alongside each other sharing the same physical computing resources. When a hypervisor is used on a physical computer or server in a data center, (also known as bare metal server), it allows the physical computer to separate its operating system and applications from its hardware. It can then divide itself into several independent virtual machines (VMs).

What is software containerization?

In contrast to virtualization which abstracts an entire system, a container shares just the kernel of the host operating system (OS), and that shared part of the OS is read-only. Containers are a more light-weight and agile way of handling virtualization since they do not use a hypervisor. This allows for faster resource provisioning, enabling new applications to be made available in shorter time. Instead of provisioning an entire VM, containerization packages together everything needed to run a single application including any required runtime elements. This enables applications to run almost anywhere, from a desktop system, within a traditional IT infrastructure, or most importantly, in the cloud. Containers are therefore a form of OS virtualization. It can be argued that containers have also been around for decades, but the common consensus is that the container era truly began in 2013 with the introduction of Docker which is an open-source platform for building, deploying, and managing containerized applications.


Container vs virtual machine – what are the pros and cons?

Containers are great for application portability

While there are still many reasons to use VMs, containerization solves several problems for software development and deployment, in addition they provide a level of flexibility and portability that is perfect for today’s multi-cloud environments. When a new application is created, developers may not know in advance all the places it will need to be deployed. An organization might run the application on a private cloud today, but tomorrow it may need to deploy within a public cloud from a different provider. Containerizing provides development teams the flexibility they need to deploy services across a multitude of platforms with ease. Containers are also ideal for automation and DevOps pipelines, including continuous integration and continuous deployment implementation (CI/CD).

Containers can provide more granular scalability

Like virtual machines, containers allow developers to improve CPU and memory utilization for specific applications, however they go even further because they also enable microservice architectures, where application components can be deployed and scaled more granularly. This is a very attractive alternative to having to scale up an entire application just because a single component of the service is struggling with load.

Always consider cybersecurity when choosing your application environment

One slight negative is that all containers on a particular host machine must be designed to run on the same kind of OS. Containers based on a different OS will require a different host. From a security perspective, because the OS is shared in a container-based environment, a security vulnerability in the OS kernel can be a threat to all containers on the host machine.

VMs may be the winner if you need multiple operating systems

In traditional virtualization the hypervisor virtualizes physical hardware such that each virtual machine contains a guest OS therefore VMs with different operating systems can be run on the same physical server. For example, a Linux VM can run next to a Microsoft VM on the same system, and so on.

Virtualization or containers – example use cases

Software containerization enables you to deploy multiple applications using the same OS on a single virtual machine or server. Virtualization in contrast enables you to run multiple OS on the hardware of a single physical server.

Containers are a great option if your priority is to minimize the number of servers you are using for multiple applications. Virtual machines are perfect for supporting applications that require an operating system’s full functionality, when you want to deploy multiple applications on a server, or if you have a variety of operating systems to manage.

With their fast set up time containers are an excellent choice for tasks which have a short lifecycle, for instance processes that may only take a few hours. Virtual machines have a longer setup time and lifecycle than containers, so are best used for more permanent applications.


Platform mobility is important to avoid cloud-service vendor lock-in

Both virtual machines and software containers allow you to move them around from platform to platform, or more importantly, from cloud to cloud. The application portability aspect of containers means they can execute on variety of different cloud platforms, helping to avoid the chances of cloud-service vendor lock-in. This can be important given the proprietary nature of some public clouds. The movement of both virtual machines and containerized applications can be greatly simplified using a migration tool such as Cristie CloneManager™ which can seamlessly migrate systems between physical, virtual and cloud targets. In addition, CloneManager provides the ability to apply scaling parameters ahead of the migration process, allowing you to scale resources for virtual machines up or down if required.

In summary

The best choice for your organization will depend on many factors such as the size of your operations, the nature of your workflows, and level of internal IT resources. Software containerization is still a relatively new technology with wide variances in implementation requiring skilled resources which may make adoption a challenging process for some. Containerization and virtualization technologies are coming together in some exciting new ways which could result in a hybrid solution being the best option for your IT strategy. For more information on VM and software container cloud-to-cloud migration, contact the Cristie Software team who are always available to provide advice and guidance.