14 December 2020 Reading time: 10 minutes

Working options for using VM, Docker, LXD and Kubernetes

Alexander Grishin, VMmanager Product Manager

Ivan Sidorov, Executive Director at ITSumma

ISPSystem

Why do some people choose Docker or LXD, but for others virtual machines are sufficient?

Let us look at how these tools differ and under what conditions they are most useful.

Content

Virtual machines

A virtual machine is a virtual server that is created on the basis of a physical server using special software:

  1. VMmanager
  2. VMware vSphere
  3. Microsoft Hyper-V etc.

Each VM can run on its own operating system. Virtual machines cannot be scaled immediately when resources are limited, but they have their own advantages that give them priority.

For example, you need to provide the employees of different departments of the company with resources for work. However, each department has its own needs — some need CRM, others need a website, while others — the accounting system or access to a flash drive. All of these systems run on different OS. To solve this problem, a couple of specialists will be enough to create "virtual desktops" with the necessary work environments on demand. An additional advantage of these working environments is their isolation from each other. In other words, a VM is an excellent fit for a heterogeneous IT infrastructure.

With the help of virtual machines, it is easy to set up a secure remote workplace, which is especially important in the period of general lockdown. At the same time, information security risks are reduced, because all hardware and computing power remain on the employer's server, and the employee has access only to what he needs to work with.

Unfortunately, a VM takes up a lot of hard disk space and consumes many resources (for virtual OS and drivers of virtual devices).

If

  1. you need to perform work processes non-stop,
  2. you do not have an in-house developers team,
  3. you do not need instant scaling of resources,
  4. you need space for testing application without being concerned about malware or an inside threat,
  5. your company has departments with different requirements to OS and software,
  6. you need a simple and inexpensive solution for resources delivery,
  7. you need to emulate a hardware device such as a graphics card,

then a VM is the optimal choice for you.

Virtual machines deployed using VMmanager platform

Docker

Docker uses virtualization at the OS level, rather than at the hardware level, as virtual machines do. In plain words, Docker is another degree of virtualization, a virtualization tool. To date, it is one of the most common container technologies — it can be called a standard in the field of application development.

The original operating system for Docker is Linux, so if you want to run Docker containers on Windows it should be done inside a Linux virtual machine.

Docker automates processes that you have to do manually. It allows you to quickly and flexibly configure a work environment in which thousands of different configurations can be tested. Docker is positioned as a convenient tool for developing and testing applications.

If your developers team

  1. needs to automate work processes,
  2. needs an easily configurable space for working with applications,
  3. needs the ability to test many different configurations in a stable environment,

then Docker is a suitable solution.

VMs will be sufficient for the processes in small companies that are not engaged in development, but for which isolation of each service (CRM, websites, database, ERP-systems or accounting, etc.) is critical.

LXD

When we talk about virtualization tools, LXD should be mentioned separately.

Linux Container Daemon (LXD) is based on container technology called LXC, adding a wider range of capabilities to it.

Whereas Docker is a virtualization for applications, LXD is an OS virtualization, a tool for creating complete lightweight VMs (also called a "lightvisor" because of this feature).

The operating principle of LXD is the same as that of Docker with containers. Only in case of LXD not applications, but OS images are deployed as containers.

LXD has several advantages over other tools:

  1. LXD containers work faster than virtual machines,
  2. unlike virtual machines, you do not need to allocate RAM for the OS kernel of the LXD, etc.;
  3. the isolation level of LXD containers is higher than that of Docker.
The difference between an LXD infrastructure container and a Docker container: LXD isolation is higher

LXD virtualization allows you to run more full-featured operating systems on the same hardware without wasting resources typical of traditional VM (RAM, processor, adapter, etc.), thus providing significant performance and savings in the long run.

LXD is not only suitable for providers, but also for companies where the IT department manages resources, where it is important to quickly provide a large number of isolated containers, for example, as an infrastructure for the development team.

If you need to

  1. deploy infrastructure containers quickly for your clients,
  2. ensure a high degree of utilization of physical server resources,
  3. arrange several local isolated environments, for example for software development or testing,
  4. ensure the isolation of the physical infrastructure from the processes performed in the container

then LXD is the best option.

Kubernetes

Now, let us turn to Kubernetes. What do you need it for if you have a Docker for applications, LXD for large providers and companies with development departments, and VMs will suffice for everyone else?

Kubernetes is a tool designed for coordinated management of container groups, i.e. orchestration. It automatically adds instant scalability to Docker* containers, which is very important when you need to support projects with unpredictable loads.

* A news has been published in the Kubernetes blog announcing that Dockershim is no longer supported. However, users can continueusing Docker in Kubernetes.

For example, you are the owner of a business that has an online store. Soon there will be a period of discounts. You are planning to launch a promotion, but you do not know how popular it will become. If the promotion is successful, your website will experience a serious load. You will need additional capacity to keep your online store running without interruptions and avoid losing profit. In such a situation, when using VMs without Kubernetes, you will have to calculate the approximate required amount of resources and pay for them in advance, since they do not have the ability to scale immediately. If the campaign is not so successful, you will simply pay for this extra capacity without getting the expected result.

Depending on the settings, Kubernetes provides automatic horizontal and vertical scaling. This means that in case of a rapid increase of the number of visitors, your website will not crash. The system will allocate the necessary amount of resources by redistributing the load in the background mode, so there will be no failures. The company will not suffer any losses due to a non-functioning website, and you will only pay for the capacity that was used during the promotion.

Kubernetes is relevant for above-average companies that have Dev-Ops teams with established Dev-Ops practices and need to support their internal development infrastructure.

Such companies need a high level of services, they need more performance, and they are willing to invest a lot of money in it (including into getting expensive specialists).

LXD containers are fast and lightweight. Creating a new instance in VMmanager took 4 seconds

If you need

  1. flexible deployment of containers,
  2. flexible container management in a production environment (traffic monitoring, load balancing in automatic mode),
  3. instant automatic scaling of applications (scaling up and rollback of resources),
  4. a secure development environment (in Kubernetes you can use several authorization schemes at the same time)

then Kubernetes is a perfect solution for you.

ВМ, Docker, LXD, Kubernetes — who needs what?

Virtual machines are the right choice for the majority of companies to accomplish ongoing tasks. If you need stable execution of different work processes in a secure environment, it is safe to choose a VM that meets all these requirements. This is a simple and accessible virtualization for everyone.

Docker— is a great tool if you have a development team for whom a stable container environment is important. Docker is the current standard in software development and testing, which saves time for developers.

LXD containerization technology is most relevant for companies that have an IT department that distributes resources, including for internal development needs, as well as hosting and telecommunications providers, for which the speed of deployment and light weight of virtual machines is important. This type of container combines the speed of Docker and the reliability of a virtual machine.

Kubernetes пis suitable for companies with large web projects (websites of large chain stores, state websites of federal significance, websites for media, airlines, popular SaaS), which have not only development teams, but also Dev-Ops engineers. Kubernetes improves the work with applications and microservices in containers, solving the problem of instantaneous automatic scaling.

Take the most from each technology

ISPsystem recommends VMmanager for managing virtual machines: it is a fast, secure and easy-to-use KVM-based server virtualization platform. Now VMmanager also offers working with an alternative to Docker — fast, lightweight yet isolated LXD containers.