Understanding Type 1 and Type 2 Hypervisors in Distributed Operating Systems, Lecture notes of Computer science

An in-depth exploration of virtualization in distributed operating systems, focusing on Type 1 and Type 2 hypervisors, their functioning, and paravirtualization. It covers topics such as CPU support, hypervisor types, virtual machine interfaces, memory virtualization, I/O virtualization, and virtual appliances.

Typology: Lecture notes

2021/2022

Uploaded on 09/27/2022

russel85
russel85 🇬🇧

4.6

(5)

285 documents

1 / 12

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS677: Distributed OS
Computer Science Lecture 6, page
Computing Parable
The Lion and the Fox
Courtesy: S. Keshav
1
Computer Science Lecture 4, page
CS677: Distributed OS
Types of Hypervisors
Type 1: hypervisor runs on “bare metal”
Type 2: hypervisor runs on a host OS
Guest OS runs inside hypervisor
Both VM types act like real hardware
2
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Understanding Type 1 and Type 2 Hypervisors in Distributed Operating Systems and more Lecture notes Computer science in PDF only on Docsity!

Computer Science CS677: Distributed OS Lecture 6, page

Computing Parable

  • The Lion and the Fox
  • Courtesy: S. Keshav 1

Types of Hypervisors

  • Type 1: hypervisor runs on “bare metal”
  • Type 2: hypervisor runs on a host OS
    • Guest OS runs inside hypervisor
  • Both VM types act like real hardware 2

Computer Science CS677: Distributed OS Lecture 4, page

How Virtualization works?

  • CPU supports kernel and user mode (ring0, ring3)
    • Set of instructions that can only be executed in kernel mode
      • I/O, change MMU settings etc -- sensitive instructions
    • Privileged instructions: cause a trap when executed in kernel mode
  • Result: type 1 virtualization feasible if sensitive instruction subset of privileged instructions
  • Intel 386: ignores sensitive instructions in user mode
    • Can not support type 1 virtualization
  • Recent Intel/AMD CPUs have hardware support
    • Intel VT, AMD SVM
      • Create containers where a VM and guest can run
      • Hypervisor uses hardware bitmap to specify which inst should trap
      • Sensitive inst in guest traps to hypervisor 3

Type 1 hypervisor

  • Unmodified OS is running in user mode (or ring 1)
    • But it thinks it is running in kernel mode ( virtual kernel mode)
    • privileged instructions trap; sensitive inst-> use VT to trap
    • Hypervisor is the “real kernel”
      • Upon trap, executes privileged operations
      • Or emulates what the hardware would do 4

Computer Science CS677: Distributed OS Lecture 4, page

Virtual machine Interface

  • Standardize the VM interface so kernel can run on bare

hardware or any hypervisor

7

Memory virtualization

  • OS manages page tables
    • Create new pagetable is sensitive -> traps to hypervisor
  • hypervisor manages multiple OS
    • Need a second shadow page table
    • OS: VM virtual pages to VM’s physical pages
    • Hypervisor maps to actual page in shadow page table
    • Two level mapping
    • Need to catch changes to page table (not privileged)
      • Change PT to read-only - page fault
      • Paravirtualized - use hypercalls to inform 8

Computer Science Lecture 4, page

I/O Virtualization

  • Each guest OS thinks it “owns” the disk
  • Hypervisor creates “virtual disks”
    • Large empty files on the physical disk that appear as “disks” to the guest OS - Hypervisor converts block # to file offset for I/O
    • DMA need physical addresses
      • Hypervisor needs to translate CS677: Distributed OS 9

Examples

  • Application-level virtualization: “process virtual

machine”

  • VMM /hypervisor 10

Computer Science Lecture 4, page

Case Study: PlanetLab

  • Distributed cluster across universities
    • Used for experimental research by students and faculty in networking and distributed systems
  • Uses a virtualized architecture
    • Linux Vservers
    • Node manager per machine
    • Obtain a “slice” for an experiment: slice creation service 13

Code and Process Migration

  • Motivation
  • How does migration occur?
  • Resource migration
  • Agent-based system
  • Details of process migration 14

Computer Science CS677: Distributed OS Lecture 6, page

Motivation

  • Key reasons: performance and flexibility
  • Process migration (aka strong mobility )
    • Improved system-wide performance – better utilization of system-wide resources
    • Examples: Condor, DQS
  • Code migration (aka weak mobility)
    • Shipment of server code to client – filling forms (reduce communication, no need to pre-link stubs with client)
    • Ship parts of client application to server instead of data from server to client (e.g., databases)
    • Improve parallelism – agent-based web searches 15

Motivation

  • Flexibility
    • Dynamic configuration of distributed system
    • Clients don’t need preinstalled software – download on demand 16

Computer Science CS677: Distributed OS Lecture 6, page

Models for Code Migration

  • Alternatives for code migration. 19

Do Resources Migrate?

  • Depends on resource to process binding
    • By identifier: specific web site, ftp server
    • By value: Java libraries
    • By type: printers, local devices
  • Depends on type of “attachments”
    • Unattached to any node: data files
    • Fastened resources (can be moved only at high cost)
      • Database, web sites
    • Fixed resources
      • Local devices, communication end points 20

Computer Science CS677: Distributed OS Lecture 6, page

Resource Migration Actions

  • Actions to be taken with respect to the references to local resources when migrating code to another machine.
  • GR: establish global system-wide reference
  • MV: move the resources
  • CP: copy the resource
  • RB: rebind process to locally available resource Unattached Fastened Fixed By identifier By value By type MV (or GR) CP ( or MV, GR) RB (or GR, CP) GR (or MV) GR (or CP) RB (or GR, CP) GR GR RB (or GR) Resource-to machine binding Process-to- resource binding 21

Migration in Heterogeneous Systems

  • Systems can be heterogeneous (different architecture, OS)
    • Support only weak mobility: recompile code, no run time information
    • Strong mobility: recompile code segment, transfer execution segment [migration stack]
    • Virtual machines - interpret source (scripts) or intermediate code [Java] 22