Virtualization2.0 简明教程
Virtualization 2.0 - Hardware
本章我们将讨论硬件的各种组件,例如 CPU、内存、存储和网络。
In this chapter, we will discuss various components of hardware such as CPU, Memory, Storage and Networking.
Understanding Virtual CPU
当我们安装管理程序时,每一个物理 CPU 都将抽象为虚拟 CPU。它划分出每个核心可用的 CPU 周期,并允许多个 VM 在给定的物理处理器核心上进行“时间共享”。一般来说,管理程序通常为每个 vCPU(每个核心)分配一个工作负载。如果服务器上的工作负载需要更多的 CPU 周期,最好在特定的虚拟 CPU 上部署更少的 VM。
When we install a hypervisor, each physical CPU is abstracted into virtual CPUs. This divides the available CPU cycles for each core and allows multiple VMs to "time share" a given physical processor core. Generally talking, the hypervisor typically assigns one workload per vCPU (per core). If the workloads on a server need more CPU cycles, it is better to deploy fewer VMs on a particular virtual CPU.
让我们考虑以下示例以了解虚拟 CPU 的逻辑。
Let us consider the following example to understand the logic of virtual CPU.
我有一台带有两个处理器的物理服务器(CPU 1 和 CPU 2),每个处理器都有四个物理核心。总共,我们有 2 * 4 = 8 个物理核心。
I have a physical server with two processors (CPU 1 and CPU 2) and each of them has four physical cores. In total, we have 2 * 4 = 8 physical cores.
基于我们的管理程序针对每个物理核心提供的一些计算,我们可以得到 5-10 个 vCPU。
Based on some calculations our hypervisor provided for each physical core, we can get 5-10 vCPUs.
总共,我们将有 [8 个物理核心 * (5 到 10 个 vCPU)] 40-80 个 vCPU,这意味着我们可以向虚拟机分配最多 80 个 vCPU。
In total, we will have [8 physical cores * (5 to 10 vCPUs)] 40-80 vCPUs, which means that we can assign a maximum of 80 vCPUs to virtual machines.

Understanding Virtual Memory
虚拟内存简单来说就是计算机的 RAM。虚拟机的内存资源设置决定了从主机分配多少内存给虚拟机。虚拟硬件内存大小决定了虚拟机中运行的应用程序可用的内存大小。
Virtual Memory in simple words is the RAM of the machine. The memory resource settings for a virtual machine determines how much of the host’s memory is allocated to the virtual machine. The virtual hardware memory size determines how much memory is available to applications that run in the virtual machine.
虚拟机无法从超过其配置虚拟硬件内存大小的内存资源受益。 ESXi hosts 将内存资源使用限制为对虚拟机有用的最大量,以便您可以接受无限制内存资源的默认设置。
A virtual machine cannot benefit from more memory resources than its configured virtual hardware memory size. The ESXi hosts limit the memory resource use to the maximum amount useful for the virtual machine, so that you can accept the default of unlimited memory resources.
您可以添加、更改和配置虚拟机内存资源或选项以提升虚拟机性能。您可以在创建虚拟机时设置大多数内存参数,也可以在 Guest Operating System 安装后进行设置。大多数管理程序要求在更改设置前关闭虚拟机。
You can add, change, and configure virtual machine memory resources or options to enhance virtual machine performance. You can set most of the memory parameters while creating the virtual machine or it can also be done after the Guest Operating System is installed. Most of the hypervisors require to power off the virtual machine before changing the settings.
在以下示意图中,您可以看到总物理内存已在两台虚拟机间分配。
In the following schematic illustration, you can see that the total physical memory is divided between two virtual machines.

Understanding Virtual Storage
存储虚拟化是来自多个网络存储设备的物理存储(数据集群)的合并,使其看起来像是由中心控制台管理的单一存储设备。我们无法向虚拟机分配多于数据集群物理提供的存储。
Storage virtualization is the pooling of physical storage (Data cluster) from multiple network storage devices into what appears to be a single storage device that is managed from a central console. We cannot assign more storage to virtual machines that data cluster offers physically.
您将在文件的末尾看到这些扩展。在用作虚拟机一部分的所有文件中,不同的管理程序喜欢使用不同的文件类型。一些比较常见的是 VDI, VHDX, VMDK 和 HDD 。
You will see these extensions on the end of a file. Of all the files used as part of a virtual machine, different hypervisors like to use different file types. Some of the more common are VDI, VHDX, VMDK and HDD.
在以下示例中,我们有一个总容量为 12 TB 的数据集群,以及四台已分配存储的虚拟机,每台存储容量为 12 TB。总的来说,向它们分配的最大存储容量为 12 TB。
In the following example, we have a data cluster of 12 TB in total and four virtual machines to which we have allocated storage to each of them. In total, the maximum storage allocated to them is 12 TB.

Understanding Virtual Networking
我们将通过一个简单的示例来讨论如何完成虚拟网络。
We will discuss this with a simple example as to how virtual networking done.
我们在同一主机上运行虚拟机 1、2、3 和 4。它们希望在彼此之间发送网络流量。这是通过虚拟网络卡完成的,如以下示意图(vNIC)中所示,该示意图通过由管理程序创建的虚拟交换机(vSwitch)进行虚拟连接。
We have Virtual Machine 1, 2, 3 and 4 running on the same host. They would like to send the network traffic back and forth. This is done by virtual networking cards as shown in the following illustration (vNIC), which connects virtually with a virtual switch (vSwitch) that is created by the hypervisor.
该虚拟交换机与服务器的物理卡(pNIC)进行通信,而该物理卡连接到物理交换机(pSwitch),然后与其余网络设备进行通信。
This virtual switch communicates with a physical card of the server (pNIC), which is connected with a physical switch (pSwitch) and then communicates with the rest of the network equipment.
请参阅以下示意图场景。
Please see the following schematically done up scenario.
