L3 - Virtualization 1/2 Flashcards

1
Q

VMM

A

Virtual Machine Manager (VMM) = hypervisor =
a type of software that allows multiple virtual machines (VMs) to run on a single physical machine. It creates a layer of abstraction between the physical hardware and the virtual machines, allowing multiple operating systems to run on the same physical hardware. Hypervisors are also referred to as virtual machine managers (VMM) or simply virtualizers.

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

What is virtualization?

A

Computer architecture technology by which multiple VMs are multiplexed in the same hardware.

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

3 objectives of virtualization

A
  1. enhance the resource sharing by many users simultaneously
  2. replace and upgrade hardware on the fly
  3. reduce downtime
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Two modes of operating systems

A

kernel mode and user mode

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

What is the kernel mode?

A
  • OS allows all CPU instructions to execute on the underlying hardware
  • Kernel mode does not execute in the user mode
  • Kernel processes run in the kernel mode with the superuser privilege
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the user mode?

A
  • OS allows only a few instructions to be executed
  • if the user applications have to execute the privileged instructions then the applications ask kernels to do the work
  • user applications can’t open files, send network packets, print to screen
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Two distinct areas of memory

A
  • user space
  • kernel space
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the user space?

A
  • Set of locations where normal user processes run (everything other than the kernel)
  • memory area where application software and some drivers execute
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the kernel space?

A
  • location where the code of the kernel is stored and executes under
  • restricted for running privileged OS kernel
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How many rings are there and which one is the most privileged ring?

A

There are rings 0,1,2,3 and ring 0 is the most privileged ring

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

What are the 4 rings?

A

Ring 0: kernel mode
Ring 1: Hypervisor
Ring 2: drivers
Ring 3: applications

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

What is Ring 2 in detail? (internet)

A

Drivers in ring 2 are typically used for managing peripheral devices such as disk drives, network interfaces, and other hardware. These drivers are responsible for communicating with the hardware, managing the data transfer between the hardware and the operating system, and providing a standard interface for applications to access the hardware.

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

What are the 4 processes that the OS does?

A
  • process management (start, run, stop)
  • memory management (allocate, deallocate)
  • file management (open, close, modify, read, rename, create)
  • network management (scheduling, timing)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is a system call?

A

In user mode, the user applications initiate a system call to get OS-related services. The system call is a user space request of a kernel service.

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

Is a system call more expensive than a normal instruction?

A

Yes. It takes around 242 cycles.

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

What is a machine cycle?

A

Consists of the steps that a computer’s processor executes whenever it receives a machine language instruction.

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

3 types of virtualization

A
  • Full-Virtualization (Software Assisted; Hardware Assisted: Type 1, Type 2)
  • Para-Virtualization
  • OS-level Virtualization
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Software Assisted Full Virtualization

A

Software-assisted full virtualization uses binary translation when trapping and virtualizing the execution of instruction sets. The binary translation also emulates the hardware by utilizing software instruction sets.

19
Q

Hardware-Assisted Full Virtualization

A

Hardware-assisted virtualization eliminates the need for binary translation. Privileged instructions can be executed directly on the processor.

Type 1 Hypervisor – also known as the bare-metal hypervisor type
Type 2 Hypervisor – also known as the hosted hypervisor type

20
Q

What is a bare-metal hypervisor?

A

Type 1 Hypervisor

When a hypervisor is installed directly on the hardware of a physical machine, between the hardware and the operating system (OS).

21
Q

Examples of bare-metal hypervisors

A

Hyper-v, VMware ESX/ESXi, Xen

22
Q

Advantages of bare-metal hypervisors

A

Since there is no software of the operating system between the two, Type 1 can provide excellent stability and performance.

https://goabacus.com/three-types-of-server-virtualization-explained/#:~:text=This%20type%20of%20full%20virtualization,physical%20server%20and%20its%20hardware.

23
Q

Challenges of bare-metal hypervisors?

A
  • Isolation at the cost of size of the VM
  • large VM of (800mb) –> challenge for scalability & migration, which is slower
24
Q

What is hosted virtualization?

A

Type 2 Hypervisor

On top of host OS. Guest OS runs on VMM.

25
Q

Examples of hosted virtualization

A

VMware workstation, VMware fusion, Oracle Virtualbox

26
Q

Advantages of hosted virtualization?

A
  • resource requirements are low
  • high scalability (not many MB per machine) -> easy migration from one machine to another
  • multiple VMs can share a single machine/cluster
27
Q

OS-level virtualization

A

OS-level virtualization doesn’t use a hypervisor and doesn’t apply a host-guest paradigm. Instead, it utilizes a process called “containerization” which creates multiple user-space instances (containers or virtual environments) through a kernel in the OS.

  • containers running on top of the OS kernel
  • in the container, you can only run the OS that has the same kernel
28
Q

Benefits of OS-level virtualization

A
  • effective concerning software migration ( all the containers run on the same kernel)
  • best for backup and recovery services
29
Q

What is full virtualization?

A

In the full virtualization technique, the hypervisor completely simulates the underlying hardware. In full virtualization, the guest OS is unaware that it’s being virtualized.

30
Q

What is a trap?

A

trap = localized exception which occurs when the guest OS does not have the privileges to run an instruction

31
Q

What happens when several guest OSs execute privileged instructions to a single hardware?

A
  • The Guest OSs are not able to execute privilege instructions to the hardware directly because they are not in ring 0
  • The VMM is in between and coordinates the requests
  • Every privilege instruction is trapped (it requires a s/w (software) interrupt) due to the execution in the less privileged ring
    the VMM intercepts such traps and emulates the instruction on the fly
32
Q

What is a binary translator?

A

VMware implemented a binary translator which overrides privileged instructions. The instructions can now go directly to the hypervisor

33
Q

What is I/O in computing?

A

the communication between an information processing system, such as a computer, and the outside world,

34
Q

IOV

A

Input/Output Virtualization (IOV) is a technology that allows multiple physical devices (e.g. network interfaces) to be shared among multiple virtual machines (VMs)

35
Q

Impact of system calls

A

a binary translated system call with the 32-bit guest OS (e.g. Windows or Linux) running on ring 1 takes around 2300 cycles

  • because CPU issues fault messages for every system call. They are later translated and executed
36
Q

Impact of Memory Virtualization

A
  • is a memory management technique
    maps programs’ memory addresses (virtual addresses) to the underlying physical machine memory
37
Q

Advantages of memory virtualization

A
  • increased security
  • isolation
  • freeing applications
  • reduce system crashes
38
Q

How are memory addresses mapped in full virtualization?

A
  • program’s memory addresses (virtual addresses of VMs) are mapped to virtual physical memory and then to physical memory (machine memory)
  • it is a 2 stage mapping process for any guest OS –> Guest OS cannot directly access the machine memory
  • VMM does the mapping based on a shadow page table
39
Q

Disadvantages of full virtualization

A
  • mapping by VMM of memory addresses takes 3 to 400 times more cycles than the native situation
  • trapping and binary writing
  • One disadvantage of full virtualization is that it can be resource-intensive, as each VM requires its own copy of the operating system and associated resources.
40
Q

Advantages of full virtualization

A

The advantage of this approach is that it allows multiple VMs to run on a single physical machine, each with its own operating system and resources.
- Allows running the unmodified OS.

41
Q

What is para virtualization?

A
  • now the hypervisor has a less critical role
  • the guest OS needs to be modified at the source code level –> runtime changes are avoided (no need for trapping and binary writing)
  • performance is comparatively good
  • hypervisor performs hypercalls to accommodate critical kernel operations

The guest systems are aware of each other’s presence and they all work as one entire unit.

42
Q

What are hypercalls?

A

They allow the guest OS to communicate with the hypervisor

43
Q

What is Hardware-assisted virtualization

A
  • idea is to quickly identify the privilege instructions and to efficiently execute them
  • in order to do so a high priority layer is added to the hardware level
  • VMM works at this level and guest OS could operate at Ring 0
  • highly portable as the hypervisor can run an unmodified guest OS