Virtualization technology - computing virtualization

Compute virtualization

introduce

Abstract the physical resources (CPU, memory, IO peripherals) on the physical host into excessive and equal amounts of logical resources (virtual CPU, virtual memory, virtual IO devices) through the virtualization layer, and then recombine them to form a new virtual host .
Insert image description here

Method to realize

Full virtualization

Relying on virtualization engine

paravirtualization

Achieved by modifying the virtual machine kernel engine

Hardware-assisted virtualization

Realized with hardware assistance

object

CPU

User mode and kernel mode

Resource management, security
Insert image description here

Deploy virtualized user mode and kernel mode

Insert image description here

problem found

The instruction sets of virtual machines (linux, Windows, etc.) of different operating systems are different. Some virtual machine request instructions cannot be recognized by the physical machine operating system kernel.

In fact, what CPU virtualization does is "translation".

Solve the problem

Software Translation Method (Full Virtualization)
  • Description:
    Design a translator, that is, VMM. The virtual machine implements instruction set translation through the VMM program running in the kernel state, and then calls it.
    Insert image description here
  • shortcoming
    Insert image description here
Software Translation Method (Paravirtualization)
  • Note:
    The instruction set is not translated through the VMM, but modified within the Guest OS, and then directly accesses the physical machine core and calls peripherals.
    Insert image description here
  • shortcoming
    Insert image description here
Hardware translation method (hardware-assisted virtualization)
  • Description:
    Implement instruction set translation through external hardware modules, and then call peripherals to improve computing performance.
    Insert image description here
    Insert image description here
  • shortcoming
    Insert image description here

Memory

Traditional physical machine memory mechanism

Insert image description here

Deploy virtualized memory access mechanism

Insert image description here

problem found

After virtualization, the conversion process becomes:
virtual machine process memory logical address - "virtual machine physical memory address;
virtual machine physical memory address (physical machine process logical address) -" physical machine physical memory address

Solve the problem

One-level mapping table method (full virtualization)

Insert image description here
Create a new software mapping table, and the VMM takes the initiative to communicate with the virtual machine to realize direct mapping of the process logical address in the virtual machine and the physical address of the physical machine to achieve efficient conversion.

One-level mapping table method (paravirtualization)

Insert image description here
Modify the virtual machine kernel so that the virtual machine can directly access the physical machine mapping table to achieve efficient conversion.

Two-tier mapping table method (hardware-assisted virtualization)

Insert image description here
Address translation within the virtual machine improves translation efficiency through hardware support. Major manufacturers have successively launched hardware-assisted memory virtualization technologies, such as Intel's EPT (Extended Page Table) and AMD's NPT (Nested Page Table).

IO device

Full virtualization

VMM simulates IO devices and has nothing to do with hardware. It can simulate any hardware device; that is, simulating IO devices in a virtual machine requires scheduling IO devices in a physical machine, which results in low performance.

Paravirtualization (not overview)

Refining VMM work to achieve pipeline operations.
Backend: VMM is only responsible for scheduling IO resources in physical machines.
Frontend: The simulation of IO devices in virtual machines is handled by specialized drivers.

Hardware-assisted virtualization

The IO device itself supports virtualization, does not require VMM implementation, and has high performance.
Note: There is a pass-through device in virtualization, which is only used by a certain VM (exclusive, such as VMWARE's pass-through device)

Implementation technology (virtualization engine)

VMWare
Xen
hyper-v
KVM
qume

resource planning

CPU virtualization

Insert image description here

  • official
  • Loss formula not considered (estimate)
    Insert image description here
  • Consider the loss formula
    Insert image description here

CPU over-allocation planning suggestions

  • Suggestion one
    Insert image description here
  • Suggestion two
    Insert image description here

memory virtualization

official
Insert image description here

Memory over-allocation planning suggestions

Insert image description here

Storage virtualization

Guess you like

Origin blog.csdn.net/qq_37907454/article/details/132612169