Virtualization and Cloud Computing

homelybrrrInternet και Εφαρμογές Web

4 Δεκ 2013 (πριν από 3 χρόνια και 10 μήνες)

131 εμφανίσεις

© 2010 VMware Inc. All rights reserved

Virtualization and Cloud Computing

Vera Asodi

VMware

2

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

3

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.

4

Virtual Machine

5

Traditional vs. Virtual Architecture

Traditional Architecture

Virtual Architecture

6

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

7

Virtual Center

8

Types of Virtualization

VMM

Host OS

VMM

APP

Hosted

Bare Metal

APP


VMware player


VMware workstation


Microsoft virtual PC


Sun
VirtualBox


QEMU


KVM


VMware ESX


Microsoft Hyper
-
V


XEN

9


Virtualization
installs like
application rather than like
OS



Can
run alongside conventional
applications



Avoid code duplication


OS
already has process scheduler,
memory management, device
support etc.



More suitable for personal users


Better
performance with
lower
overhead



Highly
efficient direct I/O pass
-
through architecture for network
and
disk



Complete control over hardware



Advanced
features like
live migration
available



Suitable for production environments

Types of Virtualization (cont.)

Hosted

Bare Metal

10

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.

11

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.

12

The Difficulty of Virtualization

Traditional Architecture

Bare Metal Virtualized Architecture

Guest OS

VMM

User Apps

Host Computer
System Hardware

Ring 3

Ring 2

Ring 1

Ring 0

User Apps

Host Computer
System Hardware

Ring 3

Ring 2

Ring 1

Ring 0

OS

The problem: the guest OS runs in ring 1, while some privileged
instructions need to run in ring 0.

13

Trap and Emulate


Run the VM directly on the host CPU.



Trap and emulate sensitive instructions.



Pros:


E
fficient



Cons:


Harder to implement


Need hardware support
-

not all sensitive instructions cause a trap
when executed in a non
-
privileged mode.

14

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

15

Paravirtualization


The OS of the VM is modified so that it calls the hypervisor when it has
to execute sensitive instructions.



Pros:


E
fficient


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.

16

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.

17

I/O Virtualization


Types of I/O:


Block (hard disk)


Network


User input: keyboard, mouse


Sound


Video



Most performance critical:


Block


Network

18

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.

19

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.



The hypervisor passes the instructions to the
registers of the physical NIC.



When physical NIC interrupts, hypervisor injects
the interrupt into guest.


Hypervisor

vNICs

pNIC

20

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.

21

I/O Virtualization
-

Paravirtualization


Add virtual NIC driver into guest (frontend).



Implement the virtual NIC in the hypervisor
(backend).



Everything works just like in the emulation
case…



…except


protocol between frontend and
backend

Hypervisor

vNICs

pNIC

22

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

23

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.



Host cannot access NIC anymore.



Pros:


As fast as possible



Cons:


Need NIC per guest (plus one for host).


Cannot encapsulate guest packets, monitor or
modify them at the hypervisor level.

Hypervisor

vNICs

pNICs

24

Hypervisor

I/O Virtualization


SR
-
IOV


Single Root I/O Virtualization



Contains a physical function controlled by the
host, used to create multiple virtual functions.



Each virtual function is assigned to a guest (like
in direct assignment).



Each guest thinks it has full control of the NIC,
accesses registers directly (like in direct access).



The NIC does multiplexing/
demultiplexing

of
traffic.

vNICs

pNIC

25

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.

26

Live Migration

2
1
4
3
6
5
8
7
1
3
4
5
6
1
2
PROC
2
PROC
1
POWER
SUPPLY
2
POWER
SUPPLY
OVER
TEMP
INTER
LOCK
1
2
POWER
CAP
FANS
DIMMS
ONLINE
SPARE
MIRROR
1A
2D
3G
4B
5E
6H
7C
8F
9i
1A
2D
3G
4B
5E
6H
7C
8F
9i
PLAYER
HP
ProLiant
DL380G6
2
1
4
3
6
5
8
7
1
3
4
5
6
1
2
PROC
2
PROC
1
POWER
SUPPLY
2
POWER
SUPPLY
OVER
TEMP
INTER
LOCK
1
2
POWER
CAP
FANS
DIMMS
ONLINE
SPARE
MIRROR
1A
2D
3G
4B
5E
6H
7C
8F
9i
1A
2D
3G
4B
5E
6H
7C
8F
9i
PLAYER
HP
ProLiant
DL380G6
27

2
1
4
3
6
5
8
7
1
3
4
5
6
1
2
PROC
2
PROC
1
POWER
SUPPLY
2
POWER
SUPPLY
OVER
TEMP
INTER
LOCK
1
2
POWER
CAP
FANS
DIMMS
ONLINE
SPARE
MIRROR
1A
2D
3G
4B
5E
6H
7C
8F
9i
1A
2D
3G
4B
5E
6H
7C
8F
9i
PLAYER
HP
ProLiant
DL380G6
Global Performance Optimization

2
1
4
3
6
5
8
7
1
3
4
5
6
1
2
PROC
2
PROC
1
POWER
SUPPLY
2
POWER
SUPPLY
OVER
TEMP
INTER
LOCK
1
2
POWER
CAP
FANS
DIMMS
ONLINE
SPARE
MIRROR
1A
2D
3G
4B
5E
6H
7C
8F
9i
1A
2D
3G
4B
5E
6H
7C
8F
9i
PLAYER
HP
ProLiant
DL380G6
2
1
4
3
6
5
8
7
1
3
4
5
6
1
2
PROC
2
PROC
1
POWER
SUPPLY
2
POWER
SUPPLY
OVER
TEMP
INTER
LOCK
1
2
POWER
CAP
FANS
DIMMS
ONLINE
SPARE
MIRROR
1A
2D
3G
4B
5E
6H
7C
8F
9i
1A
2D
3G
4B
5E
6H
7C
8F
9i
PLAYER
HP
ProLiant
DL380G6
2
1
4
3
6
5
8
7
1
3
4
5
6
1
2
PROC
2
PROC
1
POWER
SUPPLY
2
POWER
SUPPLY
OVER
TEMP
INTER
LOCK
1
2
POWER
CAP
FANS
DIMMS
ONLINE
SPARE
MIRROR
1A
2D
3G
4B
5E
6H
7C
8F
9i
1A
2D
3G
4B
5E
6H
7C
8F
9i
PLAYER
HP
ProLiant
DL380G6
Heavy Load

Lighter Load

Imbalanced

Giant Computer

Balanced

Giant Computer

28

PWR

APPs

2
1
4
3
6
5
8
7
1
3
4
5
6
1
2
PROC
2
PROC
1
POWER
SUPPLY
2
POWER
SUPPLY
OVER
TEMP
INTER
LOCK
1
2
POWER
CAP
FANS
DIMMS
ONLINE
SPARE
MIRROR
1A
2D
3G
4B
5E
6H
7C
8F
9i
1A
2D
3G
4B
5E
6H
7C
8F
9i
PLAYER
HP
ProLiant
DL380G6
2
1
4
3
6
5
8
7
1
3
4
5
6
1
2
PROC
2
PROC
1
POWER
SUPPLY
2
POWER
SUPPLY
OVER
TEMP
INTER
LOCK
1
2
POWER
CAP
FANS
DIMMS
ONLINE
SPARE
MIRROR
1A
2D
3G
4B
5E
6H
7C
8F
9i
1A
2D
3G
4B
5E
6H
7C
8F
9i
PLAYER
HP
ProLiant
DL380G6
Global
Power Optimization

2
1
4
3
6
5
8
7
1
3
4
5
6
1
2
PROC
2
PROC
1
POWER
SUPPLY
2
POWER
SUPPLY
OVER
TEMP
INTER
LOCK
1
2
POWER
CAP
FANS
DIMMS
ONLINE
SPARE
MIRROR
1A
2D
3G
4B
5E
6H
7C
8F
9i
1A
2D
3G
4B
5E
6H
7C
8F
9i
PLAYER
HP
ProLiant
DL380G6
2
1
4
3
6
5
8
7
1
3
4
5
6
1
2
PROC
2
PROC
1
POWER
SUPPLY
2
POWER
SUPPLY
OVER
TEMP
INTER
LOCK
1
2
POWER
CAP
FANS
DIMMS
ONLINE
SPARE
MIRROR
1A
2D
3G
4B
5E
6H
7C
8F
9i
1A
2D
3G
4B
5E
6H
7C
8F
9i
PLAYER
HP
ProLiant
DL380G6
2
1
4
3
6
5
8
7
1
3
4
5
6
1
2
PROC
2
PROC
1
POWER
SUPPLY
2
POWER
SUPPLY
OVER
TEMP
INTER
LOCK
1
2
POWER
CAP
FANS
DIMMS
ONLINE
SPARE
MIRROR
1A
2D
3G
4B
5E
6H
7C
8F
9i
1A
2D
3G
4B
5E
6H
7C
8F
9i
PLAYER
HP
ProLiant
DL380G6
20%

Average
Power Savings

29

Live Migration

2
1
4
3
6
5
8
7
1
3
4
5
6
1
2
PROC
2
PROC
1
POWER
SUPPLY
2
POWER
SUPPLY
OVER
TEMP
INTER
LOCK
1
2
POWER
CAP
FANS
DIMMS
ONLINE
SPARE
MIRROR
1A
2D
3G
4B
5E
6H
7C
8F
9i
1A
2D
3G
4B
5E
6H
7C
8F
9i
PLAYER
HP
ProLiant
DL380G6
2
1
4
3
6
5
8
7
1
3
4
5
6
1
2
PROC
2
PROC
1
POWER
SUPPLY
2
POWER
SUPPLY
OVER
TEMP
INTER
LOCK
1
2
POWER
CAP
FANS
DIMMS
ONLINE
SPARE
MIRROR
1A
2D
3G
4B
5E
6H
7C
8F
9i
1A
2D
3G
4B
5E
6H
7C
8F
9i
PLAYER
HP
ProLiant
DL380G6
State


1


2


n

Continue until

n

is small enough

(depends on the

desired downtime)

30

HW/SW Separation

31

Cloud Computing

32

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


33

Principles of Cloud Computing


The user should focus on the Application



All the rest is taken care of by the Cloud Provider

Internal Cloud

34

Types of Clouds




SaaS


Software as a Service




IaaS


Infrastructure as a Service




PaaS


Platform as a Service

35

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.

36

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.

37

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.

38

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




39