In this blog I’ll explain the importance of installing Integration Components in Hyper-V. Recently a customer asked me why virtual machines doesn’t perform well without Integration Components. Well to understand this I first need to explain something about the Hyper-V architecture.
Hyper-V has a so called Microkernelized Hypervisor architecture. This means that as less as possible components are running in the Hypervisor and in the Kernel Mode. The following picture illustrates this architecture:
Ring-1 is the Hypervisor. Only the CPU scheduler and Memory management runs in the Hypervisor. Everything in Ring 0 is running in Kernel Mode while everything in Ring 3 is running in User Mode. So drivers for the parent partition are executed in Ring 0 (Kernel mode).
This first overview picture will not show all components but just an overview. Well, let’s add some details to this picture:
This picture show us a parent partition and a virtual machine with Integration Components installed. For this blog the components VM Worker Processes, Virtualization Service Provider (VSP), Virtual Service Client (VSC) and the VMBus are important.
For every running virtual machine a VM worker process is created in the parent partition. The worker process provides virtual machine management services from the parent partition to the guest operating systems in the child partitions.
The VSP is also running in the parent partition and provides synthetic driver support over the VMBus to the VSC. The VSC can make use of hardware resources provided by the VSP in the parent partition. The VMBus is the communication channel between the VSP and the VSC.
A VM without Integration Components
So why did I first explain the architecture of Hyper-V in a blog that’s about the question: why virtual machines doesn’t perform well without Integration Components? I did this because virtual machines without integration components are missing parts of the components mentioned earlier.
Virtual Machines without the Integration Components installed doesn’t have a VSC and thus can’t communicate over the VMBus with the VSP for accessing hardware. These virtual machines make use of emulated devices. Emulated devices for virtual machines are executed in the VM Worker Process. The VM Worker process runs, as I illustrated, in Ring 3 (User Mode). For accessing the hardware we need to talk to the Device Drivers of the parent partition and these drivers are running in Ring 0 (Kernel Mode) so a context switch is necessary. A context switch always needs time and consumes CPU time.
And this explain why ‘emulated’ virtual machines differ in performance from an enlightened virtual machine!