Xen vs. KVM: Ending the Debate

Based on the reader comments, I apparently pushed some hot buttons in my last post.  Basically, I stated that by encouraging Linux developers to focus on KVM, the Linux Foundation is taking a somewhat small-minded view of virtualization.  Of course, I expected there to be some reaction from the Linux community to a statement like that.  But needling the Linux fan base was not my intent, yet it was evident from some of the comments that my post was unintentionally interpreted as an attack on KVM and Linux.  Ironically, it was the whole “versus” game between Xen and KVM that I was criticizing to begin with!  In this post, I’ll expound on my position and hopefully clarify the key takeaway point.  But first, I must address a few common technical inaccuracies that crept into the reader comments:

  1. ESX employs full virtualization, which fully emulates the hardware.  Xen and Hyper-V employ paravirtualization and do not fully emulate hardware.  KVM employs limited support for paravirtualization through special network and memory drivers. 
  2. Xen, Hyper-V and ESX are type-1 virtual machine monitors (VMMs)/hypervisors.  The hypervisor runs in Ring 0, while the parent partition (dom0) and the child partitions (domU, guest VMs) run in Ring 1.  KVM, Virtual Server, VirtualBox, Parallels, VMware Workstation, etc., are type-2 VMMs.  The VMM runs in Ring 3 as an application.  However, through it’s limited paravirtualization, KVM is able to achieve performance closer to that of a type-1 hypervisor when compared to typical type-2 VMMs.
  3. Hyper-V does not require installing an entire instance of Windows Server 2008.  Selecting the Hyper-V role essentially installs a stripped-down version of Windows Server or Server Core in the parent partition (dom0).

Why do these architectural differences matter?  For starters, type-1 VMMs generally perform much better than their type-2 counterparts.  One reader who commented on my last post said that in his own tests, KVM performed better than Xen and ESX.  He then admits in the next sentence that he doesn’t like Xen much anyway.  So, obviously, I’m not buying it.  Even if his testing was valid, I’m sure the better performance was only with Linux guest VMs.  And how about stability?  With a type-1 VMM, if one guest VM crashes, it should not affect the other VMs.  But with a type-2 VMM in which the host potentially is running other application workloads alongside the VMM, the failure of one application could impact the VMM.  Now, you can say that the Linux KVM host can be stripped down to basically only run virtualization workloads.  But, if you’re going to strip down your Linux host to make it function more like a type-1 VMM, why not just run a type-1 VMM?

But, let’s assume that the technology improves and that KVM performance and stability become near that of a type-1 VMM.  The issue is bigger than performance, though.  It’s more about the mentality.  The commoditization of hypervisors mean that they should be treated almost like hardware.  When you buy servers, you buy them with the expectation that you can run a desired range of operating systems (or hypervisors) on them.  It doesn’t matter whether they’re running Intel or AMD, whether they’re from Dell or HP, etc.  Same goes with hypervisors (though the CPU does matter to an extent when migrating VMs between hosts). 

One reader suggested that more and more functionality will be added to hypervisors so that they become more like full-fledged operating systems.  But the goal is not to move hypervisors up the stack by making them more like full operating systems.  If the hypervisor natively can run applications, then is it really still virtualizing?  It will just be an interface between the app and the hardware, which is what an operating system is.  Rather, hypervisors are moving down the stack and becoming closer to the hardware, as evident by the work Intel and Phoenix are doing to add virtualization instructions to chipsets and BIOS respectively.

The point is, enterprises run various operating system and OS workloads, and like the hardware, the hypervisor should support those workloads equally and indifferently.  If my goal is to virtualize all those OS workloads, why would I want to install an operating system on bare-metal hardware just so it can host those OS workloads on top of it?  Why use an operating system to host operating system workloads when I can use a type-1 VMM?  And shouldn’t the VMM sit at a lower layer than the operating system?

Of course, part of the Linux Foundation’s job is to promote Linux, and I have no problem with that.  As reader Bill Murray pointed out, there definitely are use cases for KVM, but by and large, those use cases are going to be predominately around hosting Linux workloads.  Do you really see shops hosting Windows workloads on KVM?  So for the Linux Foundation to blanketly encourage developers to focus on KVM just keeps the Xen-vs.-KVM debate going, which you think the Foundation would avoid considering the whole Xen and kernel-inclusion debacle.  Furthermore, it just seems out of touch.  Enterprises already are standardizing around Xen, ESX and Hyper-V.  Sure, the Linux Foundation can promote KVM where it’s appropriate, but shouldn’t it also be encouraging developers to improve Linux’s performance and support on those platforms?  Novell understands this, and partnered with Microsoft to support SUSE Linux workloads on Hyper-V.  Conversely, Microsoft is working to improve support of Windows workloads on Novell’s Xen-based virtualization platform. 

The bottom line is that none of the Big 3 hypervisors are going away anytime soon.  Developers can accept this and support these platforms and the enterprise customers that have adopted them.  Or, they can live in the niche.


Posted May 12 2009, 08:53 AM by Brad Moczik

Follow Me on Twitter

Did you enjoy this article? If yes, then subscribe to our RSS 2.0 feed or

Comments

Enzo wrote re: Xen vs. KVM: Ending the Debate
on 06-02-2009 8:44 AM

Virtualization should stay out of the kernel IMHO, unless you just want a containers/zone type of solution. KVM doesn't make much sense for most companies as you cannot run different operating systems with it. I just don't see that many people adopting KVM and think Redhat just made a huge mistake by with it. I'm not sure why they bothered with it when they already had Xen which is still open source. It doesn't make much sense to me.

VMWare is is too expensive, whether it is good or not is irrelevant. Paying big bucks for software is out.

Xen is a much better approach and now that Citrix has released their enterprise XenServer for free, it is even better. Oracle/Sun, Citrix, Novell, Amazon EC2 cloud are have VMs based on Xen or use Xen extensively so Xen isn't going away, in fact, it will only grow stronger.

Hein Bloed wrote re: Xen vs. KVM: Ending the Debate
on 06-08-2009 10:50 AM

Regarding "Do you really see shops hosting Windows workloads on KVM?" and "KVM doesn't make much sense for most companies as you cannot run different operating systems with it.":

KVM is/was the basis of qumranets VDI-solution. From looking at their videos and documentation I should say, that their primary target VMs are Windows VMs.

Regarding other operating systems have a look at the "guest-support-status" on the kvm homepage. Paravirtualized drivers for Windows are available, as well.

Grant McWilliams wrote re: Xen vs. KVM: Ending the Debate
on 11-10-2009 9:29 AM

There are a lot of posts on the previous article that show clearly that the posters didn't understand how virtualization works.

There's a place for a true hypervisor that just runs VMs. I use this all the time and I don't want the fat (or vulnerabilities) of a full OS. Xen provides this.

I do however think that KVM will work in about 80% of the cases where Xen is deployed and the performance seems good. I don't think it's wise to view KVM as anything but what it is - it's a CPU accelerator for QEMU and it's darn good at that. KVM generally performs better than XEN PV because the QEMU version is newer.

My biggest complaints against Xen concerns the complexity in setting it up and the nightmare of maintaining the Dom0 kernel since it's still not included in mainline. I don't see either issue going away. I will continue to deploy Xen PVs in large numbers because it's the best free enterprise ready VM solution.

I'll also continue to use KVM in a Hosted VM environment (running alternative OSes from my Desktop) much in the manner that I'd run VirtualBox or VMware.

Grant McWilliams

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
Windows is a registered trademark of Microsoft Corporation.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems Themed By nb development