You are on page 1of 39

Virtualization and Cloud Computing

Vera Asodi
VMware

© 2010 VMware Inc. All rights reserved


What is Virtualization?

 Virtualization is a technology that


allows you to transform hardware into
software

 Virtualization allows you to run


multiple operating systems
simultaneously on a single computer

2
History

 1960’s - IBM implemented virtualization as a way to logically partition


mainframe computers into separate virtual machines to enable
multitasking.

 1960’s - MIT – Project ‘MAC’ – aimed to design and implement a better


time sharing system.

 1990’s – VMware invented x86 based architecture virtualization.

3
Virtual Machine

4
Traditional vs. Virtual Architecture

Traditional Architecture Virtual Architecture

5
Benefits of Virtualization

 Encapsulation - VMs can be described in a file


• Possible to ‘snapshot’
• Easy to move

 Enables running multiple operating systems

 Consolidation & use of unused computation power

 Resource management

 High availability & disaster recovery

 Create “Base Environment”

 Safe testing of new software

 Easy Management

6
Virtual Center

7
Types of Virtualization

Hosted Bare Metal

VMM APP APP

Host OS VMM

 VMware player  Sun VirtualBox  VMware ESX


 VMware workstation  QEMU  Microsoft Hyper-V
 Microsoft virtual PC  KVM  XEN

8
Types of Virtualization (cont.)

Hosted Bare Metal


 Virtualization installs like  Better performance with lower
application rather than like OS overhead

 Can run alongside conventional  Highly efficient direct I/O pass-


applications through architecture for network and
disk
 Avoid code duplication – OS
already has process scheduler,  Complete control over hardware
memory management, device
support etc.
 Advanced features like live migration
available
 More suitable for personal users
 Suitable for production environments

9
Running a VM

 The Virtual Machine Monitor (VMM) or Hypervisor is the software layer


that runs the VMs.

 There are several ways of doing that.

10
Emulation

 Emulation:
• Do what the CPU does in SW.
• Example:
addl %ebx, %eax
is emulated as:
enum {EAX=0, EBX=1, ECX=2, EDX=3, …};
unsigned long regs[8];
regs[EAX] += regs[EBX];

 Pro: simple

 Con: slow

 Instead of emulation, it would be more efficient to run the VM directly on


the host CPU.

11
The Difficulty of Virtualization

Traditional Architecture Bare Metal Virtualized Architecture

Ring 3 User Apps Ring 3 User Apps

Ring 2 Ring 2

Ring 1 Ring 1 Guest OS

Ring 0 OS Ring 0 VMM

Host Computer Host Computer


System Hardware System Hardware

The problem: the guest OS runs in ring 1, while some privileged


instructions need to run in ring 0.

12
Trap and Emulate

 Run the VM directly on the host CPU.

 Trap and emulate sensitive instructions.

 Pros:
• Efficient

 Cons:
• Harder to implement
• Need hardware support - not all sensitive instructions cause a trap
when executed in a non-privileged mode.

13
Binary Translation

 Run the VM directly on the host CPU.

 The VMM takes a block of binary instructions that are about to be


executed and dynamically translates it into safe instructions.

 Translation:
• Most of the instructions translate identically.
• Sensitive instructions are translated into safe ones.

 Pros:
• More efficient than emulation
• No need for hardware support

 Cons:
• Less efficient than trap and emulate
• Hard to implement

14
Paravirtualization

 The OS of the VM is modified so that it calls the hypervisor when it has


to execute sensitive instructions.

 Pros:
• Efficient
• No need for hardware support

 Cons:
• Need a modified version of the guest OS, that is aware to the fact that
it runs on a VM.

15
Running a VM - Summary

 Emulation and binary translation:


• No need for modification of HW or guest OS.
• Emulation – slow, binary translation – more efficient.

 Trap and emulate:


• HW modification is required.
• Improved performance.

 Paravirtualization:
• OS modified and aware.
• Improved performance.

 The technologies used in the industry are mainly trap and emulate and
binary translation, or a combination of both.

16
I/O Virtualization

 Types of I/O:
• Block (hard disk)
• Network
• User input: keyboard, mouse
• Sound
• Video

 Most performance critical:


• Block
• Network

17
NIC – Network Interface Card

 The NIC is responsible for transmitting and receiving


packets through the network.

 The packets that are transmitted and received are


written in the memory.

 There are registers to which the driver writes the


instructions to the NIC.

 The NIC sends interrupts to the host when it finishes its


task.

18
I/O Virtualization - Emulation

 Hypervisor implements a virtual NIC (by the


specification of a real NIC, e.g., Intel, Realtek,
Broadcom).

 NIC registers are variables. vNICs

 The hypervisor passes the instructions to the


registers of the physical NIC. Hypervisor

 When physical NIC interrupts, hypervisor injects


the interrupt into guest.
pNIC

19
I/O Virtualization – Emulation (cont.)

 Pros:
• Unmodified guest (guest already has drivers for Intel NICs…).

 Cons:
• Slow – every access to every NIC register causes a VM exit (trap to
hypervisor).
• Hypervisor needs to emulate complex hardware.

20
I/O Virtualization - Paravirtualization

 Add virtual NIC driver into guest (frontend).

 Implement the virtual NIC in the hypervisor


(backend).
vNICs
 Everything works just like in the emulation
case…
Hypervisor
 …except – protocol between frontend and
backend

pNIC

21
I/O Virtualization – Paravirtualization (cont.)

 Paravirtual protocol:
• Instead of writing to registers, guest calls the hypervisor, passes it start
address and length as arguments
• Hypervisor knows what it should do

 Paravirtual protocol can be high-level, e.g., ring of buffers to transmit (so


NIC doesn’t stay idle after one transmission), and independent of
particular NIC registers

 Pro: fast – no need to emulate physical device

 Con: requires guest driver

22
I/O Virtualization – Direct Access

 “Pull” NIC out of the host, and “plug” it into the


guest.

 Guest is allowed to access NIC registers


directly, no hypervisor intervention. vNICs

 Host cannot access NIC anymore.


Hypervisor
 Pros:
• As fast as possible
pNICs
 Cons:
• Need NIC per guest (plus one for host).
• Cannot encapsulate guest packets, monitor or
modify them at the hypervisor level.

23
I/O Virtualization – SR-IOV

 Single Root I/O Virtualization

 Contains a physical function controlled by the


host, used to create multiple virtual functions.
vNICs
 Each virtual function is assigned to a guest (like
in direct assignment).
Hypervisor
 Each guest thinks it has full control of the NIC,
accesses registers directly (like in direct
access).
pNIC
 The NIC does multiplexing/demultiplexing of
traffic.

24
I/O Virtualization – SR-IOV (cont.)

 Pros:
• As fast as possible
• Need only one NIC (as opposed to direct assignment)

 Cons:
• Few hypervisors fully support it
• Expensive
• Requires new hardware
• Cannot encapsulate guest packets, monitor or modify them at the
hypervisor level.

25
Live Migration

HP HP
1 2 P o
r L ia n t 1 2 P o
r L ia n t
1 2 OP
M
E
T R
E
V 1 5 D L 3 8 0 G6 1 2 OP
M
E
T R
E
V 1 5 D L 3 8 0 G6
O WE
P R P O WE
R O WE
P R P O WE
R
Y
L
P
U
S Y
L
P
U
S OC
L
R
E
T
IN K R
E
Y
A
L
P Y
L
P
U
S Y
L
P
U
S OC
L
R
E
T
IN K R
E
Y
A
L
P
O WE
P RCP
A O WE
P RCP
A
D IM M S D IM M S
A 3
1 G E7
5 C i 9
9 i 7
C E3
5 G 1 A A 3
1 G E7
5 C i 9
9 i 7
C E3
5 G 1 A

2 6 2 6

D4
2 B6
H F
8 F 6
8 H B2
4 D D4
2 B6
H F
8 F 6
8 H B2
4 D
1 ON
E
R
A
P
S IE
L 2 1 ON
E
R
A
P
S IE
L 2

R O C M IR
P OR ROC
P R O C M IR
P OR ROC
P
N S
A
F 3 7 N S
A
F 3 7
1 2 3 4 5 6 1 2 3 4 5 6

4 8 4 8

26
Global Performance Optimization

HP HP
1 2 P o
r L ia n t 1 2 P o
r L ia n t
1 2 OP
M
E
T R
E
V 1 5 D L 3 8 0 G6 1 2 OP
M
E
T R
E
V 1 5 D L 3 8 0 G6
O WE
P R P O WE
R O WE
P R P O WE
R
Y
L
P
U
S Y
L
P
U
S OC
L
R
E
T
IN K R
E
Y
A
L
P Y
L
P
U
S Y
L
P
U
S OC
L
R
E
T
IN K R
E
Y
A
L
P
O WE
P RCP
A O WE
P RCP
A
D IM M S D IM M S
A 3
1 G E7
5 C i 9
9 i 7
C E3
5 G 1 A A 3
1 G E7
5 C i 9
9 i 7
C E3
5 G 1 A

2 6 2 6
D4
2 B6
H F
8 F 6
8 H B2
4 D D4
2 B6
H F
8 F 6
8 H B2
4 D
1 ON
E
R
A
P
S IE
L 2 1 ON
E
R
A
P
S IE
L 2

R O C M IR
P OR ROC
P R O C M IR
P OR ROC
P
N S
A
F 3 7 N S
A
F 3 7
1 2 3 4 5 6 1 2 3 4 5 6

4 8 4 8

Imbalanced
Balanced
Giant Computer

HP
Heavy Load 1 2
HP
P o
r L a
i n t

1 2 P o
r L ia n t 1 2 OP
M
E
T R
E
V 1 5 D L 3 8 0 G6
O WE
P R P O WE
R
1 2 OP
M
E
T R
E
V 1 5 D L 3 8 0 G6 S
Y
L
P
U Y
L
P
U
S OC
L
R
E
T
IN K R
E
Y
A
L
P
O WE
P R P O WE
R O WE
P RAC
P
Y
L
P
U
S Y
L
P
U
S OC
L
R
E
T
IN K R
E
Y
A
L
P D IM M S
O WE
P RCP
A A 3
1 G E7
5 C i 9
9 i 7
C E3
5 G 1 A
D IM M S
A 3
1 G E7
5 C i 9
9 i 7
C E3
5 G 1 A 2 6

2 6 D4
2 B6
H F
8 F 6
8 H B2
4 D
1 ON
E
R
A
P
S IE
L 2
D4
2 BH
6 8
F F 6
8 H BD
4 2
1 ON
E
R
A
P
S IE
L 2 R O C M IR
P OR ROC
P
N S
A
F 3 7

Lighter Load
R O C M IR
P OR ROC
P 1 2 3 4 5 6
N S
A
F 3 7
1 2 3 4 5 6

4 8

4 8

27
Global Power Optimization

20% Average
Power Savings

HHP P HP
11 22 P Pro roL Lia ian nt t 1 2 P o
r L ia n t
11 22 OT
M
E
TOP
M
ERP
E
V R
E
V 11 55 DDL L3 38 80 0GG6 6 1 2 OP
M
E
T R
E
V 1 5 D L 3 8 0 G6
OP
P OWEWE
RR POPOWE
WE
RR O WE
P R P O WE
R
YS
L
P
U
S Y
L
P
U YS
L
P
U
S Y
L
P
U OIN
L
R
E
T
INOC
L
R
E
TKCK RP
E
Y
A
L
P R
E
Y
A
L Y
L
P
U
S Y
L
P
U
S OC
L
R
E
T
IN K R
E
Y
A
L
P
OP
P OWEWE
RRC
PC
AP
A O WE
P RCP
A
DDIMIMMMSS D IM M S
A1
1 A3
G3G 5E5
E7
C7C 9
i9i9
i9i7
C7C 5 E5
E3
G3G 1 A1
A A 3
1 G E7
5 C i 9
9 i 7
C E3
5 G 1 A

22 66 2 6

D2
2 D4
B4B6
H6H 8
F8F F8
8 F6
H6H 4
B4B2
D2D D4
2 B6
H F
8 F 6
8 H B2
4 D
11 SOS
E
R
A
P ON
E
R
A
PIEN
L IE
L 22 1 ON
E
R
A
P
S IE
L 2

RP
PROOCC MMIR
OIR
ORR RP
PROOCC R O C M IR
P OR ROC
P
NF
A
FNSS
A 33 77 N S
A
F 3 7
11 22 33 44 55 66 1 2 3 4 5 6

44 88 4 8

P WE
O
Y
L
P
U
S
O WE
P

A 3
1 G
RA
1
R P

C
P
U
S

E7
5 C
2
O WE
Y
L
P
R
1

i 9
9 i 7
C
2

OP
M
E
T R
E
V

OC
L
R
E
T
IN

E3
5
K

D IM M S
G 1 A
1 5

R
E
Y
A
L
P
HP
P o
r L ia n t

D L 3 8 0 G6 PWR APPs P WE
O
Y
L
P
U
S
O WE
P

A 3
1 G
RA
1
R P

C
P
Y
L
P
U
S

E7
5 C
2
O WE
R
1

i 9
9 i 7
C
2

OP
M
E
T R
E
V

OC
L
R
E
T
IN

E3
5
K

D IM M S
G 1 A
1 5

R
E
Y
A
L
P
HP
P o
r L ia n t

D L 3 8 0 G6

2 6 2 6

D4
2 B6
H F
8 F 6
8 H B2
4 D D4
2 B6
H F
8 F 6
8 H B2
4 D
1 ON
E
R
A
P
S IE
L 2 1 ON
E
R
A
P
S IE
L 2

R O C M IR
P OR ROC
P R O C M IR
P OR ROC
P
N S
A
F 3 7 N S
A
F 3 7
1 2 3 4 5 6 1 2 3 4 5 6

4 8 4 8

28
Live Migration

HP HP
1 2 P o
r L ia n t 1 2 P o
r L ia n t
1 2 OP
M
E
T R
E
V 1 5 D L 3 8 0 G6 1 2 OP
M
E
T R
E
V 1 5 D L 3 8 0 G6
O WE
P R P O WE
R O WE
P R P O WE
R
Y
L
P
U
S Y
L
P
U
S OC
L
R
E
T
IN K R
E
Y
A
L
P Y
L
P
U
S Y
L
P
U
S OC
L
R
E
T
IN K R
E
Y
A
L
P
O WE
P RCP
A O WE
P RCP
A
D IM M S D IM M S
A 3
1 G E7
5 C i 9
9 i 7
C EG
5 3 A
1 A 3
1 G E7
5 C i 9
9 i 7
C EG
5 3 A
1

2 6 2 6

D4
2 B6
H F
8 F 6
8 H B2
4 D D4
2 B6
H F
8 F 6
8 H B2
4 D
1 ON
E
R
A
P
S IE
L 2 1 ON
E
R
A
P
S IE
L 2

R O C M IR
P OR ROC
P R O C M IR
P OR ROC
P
N S
A
F 3 7 N S
A
F 3 7
1 2 3 4 5 6 1 2 3 4 5 6

4 8 4 8

State

1
Continue until n
is small enough 2
(depends on the
desired downtime)

n

29
HW/SW Separation

30
Cloud Computing

31
Cloud Computing

 Abstract the technology infrastructure

 The user doesn’t have to know

 There is a compute power out there available for use

 Flexible * Dynamic * On Demand * Efficient


32
Principles of Cloud Computing

Internal Cloud

 The user should focus on the Application

 All the rest is taken care of by the Cloud Provider

33
Types of Clouds

 SaaS – Software as a Service

 IaaS – Infrastructure as a Service

 PaaS – Platform as a Service

34
SaaS

 Software as a Service

 Examples: Gmail, Salesforce.com

 The cloud provider provides a SW that is available for use over the
internet.

 The user only pays for usage rather than buy the SW.

 The user does not have to worry about installation, upgrades, and the
infrastructure needed for the SW.

35
IaaS

 Infrastructure as a Service

 Example: Amazon EC2

 The cloud provider provides the user a computer with CPU, memory,
storage, network, etc. that is available for use through the internet.

 The user pays for the CPU cycles and network usage.

 The user does not have to buy the HW and provide the space, electricity
maintenance, etc.

 Very suitable for startups.

36
PaaS

 Platform as a Service

 Example: Google’s App Engine

 The cloud provider provides not only the


infrastructure but also the application stack
(e.g. JVM, web server, development and
testing tools).

 The user needs only to add the code.

37
Benefits of Cloud Computing

 Tap into external computing power quickly, as needed

 Accessible using standard internet protocols

 Consumption based pricing - reduced costs

 Lower maintenance costs

 High availability

 Scalability

 Improved economics due to shared


infrastructure

 Eco-friendly

38
39

You might also like