2. Module 2: Virtualization (7 Hours)
Introduction to virtualization-Virtualizing physical computing
resources, Virtual Machines (Machine virtualization), non-virtualized
v/s virtualized machine environments. Types of VMs-process VM v/s
system VM, Emulation, interpretation and binary translation. Hardware-
level virtualization- Hypervisors/VMM. Types of Hypervisors. Full
Virtualization, Para- Virtualization, Hardware-assisted virtualization,
OS level virtualization. Basics of Network Virtualization, Storage
Virtualization and Desktop Virtualization, Pros and cons of
virtualization. Case Study- Xen: Para-virtualization, VMware: full
virtualization.
3. What is Virtualization?
• Virtualization refers to the representation of physical
computing resources in simulated form having made through
the software. This special layer of software (installed over
active physical machines) is referred as layer of virtualization.
• This layer transforms the physical computing resources into
virtual form which users use to satisfy their computing needs.
4. •In simple sense, the virtualization is the logical
separation of physical resources from direct access of
users to fulfill their service needs.
• Virtualization provides a level of logical abstraction
that liberates user-installed software (starting from
operating system and other systems as well as
application software) from being tied to a specific set
of hardware.
•Rather, the users install everything over the logical
operating environment (rather than physical ones)
having created through virtualization.
6. • Host Machine: The machine on which the virtual machine is going to
be built is known as Host Machine.
• Guest Machine: The virtual machine is referred to as a Guest Machine.
Benefits of Virtualization
• More flexible and efficient allocation of resources.
• Enhance development productivity.
• It lowers the cost of IT infrastructure.
• Remote access and rapid scalability.
• High availability and disaster recovery.
• Pay peruse of the IT infrastructure on demand.
• Enables running multiple operating systems.
7. Characteristics of Virtualization
• Increased Security: The ability to control the execution of a guest
program in a completely transparent manner opens new possibilities for
delivering a secure, controlled execution environment. All the operations
of the guest programs are generally performed against the virtual
machine, which then translates and applies them to the host programs.
• Managed Execution: In particular sharing, aggregation, emulation, and
isolation are the most relevant features.
• Sharing: Virtualization allows the creation of a separate computing
environment within the same host.
• Aggregation: It is possible to share physical resources among several
guests, but virtualization also allows aggregation, which is the opposite
process.
9. Machine Virtualization or Server Virtualization
• Machine virtualization (also called server virtualization) is the
concept of creating virtual machine (or virtual computer) on
actual physical machine.
• The parent system on which the virtual machines run is called the
host system, and the virtual machines are themselves referred as
guest systems.
• In conventional computing system, there has always been a one-to-
one relationship between physical computer and operating system.
At a time, a single OS can run over them.
• Hardware virtualization eliminates this limitation of having a one-
to-one relationship between physical hardware and operating system.
15. Hypervisor or Virtual Machine Monitor
• A hypervisor is a form of virtualization software used in Cloud hosting to
divide and allocate the resources on various pieces of hardware.
• The program which provides partitioning, isolation, or abstraction is called a
virtualization hypervisor.
• The hypervisor is a hardware virtualization technique that allows multiple
guest operating systems (OS) to run on a single host system at the same time.
• A hypervisor is sometimes also called a virtual machine monitor(VMM).
16. Hypervisor or Virtual Machine Monitor
• It also monitors and manages the execution of guest systems and
the virtual machines.
• All of the virtual machines run as self-sufficient computers isolated
from others, even though they are served by the same set of physical
resources.
• The virtual machines are created over the virtualization layers.
• This virtualization layer is actually a set of control programs that
creates the environment for the virtual machines to run on. This layer
provides the access to the system resources to the virtual machines. It
also controls and monitors the execution of the virtual machines over
it. This software layer is referred as the Hypervisor or Virtual
Machine Monitor (VMM).
17. Virtual Machines
• Virtual Machine abstracts the hardware of our personal computer such as
CPU, disk drives, memory, NIC (Network Interface Card), etc, into many
different execution environments as per our requirements..
• The virtual machine approach does not provide these additional functionalities
but it only provides an interface that is the same as basic hardware.
• Each process is provided with a virtual copy of the underlying computer
system.
• We can create a virtual machine for several reasons, all of which are
fundamentally related to the ability to share the same basic hardware yet also
support different execution environments, i.e., different operating systems
simultaneously.
18. How Does a Virtual Machine Work?
• Virtualization is the method of creating a software-based, or “virtual”
version of a computer with good amounts of CPU, memory, and
storage that are “borrowed” from a physical host computer (such as
your personal computer) and/or a remote server.
• The working of the virtual machine is very simple just check the
published article on the Working of a Virtual Machine.
19. Types of Virtual Machine
There are two types of Virtual Machine
Process Virtual Machine
System Virtual Machine
20. System Virtual Machine:
• These types of virtual machines gives us complete system platform
and gives the execution of the complete virtual operating system.
• Just like virtual box, system virtual machine is providing an
environment for an OS to be installed completely.
• Our hardware of Real Machine is being distributed between two
simulated operating systems by Virtual machine monitor. And then
some programs, processes are going on in that distributed hardware of
simulated machines separately.
22. • A System virtual machine is also called hardware virtual machine. It is the software
emulation of a computer system. It mimics the entire computer. In computing, an
emulator is hardware or software that enables one computing system (called the host)
to behave like another computing system. It is an environment that allows multiple
instances of the OS (VM) to run on a host system, sharing the physical resources.
• System Virtual Machine provides a platform for the execution of a complete operating
system. It will create a number of different isolated identical execution
environments in a single computer by partitioning computer memory to install
and execute the different operating systems at the same time. It allows us to install
applications in each OS, run the application in this OS as if we work in real work on a
real computer.
• Examples of System VM are VMware ,VirtualBox ,Windows Virtual
PC ,Parallels ,Citrix Xen
23. Advantages of System VM are:
• Multiple OS environments can
run in parallel on the same piece
of hardware in strong isolation
from each other.
• It can provide an Instruction Set
Architecture that is slightly
different from the real machine.
Drawbacks of System VM are:
• Since the VM indirectly accesses the
same hardware so the efficiency is
compromised.
• Multiple VMs running in parallel on
the same physical machine may
result in varied performance
depending on the system.
Implementing proper isolation
techniques may address this
drawback
24. Process Virtual Machine :
• While process virtual machines, unlike system virtual machine, does not
provide us with the facility to install the virtual operating system
completely.
• Rather it creates virtual environment of that OS while using some app or
program and this environment will be destroyed as soon as we exit from
that app.
• Apps running on main OS as well some virtual machines are created to
run other apps. This shows that as those programs required different OS,
process virtual machine provided them with that for the time being those
programs are running.
• Example – Wine software in Linux helps to run Windows applications.
26. Advantages of Virtual Machine
• There are no protection problems
because each virtual machine is
completely isolated from all other
virtual machines.
• Virtual machine can provide an
instruction set architecture that differs
from real computers.
• Easy maintenance, availability and
convenient recovery.
• Energy and cost savings.
• Easy backup and clone.
• Virtual Machine provide Flexibility
and Customization.
Disadvantages of Virtual Machine
• When multiple virtual machines
are simultaneously running on a
host computer, one virtual
machine can be affected by other
running virtual machines,
depending on the workload.
• Virtual machines are not as
efficient as a real one when
accessing the hardware.
30. Emulation, Interpretation and Binary translation
● Emulation in computing is done by making one system imitating
another.
● This means a system having some architecture is made enable to support
instruction set of some other machine architecture.
● For example, let a piece of software has been made for architecture ‘A’ and
is not supported by architecture ‘B’. Through emulation, it is possible to
imitate the working of system ‘A’ (i.e. architecture ‘A’) on system ‘B’ (i.e.
architecture ‘B’) and then the piece of software to run on system B.
● Emulators can be software or hardware both.
● Emulation software converts binary data written for execution on one
machine to an equivalent binary form suitable to execute on another
machine. This is done by translating the binary instructions.
31. Emulation, Interpretation and Binary translation
● There are two ways for implementation of emulations like
● Interpretation
● Binary Translation.
● In binary translation (also known as recompilation), a total conversion of the
binary data (made for the emulated platform) is done. The conversion
recompiles the whole instruction into another binary form suitable to run on
the actual or targeted platform. There are two types of binary translation like
static recompilation and dynamic recompilation.
● In interpretation, each instruction is interpreted by the emulator every time it
is being encountered. This method is easier to implement but slower than
binary translation process.
33. Types of Machine Virtualization & Types of Hypervisors
● There are two different techniques of server or machine virtualization they are
○
Hosted Approach and
○ the Bare Metal Approach.
● The techniques differ depending on the type of hypervisor used.
34. Bare Metal Approach & Type 1 Hypervisor
● In this approach of machine virtualization, the hypervisor is
directly installed over the physical machine.
● Since, the hypervisor is the first layer over hardware resources,
hence, the technique is referred as bare metal approach.
● Here, the VMM or the hypervisor communicates directly with
system hardware.
● In this approach, the hypervisor acts as low-level virtual machine
monitor and also called as Type 1 hypervisor or Native Hypervisor.
● VMware’s ESX and ESXi Servers, Microsoft’s Hyper-V, solution
Xen are some of the examples of bare-metal hypervisors.
37. Benefits and Drawbacks
Benefits:
• The bare metal hypervisor can directly
access the hardware resources in most of
the cases it provides better performance
in comparison to the hosted hypervisor.
• For bigger application like enterprise data
centers, bare-metal virtualization is more
suitable because usually it provides
advanced features for resource and
security management.
• Administrators get more control over the
host environment.
Drawbacks:
• As any hypervisor usually have
limited set of device drivers built into
it
• So the bare metal hypervisors have
limited hardware support and cannot
run on a wide variety of hardware
platform.
38. Here is the list of enterprise software which supports hardware-assisted – Full
virtualization which falls under hypervisor type 1 (Bare metal )
● VMware ESXi /ESX
● KVM
● Hyper-V
● Xen
40. Hosted Approach & Type 2 Hypervisor
• In this approach, an operating system is first installed on the physical machine
to activate it.
• This OS installed over the host machine is referred as host operating system.
• The hypervisor is then installed over this host OS. This type of hypervisor is
referred to as Type 2 hypervisor or Hosted hypervisor.
• Figure 7.4 represents the hosted machine virtualization technique. So, here the
host OS works as the first layer of software over the physical resources.
• Hypervisor is the second layer of software and guest operating systems run as the
third layer of software.
• Products like VMWare Workstation and Microsoft Virtual PC are the most
common examples of type 2 hypervisors.
43. Benefits and Drawbacks
Benefits:
• In this approach, the host OS supplies
the hardware drivers for the
underlying physical resources.
• This eases the installation and
configuration of the hypervisor.
• It makes the type-2 hypervisors
compatible for a wide variety of
hardware platform.
Drawbacks:
• A hosted hypervisor does not have
direct access to the hardware resources
and hence, all of the requests from
virtual machines must go through the
host OS.
• This may degrade the performance of
the virtual machines.
• Another drawback of the hosted
virtualization is the lack of support for
real-time operating systems.
• Since the underlying host OS controls
the scheduling of jobs it becomes
unrealistic to run a real-time OS inside
a VM using hosted virtualization.
44. The following virtualization type of virtualization falls under hypervisor type 2
(Hosted).
● VMware Workstation (64-bit guests only )
● Virtual Box (64-bit guests only )
● VMware Server (Retired )
48. Types of virtualization
Various levels of hardware virtualization exist that perform
various levels of abstraction:
1. Full Virtualization (Hardware Assisted/ Binary Translation )
2. Paravirtualization
3. Hybrid Virtualization
4. OS level Virtualization
50. Full Virtualization:
Virtual machine simulates hardware to allow an unmodified guest OS to be
run in isolation. There is two type of Full virtualizations in the enterprise
market. On both full virtualization types, guest operating system’s source
information will not be modified.
● Software assisted full virtualization
● Hardware-assisted full virtualization
51. Software Assisted – Full Virtualization (BT – Binary Translation )
● It completely relies on binary translation to trap and virtualize
the execution of sensitive, non-virtualizable instructions sets.
● It emulates the hardware using the software instruction sets. Due
to binary translation, it often criticized for performance issue.
Here is the list of software which will fall under software
assisted (BT).
● VMware workstation (32Bit guests)
● Virtual PC
● VirtualBox (32-bit guests)
● VMware Server
53. Hardware-Assisted Virtualization
• Also known as native virtualization
• In this technique, underlying hardware provides special CPU instructions to aid
virtualization.
• This technique is also highly portable as the hypervisor can run an unmodified guest
OS.
• This technique makes hypervisor implementation less complex and more
maintainable.
• Intel’s Intel-VT and AMD’s AMD-V processors provide CPU virtualization
instructions that software vendors use to implement hardware-assisted virtualization.
• This kind of virtualization is only possible when specific combinations of hardware
components are used.
• Hardware-assisted virtualization requires explicit features in the host machine’s
CPU.
54. Hardware-Assisted – Full Virtualization (VT)
● Hardware-assisted full virtualization eliminates the binary translation and
it directly interrupts with hardware using the virtualization technology
which has been integrated on X86 processors since 2005 (Intel VT-x and
AMD-V).
● Guest OS’s instructions might allow a virtual context execute privileged
instructions directly on the processor, even though it is virtualized.
57. Paravirtualization:
● Paravirtualization works differently from the full virtualization. It doesn’t need
to simulate the hardware for the virtual machines. The hypervisor is installed on
a physical server (host) and a guest OS is installed into the environment.
● Virtual guests aware that it has been virtualized, unlike the full virtualization
(where the guest doesn’t know that it has been virtualized) to take advantage of
the functions.
● In this virtualization method, guest source codes will be modified with sensitive
information to communicate with the host.
● Guest Operating systems require extensions to make API calls to the
hypervisor.
● In full virtualization, guests will issue a hardware calls but in paravirtualization,
guests will directly communicate with the host (hypervisor) using the drivers.
61. Here is the list of products which supports paravirtualization.
● Xen
● IBM LPAR
● Oracle VM for SPARC (LDOM)
● Oracle VM for X86 (OVM)
64. 1. Application Virtualization:
• Application virtualization helps a user to have remote
access to an application from a server.
• The server stores all personal information and other
characteristics of the application but can still run on a local
workstation through the internet.
• An example of this would be a user who needs to run two
different versions of the same software.
• Technologies that use application virtualization are hosted
applications and packaged applications.
65. 2. Network Virtualization:
• The ability to run multiple virtual networks with each having a
separate control and data plan. It co-exists together on top of one
physical network.
• It can be managed by individual parties that are potentially
confidential to each other.
• Network virtualization provides a facility to create and provision
virtual networks, logical switches, routers, firewalls, load balancers,
Virtual Private Networks (VPN), and workload security within days or
even weeks.
67. 3. Desktop Virtualization:
• Desktop virtualization allows the users’ OS to be remotely
stored on a server in the data center.
• It allows the user to access their desktop virtually, from any
location by a different machine.
• Users who want specific operating systems other than Windows
Server will need to have a virtual desktop.
• The main benefits of desktop virtualization are user mobility,
portability, and easy management of software installation,
updates, and patches.
68. 4. Storage Virtualization:
• Storage virtualization is an array of servers that are managed by a
virtual storage system.
• The servers aren’t aware of exactly where their data is stored and
instead function more like worker bees in a hive.
• It makes managing storage from multiple sources be managed and
utilized as a single repository.
• Storage virtualization software maintains smooth operations,
consistent performance, and a continuous suite of advanced functions
despite changes, breaks down, and differences in the underlying
equipment.
69. 5. Server Virtualization:
• This is a kind of virtualization in which the masking of server resources
takes place.
• Here, the central server (physical server) is divided into multiple
different virtual servers by changing the identity number, and processors.
• So, each system can operate its operating systems in an isolated manner.
• Where each sub-server knows the identity of the central server.
• It causes an increase in performance and reduces the operating cost by the
deployment of main server resources into a sub-server resource. It’s
beneficial in virtual migration, reducing energy consumption, reducing
infrastructural costs, etc.
71. 6. Data Virtualization:
• This is the kind of virtualization in which the data is collected from
various sources and managed at a single place without knowing more
about the technical information like how data is collected, stored &
formatted then arranged that data logically so that its virtual view can
be accessed by its interested people and stakeholders, and users
through the various cloud services remotely.
• Many big giant companies are providing their services like Oracle,
IBM, At scale, Cdata, etc.
72. Pros of Virtualization
• Utilization of Hardware Efficiently
• High Availability.
• Disaster Recovery is efficient and easy
• Virtualization saves Energy
• Quick and Easy Set up.
• Cloud Migration becomes easy.
• Resource Optimization
73. • Utilization of Hardware Efficiently: the need of Physical Hardware System
for the User is decreases and this results in less costly. In Service Provider
point of View, they will utilize the Hardware using Hardware Virtualization
which decrease the Hardware requirement from Vendor side.
• High Availability: It provides advance features which allow virtual instances
to be available all the times.
• Disaster Recovery is efficient and easy: Data Recovery, Backup,
Duplication becomes very easy. In traditional method , if somehow due to
some disaster if Server system Damaged then the surety of Data Recovery is
very less. But with the tools of Virtualization real time data backup recovery
and mirroring become easy task and provide surety of zero percent data loss.
• Virtualization saves Energy: Virtualization will help to save Energy because
while moving from physical Servers to Virtual Server’s, the number of
Server’s decreases due to this monthly power and cooling cost decreases
which will Save Money as well.
74. • Quick and Easy Set up: In traditional methods Setting up physical system and servers
are very time-consuming. Firstly Purchase them in bulk after that wait for shipment.
When Shipment is done then wait for Setting up and after that again spend time in
installing required software etc. Which will consume very time. But with the help of
virtualization the entire process is done in very less time which results in productive
setup.
• Cloud Migration becomes easy: Most of the companies those who already have spent a
lot in the server have a doubt of Shifting to Cloud. But it is more cost-effective to shift to
cloud services because all the data that is present in their server’s can be easily migrated
into the cloud server and save something from maintenance charge, power consumption,
cooling cost, cost to Server Maintenance Engineer etc.
• Resource Optimization: Virtualization allows efficient utilization of physical hardware
by running multiple virtual machines (VMs) on a single physical server. This
consolidation leads to cost savings in terms of hardware, power, cooling, and space
75. Cons of Virtualization
• High Initial Investment: While virtualization reduces costs in the long run, the
initial setup costs for storage and servers can be higher than a traditional setup.
• Complexity: Managing virtualized environments can be complex, especially as the
number of VMs increases.
• Security Risks: Virtualization introduces additional layers, which may pose security
risks if not properly configured and monitored.
• Learning New Infrastructure: As Organization shifted from Servers to Cloud. They
required skilled staff who can work with cloud easily. Either they hire new IT staff
with relevant skill or provide training on that skill which increase the cost of
company.
• Data can be at Risk: Working on virtual instances on shared resources means that
our data is hosted on third party resource which put’s our data in vulnerable
condition. Any hacker can attack on our data or try to perform unauthorized access.
Without Security solution our data is in threaten situation.
77. Xen: paravirtualization
• Xen is an open-source initiative implementing a virtualization platform based on
paravirtualization.
• Initially developed by a group of researchers at the University of Cambridge in the
United Kingdom
• Xen-based technology is used for either desktop virtualization or server
virtualization, and recently it has also been used to provide cloud computing
solutions by means of Xen Cloud Platform (XCP).
• Xen is the most popular implementation of paravirtualization, which, in contrast
with full virtualization, allows high-performance execution of guest operating
systems.
79. • A Xen-based system is managed by the Xen hypervisor, which runs in the
highest privileged mode and controls the access of guest operating system
to the underlying hardware.
• Guest operating systems are executed within domains, which represent
virtual machine instances.
• Many of the x86 implementations support four different security levels,
called rings, where
• Ring 0 represent the level with the highest privileges and
• Ring 3 the level with the lowest ones.
• Almost all the most popular operating systems, except OS/2, utilize only
two levels: Ring 0 for the kernel code, and Ring 3 for user application and
non-privileged OS code.
• This provides the opportunity for Xen to implement virtualization by
executing the hypervisor in Ring 0, Domain 0, and all the other domains
running guest operating systems
80. • Because of the structure of the x86 instruction set, some instructions allow code
executing in Ring 3 to jump into Ring 0 (kernel mode). Such operation is
performed at the hardware level and therefore within a virtualized environment will
result in a trap or silent fault, thus preventing the normal operations of the guest
operating system.
• To avoid this situation, operating systems need to be changed in their
implementation
• Paravirtualization needs the operating system codebase to be modified, and hence
not all operating systems can be used as guests in a Xen-based environment. More
precisely, this condition holds in a scenario where it is not possible to leverage
hardware-assisted virtualization.
• Therefore, Xen exhibits some limitations in the case of legacy hardware and legacy
operating systems.
• Open-source operating systems such as Linux can be easily modified, since their
code is publicly available and Xen provides full support for their virtualization, whereas
components of the Windows family are generally not supported by Xen unless hardware-
assisted virtualization is available.
81. VMware: Full Virtualization
• VMware’s technology is based on the concept of full virtualization,
where the underlying hardware is replicated and made available to the
guest operating system, which runs unaware of such abstraction layers
and does not need to be modified.
• VMware implements full virtualization either in the desktop
environment, by means of Type II hypervisors, or in the server
environment, by means of Type I hypervisors. In both cases, full
virtualization is made possible by means of direct execution (for
nonsensitive instructions) and binary translation (for sensitive
instructions), thus allowing the virtualization of architecture such as
x86.
83. Full virtualization and binary translation
• VMware is well known for the capability to virtualize x86 architectures, which runs
unmodified on top of their hypervisors x86 architecture design does not satisfy the first
theorem of virtualization .
• This causes a different behavior when such instructions are not executed in Ring 0,
which is the normal case in a virtualization scenario where the guest OS is run in Ring
1.
• Generally, a trap is generated and the way it is managed differentiates the solutions in
which virtualization is implemented for x86 hard- ware.
• This approach has both advantages and disadvantages.
• The major advantage is that guests can run unmodified in a virtualized environment,
which is a crucial feature for operating systems for which source code is not available.
This is the case, for example, of operating systems in the Windows family.
84. • Binary translation is a more portable solution for full virtualization.
• On the other hand, translating instructions at runtime introduces an additional
overhead that is not present in other approaches.
• Even though such disadvantage exists, binary translation is applied to only a
subset of the instruction set, whereas the others are managed through direct
execution on the underlying hardware. This somehow reduces the impact on
performance of binary translation.
• VMware achieves full virtualization by providing virtual representation of
memory and I/O devices.
• Finally, VMware also provides full virtualization of I/O devices such as network
controllers and other peripherals such as keyboard, mouse, disks, and universal
serial bus (USB) controllers.