What is a virtual machine?
A virtual machine (VM) is a software-based emulation of a computer system which runs an operating system and applications. It can provide the same functionality as a physical machine, and runs on the underlying hardware of a host system. In cloud computing, this takes the form of a physical server, with a hypervisor running to create and manage multiple VMs. Each VM is allocated resources and can operate independently or as part of a network, greatly extending the capacity of the physical server. The process of creating VMs from physical hardware is known as virtualisation.
What are the two types of virtual machine?
There are two types of VM – process virtual machines and system virtual machines.
Process virtual machine
A process virtual machine is used to run a single process as an application on a host machine. An example is the Java Virtual Machine, which allows any operating system to run Java applications as if they were native to the system.
System virtual machine
A system virtual machine operates as a full substitute for a physical machine. They provide the functionality to execute entire operating systems.
In this insight we will be focusing on system virtual machines and how they contribute to cloud computing.
What does a virtual machine do?
In cloud computing, VMs are used to extend the capacity of physical servers.
Virtualisation enables multi-tenant cloud solutions, including public cloud and enterprise cloud, where multiple users are allocated VMs from the same physical server. Each user has their own isolated environment, without needing their own physical resources.
VMs are also often used in single tenant cloud solutions, such as private cloud, where the underlying hardware itself is dedicated to a single user. Here, VMs are created in the same way, but are all allocated to the same user. This increases the capacity of the infrastructure without needing additional costly physical servers.
The introduction of virtual machines made cloud computing more affordable and accessible, bringing its benefits to a wider audience. Where previously a cloud solution would need many physical servers, the same workload can now be achieved with less physical hardware.
How do virtual machines work?
VMs work by using a hypervisor, software which sits and operates on top of the underlying physical hardware, or on top of an operating system. The physical hardware is referred to as the host, and the VM as the guest. The hypervisor virtualises components including CPU processing power, RAM and storage. VMs use a guest OS such as Windows or Linux, which provides the interface and functionality for applications. This allows each VM to operate completely independently from other VMs running on the same host hardware.
Virtual machines vs Containers
Virtual machines are often compared with containers, another method of resource virtualisation. While they can have similar uses, there are key differences between the two.
VMs use a hypervisor for virtualisation of the host hardware, and include a full operating system (guest OS). VMs offer strong isolation, and can be used to run multiple different OS environments on a single machine.
Containers are units of software which package code and its dependencies. They virtualise the OS, rather than the underlying physical hardware. They do not require a hypervisor, and are instead created and managed through containerisation platforms such as Docker. They are more lightweight than VMs, as they do not need a full OS instance. Containers can be less secure than VMs, as they share the host OS kernel. For more details on containers, take a look at our insight ‘Confused about containers?’.
Why should you use virtual machines?
Resource optimisation
Virtualisation through VMs allows you to build infrastructure with the equivalent operating power of multiple physical servers, using a minimal amount of hardware. This optimisation saves money and reduces the space needed to house your infrastructure, whether this is on-premise, or in a data centre. Resources can be dynamically distributed between multiple VMs within the same infrastructure, either manually, or by using a load balancer, to spread workloads and traffic and avoid overloading an individual VM.
Scalability
New VMs can quickly and cheaply be created from host hardware, increasing capacity and resources. This allows business to scale up and down reactively as needs change. Without virtualisation, scaling would require additional physical hardware to be purchased and connected to the infrastructure, which can be a slow and expensive process.
Security via isolation
VMs, while sharing host hardware with other users, are entirely isolated from each other, ensuring your environment is secure. You can configure your environment with additional security measures according to your own needs.
Hardware independence
VMs can operate independently of their specific host hardware, meaning they can be moved, copied, or backed up across different hardware environments without compatibility issues. If you upgrade your physical servers, VMs can be moved without minimal downtime, and without needing to reconfigure the guest OS. VMs can also be easily backed up and restored on different hardware, speeding up the disaster recovery process.
Virtual machines as part of managed cloud infrastructure
To get the most benefit from VMs, your business can consider their use within managed cloud infrastructure. A managed service provider (MSP) can oversee your VMs, monitoring and distributing your traffic and workloads, creating new VMs and distributing resources for rapid scalability, and monitoring platform security. This approach gives you all of the benefits of working with VMs, without the responsibility of their day-to-day management.
We can work with you to design the perfect platform for your business needs. If you’d like to talk to one of our cloud hosting experts about how to optimise your IT infrastructure, fill out our contact form.