虚拟化简介

Jump to: navigation, search

Susemini.png 本文处于需要修订的文章的状态,欢迎您积极参与翻译与修订。 翻译人员:ioriqqe,修订人员:无。

Virtualization software allows you to abstract your software servers from the physical hardware server. With server farms becoming more the norm, having 100's of entry level servers, many companies are looking at using more powerful servers that host multiple virtual servers. It should be noted that virtual software can be very helpful on the desktop for development and testing of programs. We will concentrate on server based software and solutions for this discussion.

人们可以用虚拟化软件从物理硬件服务器上抽象出你的软件服务器。随着服务器群的增加,通常有100个登陆级别的服务器,许多公司考虑使用可以使多个虚拟服务器当做主机的这种更加强大的服务器。据显示虚拟软件对于在桌面系统上开发和测试程序是非常有帮助的。接下来我们将集中讨论服务器软件及其解决方案。

VMActualServers.png

For discussion purposes, assume that the actual servers have 1Ghz processor, 1GB of memory, and a 100GB hard disk.

为了便于讨论,我们假设有一个拥有1GHZ处理器,1G内存和100G硬盘的真实服务器。

VMVirtualServers.png

For discussion purposes, assume that the host server has a 3Ghz processor, 3GB of memory, and a 300GB hard disk.

为便于讨论,我们还假设有一个拥有3Ghz处理器,3G内存和300G硬盘的主机服务器

Your first thought might be "isn't the Actual Server setup faster?". Yes and no. Virtual machines (VM) are great at doing resource allocation. For instance, what if Actual Server 1 & 2 are running at 20% capacity and Actual Server 3 is running at 98% capacity? Wouldn't it be great to give some of the wasted resources of server one and two to server three? With virtualization, you can do that. You could setup VM 1 and 2 to have 512 mb memory and using a smaller part of the hard drive, while VM 3 is using 1.5 GB memory and more hard disk space. The virtual host will automatically allocate processor resources as they are available across all the VMs. The Actual Server 3 is starving for resources, but in the VM Server environment, the third VM is running along with only using 60% of capacity.

首先你可能会想真实服务器会不会更快。其实虚拟机更善于合理分配资源。比如说,如果服务器1和服务器2只消耗了它们20%的资源而服务器3消耗了它98%的资源将会发生什么事情。它可能会分配一些服务器1和2所浪费的资源给服务器3吗?利用虚拟化技术,就可以实现。当虚拟机3需要使用1.5G内存和更多磁盘空间的时候,你可以给虚拟机1和2分配512mb内存并使用更少的硬盘。虚拟主机会自动分配虚拟机们可共同利用的处理器资源。真实服务器3急需资源,但在虚拟服务器环境中,第三个虚拟机只单独消耗了60%的资源。

Virtual servers are are not only used for resource management. That is probably the biggest advantage to companies with server farms. But small to medium size companies often use virtualization to save space. Specifically, why have 4 computers running different server software for different purposes, when you can run just one? For instance, a small company might need a general server (Windows Server 2003), a web server (openSuse Linux located in the DMZ), a DB server for the accounting department (Oracle on 64bit Red Hat Linux), and a utility DB (MySQL on openSuse Linux). Three different operating system running 4 different kinds of servers. Resource allocation will benefit here too, but the primary benefit is not having a small server farm and still having the flexibility to run the server OS that best fits the programs needs.

虚拟服务器不仅仅只用于资源管理。这对于有服务器群的公司或许是最大的优势。但中小型企业经常利用虚拟化技术来节省空间。尤其是当你用一台计算机就能为不同的目的去运行不同的服务器软件的时候,为什么你要用四台?举个例子,一个小公司可能需要一个常规服务器(Windows Server 2003),一个web服务器在(DMZ上的openSuse Linux ),供会计部门使用的数据库服务器(64位 Red Hat Linux上的Oracle),一个可用的数据库(openSuse Linux上的MySQL)。三个不同的操作系统运行四个不同的服务。资源分配对这当然也是有好处的,但主要的优势在于不需要一个小的服务器群并仍可以弹性地去运行最适合程序需要的服务器操作系统。

There are currently 4 major server virtualization software products available on the market today. The commercial and free products from VMware currently dominates the market. The open source community has not been sitting idlely by. Both XenSource and OpenVZ are considered mission critical ready and are deployed all over world. Micorsoft has also entered the market with MS Virtual Server. This being a Linux site, we will be focusing our discussion on the three that allow you to deploy a virtual server on Linux: VMware, Xen, and OpenVZ.

当前市面上有四种最主流的服务器虚拟化软件产品。VMware的商业版和免费版目前占据了统治地位。开源社区也不会右手旁观的。XenSourceOpenVZ都准备加入并在全世界范围内部署使用。微软的MS Virtual Server也加入到市场中来。这里是linux站点,我们将集中讨论可在linux上部署的三大虚拟服务器产品:VMware、Xen和OpenVZ。

虚拟化技术术语(Virtualization Terminology)

  • Virtual machine server or VM Server refers to a physical computer running software that hosts, creates, and controls virtual machines. It is sometimes referred to as a host, domain 0, dom0, or privileged domain. Much like the concept of a Web Server, the term VM Server may be used to refer to the computer/software combination or just the software.
  • 虚拟机服务器是一个物理计算机,它上面运行着可创建、控制虚拟机并作为虚拟机主机的软件。它有时也被称为主机、区域0、dom0或特权区域。这很类似于网络服务器的概念,术语VM服务器可能被认为是计算机/软件的集合或仅仅是一个软件。
  • Virtual machine refers to an instance of virtual hardware and the operating system that runs on that instance of virtual hardware. A virtual machine could be running any type of software, such as server, client, or desktop. It is often called a virtual computer, guest, domain U, domU, or unprivileged domain.
  • 虚拟机是虚拟硬件的一个实例及在它上面运行的操作系统。一个虚拟机可以运行任意类型的软件,如服务器、客户端或桌面系统。它常常被称为虚拟计算机、客户机、区域U、domU或非特权区域。
  • VT processor refers to a processor that supports virtualization technology, such as Intel VT or AMD Virtualization. Some VM Server software require VT capable processors to function or require them in certain modes of operation.
  • VT处理器是一个支持虚拟化技术的处理器,如Intel VT或AMD Virtualization。一些虚拟机服务器需要VT处理器来运行或者需要它来确保业务模型。

虚拟机模式(Virtual Machine Modes)

There are three primary VM modes: Full Virtualization, Paravirtualization, and Virtual Private Servers.

有三种主要的虚拟机模式:全虚拟化、半虚拟化和虚拟私有服务器。

  • Fully virtual: Complete emulation of all hardware devices. Although it requires special computer hardware, most operating systems can run in fully virtual mode because the VMM emulates all computer devices to fool the operating system into thinking it has exclusive access to an entire computer. This complete emulation of computer hardware demands more CPU resources from the VM Server. As a result, an operating system running in full virtualization mode runs slower.
  • 全虚拟化:是一种完全模拟所有硬件设备的虚拟化模式。由于VMM(虚拟机监控系统)模拟了所有的计算机设备使得操作系统好像独自占用了所有计算机的资源,所以尽管需要特定的计算机硬件,大多数操作系统都可以以全虚拟化模式运行。完全模拟计算机硬件需要消耗虚拟机服务器更多地CPU资源。所以全虚拟化模式操作系统运行速度会比较慢。
  • Paravirtual: Selective emulation of hardware devices. A paravirtualized operating system can run in paravirtual mode, which does not require complete emulation and therefore requires less management overhead. For example, VM-aware operating systems do not require an emulated graphics card, so the VM Server does not need to emulate video data. As a result, an operating system running in paravirtual mode demands fewer CPU resources and has better performance. It also requires no special computer hardware. The host and virtual OSs need to be of the same kernel version and type (32bit or 64bit).
  • 半虚拟化:是一种选择性的模拟硬件设备的虚拟化模式。以半虚拟化模式运行的半虚拟化操作系统并不需要完全模拟硬件,因此只需付出更少的管理代价。例如,VM-aware系统运行时不需要模拟显卡,因此虚拟机服务器就不用模拟视频数据了。所以,以半虚拟化模式运行的操作系统消耗更少的CPU资源并且执行地更好。它也并不需要特定的计算机硬件。主机和虚拟操作系统要用相同版本和型号(32比特或64比特)的内核。
  • Virtual Private Servers: Also referred to as Virtual Environments (VE), offers the least flexibility in the choice of operating system: both the guest and host OSes must be Linux (although Linux distributions can be different in different VPS). There really are no VMs using this method, but more of a virtual wall between application maintained by the OS. This operating system-level virtualization provides better performance, scalability, density, dynamic resource management, and ease of administration than Full and Para virtualization.
  • 虚拟私有服务器是一个在选择操作系统方面灵活性最差的一套虚拟环境。它的客户机和主机的操作系统都必须是Linux(尽管在不同的VPS上linux发行版本可以不同)。更多的应用间的虚拟墙是由操作系统维护的,尽管没有虚拟机用这种方法。这种操作系统级别的虚拟化技术有更好的性能、可测量性、密度、动态资源管理和比全虚拟化和半虚拟化更简单的系统管理。

外部链接(External Links)

AMD VT

Intel VT

This page is part of: