Sei sulla pagina 1di 54

Another buzz word…

Virtualization !

Cloud Computing MTech IT CEG campus 1


Virtualization

• Capable of running multiple user applications


simultaneously
• Provide necessary abstractions
• Enables application to be encapsulated

Cloud Computing MTech IT CEG campus 2


Overview
Virtualization is a proven software technology
that is rapidly transforming the IT landscape and
fundamentally changing the way that
people compute. In essence, virtualization lets you
transform hardware into software.
Virtualization is a
technology that can
benefit anyone who uses a
computer, from IT
professionals and Mac
enthusiasts to commercial
businesses and
government
organizations.
Cited from: www.vmware.com/virtualization
Cloud Computing MTech IT CEG campus 3
History
1960
 Virtualization was first presented in Time Sharing in
Large Fast Computers in 1959 as an extension of the
work being done into time-sharing on mainframe
computers.
 The term virtualization originated in the IBM
M44/44X project. M44 referred to the hardware, 44X
were the virtual machines.
1970
 IBM’s research continued through many other
projects, and were soon joined by projects at other
institutions, such as MIT’s Multics.
 All of these systems ran VMs identical to their
hardware
Cloud Computing MTech IT CEG campus 4
Source: www.vmware.com/overview/history.html
History
1980
 Availability of personal computers, main frames
phased out. Virtualization relegated to labs.
 Development of “purely” virtual machines.

2000
 Dot-com boom: Massive need for servers to run
Internet applications; low utilization
 Development of server virtualization by Xen/VMware
 Desktop virtualization

2010
 Application virtualization
Cloud Computing MTech IT CEG campus 5
Source: www.vmware.com/overview/history.html
What is virtualization?
• Virtualization (or virtualisation), in computing, is the
creation of a virtual (rather than actual) version of
something, such as a hardware platform, operating
system, storage device, or network resources.
• Virtualization 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.

Cloud Computing MTech IT CEG campus 6


Architecture Differences

1. Traditional 1.
2. Hosted virtualization
3. Bare-metal virtualization

2. 3.

Cloud Computing MTech IT CEG campus 7


• Traditional computing architecture has the following:
– Hardware ( cpu, memory, nic, disk)
– Operating system
– Application program
• Hosted virtualization architecture has the following:
– Hardware ( cpu, memory, nic, disk)
– Host Operating System
– Application program
• Virtualization layer
• Hosted (guest) operating system
• Hosted (guest) application program

Cloud Computing MTech IT CEG campus 8


Virtual Machine Monitor (VMM)
• Program in charge of virtualization
– Hypervisor
– Arbitrates access to physical resources
– Presents a set of virtual device interfaces to each host
• Guest OS runs until:
– Privileged instruction traps
– System interrupts
– Exceptions (page faults)
– Explicit call: VMCALL (intel) or VMMCALL (AMD)

Cloud Computing MTech IT CEG campus 9


Hypervisor
What is a hypervisor?
• A hypervisor, a.k.a., a virtual machine manager/monitor (VMM),
or virtualization manager.
• A program that allows multiple operating systems to share a
single hardware host.
• Another technology at the heart of system
virtualization
• Each operating system appears to have the host's processor,
memory, and other resources all to itself. However, the
hypervisor is actually controlling the host processor and
resources, allocating what is needed to each operating system in
turn and making sure that the guest operating systems (called
virtual machines) cannot disrupt each other.

Cloud Computing MTech IT CEG campus 10


Benefits from Virtualization

• Load balancing
– Create VM for new work loads
• Increased Resource utilization
– Create VM in the under utilized resources
• Reusable
– One VM created can be reused somewhere
else
• Isolation
– Destruction of one VM doesn’t affect the
other VM
Cloud Computing MTech IT CEG campus 11
Benefits Continued…

• Live migration
– Support suspend resume and migration of
created VMs
• Persistent and Non Persistent
– Support for keep/drop the changes made in
VM images
• Undoable and Append
– Allows undo and append options in VM
images

Cloud Computing MTech IT CEG campus 12


Virtualization Functions and Benefits
Virtual Virtual
Resources Resources

Sharing Aggregation

Resources Resources

Benefits: Resource utilization, workload Benefits: Management simplification,


manageability, flexibility, isolation investment protection, scalability

Resource Virtual Virtual


Type Y Resources Resources

Emulation Insulation

Resource
Type X Resources Add, Replace, Resources
or Change

Benefits: Compatibility, investment protection, Cloud


Benefits: Continuous availability, Computing
flexibility,
Slide 13/144
interoperability, flexibility MTech IT CEG campus
investment protection
Machines: Stacked Architecture

APPLICATIONS
API Calls
USER LEVEL LIBRARIES User Space
System Calls
Kernel Space
KERNEL
Instructions
HARDWARE
Cloud Computing MTech IT CEG campus 14
Abstraction
• Computer
systems are
built on levels
of abstraction.
Higher level of
abstraction hide
details at lower
levels.
(Example: Files
are an
abstraction of a
disk) 15
Cloud Computing MTech IT CEG campus
Perspective of Machine by OS Developer

ISA
 Instruction
Set
Architecture
 Major
division
ISA

between
hardware
and software

16
Cloud Computing MTech IT CEG campus
Perspective of Machine by Compiler Developer

ABI
 Application
Binary
Interface
 User ISA +
OS calls
ABI

17
Cloud Computing MTech IT CEG campus
Perspective of Machine by Application Developer
API
 Application
Program
Interface
 User ISA +
library calls
API

18
Cloud Computing MTech IT CEG campus
Architecture & Interfaces

• Architecture: formal specification of a system’s interface


and the logical behavior of its visible resources.

Cloud Computing MTech IT CEG campus 19


• Virtualization
– A layer mapping its visible interface and resources onto the
interface and resources of the underlying layer or system on
which it is implemented
– Purposes
• Abstraction – to simplify the use of the
underlying resource (e.g., by removing details of
the resource’s structure)
• Replication – to create multiple instances of the
resource (e.g., to simplify management or
allocation)
• Isolation – to separate the uses which clients
make of the underlying resources (e.g., to
improve security)
Cloud Computing MTech IT CEG campus 20
Architectural Support
• Intel Virtual Technology (Intel Core 2 Duo)
• AMD Opteron

• Certain privileged instructions are intercepted as


VM exits to the VMM
• Exceptions, faults, and external interrupts are
intercepted as VM exits
• Virtualized exceptions/faults are injected as VM
entries
Cloud Computing MTech IT CEG campus 21
System-level Design Approaches

• Full virtualization (direct execution)


– Exact hardware exposed to OS
– Efficient execution
– OS runs unchanged
– Requires a “virtualizable” architecture
– Example: VMWare

 Paravirtualization
 OS modified to execute under VMM
 Requires porting OS code
 Execution overhead
 Necessary for some (popular)
architectures (e.g., x86)
 Examples: Xen, Denali

Cloud Computing MTech IT CEG


22
campus
Full Virtualization

Virtual Machine

Guest OS

App. B
App. C
1st Generation offering of x86/x64 server virtualization

App. A
• Dynamic binary translation
– The emulation layer talks to an operating Device Drivers

system which talks to the computer hardware


– The guest OS doesn't see that it is used in an Emulated
emulated environment Hardware
• All of the hardware is emulated including the CPU
• Two popular open source emulators are QEMU and
Bochs Device Drivers

Host OS

Hardware

Cloud Computing MTech IT CEG campus 23


Full Virtualization - Advantages
• The emulation layer
– Isolates VMs from the host OS and from each other
– Controls individual VM access to system resources, preventing an unstable VM
from impacting system performance
• Total VM portability
– By emulating a consistent set of system hardware, VMs have the ability to
transparently move between hosts with dissimilar hardware without any
problems
• It is possible to run an operating system that was developed for
another architecture on your own architecture
• A VM running on a Dell server can be relocated to a Hewlett-Packard
server

Cloud Computing MTech IT CEG campus 24


Full Virtualization - Drawbacks
• Hardware emulation comes with a performance price
• In traditional x86 architectures, OS kernels expect to run privileged code in Ring 0
– However, because Ring 0 is controlled by the host OS, VMs are forced to
execute at Ring 1/3, which requires the VMM to trap and emulate
instructions
• Due to these performance limitations, paravirtualization and hardware-assisted
virtualization were developed

Application Ring 3

Guest OS Ring 1 / 3
Application Ring 3

Virtual
Operating Ring 0 Machine Ring 0
System Monitor

Traditional x86 Architecture Full Virtualization


Cloud Computing MTech IT CEG campus 25
Para-Virtualization
• The Guest OS is modified and thus run kernel-

Virtual Machine
level operations at Ring 1 (or 3)

Guest OS

App. B
App. C

App. A
– the guest is fully aware of how to process
privileged instructions Device Drivers
– thus, privileged instruction translation by the
VMM is no longer necessary
– The guest operating system uses a specialized Specialized API
API to talk to the VMM and, in this way, execute Virtual Machine Monitor
the privileged instructions
• The VMM is responsible for handling the
virtualization requests and putting them to the Device Drivers

hardware Hypervisor

Hardware
Cloud Computing MTech IT CEG campus 26
Para-Virtualization
• Today, VM guest operating systems are paravirtualized using two different
approaches:
– Recompiling the OS kernel
• Paravirtualization drivers and APIs must reside in the guest operating system kernel
• You do need a modified operating system that includes this specific API, requiring a
compiling operating systems to be virtualization aware
– Some vendors (such as Novell) have embraced paravirtualization and have
provided paravirtualized OS builds, while other vendors (such as Microsoft) have
not
– Installing paravirtualized drivers
• In some operating systems it is not possible to use complete paravirtualization, as it
requires a specialized version of the operating system
• To ensure good performance in such environments, paravirtualization can be applied
for individual devices
• For example, the instructions generated by network boards or graphical interface cards
can be modified before they leave the virtualized machine by using paravirtualized
drivers

Cloud Computing MTech IT CEG campus 27


Hypervisors or Virtual Machine Monitors

• Xen
• KVM
• VMWare

Cloud Computing MTech IT CEG campus 28


KVM - Kernel-based Virtual Machine

• KVM is open source software


• KVM is a full virtualization solution for Linux on
x86 hardware containing virtualization
extensions (Intel VT or AMD-V)
• Para-virtualization support is also available for
Linux and Windows guests using the VirtIO
framework

Cloud Computing MTech IT CEG campus 29


KVM - Architecture

Cloud Computing MTech IT CEG campus 30


Guest OS Supported by KVM
• Many flavours of Linux
• BSD
• Solaris
• Windows
• Haiku
• ReactOS
• AROS Research Operating System
• Mac OS X

Cloud Computing MTech IT CEG campus 31


Xen
• Open source VMM developed by University of Cambridge
• Designed to be able to run 100 instances of OS’s at the
same time
• OS must be modified to run within Xen, due to
paravirtualization
• Xen runs by having one OS in a privileged state called
Domain-0 which is booted on start up and is then used to
start all other unprivileged OS’s in Xen
• Citrix Server is the commercial version of Xen

Cloud Computing MTech IT CEG campus 32


Xen Design

Cloud Computing MTech IT CEG campus 33


Xen Approach
 Xen uses paravirtualization
 Paravirtualization is a process where the guest
operating system is modified to run in parallel with
other modified systems
 Advantage: Improved performance
 Disadvantage: The hosted operating system must be
modified before it can be hosted by the Xen Hypervisor
(can be difficult)

Cloud Computing MTech IT CEG campus 34


VMware Workstation
• Runs on Linux and Windows machines
• Allows you to create and run your own virtual
machines

Cloud Computing MTech IT CEG campus 35


Software Virtualization using VMWare
• VMware Server (ESX)

http://openlab-mu-internal.web.cern.ch/openlab-mu-internal/openlab-
II_Projects/Platform_Competence_Centre/Virtualization/Virtualization.asp

Cloud Computing MTech IT CEG campus 36


X86 VIrtualization
• In computing, x86 virtualization is the facility that allows
multiple operating systems to simultaneously share x86
processor resources in a safe and efficient manner, a facility
generically known as hardware virtualization.
• In the late 1990s x86 virtualization was achieved by complex
software techniques which overcame the processor's lack of
virtualization support and attained reasonable performance.
In the mid 2000s, both Intel and AMD added hardware
support to their processors making virtualization software
simpler, and later hardware changes provided substantial
speed improvements.

Cloud Computing MTech IT CEG campus 37


• Today’s x86 computer hardware was designed to run a single
operating system and a single application, leaving most
machines vastly underutilized.
• Virtualization lets you run multiple virtual machines on a
single physical machine, with each virtual machine sharing the
resources of that one physical computer across multiple
environments.
• Different virtual machines can run different operating systems
and multiple applications on the same physical computer.

Cloud Computing MTech IT CEG campus 38


Virtualization

• The process of virtualization consists of two


parts:
(1) the mapping of virtual resources or state,
e.g., registers, memory, or files, to real
resources in the underlying machine
(2) the use of real machine instructions and/or
system calls to carry out the actions specified
by virtual machine instructions and/or system
calls
Cloud Computing MTech IT CEG Campus 39
Virtual Machines
So what exactly is a virtual machine?
• A virtual machine is defined as a
representation of a physical machine by
software that has its own set of virtual
hardware upon which an operating system
and applications can be loaded. With
virtualization each virtual machine is provided
with consistent virtual hardware regardless of
the underlying physical hardware that the
host server is running. When you create a VM
a default set of virtual hardware is given to it.
You can further customize a VM by adding or
removing additional virtual hardware as
needed by editing its configuration.

Cloud Computing MTech IT CEG campus 40


Virtual Machines

Cloud Computing MTech IT CEG campus 41


Virtual Machines
Virtual machines provide:
– Hardware independence – VM
sees the same hardware
regardless of the host hardware

– Isolation – VM’s operating


system is isolated from the host
operating system

– Encapsulation – Entire VM
encapsulated into a single file

Cloud Computing MTech IT CEG campus 42


Major Program Interfaces
• ISA Interface -- supports all conventional software
Application Software
System Calls

Operating System

System ISA User ISA


ISA

 Application Binary Interface (ABI)


-- supports application software only
Application Software
System Calls

Operating System

System ISA User ISA


ABI
Cloud Computing MTech IT CEG Campus 43
Virtual Machines
Two types:

• Process Virtual machine : Process-level VMs provide user applications


with a virtual ABI environment. In their various implementations,
process VMs can provide replication,emulation, and optimization.

. System Virtual machine : System virtual machine provides a complete system


environment in which many processes, possibly belonging to multiple users can
coexist

Cloud Computing MTech IT CEG Campus


44
Process VMs
• Process-level VMs provide user applications with a virtual ABI environment.
In their various implementations, process VMs can provide replication,
emulation, and optimization.

Guest Application Process Application Process

Runtime Virtualizing
Software

OS Virtual
Machine
Host Machine

Hardware

Cloud Computing MTech IT CEG Campus 45


HLL VMs (Process VM)
• Java and Microsoft CLI are recent examples
• Platform independent Binary class files are distributed
• OS interaction via APIs (part of VM platform)
• Platform dependent VM’s

Java Binary Classes


Java VM
Architecture

VM VM VM
implementation implementation implementation

Sparc x86 Apple


Workstation PC Mac

Cloud Computing MTech IT CEG Campus 46


High Level Language Virtual Machines

• Process VM (or API VM)

HLL Program HLL Program

Compiler front-end Compiler

Intermediate Code Portable Code


( Virtual ISA )
Compiler back-end

Object Code VM loader


( ISA ) Virt. Mem. Image

Loader VM Interpreter/Translator
Memory Image Host Instructions

Traditional-Not portable HLL VM


Cloud Computing MTech IT CEG Campus 47
System Virtual Machines
Add Virtualizing Software to a Host platform and support Guest process or
system on a Virtual Machine (VM)

Example: System Virtual Machine

Applications Applications

Guest
OS OS

Virtualizing
VMM Software
Virtual
Machine
Hardware
Host "Machine"

Cloud Computing MTech IT CEG Campus 48


System Virtual Machines

• System virtual machine provides a complete system environment in which


many processes, possibly belonging to multiple users can coexist.

Cloud Computing MTech IT CEG Campus 49


Features of System VMs
• They provide a secure way of partitioning major software systems that run
concurrently on the same hardware platform.
• Software running on one guest system is isolated from software running
on other guest systems.
• If security on one guest system is compromised or if the guest OS suffers a
failure, the software running on other guest systems is not affected.
• Ability to support different operating systems simultaneously
• In system VMs, platform replication is the major feature provided by a
VMM. The central problem is that of dividing a single set of hardware
resources among multiple guest operating system environments. The
VMM has access to and manages all the hardware resources.

Cloud Computing MTech IT CEG Campus 50


Classic System VM vs Hosted VM

Type 1

• Structure
– Type 1: runs directly on host hardware
– Type 2: runs on HostOS
• Primary goals
– Type 1: High performance
– Type 2: Ease of construction/installation/acceptability
• Examples
– Type 1: VMWare ESX Server, Xen, OS/370
– Type 2: User-mode Linux Type 2

Cloud Computing MTech IT CEG Campus 51


Whole-system VMMs

 Challenge: GuestOS ISA differs


from HostOS ISA
 Requires full emulation of
GuestOS and its applications
 Example: VirtualPC

Cloud Computing MTech IT CEG Campus 52


Codesigned VM

• Used to improve performance and power efficiency.


• A portion of the real memory is reserved for VMM code. This
memory is concealed.
• Code can take control of H/W as and when required.
• Guest instructions are converted to native ISA instruction and
cached by the binary translator.
• Guest ISA never directly executes on H/W.
• Binary translation coupled with code optimization provides
improved performance.

Cloud Computing MTech IT CEG Campus 53


Summary (Taxonomy)

Cloud Computing MTech IT CEG Campus 54