Virtualization Basics

Virtualization is not a new concept, but its complexity has been growing, and a number of new paradigms are rising. I will try to demystify some of the concepts behind virtualization, briefly explain some of its basics, and finally look at some of the products and solutions out there.

To begin, let me introduce three very simple concepts regarding virtualization: the host operating system, the hypervisor, and the guest operating system.

The host operating system provides a host to one or more virtual machines (or partitions) and shares physical resources with them. It’s where the virtualization product or the partitioning product is installed.

The guest operating system is the operating system installed inside a virtual machine (or a partition). In a virtualization solution the guest OS can be completely different from the host OS. In a partitioning solution the guest OS must be identical to the host OS.

A hypervisor, also called a virtual machine manager (VMM), is a program that allows multiple operating systems to share a single hardware host. Each operating system appears to have the host’s processor, memory, and other resources all to itself. The task of this hypervisor is to handle resource and memory allocation for the virtual machines, ensuring they cannot disrupt each other, in addition to providing interfaces for higher level administration and monitoring tools.

The Hypervisor

There are two types of hypervisors as depicted below:

Note: Xen is an open-source virtualization software used by several companies to implement their virtualization solution; companies like, ORACLE, Citrix, Sun, and Virtual Iron, to name a few.

Type 1 hypervisors, also known as bare-metal, are software systems that run directly on the host’s hardware as a hardware control and guest operating system monitor. Bare-metal virtualization is the current enterprise data center leader. VMware ESX is easily the market leader in enterprise virtualization at the moment, and it utilizes bare-metal virtualization architecture. What is immediately apparent about this architecture, is the lack of an existing OS; the hypervisor sits directly on top of the hardware, hence the term “bare-metal virtualization”. The reason so many data centers implement bare-metal products, such as ESX, Xen, and Hyper-V, is because of the speed it provides due to the decreased overhead from the OS that hosted virtualization uses.

Type 2 hypervisors, also known as hosted, are software applications running within a conventional operating system environment. This type of hypervisor is typically used in client side virtualization solutions such as Microsoft´s Virtual PC, and VMWare´s Workstation.

The Protection Rings

Another important concept is the protection rings. x86 CPUs provide a range of protection levels, also known as rings, in which code can execute. Ring 0 has the highest level privilege and is where the operating system kernel normally runs. Code executing in Ring 0 is said to be running in system space, kernel mode or supervisor mode. All other code, such as applications running on the operating system, operate in less privileged rings, typically Ring 3.

The hypervisor runs directly on the hardware of the host system in ring 0. Clearly, with the hypervisor occupying ring 0 of the CPU, the kernels for any guest operating systems running on the system must run in less privileged CPU rings. Unfortunately, most operating system kernels are written explicitly to run in ring 0, for the simple reason that they need to perform tasks that are only available in that ring, such as the ability to execute privileged CPU instructions and directly manipulate memory.

The AMD-V and Intel-VT CPUs use a new privilege level called Ring -1 for the VMM to reside, allowing for better performance as the VMM no longer needs to fool the Guest OS that it is running in Ring 0. Solutions like VMWare ESX, Xen (Citrix, ORACLE, IBM, etc.), and Microsoft Hyper-V take advantage of the hardware virtualization capabilities inherent to the new Intel and AMD CPUs.

Virtualization Landscape

After this brief introduction, let´s now take a look at the global virtualization landscape available out there. The following diagram shows how virtualization architectures are organized, as well as some of the solutions that implement them.

The following sections will briefly introduce some of the most important types of virtualization.

Traditional

This is not a virtualization scenario; it´s here solely for comparison purposes. Here we see that the OS sits directly above the hardware executing in the ring 0.

Paravirtualization

Under paravirtualization, the kernel of the guest operating system is modified specifically to run on the hypervisor. This typically involves replacing any privileged operations that will only run in ring 0 of the CPU with calls to the hypervisor (known as hypercalls). The hypervisor in turn performs the task on behalf of the guest kernel.

This typically limits support to open source operating systems, such as Linux, which may be freely altered, and proprietary operating systems where the owners have agreed to make the necessary code modifications to target a specific hypervisor. This results in the ability of the guest kernel to communicate directly with the hypervisor, resulting in greater performance levels than other virtualization approaches.

Full Virtualization without Hardware Assist

Full virtualization provides support for unmodified guest operating systems. The term unmodified refers to operating system kernels which have not been altered to run on a hypervisor and, therefore, still execute privileged operations as though running in ring 0 of the CPU.

In this scenario, the hypervisor provides CPU emulation to handle and modify privileged and protected CPU operations made by unmodified guest operating system kernels. Unfortunately, this emulation process requires both time and system resources to operate, resulting in inferior performance levels when compared to those provided by paravirtualization.

Full Virtualization with Hardware Assist

Hardware virtualization leverages virtualization features built into the latest generations of CPUs from both Intel and AMD. These technologies, known as Intel VT and AMD-V, respectively, provide extensions necessary to run unmodified guest virtual machines without the overheads inherent in full virtualization CPU emulation.

In very simplistic terms, these new processors provide an additional privilege mode below ring 0 in which the hypervisor can operate essentially, leaving ring 0 available for unmodified guest operating systems.

OS virtualization

Compared with hypervisor based virtualization, container based virtualization offers a completely different approach to virtualization. Instead of virtualizing with a system in which there is a complete operating system installation, container based virtualization isolates containers work from within a single OS. In cases where only one operating system is needed, the main benefits of container based virtualization are that it doesn’t duplicate functionality and improves performance.

OS virtualization has been making waves lately because Microsoft is rumored to be in the market for an OS virtualization technology. The most well-known products that use OS virtualization are Parallels Virtuozzo and Solaris Containers. This virtualization architecture has many benefits, speedy performance being the foremost. Another benefit is reduced disk space requirements. Many containers can use the same files, resulting in lowered disk space requirements.

The big caveat with OS virtualization is the OS requirement. Container OSs must be the same OS as the host OS. This means that if you are utilizing Solaris containers then all containers must run Solaris. If you are implementing Virtuozzo containers on Windows 2003 Standard Edition, then all its containers must also be running Windows 2003 Standard Edition.

Hosted virtualization

This is the type of virtualization with which most users are familiar with. All of the desktop virtualization products, such as VMware Workstation, VMware Fusion, and Parallels Desktop for the Mac, and Microsoft Virtual PC implement hosted virtualization architecture. There are many benefits to this type of virtualization. Users can install a virtualization product onto their desktop just as any other application, and continue to use their desktop OS. Hosted virtualization products also take advantage of the host OS’s device drivers, resulting in the virtualization product supporting whatever hardware the host does.

Conclusion

As concepts evolve, it is often difficult to get a clear definition of the basics behind them, and virtualization is no exception to this rule. When I first started looking into virtualization a little more deeply (driven by my Cloud Computing crusade) I found it difficult to find clear information of all its fronts. I hope this blog entry helps the rest of you with the same problem. Furthermore, with the rise of Cloud Computing, new paradigms are emerging, forcing the virtualization solutions to adapt to a new reality; a subject that I will address shortly.

[转]Virtualization Basics的更多相关文章

  1. 别以为真懂Openstack: 虚拟机创建的50个步骤和100个知识点(4)

    六.Libvirt 对于Libvirt,在启动虚拟机之前,首先需要define虚拟机,是一个XML格式的文件 列出所有的Instance # virsh list Id    Name         ...

  2. [WPF]WPF Data Virtualization和UI Virtualization

    这篇博客将介绍WPF中的虚拟化技术. 1. Data Virtualization 通常情况下我们说数据虚拟化是指数据源没有完全加载,仅加载当前需要显示的数据呈现给用户.这种场景会让我们想到数据分页显 ...

  3. Assembler : The Basics In Reversing

    Assembler : The Basics In Reversing Indeed: the basics!! This is all far from complete but covers ab ...

  4. The Basics of 3D Printing in 2015 - from someone with 16 WHOLE HOURS' experience

    全文转载自 Scott Hanselman的博文. I bought a 3D printer on Friday, specifically a Printrbot Simple Metal fro ...

  5. Geneve: Generic Network Virtualization Encapsulation

    Earlier this year, VMware, Microsoft, Red Hat and Intel published an IETF draft on Generic Network V ...

  6. Cadence UVM基础视频介绍(UVM SV Basics)

    Cadence关于UVM的简单介绍,包括UVM的各个方面.有中文和英文两种版本. UVM SV Basics 1 – Introduction UVM SV Basics 2 – DUT Exampl ...

  7. C basics

    C 日记目录 C basics ................ writing Numeration storage   , structor space assigning pointer,  a ...

  8. Xperf Basics: Recording a Trace(转)

    http://randomascii.wordpress.com/2011/08/18/xperf-basics-recording-a-trace/   This post is obsolete ...

  9. Xperf Analysis Basics(转)

      FQ不易,转载 http://randomascii.wordpress.com/2011/08/23/xperf-analysis-basics/ I started writing a des ...

随机推荐

  1. 【转载】python中not,and,or的优先级问题及用法

    作业: >>> print(5<4 or 3)3>>> print(2>1 or 6)True>>> print(5>1 and ...

  2. 机器学习入门:Linear Regression与Normal Equation -2017年8月23日22:11:50

    本文会讲到: (1)另一种线性回归方法:Normal Equation: (2)Gradient Descent与Normal Equation的优缺点:   前面我们通过Gradient Desce ...

  3. 使用react-handsontable

    新建一个项目 create-react-app myProject cd myProject npm install handsontable 或者 npm install handsontable- ...

  4. Java多线程中static变量的使用

    轉:https://blog.csdn.net/yy304935305/article/details/52456771 鲁迅先生曾说过:“时间就像海绵里的水,只要愿挤,总还是有的”.不管肿(怎)么说 ...

  5. clean-room 洁净室软件工程

          众所周知,软件工程的主要目的是提高软件的开发效率和软件质量.近年来发展起来的洁净室软件工程(cleanroom software engineering)提出了用统计的质量控制方法管理软件 ...

  6. 7行代码,彻底告别python第三方包import导入问题!

    最近有不少小伙伴咨询关于pyton第三方包导入的问题,今天我们就来聊聊第三方包导入那些事. 随着对python学习的渐入臻境,越来越多的小伙伴们开始导入自己所需的第三方包,实现各种各样的功能.但是,他 ...

  7. 常见的hbase jar

  8. 关于python-flask中规范创建项目的几个关键py项目文件

    1.config.py——配置文件 DEBUG = True DIALECT = 'mysql' DRIVER = 'mysqldb' USERNAME = 'root' PASSWORD = '' ...

  9. appium:运行脚本时,报404的解决办法

    对于报404的错,不要怀疑,在环境正常的情况下,一定是你的端口被占用了. 就用:查看端口:netstat -aon|findstr 5037 查看进程:tasklist /fi "PID e ...

  10. 【ORA-12516 TNS监听程序找不到符合协议堆栈要求的可用处理程序】

    服务器上某个数据库出现' ORA-12516: TNS: 监听程序找不到符合协议堆栈要求的可用处理程'错误,要解决该问题首先查看一下数据库现有的进程数,是否已经达到参数processes的大小. 取得 ...