Virtualization 3

Download Report

Transcript Virtualization 3

COMP25212
VIRTUALIZATION 3
Sergio Davies
[email protected]
Feb/Mar 2014
COMP25212 – Virtualization 3
Learning objectives
Subtitle: “What can we do to a VM?”
Learning Objectives:
– To understand the VM-handling
mechanisms of a hypervisor
– To understand how many different valueadded services are constructed on top of
VM-handling mechanisms
Feb/Mar 2014
COMP25212 – Virtualization 3
2
Starting a VM
• Hypervisor:
Applications
Applications
– gains control (e.g.
Guest A
Guest B
clock tick)
Operating System
Operating System
– saves previous
Virtual Machine Monitor/Hypervisor
VM’s CPU registers
– loads next VM’s
Host Hardware
CPU registers
Virtualized
– jumps to next VM’s next-PC
(in correct privilege state)
Feb/Mar 2014
COMP25212 – Virtualization 3
3
Stopping a VM
Stop by:
• Saving CPU registers
into Hypervisor data
area
Hypervisor stops
and starts VM all
the time:
Applications
Applications
Guest A
Operating System
Guest B
Operating System
Virtual Machine Monitor/Hypervisor
Host Hardware
– to share CPUs
– to serialize access to resources
Feb/Mar 2014
COMP25212 – Virtualization 3
Virtualized
4
VM State While
Stopped
VM State:
– Memory (all guest
physical memory)
• Includes: Application
state, OS state
Applications
Applications
Guest A
Operating System
Guest B
Operating System
Virtual Machine Monitor/Hypervisor
– CPU state
(registers)
– Small amount of I/O state
Host Hardware
Virtualized
• Let’s stop VM when I/O is quiescent!
Feb/Mar 2014
COMP25212 – Virtualization 3
5
“Freeze” a VM
• Once suspended, the
VM image is selfcontained
– VM can be (e.g.)
copied to a file
Applications
Guest A
Operating System
CPU registers
I/O state
(LARGE file!)
• Now, what else can
we do with this?
Feb/Mar 2014
COMP25212 – Virtualization 3
6
Move a VM
Applications
Applications
Applications
Applications
Guest A
Operating System
Guest B
Operating System
Guest B
Operating System
Guest C
Operating System
Virtual Machine Monitor/Hypervisor
Virtual Machine Monitor/Hypervisor
Host Hardware X
Host Hardware Y
Virtualized
Virtualized
Feb/Mar 2014
COMP25212 – Virtualization 3
7
Snapshot and Rollback
a VM
Applications
Applications
Applications
Guest A
Operating System
Guest B
Operating System
Virtual Machine Monitor/Hypervisor
Guest B
Operating System
Snapshot 1
…
Host Hardware
Applications
Virtualized
Think: Optimizations?
Feb/Mar 2014
COMP25212 – Virtualization 3
Guest B
Operating System
Snapshot n
8
Archive a VM
Applications
Applications
Guest B
Operating System
Feb/Mar 2014
COMP25212 – Virtualization 3
Guest B
Operating System
9
Rapid Provisioning
Applications
Guest B
Operating System
Applications
Guest C
Operating System
Virtual Machine Monitor/Hypervisor
Host Hardware
Virtualized
Feb/Mar 2014
COMP25212 – Virtualization 3
10
Virtual Appliances
• http://www.vmware.com/appliances/directory/
• over 1000 downloadable appliances
Applications
Applications
Applications
Applications
Guest
Guest B
B
Applications
Guest
B
Applications
Guest
B System
Operating
Operating
Applications
Operating
Guest
B
Applications
Operating
Guest
B
System
Guest
BSystem
Operating
Guest
BSystem
Operating
Operating
System
Operating
System
System
System
Feb/Mar 2014
• e.g.:
• mail server
• web server
• hotel system
• virus scanner
• firewall
COMP25212 – Virtualization 3
11
Deploying Secure
Desktops
Applications
Guest Operating
System
Virtual Machine Monitor/Hypervisor
Host Hardware
Virtualized Desktop Machine
Feb/Mar 2014
COMP25212 – Virtualization 3
12
Live Migration
• Optimizing live migration from “source” to
“destination” VMM:
– Copy every page from “source” to “destination” machine
• reset “dirty” bit in VMM’s page table for every page copied
– Repeat:
• Find next non-“dirty” page in “source” machine
• Copy to “destination” machine and reset “dirty” bit
– Until only minimal subset of pages left
– Suspend VM on “source”
– Copy remaining pages to “destination”
– Resume VM on “destination”
Feb/Mar 2014
COMP25212 – Virtualization 3
13
Load Balancing
• Management software monitors “load”
on all physical machines
• If loads are mismatched, migrate a VM
from a loaded to a less-loaded machine
Independent of Application!
Independent of Operating System!
Feb/Mar 2014
COMP25212 – Virtualization 3
14
High Availability
• For critical applications, keep a standby VM available
on a different hardware system
• Regularly copy active VM image to standby VM (but
don’t activate it)
• Activate standby VM if active VM stops responding
(VM crashes? VMM crashes? Hardware system
fails?)
Independent of Application!
Independent of Operating System!
Feb/Mar 2014
COMP25212 – Virtualization 3
15
Goals of system
virtualization
• Multiple OS running on the same
hardware
• Pre-configured virtual machines
• Load balancing
• High availability
Feb/Mar 2014
COMP25212 – Virtualization 3