Chapter 2: Virtual Resources Flashcards

1
Q

What is a Hypervisor?

A
  • is a program that allows multiple OS systems to share a single hardware host, each OS appears to have the host’s resources ie: processore, memeory, nic etc all to itself
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Name and explain Type 1 Hypervisor

A

Runs directly on hardware

  • More secure and more available
  • Offers better performance to the guests it supports
  • Requires special device drivers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Name and explain Type 2 Hypervisor

A

Runs on top of an OS

  • Leverages the OS drivers
  • Often used for desktop development and testing
  • More overhead
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the Challenges for IaaS Providers?

A
  • Rapid provisioning
  • Elasticity
  • Isolation of different consumers
  • Performance
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Definition of Virtualization

A

Virtualization is the simulation of the software and/or hardware upon which other software runs. This simulated environment is called a virtual machine (VM).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the challenge of Elasticity for a Cloud?

A
  • Create illusion of infinite resources

- manage data center in a cost-efficient manner

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the challenge Rapid Provisioning for a Cloud?

A
  • Resources must be available to the consumer quickly

- No human interaction during provisioning

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Taxonomy of Virtualization

A
  • Process Virtualization
  • OS Virtualization
  • System Virtualization
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the VMM?

A

Virtual machine monitor

aka Hypervisor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Name the three types of processor instructions.

A
  • Privileged instruction
  • Sensitive instructions
  • Unprivileged instructions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the necessary condition to the processor instructions for efficient virtualization (Popek and Goldberg-Theorem)?

A

Set of sensitive instructions is a subset of the set of privileged instructions. (=Condition satisfied)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the three Hardware Virtualization techniques?

A
  • Full Virtualization
  • Paravirtualization (OS-Assisted)
  • Hardware-Assisted Virtualization
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Define Full Virtualization.

A

Full Virtualization is virtualization in which the guest operating system is unaware that it is in a virtualized environment, and therefore hardware is virtualized by the host operating system.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Define Paravirtualisation.

A

Software Assisted Virtualization (Paravirtualization) is virtualization in which the guest operating system is aware that it is a guest. Therefore the guest source code is modified so that it avoids assistance of the VMM as far as possible.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Define Hardware-Assisted Virtualization.

A

Hardware Assisted Virtualization has special instructions to aid the virtualization of hardware. The guest can execute privileged instructions directly on the processor without affecting the host.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Explain Full Virtualization using Binary Translation

A
  • Find critical instructions and replace them
  • Run unprivileged instructions directly on CPU
  • Trap and emulate privileged and sensitive instructions
  • Find critical instructions and replace with exception
  • Problem: Replacement must be done at runtime
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is the MMU

A

Memory management unit (MMU) translates logical to physical memory addresses
by lookup the page table (logical page ←→ physical page)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What are Shadow Pages?

A

Shadow page tables solves the problem of additional memory access required to resolve address at full virtualization. By mapping the logical pages of a process in the VM directly to the physical address.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What are the classes of I/O devices

A
  1. Dedicated devices (e.g. display, keyboard, mouse, …)
    Not shared among VMs on a very long time scale
  2. Partitioned devices (e.g.disks)
    Partitions made available to VMs as dedicated devices
  3. Shared devices (e.g. network adapters)
    Shared among VMs on very fine-grained time scale
  4. Spooled devices (e.g.printers)
    Shared among VMs but with time higher granularity
  5. Non existent physical devices e.g.virtualNICs)
    Virtual devices without physical counterpart
20
Q

What is the idea for Paravirtualization (OS-Assisted)?

A

Idea of Paravirtualization:

  • Make guest OS aware that it is running in a VM
  • Modify the guest source code so that it avoids assistance of the VMM as far as possible
21
Q

How does Physical Memory Management with XEN work?

A

Domain gets fraction of phys. memory at creation time

  • Static partitioning among domains
  • No guarantee partition is contiguous
  • Hypervisor knows which domain „owns“ which pages
  • Each guest (Domain) knows which blocks to use
22
Q

How does Virtual Memory Management with XEN work?

A

Command Batching:

  • Xen collects Requests and submits them with one hypercall
  • > Requests are not immediately processed
  • > Requires only one entry to hypervisor
23
Q

How does I/O Virtualization with XEN work?

A
  • XEN itself contains specific device drivers

- I/O data transferred from guests via XEN using shared-memory, async. buffer ring

24
Q

Explain how Binary Translation works

A
  1. Separate instruction sequence in translation units
  2. Check unit for critical instructions and modify code
  3. Modified code is stored in translation cache
25
Q

Name different levels of I/O virtualization possible

A
  1. At system call level
  2. At device driver level
  3. At I/O operation level
26
Q

What is the requirement for Paravirtualization (OS-Assisted)?

A

Requirements for pure OS-assisted approach:
- Source code of guest operating system is available
- Modified guest OS maintains application binary interface
Most common used for device driver virtualization. e.g. XEN

27
Q

Summary OS-Assisted Virtualization

A

Requires modified guest OS? YES
Requires hardware support? NO

+ Better performance through cooperation between hypervisor and guest OS

  • Limited compatibility, not generally applicable
  • Increased management overhead for data center operator, different version of OS must be maintained
28
Q

Summary of full virtualization

A

Requires modified Guest OS? NO
Requires hardware support? NO
- Good approach for compute-intensive applications, because unprivileged instructions run directly on CPU
- Not so good for data-intensive applications

29
Q

Which Virtualization requires a modified guest OS?

A

OS-Assisted Virtualization

30
Q

Which Virtualization requires hardware support?

A

HW-Assisted Virtualization

31
Q

Performance of Full Virtualization

A

■ Good approach for compute-intensive applications
♦ Unprivileged instructions run directly on CPU
■ Degraded performance for data-intensive applications
♦ I/O requires syscallsprivileged instructions
♦ “trap and emulate” often requires context switches
♦ Context switches lead to complete flush of TLB

32
Q

Pros and Cons of OS-Assisted

A

+ Better performance through cooperation between hypervisor and guest OS

  • Limited compatibility, not generally applicable
  • Increased management overhead for data center operator, different version of OS must be maintained
33
Q

Pros and Cons of HW-Assisted

A

+ Improved performance even for unmodified guest OSs

- Reduced flexibility due to hardware constraints (especially for 3rd generation HW support)

34
Q

First Generation of HW - Assisted Virtualization

A

Two new CPU modes: VMM runs in root mode vs. Guest OS in guest mode
VMM and guest run as “co-routines”
VMM can give CPU to guest OS (VM ENTER)
VMM can define conditions when to regain CPU (VM EXIT)
VMM uses control bits to “confine” and observe guest

35
Q

Second Generation of HW - Assisted Virtualization

A

Extended Page Tables/Nested Page Tables introduce HW support for memory virtualization
Tagged Translation Lookaside Buffer TBL continues to cache LA PA address translation
MMU composes LA RA and RA PA mapping at TLB fill time

36
Q

Third Generation of HW - Assisted Virtualization

A

Third generation support for virtualization focuses on I/O

37
Q

Desired property: Live migration

A

■ No shutdown of the virtual machine
■ No disruption of the service
■ Minimal impact for the user
-> Minimize downtime and total migration time

38
Q

Strategies for Memory Migration

A
  1. Push phase
    ■ Source VM continues running, sends pages to destination ■ Memory must potentially be sent multiple times Minimum downtime, potentially long migration time
  2. Stop-and-copy phase
    ■ Source VM stopped, pages copied to destination VM
    ■ Destination VM is started after having received all pages Short overall migration time, long downtime
  3. Pull phase
    ■ Execute new VM, pull accessed pages from source Performance depends on number of page faults
39
Q

Resource Distribution among VMs

A

Storage space: statically partitioned
■ Each VM typically receives predefined fraction of disk
Main memory: statically partitioned
■ Each VM typically receives predefined fraction of RAM
CPU: Different methods possible
■ Pinning: Each VM is statically assigned CPU (cores)
■ Scheduling: VMM dynamically assigns time slots to VMs
I/O Access: Typically FCFS, see XEN ring buffer
■ More sophisticated methods subject to research!

40
Q

What means Virtual Machine Migration

A
Move VM from one physical host to another.
Motivation: 
- Fault management
- Maintenance
- Load Balancing
41
Q

Rings to manage privileges.

A

0: OS, supervisor mode
1, 2
3: Application, user space

42
Q

Explain TLB.

A

Translation Lookaside Buffer: Cache recent address translations.

43
Q

How does XEN tackle Full Virtualization Problems?

A

Guest OS is aware of virtualization -> critical instructions can be avoided
Frequent intervention of the Hypervisor required

44
Q

Motivation for OS/Container Virtualization.

A

HW Virtualization comes with too much overhead, large images and long boot times.
-> do not virtualize entire machine, but reuse OS Kernel and isolate processes, virtualize access to resource by processes

45
Q

Linux Kernel mechanisms for process isolation.

A
  • chroot system call (root of dircetory to /)
  • Namespaces (Separate view on kernel resources)
  • Capabilities (slested capabilities like syscalls)
  • cgroups (definition of resource usage)
  • SELinux (security profiles)
46
Q

VMs vs Containers.

A
VM images larger, boot times longer.
VMs:
- Complete isolation
- Flexible OS
- Live migration
Containers:
- Small images
- Quick startup
- Direct device access
-> Tradeoff between performance and isolation & security