Mental Ward

Blog archive

KVM: Bare-Metal Hypervisor?

I need to turn to you, knowledgeable readers, for help in answering some questions. In a followup to yesterday's announcement by Red Hat about its virtualization roadmap, I asked the company some questions about the new Enterprise Hypervisor.

Specifically, I wanted some details about how KVM would work as a standalone hypervisor, since my understanding is that it's hosted inside the Linux kernel (i.e., a Type II hypervisor). The response I got from Navin Thadani, senior director, virtualization business at Red Hat, threw me for a bit of a loop. He says KVM is a bare-metal hypervisor (also known as Type I), and even tries to make the case that Xen is a hosted hypervisor. Here's his comment in full:

It is a myth that KVM is not a Type-1 hypervisor. KVM converts Linux into a Type-1 hypervisor. There is only one kernel that is used (and that is the Linux kernel, which has KVM included). On the flip side, I can make an argument that Xen is not a Type-1 hypervisor, because the CPU and memory is scheduled by the hypervisor, but IO is scheduled by Dom0, which is a guest (so it's not bare metal). In the KVM architecture, the CPU, memory, and IO are scheduled by the Linux kernel with KVM.

On the other hand, other folks fall into the "KVM is a hosted hypervisor" camp, exemplified by this snippet from Brian Madden:

Xen folks attack KVM, saying it's like VMware Server (the free one that was called "GSX") or Microsoft Virtual Server because it's really a Type 2 hypervisor that runs on top of another OS, rather than a "real" Type 1 hypervisor. KVM responds "So what? Why should we rewrite an OS from scratch when something like Linux is available? And if you want to use a KVM machine as a dedicated VM host, then fine, just don't install anything else on that box."

So, is KVM hosted or not? Is Xen hosted or not? Is Red Hat full of hot air, or are they onto something? I'll be honest and say that I just don't know. Thadani upset my hypervisor apple cart with this comment. But, with your help, I'll get to the bottom of it. Weigh in in the comments below, or e-mail me directly. As a follow-up, tell me what difference you think it makes in the grand scheme of things ("it" being whether KVM is hosted or not, and the same thing about Xen). I'll post comments as they come in. If you do not want your name used with your comments, let me know.

Posted by Keith Ward on 02/24/2009 at 10:27 AM


Reader Comments:

Tue, Jul 27, 2010

What is Qemu? How does it employ KVM?

Sun, Feb 7, 2010

Right Type 1 it is too much a small thing to say in fact it should be type 0 . It is the a new true hypervisor type 0 right. Cause it don't need DOM0 or thing like that. Its the only one with that power.

Sun, Mar 29, 2009 Anthony Liguori

The answer is "none of the above". The terms "Type I" and "Type II" became popular mainly as a marketing gimmick. Usually, the paper cited as the source of these definitions is "Analysis of the Intel Pentium's Ability to Support a Secure Virtual Machine Monitor" [Robin 2000]. This paper has a number of flaws but it's basically a practical application of a much easier work, "Architectural Principles for Virtual Computer Systems" [Goldberg 1972] to the early Pentium processors.

The Goldberg thesis is theoretical and dense. It's lays out a theoretical model for proving that a computing system is virtualizable. The difference between the 'Type I' and 'Type II' model is that 'Type II' includes requirements to support what's essentially nested virtualization.

That is, 'Type I' basically says, these are what the processor must do in order to allow a virtual machine to be created. 'Type II' goes further and says if you have system software in place (i.e. you're in a virtual machine), then besides what the hardware must do, here is what your system software must do.

These are theoretical models, they really have nothing to do with actually virtualization software today.

FWIW, VMware workstation is just as capable of a product as ESX. ESX just has more features because that's how they market it. The same VMM code is used for both products.

So in many ways, KVM running on a standard Linux desktop is equivalent to VMware workstation whereas KVM running in a dedicated, optimized environment (like RHEV) is like ESX.

Mon, Mar 2, 2009 Dave Waters Tampa, FL

KVM isn't a product like XenServer or ESX are products. KVM is simply a part of the Linux Kernel. From a technical standpoint, _Linux_ is the Hypervisor, KVM is simply the title given to part of the code that handles the virtualization aspect. As such, Linux/KVM is as much a bare-metal hypervisor as any system.

Red Hat's point (I think) was to illustrate that Xen is based on one Kernel (not Linux, can't recall the name) and then uses Linux on top of that to handle the I/O. So the question they pose is what is closer to bare metal, Linux? or another kernel + Linux?

Additionally, ESX is its own kernel/OS, so it would be the same as Linux in this respect. Although, since it is closed source there is no way to know for certain.

It is worth noting that the KVM code gets a bad rap for being "new" to the virtualization game. KVM is a _full_ virtualization platform that only utilizes hardware extensions for virtualization. Those VT extensions have only been around for only a few years. Whereas Xen uses a mature para-virt and ESX uses a very mature binary translation, Xen also requires VT for Windows hosting, and ESX requires it for 64bit Windows. As such, KVM is as mature as Xen and ESX on full virtualization. And KVM does that very well, full virtualization, and will run everywhere Linux can run with VT hardware.

Honestly though, it to too much time spent on what has turned into marketing titles such as "Type1" vs "Type2" hypervisors and the like. You have to look past the marketing, and pose technical questions to Engineers to get the facts. KVM is certainly a 'Type 1' hypervisor. Xen is a bit of an anomally. ESX might be a 'Type 1', but you can't no for sure. In the end, look at the performance and capabilities of a virtualization platform to make an informed decision, and ignore the marketing excitement. Regardless of the bare-metal credentials, Xen has exceptional performance. ESX has a long history of virtualization. KVM has the ubiquity of being Linux and being everywhere. I can attest that all are solid, high performance platforms.

Sat, Feb 28, 2009

As all the boys and girls comes running with their semi vendor lock in attempts, calling them HyperV, OracleVM, ESX etc etc, Red Hat has moved on.
KVM is now a 'module-plugin' for the kernel - making it into a type 1.
Without kvm the linux kernel is just what it has always been, but with proper separation of the code, naming it KVM and then using it as a feature of the kernel the notion of type 1 or 2 becomes mute.
If you however start implementing lots of features for your market segment based on various intentions for your customers, into the portion of your kernel that makes it into a hypervisor, well - then you ofcourse need to have a name for the different states of your kernel.

Imho, KVM isnt type 1 or 2 - because it doesnt have to be.
Its just the next natural step for any good kernel in line with best practice open source philosophy.
A good name might be "A true hypervisor"
Or maybe generation 2 hyper, hyper2, kernel director, king of the hill, or uhm.. well - the choice is yours :)

Wed, Feb 25, 2009 Keith

Erik, thanks for that explanation. Maybe you're right, that the definitions are getting blurred. I do find it interesting that Red Hat, now that it's committed to KVM, is trying to imply that Xen isn't as worthy when it wasn't that long ago that it was fully on the Xen bandwagon.

Wed, Feb 25, 2009 Erik de Ruijter Amsterdam

Well, at least shows that the type/type-2 distinction gets blurred and needs refining. It _was_
Type2: Boot full OS including (usually) GUI, and launch the VM inside of it. Physical device drivers from full OS.
Type1: Boot hypervisor including device drivers (without serious GUI), launch the VM from this.
And in this distinction I'd call both Hyper-V and Xen full type1 models, and of course GSX Server and Virtual Servers type2. Because also for Hyper-V no GUI is needed on the server (Server Core), even though just like with Xen the device drivers are not inside the core but in the 'outboard motor' - with MS it's the parent partition and with Xen it's DOM0.

The trick that KVM uses is
a) Using the device drivers inside the Linux kernel
b) Adding the hypervisor on top of a running, stripped, essentially GUI-less Linux. It's not fully inside the Kernel but it uses the KVM kernel extensions to support the hypervisor.

So I'd disagree with Red Hat that Xen would be a type2, it's almost as much a type1 as VMware ESX is. But I do agree that KVM is not the usuall type2 - but calling it type1 maybe is too much also, it's still a hypervisor layer on top of Linux. So maybe 'type 1.5', or 'type1-modified' or the like?

Add Your Comment:

Your Name:(optional)
Your Email:(optional)
Your Location:(optional)
Comment:
Please type the letters/numbers you see above