Unit 2 Lec 4 Cloud Computing
Unit 2 Lec 4 Cloud Computing
1
Content
1:- Hypervisor and XEN architecture
2:-Full virtualization
3:- Host based virtualization
4:- Para Virtualization
2
Virtualization
• Virtualization is the ability to run multiple
operating systems on a single physical system
and share the underlying hardware resources
• It is the process by which one computer hosts
the appearance of many computers.
• Virtualization is used to improve IT throughput
and costs by using physical resources as a pool
from which virtual resources can be allocated.
3
Virtualization Architecture
• A Virtual machine (VM) is an isolated runtime
environment (guest OS and applications)
• Multiple virtual systems (VMs) can run on a single
physical system
4
Cont..
• 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.
5
Contd..
• Depending on the position of the virtualization
layer, there are several classes of VM
architectures, namely
– hypervisor architecture,
– paravirtualization,
– host-based virtualization.
6
Hypervisor and Xen Architecture
• The hypervisor supports hardware-level
virtualization on bare metal devices like CPU,
memory, disk and network interfaces.
• The hypervisor software sits directly between
the physical hardware and its OS.
• This virtualization layer is referred to as either
the VMM or the hypervisor.
7
• The hypervisor provides hypercalls for the
guest OSes and applications.
• Depending on the functionality, a hypervisor
can assume a micro-kernel architecture like
the Microsoft Hyper-V. Or it can assume a
monolithic hypervisor architecture like the
VMware ESX for server virtualization.
8
Micro-kernel hypervisor Vs Monolithic hypervisor
• 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 hypervisor is smaller than that of a
monolithic hypervisor.
9
The Xen Architecture
• Xen is an open source hypervisor program
developed by Cambridge University.
• Xen is a microkernel hypervisor, which
separates the policy from the mechanism.
• The Xen hypervisor implements all the
mechanisms, leaving the policy to be handled
by Domain 0, as shown on the next slide
10
The Xen architecture’s special domain 0 for control and I/O,
and several guest domains for user applications.
11
• Xen does not include any device drivers
natively.
• It just provides a mechanism by which a guest
OS can have direct access to the physical
devices.
• As a result, the size of the Xen hypervisor is
kept rather small.
• Xen provides a virtual environment located
between the hardware and the OS.
12
• A number of vendors are in the process of
developing commercial Xen hypervisors, among
them are Citrix XenServer and Oracle VM
• The core components of a Xen system are the
hypervisor, kernel, and applications.
• The organization of the three components is
important.
• Like other virtualization systems, many guest Oses
can run on top of the hypervisor.
13
• However, not all guest OSes are created equal,
and one in 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.
14
Binary Translation with Full Virtualization
• Depending on implementation technologies,
hardware virtualization can be classified into
two categories:
– full virtualization
– and host-based virtualization.
• Full virtualization does not need to modify the
host OS. It relies on binary translation to trap
and to virtualize the execution of certain
sensitive, nonvirtualizable instructions.
15
• The guest OSes and their applications consist
of noncritical and critical instructions.
• In a host-based system, both a host OS and a
guest OS are used.
• A virtualization software layer is built between
the host OS and guest OS.
16
Full Virtualization
• With full virtualization, noncritical instructions
run on the hardware directly while critical
instructions are discovered and replaced with
traps into the VMM to be emulated by
software.
• Both the hypervisor and VMM approaches are
considered full virtualization.
• Why are only critical instructions trapped into
the VMM?
17
• This is because binary translation can incur a
large performance overhead.
• Noncritical instructions do not control
hardware or threaten the security of the
system, but critical instructions do.
• Therefore, running noncritical instructions on
hardware not only can promote efficiency, but
also can ensure system security.
18
Binary Translation of Guest OS Requests Using a VMM
19
• VMware puts the VMM at Ring 0 and the guest OS
at Ring 1. The VMM scans the instruction stream
and identifies the privileged, control- and
behavior-sensitive instructions.
• When these instructions are identified, they are
trapped into the VMM, which emulates the
behavior of these instructions. The method used
in this emulation is called binary translation.
• Performance of full virtualization on the x86
architecture is typically 80 percent to 97 percent
that of the host machine.
20
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.
21
• 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.
22
Para-Virtualization with Compiler Support
• Para-virtualization needs to modify the guest
operating systems.
• A para-virtualized VM provides special APIs
requiring substantial OS modifications in user
applications.
• Performance degradation is a critical issue of a
virtualized system.
• No one wants to use a VM if it is much slower
than using a physical machine.
23
• The virtualization layer can be inserted at
different positions in a machine software
stack.
• However, para-virtualization attempts to
reduce the virtualization overhead, and thus
improve performance by modifying only the
guest OS kernel.
24
Figure: Para-virtualized VM architecture, which involves modifying the guest OS
kernel to replace nonvirtualizable instructions with hypercalls for the hypervisor or
the VMM to carry out the virtualization process
25
The use of a para-virtualized guest OS assisted by an intelligent compiler to replace
nonvirtualizable OS instructions by hypercalls.
26
• When the x86 processor is virtualized, a
virtualization layer is inserted between the
hardware and the OS.
• According to the x86 ring definition, the
virtualization layer should also be installed at
Ring 0. Different instructions at Ring 0 may
cause some problems.
27
• we show in previous slide that
para-virtualization replaces nonvirtualizable
instructions with hypercalls that communicate
directly with the hypervisor or VMM.
• However, when the guest OS kernel is
modified for virtualization, it can no longer
run on the hardware directly.
• Example: Xen, KVM, and VMware ESX
28
KVM (Kernel-Based VM)
• This is a Linux para-virtualization system—a
part of the Linux version 2.6.20 kernel.
Memory management and scheduling
activities are carried out by the existing Linux
kernel.
• The KVM does the rest, which makes it
simpler than the hypervisor that controls the
entire machine.
29
• KVM is a hardware-assisted para-virtualization
tool, which improves performance and
supports unmodified guest OSes such as
Windows, Linux, Solaris, and other UNIX
variants.
30
Para-Virtualization with Compiler
Support
• 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 hypervisor or VMM.
31
• 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.
32
• On an UNIX system, a system call involves an
interrupt or service routine. The hypercalls
apply a dedicated service routine in Xen.
33
Important Questions
Q1. Explain Hypervisor and Xen Architecture.
Q2. List the classes of different VM architecture.
Q3. How full virtualization is different with host based
virtualization
Q4. Explain merit and demerits of para-virtualizaiton.
34
References
• Text Books:-
• 1. Kai Hwang, Geoffrey C. Fox, Jack G.
Dongarra, “Distributed and Cloud Computing,
From Parallel Processing to the Internet of
Things”, Morgan Kaufmann Publishers, 2012.
35
Thank You
36