Sei sulla pagina 1di 32

Virtualization:Virtualization: Concepts,Concepts, Applications,Applications, andand PerformancePerformance ModelingModeling

Daniel A. Menascé, Ph.D.

The Volgenau School of Information Technology and Engineering Department of Computer Science George Mason University

www.cs.gmu.edu/faculty/menasce.html

© 2005 D.A. Menascé. All Rights Reserved.

Science George Mason University www.cs.gmu.edu/faculty/menasce.html © 2005 D.A. Menascé . All Rights Reserved. 1

1

BasicBasic ConceptsConcepts inin VirtualizationVirtualization

Environment

Environment

Environment

Application

Application

Application

Operating System

Hardware

Non-virtualized system

© 2005 D.A. Menascé. All Rights Reserved.

• The OS controls access to the hardware resources.

• The instruction set is divided into privileged and non-privileged.

• The machine can be in two modes of operation: user and supervisor.

• Only non-privileged instructions can be executed in user mode.

• Any instruction can be executed in supervisor mode.

• Application environments execute in user mode and the OS in supervisor mode.

can be executed in supervisor mode. • Application environments execute in user mode and the OS

2

BasicBasic ConceptsConcepts inin VirtualizationVirtualization

Environment

Environment

Environment

Application

Application

Application

Operating System

Hardware

Non-virtualized system

© 2005 D.A. Menascé. All Rights Reserved.

Environment

Environment

Environment

Application

Application

Application

Operating System

Virtual Machine Monitor

Hardware

Virtualized system

i o n A p p l i c a t i o n Operating System

3

BasicBasic ConceptsConcepts inin VirtualizationVirtualization

Environment

Environment

Environment

Application

Environment

Application

Application

Application

OS 1

OS 2

Virtual Machine Monitor (VMM)

Hardware

Virtualized system

© 2005 D.A. Menascé. All Rights Reserved.

• The VMM controls access to the hardware resources.

• OSs (called guest OSs) execute in user mode and the VMM in supervisor mode.

• The VMM interprets in software privileged instructions that would be executed by an OS.

• Any non-privileged instruction issued by an OS or Application Environment is executed directly by the machine.

• This is called virtualization by direct execution or full virtualization.

is executed directly by the machine. • This is called virtualization by direct execution or full

4

BasicBasic ConceptsConcepts inin Virtualization:Virtualization:

Environment

Environment

Environment

Application

Environment

Application

Application

Application

OS 1

OS 2

Virtual Machine Monitor (VMM)

Hardware

Virtualized system

© 2005 D.A. Menascé. All Rights Reserved.

thethe x86x86 architecturearchitecture

• The x86 architecture provides four levels of privilege: rings 0 through 3.

• In a non virtualized environment, the OS executes in ring 0 and the applications in ring 3.

• In a virtualized environment that uses paravirtualization (e.g., Xen) the VMM runs at ring 0, the guest OS at ring 1 and the applications at ring 3.

uses paravirtualization (e.g., Xen) the VMM runs at ring 0, the guest OS at ring 1

5

BasicBasic ConceptsConcepts inin VirtualizationVirtualization

Basic Basic Concepts Concepts in in Virtualization Virtualization © 2005 D.A. Menascé . All Rights Reserved.

© 2005 D.A. Menascé. All Rights Reserved.

Basic Basic Concepts Concepts in in Virtualization Virtualization © 2005 D.A. Menascé . All Rights Reserved.

6

VirtualizationVirtualization Slowdown,Slowdown, SS vv

In the direct execution approach, privileged instructions have to be emulated by the VMM instead of being executed by the hardware.

S v = f p × N e + (1 f p )

f p

N e

: fraction of privileged instructions executed by a VM.

: average number of instructions required by the VMM to emulate a privileged instruction.

© 2005 D.A. Menascé. All Rights Reserved.

of instructions required by the VMM to emulate a privileged instruction. © 2005 D.A. Menascé .

7

Execution Slowdown

6 5 4 3 2 1 0 0.00% 0.05% 0.10% 0.15% 0.20% 0.25% 0.30% 0.35%
6
5
4
3
2
1
0
0.00%
0.05%
0.10%
0.15%
0.20%
0.25%
0.30%
0.35%
0.40%
0.45%
Slowdown

Fraction of privileged instructions

Ne= 500 Ne= 1000

Ne= 500

Ne= 500 Ne= 1000

Ne= 1000

© 2005 D.A. Menascé. All Rights Reserved.

0.45% Slowdown Fraction of privileged instructions Ne= 500 Ne= 1000 © 2005 D.A. Menascé . All

8

MappingMapping ofof VirtualVirtual toto PhysicalPhysical DisksDisks

Mapping of of Virtual Virtual to to Physical Physical Disks Disks © 2005 D.A. Menascé .

© 2005 D.A. Menascé. All Rights Reserved.

9

SomeSome HistoryHistory

• Over 30 years ago: IBM’s VM/370

• 80’s: decrease in hardware cost caused migration away from mainframes and virtualization faded away.

• More recent networked environments brought problems such as reliability, security, increased administration cost and complexity, thermal dissipation.

Virtualization is poised to address these problems.

© 2005 D.A. Menascé. All Rights Reserved.

dissipation. – Virtualization is poised to address these problems. © 2005 D.A. Menascé . All Rights

10

AdvantagesAdvantages ofof VirtualizationVirtualization

• Security

Compartmentalized environments allow for better choice of guest operating system for each environment (e.g., run Apache on top of Linux and MS SQL on top of Windows XP)

• Reliability and Availability

– A software failure in one VM does not affect other VMs

• Cost

– Server consolidation can bring cost reductions from hardware economies of scale, personnel cost reductions, floor space, and software licenses.

Typical savings: 29% to 64%.

© 2005 D.A. Menascé. All Rights Reserved.

floor space, and software licenses. • Typical savings: 29% to 64%. © 2005 D.A. Menascé .

11

AdvantagesAdvantages ofof VirtualizationVirtualization (cont(contd)d)

• Adaptability to Workload Variations:

– Changes in workload intensity levels can be taken care by dynamically shifting resources and priority allocations among VMs using autonomic computing techniques.

• Load Balancing

– The state of a VM is completely encapsulated in the VMM: easy to migrate VMs to other platforms to improve performance.

• Legacy applications

Legacy applications can continue to run on old OSs that run as a guest operating systems on VMs.

© 2005 D.A. Menascé. All Rights Reserved.

continue to run on old OSs that run as a guest operating systems on VMs. ©

12

PerformancePerformance ModelingModeling ofof VirtualizedVirtualized EnvironmentsEnvironments

Use Queuing Network (QN) models:

– Customer classes

– Parameters: service demands and workload intensities

– Service Demand Law: D i,r = U i,r / X 0,r

© 2005 D.A. Menascé. All Rights Reserved.

– Service Demand Law: D i , r = U i , r / X 0

13

QueuingQueuing NetworkNetwork ModelsModels

CPU
CPU
Queuing Queuing Network Network Models Models CPU Disk 1 Disk n © 2005 D.A. Menascé .
Queuing Queuing Network Network Models Models CPU Disk 1 Disk n © 2005 D.A. Menascé .

Disk 1

Queuing Queuing Network Network Models Models CPU Disk 1 Disk n © 2005 D.A. Menascé .

Disk n

Queuing Network Network Models Models CPU Disk 1 Disk n © 2005 D.A. Menascé . All

© 2005 D.A. Menascé. All Rights Reserved.

Input parameters per class:

• workload intensity (e.g., arrival rates, concurrency levels)

• service demands per device (i.,e, total time spent by a transaction receiving service from that device)

Solution techniques:

•“Performance by Design,” Menasce, Almeida, and Dowdy, Prentice Hall,

2004.

that device) Solution techniques: •“Performance by Design,” Menasce, Almeida, and Dowdy, Prentice Hall, 2004. 14

14

ServiceService DemandDemand (D)(D)

Service demand = Total service time received by a request over all visits to a
Service demand =
Total service time received
by a request over
all visits to a resource
S 1
S 2
.
.
.
S k
Completing
Arriving requests
requests
LINE
Resource

S k : Service time received by the request during visit k D: Service demand = S1 + S2 + + Sk

© 2005 D.A. Menascé. All Rights Reserved.

by the request during visit k D: Service demand = S1 + S2 + … +

15

ComputingComputing ServiceService DemandsDemands usingusing thethe ServiceService DemandDemand LawLaw

• The service demand D i is given by:

D i = U i / X o

service demand D i is given by: D i = U i / X o where

where U i is the utilization of resource i and X o the system throughput.

© 2005 D.A. Menascé. All Rights Reserved.

i is the utilization of resource i and X o the system throughput. © 2005 D.A.

16

PerformancePerformance ModelingModeling ofof VirtualizedVirtualized EnvironmentsEnvironments

• Use Queuing Network (QN) models:

Customer classes

Parameters: service demands and workload intensities

Service Demand Law: D i,r = U i,r / X 0,r

• Issue: How to combine measurements obtained from measurements tools at different software layers of a virtualized environment?

© 2005 D.A. Menascé. All Rights Reserved.

tools at different software layers of a virtualized environment? © 2005 D.A. Menascé . All Rights

17

ParameterParameter ComputationComputation

420 sec of CPU 220 sec of CPU 18
420 sec of CPU
220 sec of CPU
18

Ucpu for vm1:

0.4*

420/(420+220)

= 0.2625

Ucpu=40% U =35% D1 U =45% D2
Ucpu=40%
U
=35%
D1
U
=45%
D2

© 2005 D.A. Menascé. All Rights Reserved.

ParameterParameter ComputationComputation

420 sec of CPU 220 sec of CPU 19
420 sec of CPU
220 sec of CPU
19

Ucpu for vm2:

0.4*

220/(420+220)

= 0.1375

Ucpu=40% U =35% D1 U =45% D2
Ucpu=40%
U
=35%
D1
U
=45%
D2

© 2005 D.A. Menascé. All Rights Reserved.

ParameterParameter ComputationComputation

U cpu for vm1:

0.4*

420/(420+220)

= 0.2625

290 sec CPU 100 sec CPU 420 sec of CPU 220 sec of CPU 20
290 sec CPU
100 sec CPU
420 sec of CPU
220 sec of CPU
20

U cpu of TPM:

0.2625 *

290/(290+100)=

0.1952

Ucpu=40% U =35% D1 U =45% D2
Ucpu=40%
U
=35%
D1
U
=45%
D2

© 2005 D.A. Menascé. All Rights Reserved.

U cpu of TPM:

0.2625 *

290/(290+100)=

0.1952

ParameterParameter ComputationComputation

290 sec CPU 100 sec CPU 420 sec of CPU 220 sec of CPU 21
290 sec CPU
100 sec CPU
420 sec of CPU
220 sec of CPU
21

U cpu of Query:

0.1952 *

110/(110+150)=

0.0826

5400 Q 1200 U Q: 110 sec CPU U: 150 sec CPU
5400
Q
1200
U
Q: 110 sec CPU
U: 150 sec CPU
Ucpu=40% U =35% D1 U =45% D2
Ucpu=40%
U
=35%
D1
U
=45%
D2

© 2005 D.A. Menascé. All Rights Reserved.

U cpu of Query:

0.1952 *

110/(110+150)=

0.0826

ParameterParameter ComputationComputation

290 sec CPU 100 sec CPU 420 sec of CPU 220 sec of CPU 22
290 sec CPU
100 sec CPU
420 sec of CPU
220 sec of CPU
22

Query throughput:

5400 / 1800 = 3tps

CPU demand for Q:

0.0826/3=0.0275 sec

5400 Q 1200 U Q: 110 sec CPU U: 150 sec CPU
5400
Q
1200
U
Q: 110 sec CPU
U: 150 sec CPU
Ucpu=40% U =35% D1 U =45% D2
Ucpu=40%
U
=35%
D1
U
=45%
D2

© 2005 D.A. Menascé. All Rights Reserved.

ServerServer ConsolidationConsolidation

Server Server Consolidation Consolidation 3-server scenario consolidated server scenario © 2005 D.A. Menascé . All

3-server

scenario

consolidated server scenario

© 2005 D.A. Menascé. All Rights Reserved.

23

ServerServer ConsolidationConsolidation

Server Server Consolidation Consolidation © 2005 D.A. Menascé . All Rights Reserved. 24

© 2005 D.A. Menascé. All Rights Reserved.

Server Server Consolidation Consolidation © 2005 D.A. Menascé . All Rights Reserved. 24

24

ServerServer ConsolidationConsolidation

Server Server Consolidation Consolidation Physical disks Logical disks © 2005 D.A. Menascé . All Rights Reserved.

Physical disks

Logical disks

© 2005 D.A. Menascé. All Rights Reserved.

25

ServerServer ConsolidationConsolidation ComputingComputing ServiceService DemandsDemands

Computing Computing Service Service Demands Demands cons D CPU , r = Service demand at the

cons D CPU , r

=

Service demand at the CPU of the consolidated server for class r applications.

© 2005 D.A. Menascé. All Rights Reserved.

Number of original servers

Slowdown factor

Rights Reserved. Number of original servers Slowdown factor S ∑ D CPU s , r ×
Rights Reserved. Number of original servers Slowdown factor S ∑ D CPU s , r ×

S

D CPU s , r × S v / C s

s= 1

S ∑ D CPU s , r × S v / C s s = 1

Service demand at the CPU of original server s for class r applications.

Speedup of consolidated server relative to individual server s

26

27 © 2005 D.A. Menascé . All Rights Reserved.

27

© 2005 D.A. Menascé. All Rights Reserved.

28 For a Cs = 1, the response time is 3.6 times higher. © 2005

28

For a Cs = 1, the response time is 3.6 times higher.

© 2005 D.A. Menascé. All Rights Reserved.

For a Cs = 2.5, the response time is only 4% higher.
For a Cs = 2.5, the response time is only
4% higher.

29

© 2005 D.A. Menascé. All Rights Reserved.

ConcludingConcluding RemarksRemarks

• Many vendors are adopting virtualization solutions:

– Sun’s zones in Solaris 10

IBM’s Logical Partitioning (LPAR)

Intel’s Virtualization Technology: hardware support for virtualization.

Additional instructions that can be used by the VMM to create and support VMs.

The VMM runs one level below ring 0 and the VMs execute at ring 0

Xen (Open Source)

EMC’s VMWare

Microsoft Virtual Server 2005 R2

(Open Source) – EMC’s VMWare – Microsoft Virtual Server 2005 R2 30 © 2005 D.A. Menascé

30

© 2005 D.A. Menascé. All Rights Reserved.

ConcludingConcluding RemarksRemarks (cont(contd)d)

Two main directions in virtualization:

Full virtualization: the VMM provides an identical abstraction of the underlying hardware. However, not all architectures are virtualizable (e.g., x86).

No changes required to the guest OSs

Example: VMware

– Paravirtualization: the VMM provides an “almost” identical abstraction of the underlying hardware. The abstraction implements some new instructions to make the machine virtualizable.

Guest OSs need to be modified.

Better performance than full virtualization.

Examples: Xen and Denali

© 2005 D.A. Menascé. All Rights Reserved.

Better performance than full virtualization. • Examples: Xen and Denali © 2005 D.A. Menascé . All

31

Questions?Questions?

www.cs.gmu.edu/faculty/menasce.html

© 2005 D.A. Menascé. All Rights Reserved.

Questions? Questions? www.cs.gmu.edu/faculty/menasce.html © 2005 D.A. Menascé . All Rights Reserved. 32

32