Introduction to VTwebpages.iust.ac.ir/hsalimi/Courses/89-90-1/CC... · hardware, security, network...

35
Hadi Salimi An Introduction to Virtualization Technology Hadi Salimi Distributed Systems Lab, School of Computer Engineering, Iran University of Science and Technology, Tehran, Iran [email protected]

Transcript of Introduction to VTwebpages.iust.ac.ir/hsalimi/Courses/89-90-1/CC... · hardware, security, network...

Page 1: Introduction to VTwebpages.iust.ac.ir/hsalimi/Courses/89-90-1/CC... · hardware, security, network computing (and others) They involve computer architecture in a pure sense Virtualization

Hadi Salimi

An Introduction to

Virtualization Technology

Hadi Salimi

Distributed Systems Lab,

School of Computer Engineering,

Iran University of Science and Technology,

Tehran, Iran

[email protected]

Page 2: Introduction to VTwebpages.iust.ac.ir/hsalimi/Courses/89-90-1/CC... · hardware, security, network computing (and others) They involve computer architecture in a pure sense Virtualization

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

Page 3: Introduction to VTwebpages.iust.ac.ir/hsalimi/Courses/89-90-1/CC... · hardware, security, network computing (and others) They involve computer architecture in a pure sense Virtualization

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.

Page 4: Introduction to VTwebpages.iust.ac.ir/hsalimi/Courses/89-90-1/CC... · hardware, security, network computing (and others) They involve computer architecture in a pure sense Virtualization

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

Page 5: Introduction to VTwebpages.iust.ac.ir/hsalimi/Courses/89-90-1/CC... · hardware, security, network computing (and others) They involve computer architecture in a pure sense Virtualization

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

Page 6: Introduction to VTwebpages.iust.ac.ir/hsalimi/Courses/89-90-1/CC... · hardware, security, network computing (and others) They involve computer architecture in a pure sense Virtualization

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

Page 7: Introduction to VTwebpages.iust.ac.ir/hsalimi/Courses/89-90-1/CC... · hardware, security, network computing (and others) They involve computer architecture in a pure sense Virtualization

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

Page 8: Introduction to VTwebpages.iust.ac.ir/hsalimi/Courses/89-90-1/CC... · hardware, security, network computing (and others) They involve computer architecture in a pure sense Virtualization

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

Page 9: Introduction to VTwebpages.iust.ac.ir/hsalimi/Courses/89-90-1/CC... · hardware, security, network computing (and others) They involve computer architecture in a pure sense Virtualization

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

Page 10: Introduction to VTwebpages.iust.ac.ir/hsalimi/Courses/89-90-1/CC... · hardware, security, network computing (and others) They involve computer architecture in a pure sense Virtualization

So …So …

� In abstraction, the details are hidden necessarily, but this is not true for virtualization.

10

Abstraction

Virtualization

Page 11: Introduction to VTwebpages.iust.ac.ir/hsalimi/Courses/89-90-1/CC... · hardware, security, network computing (and others) They involve computer architecture in a pure sense 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

Page 12: Introduction to VTwebpages.iust.ac.ir/hsalimi/Courses/89-90-1/CC... · hardware, security, network computing (and others) They involve computer architecture in a pure sense Virtualization

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

Page 13: Introduction to VTwebpages.iust.ac.ir/hsalimi/Courses/89-90-1/CC... · hardware, security, network computing (and others) They involve computer architecture in a pure sense Virtualization

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

Page 14: Introduction to VTwebpages.iust.ac.ir/hsalimi/Courses/89-90-1/CC... · hardware, security, network computing (and others) They involve computer architecture in a pure sense Virtualization

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

Page 15: Introduction to VTwebpages.iust.ac.ir/hsalimi/Courses/89-90-1/CC... · hardware, security, network computing (and others) They involve computer architecture in a pure sense Virtualization

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

Page 16: Introduction to VTwebpages.iust.ac.ir/hsalimi/Courses/89-90-1/CC... · hardware, security, network computing (and others) They involve computer architecture in a pure sense Virtualization

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

Page 17: Introduction to VTwebpages.iust.ac.ir/hsalimi/Courses/89-90-1/CC... · hardware, security, network computing (and others) They involve computer architecture in a pure sense Virtualization

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

Page 18: Introduction to VTwebpages.iust.ac.ir/hsalimi/Courses/89-90-1/CC... · hardware, security, network computing (and others) They involve computer architecture in a pure sense Virtualization

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

Page 19: Introduction to VTwebpages.iust.ac.ir/hsalimi/Courses/89-90-1/CC... · hardware, security, network computing (and others) They involve computer architecture in a pure sense Virtualization

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

Page 20: Introduction to VTwebpages.iust.ac.ir/hsalimi/Courses/89-90-1/CC... · hardware, security, network computing (and others) They involve computer architecture in a pure sense Virtualization

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

Page 21: Introduction to VTwebpages.iust.ac.ir/hsalimi/Courses/89-90-1/CC... · hardware, security, network computing (and others) They involve computer architecture in a pure sense Virtualization

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

Page 22: Introduction to VTwebpages.iust.ac.ir/hsalimi/Courses/89-90-1/CC... · hardware, security, network computing (and others) They involve computer architecture in a pure sense Virtualization

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

Page 23: Introduction to VTwebpages.iust.ac.ir/hsalimi/Courses/89-90-1/CC... · hardware, security, network computing (and others) They involve computer architecture in a pure sense Virtualization

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

Page 24: Introduction to VTwebpages.iust.ac.ir/hsalimi/Courses/89-90-1/CC... · hardware, security, network computing (and others) They involve computer architecture in a pure sense Virtualization

Advantages of VTAdvantages of VT

� Three main advantages of VT:

� Isolation� Isolation

� Consolidation

� Migration

24

Page 25: Introduction to VTwebpages.iust.ac.ir/hsalimi/Courses/89-90-1/CC... · hardware, security, network computing (and others) They involve computer architecture in a pure sense Virtualization

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

Page 26: Introduction to VTwebpages.iust.ac.ir/hsalimi/Courses/89-90-1/CC... · hardware, security, network computing (and others) They involve computer architecture in a pure sense Virtualization

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

Page 27: Introduction to VTwebpages.iust.ac.ir/hsalimi/Courses/89-90-1/CC... · hardware, security, network computing (and others) They involve computer architecture in a pure sense Virtualization

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

Page 28: Introduction to VTwebpages.iust.ac.ir/hsalimi/Courses/89-90-1/CC... · hardware, security, network computing (and others) They involve computer architecture in a pure sense Virtualization

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

Page 29: Introduction to VTwebpages.iust.ac.ir/hsalimi/Courses/89-90-1/CC... · hardware, security, network computing (and others) They involve computer architecture in a pure sense Virtualization

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

Page 30: Introduction to VTwebpages.iust.ac.ir/hsalimi/Courses/89-90-1/CC... · hardware, security, network computing (and others) They involve computer architecture in a pure sense Virtualization

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

Page 31: Introduction to VTwebpages.iust.ac.ir/hsalimi/Courses/89-90-1/CC... · hardware, security, network computing (and others) They involve computer architecture in a pure sense Virtualization

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

Page 32: Introduction to VTwebpages.iust.ac.ir/hsalimi/Courses/89-90-1/CC... · hardware, security, network computing (and others) They involve computer architecture in a pure sense Virtualization

CompositionComposition

apps 2

OS 1

apps 1

32

ISA 2

OS 1

Page 33: Introduction to VTwebpages.iust.ac.ir/hsalimi/Courses/89-90-1/CC... · hardware, security, network computing (and others) They involve computer architecture in a pure sense Virtualization

Composition: ExampleComposition: Example

Java application

Linux x86

JVM

VMware

33

Windows x86

VMware

Crusoe VLIW

Code Morphing

Page 34: Introduction to VTwebpages.iust.ac.ir/hsalimi/Courses/89-90-1/CC... · hardware, security, network computing (and others) They involve computer architecture in a pure sense Virtualization

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

Page 35: Introduction to VTwebpages.iust.ac.ir/hsalimi/Courses/89-90-1/CC... · hardware, security, network computing (and others) They involve computer architecture in a pure sense Virtualization

Any Questions?Any Questions?

35