Initial knowledge of virtualization technology

Source: Internet
Author: User

(i) Overview of virtualization Technologies

Virtualization technology can be used for detailed application purposes to create a specific purpose of the virtual environment, security, high efficiency, snapshot, cloning, backup, migration and other convenient. System virtualization is to virtual a physical computer into one or more virtual computer systems, each with its own virtual hardware, the operating system on its own to feel that they do on a separate host, computer software on a virtual platform rather than the real hardware platform to execute. Virtualization technology can expand the capacity of the hardware. Simplify the software configuration process again. CPU virtualization enables a single CPU to simulate multi-CPU parallel execution, agreeing that a platform executes multiple operating systems at the same time, and that applications can execute independently of each other in a separate space.

Virtualization technology reduces hardware costs at the same time. It can also significantly improve the efficiency and security of the system.

The implementation of a virtualized system is typically the addition of a hypervisor between the operating system and the hardware, known as hypervisor (1). The hypervisor is primarily responsible for the coordination of hardware resources between the various operating systems. A hypervisor is a special operating system that executes directly on bare metal (for full virtualization technology). The hypervisor creates an abstraction of the underlying hardware platform. One or more virtual machines (VMS) share this underlying hardware platform. In such an environment. A VM is simply a container for the operating system and its applications. One VM is isolated from other VMs performed on the hypervisor. This supports multiple operating systems or many similar operating systems with different configurations.

      watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvc3vpcgluz3nw/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/center ">

Figure 1 Virtualization System Architecture

1. Virtual computer System three layer meaning-homogeneous, efficient, resource-controlled.

Homogeneous-essentially virtual machines and physical machines are the same and behave differently, such as a physical core virtual multiple cores.

Efficient-Virtual machine performance is close to the physical machine.

Resource controlled-virtual machines have complete control over system resources. Includes allocation, management, and recycling.

2, virtualization in different levels of virtualization

Virtualization of the hardware abstraction Layer-the client is similar to the host hardware, and the instruction set is similar.

Operating system layer Virtualization-the kernel can provide multiple isolated user profiles with separate file system, network, system settings, and library functions.

Library function layer Initialization-is different operating systems can have a common library function interface, the application does not need to change.

Programming language layer Virtualization-programs that are programmed to execute on a virtual machine, regardless of the detailed hardware. such as Java.

3. Advantages of virtual machines

Good encapsulation, the execution environment of the virtual machine is kept convenient. Easily crawl state, backup, clone, suspend, and resume at any time.

Multi-instance-minimizes physical resources and improves utilization. Easy to manage.

Isolation-Each application can be executed in a separate operating system. Non-interference. Crashes do not affect other tasks.

Hardware agnostic-simply by having the same hardware abstraction layer, virtual machines can migrate seamlessly, so maintenance and upgrades are simple.

Security-easy to control access rights, virus intrusion detection, etc.

4, Virtualization classification

Virtualization and class virtualization are all based on the degree of virtualisation. Fully virtualized-Customers and operating systems do not need to be executed, regardless of any changes, software-assisted full virtualization and hardware-assisted total virtualization, fully virtualized to simulate all CPU instructions. Class virtualization-the operating system needs to make adaptive changes. Avoid commands that are difficult to emulate.

According to the existence of the host independent operating system is divided into hypervisor model and host model, the former need to support all physical resource management (System boot, memory management, device driver, etc.). High efficiency and complexity. The latter only needs to invoke the host operating system API to achieve virtualization, the host operating system can be Windows, Linux, inefficient, simple. The third class is the mix of the two, which is on top of the hardware layer, but gives up some IO device management to a privileged operating system that executes on a privileged virtual machine. VMM is responsible for processor and memory virtualization.

(ii) Virtualization technology Framework

Virtual environments consist of: hardware, VMM, virtual machines. The operating system in the physical machine manages the hardware directly (through the hardware abstraction Layer HAL), and the VMM manages the hardware in the virtual environment (one or more logical HAL is built). The operating system executes above the VMM logical HAL, performing the highest privileges on non-CPUs.

Three primary tasks for virtual physical resources: Processor Virtualization, memory virtualization, and I/O virtualization. If the hardware supports virtualization technology directly, the CPU assists the virtualization process. Increased support for virtualization, such as CPUs, chipsets, and IO devices, makes virtualization fast and efficient.


      Figure 2 The virtualization environment consists of

1,VMM Introduction

The virtual machine VMM (Virtual machine Monitor) executes at the highest privilege level on the physical CPU. VMM manages the host physical resources down, including processor management, memory management, peripheral management, interrupt management, System time management, and so on. The virtual environment resource is managed up, including:

I virtual physical resources-processors, memory, IO devices, and so on.

II Scheduling of multiple independent virtual environments-similar to process scheduling.

III The communication mechanism between virtual environments--VMM provides communication APIs between VMM and the virtual environment, and between virtual environments. The means of communication can be shared memory, event notification, and so on.

IV Management of virtual environments-Create, delete, pause, etc.

2, hardware-assisted virtualization

I processor virtualization:

At the core of VMM, memory, IO virtualization depends on the correct implementation of processor virtualization. The virtualization of the processor is a key part of the analog processor-instruction set, memory interview.

Three key concepts: virtual registers, virtual contexts, virtual CPUs, in which the virtual CPU and the physical CPU have a consistent function, the function is completed by the physical CPU and VMM (non-sensitive instruction directly physical CPU completed. Sensitive instructions for VMM to get into a post-simulation). Processor virtualization consists of:

(a) instruction set emulation: the act of correctly simulating instructions. When the operating system tries to access critical resources, VMM locates the access on the virtual registers of VMM. When the operating system runs the operation (process switching, etc.), the VMM "falls into" the simulation. Trapped means include: Processor protection triggers exceptions, VMM proactively passes trap calls, asynchronous interrupts (processor internal interrupt sources and external interrupts).

(b) Simulation of interrupts and anomalies: simulation of hardware interrupts and the operation of software anomalies.

(c) Symmetric multiprocessor simulations: the number of virtual processors does not necessarily relate to the physical CPU and presents an SMP presence to the operating system.

II Memory Virtualization: The core requirement is that each client physical address starts at 0, with a large granularity address continuous (such as 256M), the basic approach is to introduce a new layer of address space-the client physical address space, when used by VMM to convert the address to the actual physical address.

III IO Virtualization: Intercepts requests for access to devices by the guest operating system. Simulate real-world physical effects with software, "spoof clients"

3, software-based total virtualization

If the hardware is defective in virtualization support. Can be remedied by software. Two possible scenarios-analog run (fully virtualized) and direct source rewriting (class virtualization).

Software simulation technology is a hardware platform through software simulation of the second hardware platform, so as to be able to run the operating system, applications. The core of simulation is the operation effect of analog instruction set, which can simulate the same hardware architecture, and can simulate different.

I software-based CPU virtualization

(a) The simplest of simulation technology is to explain the operation-take the finger, simulate the operation effect, and then take the finger, the disadvantage is poor performance. such as Java is interpreted to run, with hardware platform-independent.

(b) Scanning and patching-most instructions are run directly by the physical CPU, and some operating system sensitive instructions are trapped into the VMM simulation run through traps.

(c) Binary code translation-physical CPUs cannot directly run client operating system operations. The code to be run is in the VMM buffer.

II Memory Virtualization: In order to achieve a mapping of the physical address of the client to the host, VMM maintains a mapping table. VMM intercepts the client memory operation instructions and maps to the physical address of the host that VMM assigns to the client. The translation process is implemented through the shadow page table and translates directly to the host physical address.

III IO Virtualization: The device that is being measured in a virtual machine is a VMM virtual device. Can be more or less than the real device, the function and model can be different, analog device and operating system to interact with the API.

Initial knowledge of virtualization technology

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.