Anda di halaman 1dari 54

Virtualization !

5/20/2016 MIT 1
Virtualization

Capable of running multiple user


applications simultaneously
Provide necessary abstractions
Enables application to be
encapsulated

5/20/2016 MIT 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
5/20/2016 MIT 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
IBMs research continued through many
other projects, and were soon joined by
projects at other institutions, such as MITs
Multics.
All of
5/20/2016
these systemsMITran VMs identical to 4
Source:
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
5/20/2016 MIT 5
Application virtualization
Source:
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.
MIT
5/20/2016 6
Architecture Differences

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

2. 3.

5/20/2016 MIT 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

MIT
5/20/2016 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)

5/20/2016 MIT 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.

5/20/2016 MIT 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 doesnt affect
the other VM
5/20/2016 MIT
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

5/20/2016 MIT
12
Virtualization Functions and Benefits
Virtual Virtual
Resources Resources

Sharing Aggregation

Resources Resources

nefits: 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

fits: Compatibility,
Slide 13/144 Benefits:
investment protection , Continuous availability, flexibility,
MIT
5/20/2016
interoperability, flexibility investment protection
Machines: Stacked
Architecture

APPLICATIONS
API Calls
USER LEVEL LIBRARIES User
System Calls Space
Kernel
KERNEL Space
Instructions
HARDWARE
5/20/2016 MIT 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 15
a disk)
5/20/2016 MIT
Perspective of Machine by OS Developer

ISA
Instruction
Set
Architectur
e
Major ISA

division
between
hardware
and
software
5/20/2016 16
MIT
Perspective of Machine by Compiler
Developer
ABI
Applicati
on Binary
Interface
User ISA
+ OS
calls ABI

5/20/2016 17
MIT
Perspective of Machine by Application
Developer
API
Applicatio
n
Program
Interface
User ISA
+ library API

calls

5/20/2016 18
MIT
Architecture & Interfaces

Architecture: formal specification of a systems


interface and the logical behavior of its visible
resources.

5/20/2016 MIT 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 resources 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
5/20/2016 resources (e.g.,MITto improve security) 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
5/20/2016 MIT 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

5/20/2016
MIT 22
Full Virtualization

Virtual Machine

Guest OS

App. C

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

App. A
virtualization
Dynamic binary translation Device Drivers

The emulation layer talks to an


operating system which talks to the
Emulated
computer hardware
Hardware
The guest OS doesn't see that it is
used in an emulated environment
All of the hardware is emulated including the Device Drivers
CPU Host OS
Two popular open source emulators are
QEMU and Bochs

Hardware

5/20/2016 MIT 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

5/20/2016 MIT 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


5/20/2016 MIT 25
Para-Virtualization
The Guest OS is modified and thus run

Virtual Machine
kernel-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 API
specialized API to talk to the VMM and, Virtual Machine Monitor
in this way, execute the privileged
instructions
The VMM is responsible for handling Device Drivers

the virtualization requests and putting Hypervisor


them to the hardware

Hardware
5/20/2016 MIT 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
5/20/2016 MIT 27
virtualized machine by using paravirtualized drivers
Hypervisors or Virtual Machine
Monitors
Xen
KVM
VMWare

5/20/2016 MIT 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
5/20/2016 MIT 29
KVM - Architecture

5/20/2016 MIT 30
Guest OS Supported by KVM
Many flavours of Linux
BSD
Solaris
Windows
Haiku
ReactOS
AROS Research Operating System
Mac OS X

5/20/2016 MIT 31
Xen
Open source VMM developed by University of
Cambridge
Designed to be able to run 100 instances of OSs 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 OSs in Xen
Citrix Server is the commercial version of Xen

5/20/2016 MIT 32
Xen Design

5/20/2016 MIT 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)

5/20/2016 MIT 34
VMware Workstation
Runs on Linux and Windows
machines
Allows you to create and run your
own virtual machines

5/20/2016 MIT 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.as
p

5/20/2016 MIT 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.
5/20/2016 MIT 37
Todays 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.

5/20/2016 MIT 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
5/20/2016 MIT 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.

5/20/2016 MIT 40
Virtual Machines

MIT
5/20/2016 41
Virtual Machines
Virtual machines
provide:
Hardware independence
VM sees the same
hardware regardless of
the host hardware

Isolation VMs operating


system is isolated from
the host operating system

Encapsulation Entire VM
encapsulated into a single
5/20/2016
file MIT 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
5/20/2016 MIT 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

MIT
5/20/2016 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

5/20/2016 MIT 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 VMs

Java Binary Classes


Java VM
Architecture

VM VM VM
implementation implementation implementation

Sparc x86 Apple


Workstation PC Mac

5/20/2016 MIT 46
High Level Language Virtual Machines

Process VM (or API VM)

HLL Program HLL


Program
Compiler front-end Compiler

Intermediate Code Portable Code


V
( irtual 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


5/20/2016 MIT 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"

5/20/2016 MIT 48
System Virtual Machines

System virtual machine provides a complete system


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

5/20/2016 MIT 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.

5/20/2016 MIT 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
Type 2: User-mode Linux

5/20/2016 MIT 51
Whole-system VMMs

Challenge: GuestOS ISA differs


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

5/20/2016 MIT 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.

5/20/2016 MIT 53
Summary (Taxonomy)

5/20/2016 MIT 54

Anda mungkin juga menyukai