Virtualization Structures
Virtualization Structures
In general, there are three typical classes of VM architecture. Figure 3.1 showed the
architectures of a machine before and after virtualization. Before virtualization, the
operating system manages the hardware. After virtualization, a virtualization layer is
inserted between the hardware and the operating system. In such a case, the
virtualization layer is responsible for converting portions of the real hardware into virtual
hardware. Therefore, different operating systems such as Linux and Windows can run on
the same physical machine, simultaneously. Depending on the position of the
virtualization layer, there are several classes of VM architectures, namely
the hypervisor architecture, paravirtualization, and host-based virtualization.
The hypervisor is also known as the VMM (Virtual Machine Monitor). They both perform
the same virtualization operations.
A micro-kernel hypervisor includes only the basic and unchanging functions (such as
physical memory management and processor scheduling). The device drivers and other
changeable components are outside the hypervisor. A monolithic hypervisor
implements all the aforementioned functions, including those of the device drivers.
Therefore, the size of the hypervisor code of a micro-kernel hyper-visor is smaller than
that of a monolithic hypervisor. Essentially, a hypervisor must be able to convert physical
devices into virtual resources dedicated for the deployed VM to use.
particular controls the others. The guest OS, which has control ability, is called Domain
0, and the others are called Domain U. Domain 0 is a privileged guest OS of Xen. It is
first loaded when Xen boots without any file system drivers being available. Domain 0 is
designed to access hardware directly and manage devices. Therefore, one of the
responsibilities of Domain 0 is to allocate and map hardware resources for the guest
domains (the Domain U domains).
For example, Xen is based on Linux and its security level is C2. Its management VM is
named Domain 0, which has the privilege to manage other VMs implemented on the
same host. If Domain 0 is compromised, the hacker can control the entire system. So, in
the VM system, security policies are needed to improve the security of Domain 0.
Domain 0, behaving as a VMM, allows users to create, copy, save, read, modify, share,
migrate, and roll back VMs as easily as manipulating a file, which flexibly provides
tremendous benefits for users. Unfortunately, it also brings a series of security problems
during the software life cycle and data lifetime.
The performance of full virtualization may not be ideal, because it involves binary
translation which is rather time-consuming. In particular, the full virtualization of I/O-
intensive applications is a really a big challenge. Binary translation employs a code cache
to store translated hot instructions to improve performance, but it increases the cost of
memory usage. At the time of this writing, the performance of full virtualization on the
x86 architecture is typically 80 percent to 97 percent that of the host machine.
2.3 Host-Based Virtualization
An alternative VM architecture is to install a virtualization layer on top of the host OS.
This host OS is still responsible for managing the hardware. The guest OSes are installed
and run on top of the virtualization layer. Dedicated applications may run on the VMs.
Certainly, some other applications
can also run with the host OS directly. This host-based architecture has some distinct
advantages, as enumerated next. First, the user can install this VM architecture without
modifying the host OS. The virtualizing software can rely on the host OS to provide
device drivers and other low-level services. This will simplify the VM design and ease its
deployment.
Unlike the full virtualization architecture which intercepts and emulates privileged and
sensitive instructions at runtime, para-virtualization handles these instructions at
compile time. The guest OS kernel is modified to replace the privileged and sensitive
instructions with hypercalls to the hypervi-sor or VMM. Xen assumes such a para-
virtualization architecture.
The guest OS running in a guest domain may run at Ring 1 instead of at Ring 0. This
implies that the guest OS may not be able to execute some privileged and sensitive
instructions. The privileged instructions are implemented by hypercalls to the hypervisor.
After replacing the instructions with hypercalls, the modified guest OS emulates the
behavior of the original guest OS. On an UNIX system, a system call involves an interrupt
or service routine. The hypercalls apply a dedicated service routine in Xen.
Example 3.3 VMware ESX Server for Para-Virtualization
VMware pioneered the software market for virtualization. The company has developed
virtualization tools for desktop systems and servers as well as virtual infrastructure for
large data centers. ESX is a VMM or a hypervisor for bare-metal x86 symmetric
multiprocessing (SMP) servers. It accesses hardware resources such as I/O directly and
has complete resource management control. An ESX-enabled server consists of four
components: a virtualization layer, a resource manager, hardware interface components,
and a service console, as shown in Figure 3.9. To improve performance, the ESX server
employs a para-virtualization architecture in which the VM kernel interacts directly with
the hardware without involving the host OS.
The VMM layer virtualizes the physical hardware resources such as CPU, memory,
network and disk controllers, and human interface devices. Every VM has its own set of
virtual hardware resources. The resource manager allocates CPU, memory disk, and
network bandwidth and maps them to the virtual hardware resource set of each VM
created. Hardware interface components are the device drivers and the
VMware ESX Server File System. The service console is responsible for booting the
system, initiating the execution of the VMM and resource manager, and relinquishing
control to those layers. It also facilitates the process for system administrators.