14
COMP25212: COMP25212: Virtualization 3 Virtualization 3 Subtitle: “What can we do to a VM?” Learning Objectives: – To understand the VM-handling mechanisms of a hypervisor – To understand how many different value-added services are constructed on top of VM-handling mechanisms COMP25212 1 Feb 2013

COMP25212: Virtualization 3 Subtitle: “What can we do to a VM?” Learning Objectives: –To understand the VM-handling mechanisms of a hypervisor –To understand

Embed Size (px)

Citation preview

Page 1: COMP25212: Virtualization 3 Subtitle: “What can we do to a VM?” Learning Objectives: –To understand the VM-handling mechanisms of a hypervisor –To understand

COMP25212: COMP25212: Virtualization 3Virtualization 3

Subtitle: “What can we do to a VM?”

Learning Objectives:– To understand the VM-handling

mechanisms of a hypervisor

– To understand how many different value-added services are constructed on top of VM-handling mechanisms

COMP25212 1Feb 2013

Page 2: COMP25212: Virtualization 3 Subtitle: “What can we do to a VM?” Learning Objectives: –To understand the VM-handling mechanisms of a hypervisor –To understand

Stopping a VMStopping a VM

Hypervisor stops and starts VM all the time:– to share CPUs– to serialize access to

resources

• Stop by:– Saving CPU registers

into Hypervisor data area

COMP25212 2

ApplicationsApplications

Guest AOperating System

Guest AOperating System

Virtual Machine Monitor/HypervisorVirtual Machine Monitor/Hypervisor

ApplicationsApplications

Host HardwareHost Hardware

Guest BOperating System

Guest BOperating System

Virtualized

Feb 2013

Page 3: COMP25212: Virtualization 3 Subtitle: “What can we do to a VM?” Learning Objectives: –To understand the VM-handling mechanisms of a hypervisor –To understand

Starting a VMStarting a VM

• Hypervisor:– gains control (e.g.

clock tick)– saves previous VM’s

CPU registers– loads next VM’s

CPU registers– jumps to next VM’s

next-PC (in correct privilege state)

COMP25212 3

ApplicationsApplications

Guest AOperating System

Guest AOperating System

Virtual Machine Monitor/HypervisorVirtual Machine Monitor/Hypervisor

ApplicationsApplications

Host HardwareHost Hardware

Guest BOperating System

Guest BOperating System

Virtualized

Feb 2013

Page 4: COMP25212: Virtualization 3 Subtitle: “What can we do to a VM?” Learning Objectives: –To understand the VM-handling mechanisms of a hypervisor –To understand

VM State While VM State While StoppedStopped

VM State:– Memory (all guest

physical memory)• includes Application

state, OS state

– CPU state (registers)– Small amount of I/O

state• Let’s stop VM when

I/O is quiescent!

COMP25212 4

ApplicationsApplications

Guest AOperating System

Guest AOperating System

Virtual Machine Monitor/HypervisorVirtual Machine Monitor/Hypervisor

ApplicationsApplications

Host HardwareHost Hardware

Guest BOperating System

Guest BOperating System

Virtualized

Feb 2013

Page 5: COMP25212: Virtualization 3 Subtitle: “What can we do to a VM?” Learning Objectives: –To understand the VM-handling mechanisms of a hypervisor –To understand

““Freeze” a VMFreeze” a VM

• Once suspended, the VM image is self-contained– VM can be (e.g.)

copied to a file(LARGE file!)

• Now, what else can we do with this?

COMP25212 5

ApplicationsApplications

Guest AOperating System

Guest AOperating System

CPU registersCPU registers

I/O stateI/O state

Feb 2013

Page 6: COMP25212: Virtualization 3 Subtitle: “What can we do to a VM?” Learning Objectives: –To understand the VM-handling mechanisms of a hypervisor –To understand

Move a VMMove a VM

COMP25212 6

ApplicationsApplications

Guest AOperating System

Guest AOperating System

Virtual Machine Monitor/HypervisorVirtual Machine Monitor/Hypervisor

ApplicationsApplications

Host Hardware XHost Hardware X

Guest BOperating System

Guest BOperating System

Virtualized

Virtual Machine Monitor/HypervisorVirtual Machine Monitor/Hypervisor

ApplicationsApplications

Guest COperating System

Guest COperating System

Virtualized

Host Hardware YHost Hardware Y

ApplicationsApplications

Guest BOperating System

Guest BOperating System

Feb 2013

Page 7: COMP25212: Virtualization 3 Subtitle: “What can we do to a VM?” Learning Objectives: –To understand the VM-handling mechanisms of a hypervisor –To understand

Snapshot and Rollback Snapshot and Rollback a VMa VM

COMP25212 7

ApplicationsApplications

Guest AOperating System

Guest AOperating System

Virtual Machine Monitor/HypervisorVirtual Machine Monitor/Hypervisor

ApplicationsApplications

Host HardwareHost Hardware

Guest BOperating System

Guest BOperating System

Virtualized

Think: Optimizations?Feb 2013

ApplicationsApplications

Guest BOperating System

Guest BOperating System

Snapshot 1

ApplicationsApplications

Guest BOperating System

Guest BOperating System

Snapshot n

Page 8: COMP25212: Virtualization 3 Subtitle: “What can we do to a VM?” Learning Objectives: –To understand the VM-handling mechanisms of a hypervisor –To understand

Archive a VMArchive a VM

COMP25212 8

ApplicationsApplications

Guest BOperating System

Guest BOperating System

ApplicationsApplications

Guest BOperating System

Guest BOperating System

Feb 2013

Page 9: COMP25212: Virtualization 3 Subtitle: “What can we do to a VM?” Learning Objectives: –To understand the VM-handling mechanisms of a hypervisor –To understand

Rapid ProvisioningRapid Provisioning

COMP25212 9

Virtual Machine Monitor/HypervisorVirtual Machine Monitor/Hypervisor

ApplicationsApplications

Host HardwareHost Hardware

Guest COperating System

Guest COperating System

Virtualized

ApplicationsApplications

Guest BOperating System

Guest BOperating System

Feb 2013

Page 10: COMP25212: Virtualization 3 Subtitle: “What can we do to a VM?” Learning Objectives: –To understand the VM-handling mechanisms of a hypervisor –To understand

Virtual AppliancesVirtual Appliances

• http://www.vmware.com/appliances/directory/

• over 1000 downloadable appliances

COMP25212 10

ApplicationsApplications

Guest BOperating System

Guest BOperating System

ApplicationsApplications

Guest BOperating System

Guest BOperating System

ApplicationsApplications

Guest BOperating System

Guest BOperating System

ApplicationsApplications

Guest BOperating System

Guest BOperating System

ApplicationsApplications

Guest BOperating System

Guest BOperating System

ApplicationsApplications

Guest BOperating System

Guest BOperating System

ApplicationsApplications

Guest BOperating System

Guest BOperating System

ApplicationsApplications

Guest BOperating System

Guest BOperating System

• e.g.:• mail server• web server• hotel system• virus scanner• firewall

Feb 2013

Page 11: COMP25212: Virtualization 3 Subtitle: “What can we do to a VM?” Learning Objectives: –To understand the VM-handling mechanisms of a hypervisor –To understand

Deploying Secure Deploying Secure DesktopsDesktops

COMP25212 11

Virtual Machine Monitor/HypervisorVirtual Machine Monitor/Hypervisor

Host HardwareHost Hardware

Virtualized Desktop Machine

ApplicationsApplications

Guest Operating System

Guest Operating System

Feb 2013

Page 12: COMP25212: Virtualization 3 Subtitle: “What can we do to a VM?” Learning Objectives: –To understand the VM-handling mechanisms of a hypervisor –To understand

Live MigrationLive 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”

COMP25212 12Feb 2013

Page 13: COMP25212: Virtualization 3 Subtitle: “What can we do to a VM?” Learning Objectives: –To understand the VM-handling mechanisms of a hypervisor –To understand

Load BalancingLoad 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!

COMP25212 13Feb 2013

Page 14: COMP25212: Virtualization 3 Subtitle: “What can we do to a VM?” Learning Objectives: –To understand the VM-handling mechanisms of a hypervisor –To understand

High AvailabilityHigh 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!

COMP25212 14Feb 2013