One of the interesting things about Kubernetes virtualisation is that it's changing how businesses can manage their virtual machines (VMs). Businesses can now use Kubernetes to manage both their VMs and containerised applications. But what if they could also change the technology that runs their VMs without having to change how they manage them? 

Virtual machines rely on something called a hypervisor. This is what allows multiple VMs to run on the same physical computer while keeping them separate from one another. The type of hypervisor a business uses can affect everything from the tools its IT teams work with to the hardware and software its applications need. 

em360tech image

Kubernetes gives businesses a way to separate some of these things. And there's work underway to make Kubernetes virtualisation possible with hypervisors other than KVM, the one it traditionally relies on. This raises an interesting question about how much of a business's virtualisation infrastructure it could change without disrupting its applications or the way its IT teams work.

How Kubernetes Manages Virtual Machines

Kubernetes was originally designed to manage containerised applications. It can't run virtual machines on its own. But there's an open source project called KubeVirt that gives Kubernetes the ability to manage them. To understand how this works, we first need to understand something called declarative configuration. 

It's one of the ways Kubernetes manages applications. Rather than telling Kubernetes what steps to take, you tell it what you want things to look like when it's done. Kubernetes then works to make that happen and keep things that way. With KubeVirt, you can do the same thing with virtual machines. 

You can tell Kubernetes how much memory a VM needs, which disks it should have access to and whether it should be running. All of this information goes into a configuration file. As explained in the KubeVirt architecture documentation, KubeVirt leaves some of the work to Kubernetes, such as finding a suitable computer to run a VM on. 

It also adds the tools Kubernetes needs to do things like create, start and stop virtual machines. There are a few other technologies involved in making this work:

  • KVM (Kernel-based Virtual Machine): Allows Linux to use the physical computer's hardware to run virtual machines.
  • QEMU: Creates the virtual computer, including the hardware that the VM's operating system sees and uses.
  • Libvirt: Provides a way for software to control and manage virtualisation resources.

Each of these technologies does a different part of the work needed to run a VM. Kubernetes coordinates much of this work rather than doing it all itself. So businesses can already change how they manage their virtual machines by using KubeVirt. But what happens if we start changing some of the technologies that KubeVirt relies on to run them?

What Changes When KubeVirt Supports Other Hypervisors?

Let's say a business wants to run its KubeVirt-managed virtual machines in a public cloud that uses a different hypervisor. How would it go about doing this if KubeVirt relies on KVM? One way of doing this is through something called nested virtualisation. This is essentially where you run a virtual machine inside another virtual machine. 

The first VM gives you somewhere to run KVM, which can then run VMs of its own. The problem with doing things this way is that you're adding another layer of virtualisation between your applications and the physical computer they're running on. 

Red Hat and Microsoft are working on another way of doing this by adding support for Microsoft's hypervisor to the Linux virtualisation stack. But this involves more than making changes to KubeVirt. The other technologies it uses to create and run VMs also need to be able to work with Microsoft's hypervisor. 

What's interesting about this is what it could mean for the people managing those virtual machines. They could potentially use many of the same tools and processes regardless of which of the supported hypervisors their VMs are running on. 

But just because you can manage VMs running on two different hypervisors in the same way doesn't mean those hypervisors can do all the same things. It also doesn't mean you can easily move an existing VM from one to the other.

Management Portability Isn't the Same as Workload Portability

There are two different things to consider when we talk about making virtual machines more portable. There's how easily you can take the way you manage your VMs from one environment to another. And then there's how easily you can move the VMs themselves.

What can remain consistent?

Think about all the work that goes into setting up the tools and automated processes an IT team uses to manage its virtual machines. This could include everything from how new VMs are created to how the business controls who has access to them. If a business can use compatible versions of KubeVirt in different environments, it could take much of that work with it. 

Its IT teams could carry on using the Kubernetes tools they're familiar with. Some things might still need to change. A VM's configuration file might refer to a type of storage that isn't available in the new environment, for example. But changing a few settings in a file is quite different from having to build a whole new set of management tools and processes. 

This is what we mean by management portability.

Can virtual machines move between hypervisors?

There's a lot more to a virtual machine than the file that tells Kubernetes how it should be set up. There's the operating system, the applications installed on it and all the data on its disks. Depending on how you're moving the VM, you might also need to move whatever's in its memory at the time. There are a few different ways to move a virtual machine:

  • Cold migration: You shut the VM down before moving it.
  • Warm migration: You copy much of the data while the VM is still running, then briefly stop it to finish the move.
  • Live migration: You move the VM while it's running, with as little interruption as possible.

KubeVirt already allows businesses to move running VMs between compatible computers. Its decentralised live migration capabilities also make it possible to move VMs between separate Kubernetes clusters under certain conditions. But moving a VM between two Kubernetes clusters doesn't necessarily involve changing its hypervisor. 

Doing that introduces a few more things to consider about the infrastructure the VM needs to run on.

Where Virtualisation Dependencies Remain

Regardless of how a business manages its virtual machines, the applications running inside them still need access to things like storage, networks and computing power. How these resources are made available to a VM can affect how easily it can run somewhere else.

Storage and data portability

One of the useful things about Kubernetes is that you can tell it what kind of storage a VM needs without having to tell it exactly how to provide that storage. But what happens to the data that's already on a VM's disks when you move it? The new environment needs to be able to access that data. It also needs to be able to read the disk format and provide the speed and reliability the application needs. 

For example, KubeVirt's live migration requirements specify that certain types of storage need to be accessible from both computers involved in the move. If that's not possible, the business needs another way of moving the data without losing any of it. This can get particularly complicated if an application is still making changes to the data while it's being moved.

Networking and connectivity

Think about how many other systems within a business an application might need to communicate with. It might use specific IP addresses to find those systems. There might also be rules about which systems it's allowed to connect to. While you can use Kubernetes to define how a VM connects to a network, the networks themselves can differ from one environment to another. 

Are you enjoying the content so far?

Even within KubeVirt, some ways of connecting a VM to a network can prevent it from being moved while it's running. So it's not just about whether an application will run once you've moved its VM. It's also about whether the people and other applications that use it can still connect to it.

Hardware compatibility and performance

There are also things to consider about the physical hardware a VM uses. Not all processors have the same features, for example. And some applications need access to specialised hardware like graphics processing units (GPUs). 

As the KubeVirt virtual hardware documentation explains, the processor model and features a VM needs can affect which computers it's able to run on. If a VM needs a particular processor feature, you can't simply move it to a computer that doesn't have that feature and expect everything to work as it did before. 

Similarly, if a VM has direct access to a physical GPU, you'll need to consider the GPUs and drivers available in the new environment. Then there's the question of how well the applications will run. Different hypervisors can handle things like memory and processing power differently. 

So even if an application runs on another hypervisor, a business still needs to test whether it runs well enough to meet its needs.

How Much Hypervisor Independence Can Enterprises Achieve?

Something businesses need to be careful of when adopting Kubernetes virtualisation is becoming dependent on a different part of their infrastructure instead. Just because two platforms use KubeVirt doesn't mean everything a business does on one platform can be done in the same way on the other. 

There might be differences in the tools they provide for securing VMs, backing up data or getting applications running again after something goes wrong. So how can a business work out how much freedom a particular approach to virtualisation actually gives it? There are a few questions worth asking:

  • Which of our existing management tools and automated processes could we carry on using?
  • What would we need to change in our VM configuration files?
  • Would we need to make changes to our operating systems or drivers?
  • Which VMs could we move without disrupting the business?
  • Which features do we use that are only available with a particular Kubernetes distribution or hypervisor?
  • Who would we turn to for help if something went wrong?

It's also important to know which features are ready for businesses to use and which ones are still being developed. Knowing that a technology provider is working on support for another hypervisor is useful when planning for the future. But it's not something a business should rely on when deciding where to run its applications today. 

Answering these questions can help a business work out how much of its virtualisation infrastructure it could change, how much work would be involved and what it could leave as it is.

Final Thoughts: Hypervisor Choice Can Become Less Restrictive

Businesses don't need to be completely independent of their hypervisors to benefit from Kubernetes virtualisation. Being able to keep using the tools, skills and processes they've spent years investing in could give them more freedom to make changes elsewhere in their infrastructure. 

As support for other hypervisors develops, perhaps the more interesting question won't be which hypervisor a business chooses today, but how easily it could make a different choice in a few years' time. 

It's an interesting way of thinking about how we build enterprise infrastructure as a whole, and something you can learn more about through our conversations with infrastructure experts at EM360Tech.