Wednesday, October 22, 2014

The Paravirtualization Spectrum

As OS virtualization techniques evolved from Full Virtualization to Hardware assisted and then to Para Virtualized modes, all of these norms seems quite confusing and difficult to understand. As a beginner, I've searched a bit on this topic, and found a good graphical representation that describes all these terms, much more intuitively. Please note that, all terms are evolved based on Xen Hypervisor. We can also see, how KVM (Kernel Based Virtual Machine) fits in to this.

pv-spectrum-grid

Full Virtualization (FV)


What is virtualized?
Everything.

Everything from BIOS, motherboard, disk, network, CPU Privileged instructions etc.

Performance?
Least.

As you can see, every hardware elements will be virtualized. This is the least performing mode. It requires frequent context switches.

Windows Guest Support?
Yes.

As it does not requires Kernel recompilation.

Hypervisors?
Xen and KVM.

*Hardware Virtualization (HVM) - Hardware Extensions to Full Virtualization


What is virtualized?
Everything, except CPU privileged instructions.

Fully virtualized, but instead of virtualizing privileged instructions, they can be directly run with physical CPU, using Intel-VT/AMD-V extensions.


i.e CPU's with these extensions, provides 3 rings (instead of 2), where 'Ring -1' will be used by Hypervisor, So guest can directly execute privileged instructions in Ring0 (Supervisor Mode)

Performance?
Better than Full Virtualization.

As running privileged instructions can be run directly under physical CPU, no emulation or context switch required and hence the performance improvement.

Windows Guest Support?
Yes.

As it does not requires Kernel recompilation.

Hypervisors?
Xen and KVM.


This one is not included in the above figure, as it is most often used with para virtualized drivers (network/disk), for high performance.
 

Full Virtualization with Paravirtualized Drivers(PV on HVM)


What is virtualized?
Everything, except CPU privileged instructions + Disk + Network.

Para virtualized implementations have been provided for Disk and Network, and supporting drivers have made available to guests.

Performance?
Better than HVM and Full Virtualization.

As additionally disk and network interfaces has been paravirtualized, this modes provides a huge performance improvement, as most of the time disk/network performances are the major bottle necks.

Windows Guest Support?
Yes.

As it does not requires Kernel recompilation. Paravirtualized network and disk been supported by drivers specifically developed for windows guests.

Hypervisors?
Xen and KVM
 
 

Para virtualized Interrupt Controllers with HVM (PVHVM)


What is virtualized?
Everything, except CPU privileged instructions + Disk + Network + APIC/IOAPIC.

Interrupt controllers and CPU timers have been paravirtualized here.

Performance?
Better than PV on HVM, HVM, Full Virtualization.


In addition to paravirtualized disk and network, it also paravirtualizes interrupts and timers.

Windows Guest Support?
No.

To support paravirtualzed APIC and IOAPIC, kernel should be recompiled and only linux based guest's are supported in this mode with kernel recompilations.

Hypervisors?
Xen only.
 
 

Almost Paravirtualized (PVH)


What is virtualized?
Only memory/pagetables have been virtualized.

There are no emulated devices of any kind, like no Motherboard, PCI and BIOS or legacy boot.

Performance?
Far better than PVHVM, PV on HVM, HVM, Full Virtualization.
As virtually everything except memory access have been paravirtualized.

Windows Guest Support?
No
.
This extensive paravirtualization support requires kernel recompilations.

Hypervisors?
Xen only.
 
 

Fully Paravirtualized (PV)


What is virtualized?
None. Everything paravirtualized.


Performance?
Highest performance.

As virtually everything have been paravirtualized.

Windows Guest Support?
No.

This extensive paravirtualization support requires kernel recompilations.

Hypervisors?
Xen only.
 
 

Conclusion


Now I know why even there is a comparison between Xen and KVM, though Xen have advanced high performing modes like PVM and PVHVM. Those modes can only run modified Linux Distros not windows guests.

Most often comparison will happen for windows guests, that will only supported in Full Virtualization, HVM and PV on HVM modes, that are common to both KVM and Xen.

So KVM may be performing equal or slightly better than, PV on HVM mode.

Otherwise Xen will simply outperforms KVM, as it having more advanced modes like PVM.

Original post
here

Review


I request the readers to put any suggestions , corrections, if found as comments, so that I can update this article to be as accurate as possible.

1 comment: