Introduction to VTwebpages.iust.ac.ir/hsalimi/Courses/89-90-1/CC... · hardware, security, network...
Transcript of Introduction to VTwebpages.iust.ac.ir/hsalimi/Courses/89-90-1/CC... · hardware, security, network...
Hadi Salimi
An Introduction to
Virtualization Technology
Hadi Salimi
Distributed Systems Lab,
School of Computer Engineering,
Iran University of Science and Technology,
Tehran, Iran
IntroductionIntroduction
� What is Virtualization?◦ Virtual Reality?
◦ Virtual Memory?
◦ Java Virtual Machine?
◦ VMWareVirtual Machine?
� Why they are interesting?� Why they are interesting?
� They enable innovation in flexible, adaptive software & hardware, security, network computing (and others)
� They involve computer architecture in a pure sense
� Virtualization will be a key part of future computer systems in hardware, system software and application software.
Introduction 2
Advantages of Standard InterfacesAdvantages of Standard Interfaces
� Major design tasks are decoupled
◦ In space and time
� Different hardware and software development schedules
� Software can run on any machine
supporting a compatible interfacesupporting a compatible interface
3
PowerPC
MacOS
MacIntosh apps.
x86
Linux
Linux apps
x86
Windows
Windows apps.
DisadvantagesDisadvantages� Software compiled for one ISA will not run on hardware with a different ISA◦ Apple Mac (PowerPC) binaries on an x86? No !!! �
� Even if ISAs are the same, OSes may differ◦ Windows NT applications on a Solaris x86? No !!! �
� Binary may not be optimized for the specific hardware platform it runs onplatform it runs on◦ Intel Pentium 4 binaries on an AMD Athlon?
4
MacOS
MacIntosh apps
x86 x86
Windows apps.
Linux
Disadvantages (contd.)Disadvantages (contd.)
� Innovation may be inhibited by fixed ISA
◦ Hard to add new instructions
� OR remove obsolete ones
◦ What was the most recent (successful) new ISA?
Or new OS?
� Difficult for software to interact directly with � Difficult for software to interact directly with implementation
◦ Performance features
◦ Power management
◦ Fault tolerance
◦ Software is supposed to be implementation independent
5
Hardware ResourcesHardware Resources� Conventional system software manages hardware resources directly◦ An OS manages the physical memory of a specific size
◦ I/O devices are managed as physical entities
� Difficult to share resources except through OS◦ All users of hardware must use the same OS
◦ All users are vulnerable to attack from other users sharing the resource (via security holes in OS)
6
AbstractionAbstraction
� Computer systems are built on levels of abstraction
� Higher level of abstraction hide details at lower levels
Execution Hardware
DriversMemory
ManagerScheduler
Operating System
Libraries
Application
Programs
Software
filefile
abstraction
at lower levels
� Example: files are an abstraction of a disk
I/O devices
and
Networking
Controllers
System Interconnect
(bus)
Controllers
Memory
Translation
Execution Hardware
Main
Memory
Hardware
7
VirtualizationVirtualization
� An isomorphism from guest to host
◦ Map guest state to host state
◦ Implement “equivalent” functions
e(Si)
8
Si S
Si' Sj'
Guest
Host
V(Si) V(S j)
e'(Si')
j
VirtualizationVirtualization
� Similar to abstraction
Except
◦ Details not necessarily hidden
� Construct Virtual Disksfile
file
virtualization
◦ As files on a larger disk
◦ Map state
◦ Implement functions
� VMs: do the same thing with the whole “machine”
9
So …So …
� In abstraction, the details are hidden necessarily, but this is not true for virtualization.
10
Abstraction
Virtualization
The “MachineThe “Machine””
� Different perspectives on what the Machine is:
� OS developer
� Compiler developer
� Application programmerSystem Interconnect
Memory
Translation
Execution Hardware
Application
Programs
Operating System
Libraries
11
Application Program
Interface
• API
• User ISA + library calls
Application Binary Interface
• ABI
• User ISA + OS calls
I/O devices
and
Networking
System Interconnect
(bus)
Main
Memory
The “Machine”The “Machine”
� Different perspectives on what the Machine is:
� OS developer
Execution Hardware
Application
Programs
Operating System
Libraries
� Instruction Set Architecture
◦ ISA
◦ Major division between hardware and software
12
I/O devices
and
Networking
System Interconnect
(bus)
Memory
Translation
Execution Hardware
Main
Memory
The “Machine”The “Machine”
� Different perspectives on what the Machine is:
� Compiler developer
Execution Hardware
Application
Programs
Operating System
Libraries
13
Application Binary
Interface
• ABI
• User ISA + OS callsI/O devices
and
Networking
System Interconnect
(bus)
Memory
Translation
Execution Hardware
Main
Memory
The “Machine”The “Machine”
� Different perspectives on what the Machine is:
� Application programmer
Execution Hardware
Application
Programs
Operating System
Libraries
14
Application Program
Interface
• API
• User ISA + library callsI/O devices
and
Networking
System Interconnect
(bus)
Memory
Translation
Execution Hardware
Main
Memory
Virtual MachinesVirtual 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
15
Hardware
"Machine"
OS
Applications
Virtualizing
SoftwareVirtual
Machine
OS
Applications
Guest
VMM
Host
The Family of Virtual MachinesThe Family of Virtual Machines
� Lots of things are called “virtual machines”
IBM VM/370
Java
VMware
Some things not called “virtual machines”, are virtual Some things not called “virtual machines”, are virtual machines
IA-32 EL
Dynamo
Transmeta Crusoe
16
Taking a Unified ViewTaking a Unified View
“The subjects of virtual machines and emulators have been treated as entirely separate. … they have much in common. Not only do the usual implementations have many shared characteristics, but this commonality extends to the theoretical concepts on extends to the theoretical concepts on which they are based”
-- Efrem G. Wallach, 1973
17
Major Program InterfacesMajor Program Interfaces� ISA Interface -- supports all conventional software
System Calls
User ISASystem ISAISA
Application Software
Operating System
18
System Calls
User ISASystem ISAABI
Application Software
Operating System
� Application Binary Interface (ABI) -- supports application software only
System Virtual MachinesSystem Virtual Machines
� Provide a system environment
� Constructed at ISA level
guestprocess
Guest OS
VMM
guest
process
guestprocess
guestprocess
Guest OS2
VMM
guestprocess
guestprocess
ISA level
� Persistent
19
HOST PLATFORM
virtual
network communication
VMM
� Examples: IBM VM/360, VMware, TransmetaCrusoe
Virtualization Technology (VT)Virtualization Technology (VT)
� An old technology from late 60’s
�Was first coined by IBM to multiplex the power of mainframes
20
VT (Cont.)VT (Cont.)
�Was dormant for decades because of its overhead
� Has became active after recent advanced in hardware and software technologiesin hardware and software technologies
� Two main concepts:◦ Virtual Machine (VM)
◦ Virtual Machine Monitor (VMM)
21
Basic ConceptsBasic Concepts
� Virtualization basic concepts [GOL73]:◦ Virtual Machine
◦ Virtual Machine Monitor
VM VM6
22
Machine
Virtual Machine Monitor
Virtual Machine
Virtual Machine
Virtual Machine
Virtual Machine
6
VMM
VT CategoriesVT Categories
Virtual Machine
App App
Virtual Machine
OS
App App
� Types of VMM:
23/39
Physical Hardware
VMM
OS
App App
Physical Hardware
VMM
OS
OS
App
Type I Type II
Advantages of VTAdvantages of VT
� Three main advantages of VT:
� Isolation� Isolation
� Consolidation
� Migration
24
System Virtual MachinesSystem Virtual Machines
� Native VM System
◦ VMM privileged mode
◦ Guest OS user mode
◦ Example: classic IBM VMs
� User-mode Hosted VM
Non-privileged
modes
Privileged
Mode
Virtual
Machine
VMM
Virtual
Machine
Host OS
VMM
Virtual
Machine
Host OS
VMM
User-mode Hosted VM
◦ VMM runs as user application
� Dual-mode Hosted VM
◦ Parts of VMM privileged; parts non-privileged
◦ Example VMware
25
Mode
HardwareHardwareHardware
Process VMsProcess VMs
� Execute application binaries with an ISA different from hardware platform
� Couple at ABI level via Runtime System
� Examples: IA-32 EL, FX!32
Application ProcessGuest Application Process
26
VirtualizingSoftware
Application Process
Machine
OS
Hardware
Guest
Runtime
Host
Application Process
Virtual
Machine
Process Virtual MachinesProcess Virtual Machines
� Constructed at ABI level
� Runtime manages guest process
� Not persistent
� Guest processes may intermingle with host
guestprocess
create
host
process
guest
process
runtimeruntime
guest
process
runtime
host
process
intermingle with host processes
� As a practical matter, guest and host OSes are often the same
� Dynamic optimizers are a special case
� Examples: IA-32 EL, FX!32, Dynamo
27
HOST OS
Disk
file sharing
network communication
create
SameSame--ISA Dynamic Binary ISA Dynamic Binary OptimizersOptimizers
� Optimize Binary at Runtime
� An ABI level optimization
A type of Process VM
UNIX
HP Apps
� A type of Process VM
� Example HP Dynamo◦ Can optimize for dynamic properties of program
◦ Can optimize for a specific processor implementation
28
HP PA
HLL VMsHLL VMs
� Java and CLI are recent examples� Binary class files are distributed� “ISA” is part of binary class format� OS interaction via APIs (part of VM platform)
29
Sparc
Workstation
Java Binary Classes
x86
PC
Apple
Mac
VM
implementation
VM
implementation
VM
implementation
Java VMArchitecture
High Level Language Virtual MachinesHigh Level Language Virtual Machines
� Raise the level of abstraction◦ User higher level virtual ISA◦ OS abstracted as standard libraries
� Process VM (or API VM)
HLL Program HLL Program
30
Intermediate Code
Memory Image
Object Code(ISA)
Compiler front-end
Compiler back-end
Loader
Portable Code(Virtual ISA )
Host Instructions
Virt. Mem. Image
Compiler
VM loader
VM Interpreter/Translator
Traditional HLL VM
CoCo--Designed VMsDesigned VMs
Windows
X86 Apps
� Perform both translation and optimization
� VM provides interface between standard ISA software and implementation ISA
� Primary goal is performance or
31
VLIW
� Primary goal is performance or power efficiency
� Use proprietary implementation ISA
� Transmeta Crusoe and IBM Daisy best-known examples
CompositionComposition
apps 2
OS 1
apps 1
32
ISA 2
OS 1
Composition: ExampleComposition: Example
Java application
Linux x86
JVM
VMware
33
Windows x86
VMware
Crusoe VLIW
Code Morphing
Summary (Taxonomy)Summary (Taxonomy)
VM type (Process or System)
Host/Guest ISA same or different
Process VMs System VMs
34
Multiprogrammed
Systems
Java VM
MS CLI
Transmeta
Crusoe
same ISAdifferent
ISA
Virtual PC
for Mac
different
ISAsame ISA
IBM VM/370
VMware
HP
Dynamo
IA-32 EL
FX!32
Any Questions?Any Questions?
35