設定 VMM 計算光纖的虛擬機器設定Configure virtual machine settings in the VMM compute fabric

重要

已不再支援此版本的 Virtual Machine Manager (VMM),建議升級至 VMM 2019This version of Virtual Machine Manager (VMM) has reached the end of support, we recommend you to upgrade to VMM 2019.

本文說明在 System Center - Virtual Machine Manager (VMM) 網狀架構中,如何設定 VM 的效能和可用性設定。This article describes how to configure performance and availability settings for VMs in the System Center - Virtual Machine Manager (VMM) fabric.

設定包括變更 VM 內容以及設定效能選項,例如儲存品質 (QoS)、可用性選項、資源節流設定和虛擬 NUMA。Settings include changing VM properties, and setting up performance options such as quality-of-storage (QoS), availability options, resource throttling, and virtual NUMA.

將虛擬介面卡新增至 VMAdd a virtual adapter to a VM

您可以從執行中的 VM 新增和移除虛擬網路介面卡 (vNIC)。You can add and remove virtual network adapters (vNICs) from VMs that are running. 這樣可降低工作負載的停機時間。This reduces workload downtime. 請注意:Note that:

  • 您可以藉由建立或修改 VMM 硬體設定檔,來新增虛擬網路介面卡。You add new virtual network adapters by creating or modify a VMM hardware profile.
  • 這項功能僅適用於第 2 代 VM。This feature is only available for Generation 2 VMs.
  • 根據預設,新增的虛擬網路介面卡將不會連線至虛擬網路。By default added virtual network adapters aren't connected to a virtual network. 在主機上部署 VM 之後,您可以設定已使用硬體設定檔指派的 VM 來使用一或多個虛擬網路介面卡。You can configure VMs assigned with the hardware profile to use one or more of the virtual network adapters, after they're deployed on a host.
  1. 在虛擬機器內容 > [硬體設定] 中,按一下 [網路介面卡] ,然後選取要新增的網路介面卡。In the virtual machine properties > Hardware Configuration, click Network Adapters, and select the network adapter you want to add.

  2. 您可以針對網路介面卡設定多個內容,包括:You can configure a number of properties for the network adapter, including:

    • 已連線到︰選取介面卡的連線目標。Connected to: Select what the adapter is connected to.
    • 未連線︰選取您是否想要現在指定網路。Not connected: Select if you don't want to specify a network now.
    • 內部網路︰選取您是否想要連線到隔離的內部網路,以便在相同主機上的 VM 之間進行通訊。Internal network: Select if you want to connect to an isolated internal network that enables communication among VMs on the same host. 連接到內部虛擬網路的虛擬機器無法與主機、主機 LAN 上的任何其他實體電腦或網際網路進行通訊。Virtual machines attached to the internal virtual network cannot communicate with the host, with any other physical computers on the host's LAN, or with the internet.
    • 外部網路︰選取選項,以指定使用此硬體設定檔建立的虛擬機器將連線至其主機上的實體網路介面卡。External network: Select to specify that a virtual machine created by using this hardware profile will be connected to a physical network adapter on its host. 連接至實體網路介面卡的虛擬機器可以與任何主機可以通訊的實體或虛擬電腦進行通訊,而且可以與內部網路上或透過主機電腦可以存取的網際網路上可用的任何資源進行通訊。Virtual machines attached to a physical network adapter can communicate with any physical or virtual computer that the host can communicate with and with any resources available on the intranet and over the Internet that the host computer can access.
    • 乙太網路 (MAC) 位址:電腦,虛擬機器上的虛擬 MAC 位址可以唯一識別相同子網路上的每部電腦。Ethernet (MAC) address: computers, a virtual MAC address on virtual machines uniquely identifies each computer on the same subnet. 選取下列其中一個選項:Select one of the following options:
    • 動態Dynamic. 如果想要啟用虛擬機器的動態 MAC 位址,請選取這個選項。Select this option if you want to enable a dynamic MAC address for a virtual machine.
    • 靜態Static. 如果想要指定虛擬機器的靜態 MAC 位址,請選取這個選項。Select this option if you want to specify a static MAC address for a virtual machine. 請在提供的欄位中輸入靜態 MAC 位址。Type a static MAC address in the field provided.

使用 PowerShell 新增虛擬介面卡Add a virtual adapter with PowerShell

您可以使用 PowerShell 來新增虛擬介面卡。You can use PowerShell to add a virtual adapter. 以下是設定此功能的 Cmdlet 範例︰Here's a sample cmdlet for setting this up:

範例 1Example 1

新增 vNIC:Add a vNIC:

  • 第一個命令會取得名為 VM01 的虛擬機器物件,然後將物件儲存在 $VM 變數中。The first command gets the virtual machine object named VM01, and then stores the object in the $VM variable.
  • 第二個命令會在 VM01 上建立虛擬網路介面卡。The second command creates a virtual network adapter on VM01.
PS C:\> $VM = Get-SCVirtualMachine -Name "VM01"
PS C:\> New-SCVirtualNetworkAdapter -VM $VM -Synthetic

範例 2Example 2

下列 PowerShell 命令會從執行中的 VM 移除 vNIC。The following PowerShell commands will remove a vNIC from a running VM. 它假設 VM 上只有一個 vNIC。It assumes there's only one vNIC on the VM.

  • 第一個命令會取得名為 VM02 的虛擬機器物件,然後將物件儲存在 $VM 變數中。The first command gets the virtual machine object named VM02, and then stores the object in the $VM variable.
  • 第二個命令會取得 VM02 上的虛擬網路介面卡物件,然後將物件儲存在 $Adapter 變數中。The second command gets the virtual network adapter object on VM02, and then stores the object in the $Adapter variable.
  • 最後一個命令會從 VM02 移除存放於 $Adapter 的虛擬網路介面卡物件。The last command removes the virtual network adapter object stored in $Adapter from VM02.
PS C:\> $VM = Get-SCVirtualMachine -Name "VM02"
PS C:\> $Adapter = Get-SCVirtualNetworkAdapter -VM $VM
PS C:\> Remove-SCVirtualNetworkAdapter -VirtualNetworkAdapter $Adapter

管理執行中 VM 的靜態記憶體Manage static memory on a running VM

您可以修改使用靜態記憶體之執行中 VM 的記憶體設定。You can modify the memory configuration of a running VM that uses static memory. 這項功能有助於避免因重新設定而產生的工作負載停機時間。This feature helps in eliminating workload downtime due to reconfiguration. 您可以增加或減少記憶體配置,或將虛擬機器切換為動態記憶體。You can increase or decrease the memory allocation, or switch the virtual machine to dynamic memory. 請注意,使用者已可從 VMM 修改執行中 VM 的動態記憶體,此功能是關於修改靜態記憶體。Note that users can already modify dynamic memory for a running VM from VMM and this feature is about modifying the static memory.

使用下列 PowerShell 範例修改靜態記憶體設定。Using the following PowerShell examples to modify the static memory setting.

範例 1Example 1

變更執行中虛擬機器的靜態記憶體。Change the static memory for a running virtual machine.

  • 第一個命令會取得名為 VM01 的虛擬機器物件,然後將物件儲存在 $VM 變數中。The first command gets the virtual machine object named VM01, and then stores the object in the $VM variable.
  • 第二個命令會將配置給 VM01 的記憶體變更為 1024 MB。The second command changes the memory allocated to VM01 to 1024 MB.
PS C:\> $VM = Get-SCVirtualMachine -Name "VM01"
PS C:\> Set-SCVirtualMachine -VM $VM -MemoryMB 1024

範例 2Example 2

為執行中的虛擬機器啟用動態記憶體。Enable dynamic memory for a running virtual machine.

  • 第一個命令會取得名為 VM02 的虛擬機器物件,然後將物件儲存在 $VM 變數中。The first command gets the virtual machine object named VM02, and then stores the object in the $VM variable.
  • 第二個命令會啟用動態記憶體,並將啟動記憶體設定為 1024 MB、記憶體上限設定成 2048 MB。The second command enables dynamic memory, sets the startup memory to 1024 MB, and sets the maximum memory to 2048 MB.
PS C:\> $VM = Get-SCVirtualMachine -Name "VM02"
PS C:\> Set-SCVirtualMachine -VM $VM -DynamicMemoryEnabled $True -MemoryMB 1024 -DynamicMemoryMaximumMB 2048

在 VM 中加入服務視窗Add a servicing window to a VM

您可以設定VM 或服務的服務視窗,以便在 VMM 主控台進行維護。You can set up a servicing window for a VM or service so that you can maintain it outside the VMM console. 您要設定視窗,然後將它指派給 VM 內容。You set up the window, and then assign it to the VM properties.

建立 VM 的生產檢查點Create a production checkpoint for a VM

生產檢查點可讓您輕鬆建立 VM 的「時間點」映像,以供日後還原。Production checkpoints allow you to easily create "point in time" images of a VM, which can then be restored later.

  • 生產檢查點是使用客體內部的備份技術建立檢查點,不是使用儲存的狀態技術。Productions checkpoints are achieved using backup technology inside the guest to create the checkpoint, instead of using saved state technology.

  • 在執行 Windows 作業系統的虛擬機器上,生產檢查點是與磁碟區快照服務 (VSS) 一起建立。On a virtual machine running a Windows operating system production checkpoints are created with the Volume Snapshot Service (VSS).

  • Linux 虛擬機器會排清其檔案系統緩衝區,以建立一致的檔案系統檢查點。Linux virtual machines flush their file system buffers to create a file system consistent checkpoint.

  • 如果想要使用儲存狀態技術建立檢查點,您的虛擬機器仍然可以選擇使用標準檢查點。If you want to create checkpoints using saved state technology you can still choose to use standard checkpoints for your virtual machine.

  • 您可以設定這些 VM 檢查點設定的其中之一:You can set one of these checkpoint settings for a VM:

    • Disabled︰不使用任何檢查點。Disabled: No checkpoint taken.
    • Production︰生產檢查點是虛擬機器的應用程式一致快照。Production: Production checkpoints are application consistent snapshots of a virtual machine. Hyper-V 會利用客體 VSS 提供者建立虛擬機器的映像,而此虛擬機器所有應用程式的狀態皆一致。Hyper-V leverages the guest VSS provider to create an image of the virtual machine where all of its applications are in a consistent state. 生產環境快照集不支援建立期間的自動復原階段。The production snapshot does not support the auto-recovery phase during creation. 套用生產檢查點需要還原的虛擬機器從離線狀態開機,就像使用還原備份一樣。Applying a production checkpoint requires the restored virtual machine to boot from an off-line state just like with a restored backup. 這更適合生產環境。This is always more suitable for production environments.
    • ProductionOnly︰這個選項和 [Production] 只有一點不同︰使用 [ProductionOnly] 時,如果生產檢查點失敗,即不使用任何檢查點。ProductionOnly: This option is the same as Production with one key difference: With ProductionOnly, if a production checkpoint fails then no checkpoint will be taken. [Production] 和它的不同之處在於,如果生產檢查點失敗,即改用標準的檢查點。This is different from Production where if a production checkpoint fails, a standard checkpoint will be taken instead.
    • Standard︰儲存所有執行中應用程式的記憶體狀態,當您套用檢查點時,應用程式會還原為先前的狀態。Standard: All of the memory state of running applications gets stored so that when you apply the checkpoint the application reverts to the previous state. 這並不適合生產環境的多數應用程式。For many applications this would not be suitable for a production environment. 因此,此類型的檢查點通常更適合開發和測試環境中某些應用程式。Therefore this type of checkpoint is typically more suitable for development and test environments for some applications.

使用下列 PowerShell 命令設定檢查點:Set-SCVirtualMachine CheckpointType (Disabled, Production, ProductionOnly, Standard)Set the checkpoint with the following PowerShell command: Set-SCVirtualMachine CheckpointType (Disabled, Production, ProductionOnly, Standard)

設定叢集 VM 的可用性選項Configure availability options for clustered VMs

您可以設定多項設定,幫助叢集中的虛擬機器提高可用性與恢復:You can configure a number of setting that help high availability and resilience for virtual machines in a cluster:

  • 儲存體 QoS︰您可以使用服務品質 (QoS) 設定,來設定 Hyper-V VM 硬碟,以控制頻寬。Storage QoS: You can configure Hyper-V VM hard disks with quality-of-service (QoS) settings, to control bandwidth. 您可以使用 Hyper-V 管理員來執行這項操作。You use Hyper-V Manager to do this.
  • 虛擬機器優先順序︰您可以為部署在主機叢集中 VM 設定優先順序。Virtual machine priority: You can configure priority settings for VMs deployed in a host cluster. 根據 VM 優先順序,主機叢集會先啟動或放置高優先順序的虛擬機器,之後才是中優先順序或低優先順序的虛擬機器。Based on VM priority, the host cluster starts or places high-priority virtual machines before medium-priority or low-priority virtual machines. 這樣可確保先為高優先順序的虛擬機器配置記憶體與其他資源,以獲得較好的效能。This ensures that the high-priority virtual machines are allocated memory and other resources first, for better performance. 此外在節點失敗後,若高優先順序的虛擬機器並未啟動所需的記憶體或其他資源時,會將較低優先順序的虛擬機器進行離線,以釋放資源供高優先順序的虛擬機器使用。Also, after a node failure, if the high-priority virtual machines do not have the necessary memory and other resources to start, the lower priority virtual machines will be taken offline to free up resources for the high-priority virtual machines. 被佔用的虛擬機器稍後會依優先順序重新啟動。Virtual machines that are preempted are restarted later in priority order.
  • 虛擬機器的偏好與可能的擁有者:這些設定會影響主機叢集節點上,虛擬機器的放置。Preferred and possible owners of virtual machines: These settings influence the placement of virtual machines on the nodes of the host cluster. 依預設,沒有偏好的擁有者 (沒有偏好設定),而可能的擁有者包含叢集上的所有伺服器節點。By default, there are no preferred owners (there is no preference), and the possible owners include all server nodes on the cluster.
  • 可用性集合:當您將多部虛擬機器放置於可用性集合時,VMM 會嘗試將這些虛擬機器放置在不同的主機上,並儘可能避免將它們全放置在同一個主機上。Availability sets: When you place multiple virtual machines in an availability set, VMM will attempt to keep those virtual machines on separate hosts and avoid placing them together on the same host whenever possible. 這有助於改善服務的持續性。This helps to improve continuity of service.

設定 VM 的 QoSConfigure QoS for a VM

  1. 開啟 [Hyper-V 管理員] ,然後按一下 [動作] > [設定] 。Open Hyper-V Manager, and click Action > Settings.
  2. 在 [SCSI 控制器] 中,按一下 [硬碟機] In SCSI Controller, click Hard Drive
  3. 在 [進階功能] 中,按一下 [啟用服務品質管理] 。In Advanced Features, click Enable Quality of Service management.
  4. 指定最小和最大 IOPS 值。Specify minimum and maximum IOPS values.

設定優先順序Configure priority

  1. 使用下列其中一個選項,設定虛擬機器或虛擬機器範本:Configure a virtual machine or virtual machine template by using one of the following options:

    • 若要設定已部署的虛擬機器,請在 [VM 和服務] 中瀏覽至虛擬機器部署所在的主機。To configure a deployed virtual machine, in VMs and Services, navigate to the host on which the virtual machine is deployed. 以滑鼠右鍵按一下虛擬機器 > [內容] 。Right-click the virtual machine > Properties.
    • 若要設定預存虛擬機器,請在 [資源庫] 中瀏覽至虛擬機器儲存所在的程式庫伺服器。To configure a stored virtual machine, in the Library, navigate to the library server on which the virtual machine is stored. 以滑鼠右鍵按一下虛擬機器 > [內容] 。Right-click the virtual machine > Properties.
    • 您也可以在設定 VM 時,在 [設定硬體] 頁面設定優先順序。You can also set up priority while you're configuring a VM, on the Configure Hardware page. 若要設定虛擬機器範本,請在 [資源庫] > [範本] ,按一下 [VM 範本] 。To configure a virtual machine template, in Library > Templates, click VM Templates. 以滑鼠右鍵按一下虛擬機器範本 > [內容] 。Right-click the virtual machine template, > Properties.
  2. 在 [硬體組態] 或 [設定硬體] 中,向下捲動至 [進階] ,再按一下 [可用性] 。In Hardware Configuration or Configure Hardware, scroll down to Advanced, and click Availability. 確認已勾選 [讓此虛擬機器成為高可用性] 。Make sure Make this virtual machine highly available is checked. 在已部署的虛擬機器上,無法變更這項設定,因為這取決於虛擬機器是否部署在主機叢集上。On a deployed virtual machine this setting cannot be changed, because it depends on whether the virtual machine is deployed on a host cluster.

  3. 在 [虛擬機器優先順序] 中,選取 VM 的 [高]、[中] 或 [低] 優先順序。In Virtual machine priority, select a priority of High, Medium, or Low for the VM. 如果您想要讓虛擬機器一律需要手動啟動,且永遠不會預先清空其他虛擬機器,請選取 [不要自動重新啟動] 。If you want the virtual machine to always require a manual start and never preempt other virtual machines, select Do not restart automatically.

設定慣用的擁有者Configure preferred owners

  1. 在 [VM 和服務] 中瀏覽至虛擬機器部署所在的主機。In VMs and Services, navigate to the host on which the virtual machine is deployed. 以滑鼠右鍵按一下虛擬機器 > [內容] 。Right-click the virtual machine > Properties.

  2. 按一下 [設定] 設定選項:Click Settings and configure the options:

    • 若要控制叢集中的哪些節點 (伺服器) 大部分時間將擁有虛擬機器,請設定慣用的擁有者清單。To control which nodes (servers) in the cluster will own the virtual machine most of the time, configure the preferred owners list.
    • 若要防止特定節點擁有虛擬機器,請設定可能的擁有者清單,只刪去應永遠不能擁有虛擬機器的節點。To prevent a virtual machine from being owned by a particular node, configure the possible owners list, omitting only the nodes that should never own the virtual machine.

設定可用性集合Configure availability sets

您可以設定叢集中獨立 VM 的可用性集合或服務範本的可用性集合,以指定該如何在主機上放置使用範本建立的 VM。You can configure availability sets for standalone VMs in a cluster, or in availability sets in a service template, to specify how VMs created with the template should be placed on hosts.

  1. 使用下列其中一個選項,設定虛擬機器或虛擬機器範本:Configure a virtual machine or virtual machine template by using one of the following options:

    • 若要設定已部署的虛擬機器,請在 [VM 和服務] 中瀏覽至虛擬機器部署所在的主機。To configure a deployed virtual machine, in VMs and Services, navigate to the host on which the virtual machine is deployed. 以滑鼠右鍵按一下虛擬機器 > [內容] 。Right-click the virtual machine > Properties.
    • 若要設定預存虛擬機器,請在 [資源庫] 中瀏覽至虛擬機器儲存所在的程式庫伺服器。To configure a stored virtual machine, in the Library, navigate to the library server on which the virtual machine is stored. 以滑鼠右鍵按一下虛擬機器 > [內容] 。Right-click the virtual machine > Properties.
    • 您也可以在設定 VM 時,在 [設定硬體] 頁面設定優先順序。You can also set up priority while you're configuring a VM, on the Configure Hardware page. 若要設定虛擬機器範本,請在 [資源庫] > [範本] ,按一下 [VM 範本] 。To configure a virtual machine template, in Library > Templates, click VM Templates. 以滑鼠右鍵按一下虛擬機器範本 > [內容] 。Right-click the virtual machine template, > Properties.
  2. 在 [硬體組態] 索引標籤上,向下捲動至 [進階] ,然後按一下其下的 [可用性] 。On the Hardware Configuration tab, scroll down to Advanced and under it, click Availability.

  3. 確認 [讓此虛擬機器成為高可用性] 具有預期的設定。Confirm that Make this virtual machine highly available has the intended setting. (在已部署的虛擬機器上,無法變更這項設定,因為這取決於虛擬機器是否部署在主機叢集上。)(On a deployed virtual machine, the setting cannot be changed, because it depends on whether the virtual machine is deployed on a host cluster.)

  4. 在 [可用性集合] 下方,按一下 [管理可用性集合] 。Under Availability sets, click Manage availability sets.

  5. 按一下可用性集合的名稱,並使用控制項來新增或移除集合。Click the name of an availability set, and use the controls to add or remove the set. 重複這項動作,直到所有預期的可用性集合都出現在 [已指派的內容] 清單中。Repeat this action until all of the intended availability sets appear in the Assigned properties list. 若要建立新的可用性集合,請按一下 [建立] 按鈕,提供集合的名稱,然後按一下 [確定] 。To create a new availability set, click the Create button, provide a name for the set, and then click OK.

  6. 若要確認虛擬機器清單中已部署虛擬機器的設定,請檢視 [可用性集合名稱] 下方的名稱。To verify the setting for a deployed virtual machine, in the listing for the virtual machine, view the name under Availability Set Name.

針對主機叢集上已部署的虛擬機器,這項設定的另一個設定方法是使用 Windows PowerShell 命令進行容錯移轉叢集。For virtual machines that have been deployed on a host cluster, another way to configure this setting is to use Windows PowerShell commands for failover clustering. 在本文中,設定會出現在 Get-ClusterGroup 作為 AntiAffinityClassNamesIn this context, the setting appears in the Get-ClusterGroup as AntiAffinityClassNames.

設定資源節流Configure resource throttling

VMM 包含資源節流功能,例如處理器 (CPU) 和記憶體節流,可控制資源配置及提高虛擬機器執行效率。VMM includes resource throttling features such as processor (CPU) and memory throttling, to control resource allocation and help virtual machines to run more effectively.

  • 處理器節流:您可以設定虛擬處理器的份額,提供處理器更多或更少的 CPU 週期時間。Processor throttling: You can set the weight of a virtual processor to provide the processor with a larger or smaller share of CPU cycles. 這些內容確保當過度提交 CPU 資源時,可提高或推遲 VM 的優先順序。The properties ensure that VMs can be prioritized or deprioritized when CPU resources are overcommitted. 若為極大量的工作負載,可增加更多虛擬處理器,尤其當實體 CPU 已接近其上限時。For highly intensive workloads, more virtual processors can be added, especially when a physical CPU is close to its upper limit.

    • 高、標準、低、自訂:指定發生競爭時如何分配 CPU。High, Normal, Low, Custom: Specifies how the CPU is distributed when contention occurs. 首先會先將 CPU 配置給較高優先順序虛擬機器。Higher priority virtual machines will be allocated CPU first.
    • 保留 CPU 週期 (%) :指定與一個邏輯處理器相關聯的 CPU 資源百分比,以保留給虛擬機器。Reserve CPU cycles (%): Specifies the percentage of CPU resources that are associated with one logical processor that should be reserved for the virtual machine. 當虛擬機器執行的應用程式特別耗用 CPU 資源,而且您想要確保基本最低的 CPU 資源層級時,這十分有用。This is useful when a virtual machine runs applications that are particularly CPU-intensive and you want to ensure a minimal level of CPU resources. 設為零表示不會為虛擬機器保留特定的 CPU 百分比。A zero setting indicates that no specific CPU percentage is reserved for the virtual machine.
    • 限制 CPU 週期 (%) :指定虛擬機器不應該耗用超過一個邏輯處理器的指示百分比。Limit CPU cycles (%)"Specifies that the virtual machine should not consume more that the indicated percentage of one logical processor.
  • 記憶體節流和權重:記憶體節流可協助提高或推遲記憶體資源受限案例中記憶體資源的存取優先順序。Memory throttling and weight: Memory throttling helps to prioritize or deprioritize access to memory resources in scenarios where memory resources are constrained. 當主機的記憶體使用量偏高時,記憶體優先順序較高的虛擬機器會比優先順序較低的虛擬機器先被配置記憶體資源。When memory usage on a host is high, then the virtual machines with a higher memory priority are allocated memory resources before the virtual machines with a lower priority. 如果您指定較低的優先順序,當其他虛擬機器正在執行且可用記憶體偏低時,這會造成虛擬機器無法啟動。If you specify a lower priority, it might prevent a virtual machine from starting when other virtual machines are running and the available memory is low. 您可以設定記憶體優先順序設定和閾值,如下所示:You can set the memory priority settings and thresholds as follows:

    • 靜態:指派給特定虛擬機器的靜態記憶體數量。Static: The amount of static memory that is assigned to a specific virtual machine.
    • 動態:動態記憶體設定包括:Dynamic: Dynamic memory settings include:
      • 啟動記憶體:啟動虛擬機器時,配置給虛擬機器的記憶體數量。Start-up memory: The amount of memory that is allocated to the virtual machine when it starts up. 這應該至少設定為虛擬機器上執行作業系統和應用程式所需的記憶體數量下限。It should at least be set to the minimum amount of memory that is required to run the operating system and applications on the virtual machine. 動態記憶體將視需求調整記憶體數量。Dynamic memory will adjust the memory amount as required.
      • 記憶體下限:這是虛擬機器所需的記憶體數量下限。Minimum memory: The minimum amount of memory that is required for the virtual machine. 其可讓閒置機器將記憶量消耗量向下調整至低於啟動記憶體需求。It allows an idle machine to scale back the memory consumption below the start-up memory requirement. 然後其他虛擬機器便可使用可用記憶體。The available memory can then be used by other virtual machines.
      • 記憶體上限:配置給虛擬機器的記憶體限制。Maximum memory: The memory limit that is allocated to the virtual machine. 預設值為 1 TB。The default value is 1 TB.
      • 記憶體緩衝區百分比:動態記憶體會視需求將記憶體新增至虛擬機器,但可能在動態記憶體配置記憶體之前,應用程式便需要記憶體。Memory Buffer Percentage: Dynamic memory adds memory to a virtual machine as required, but there is a chance that an application might demand memory more quickly than dynamic memory allocates it. 記憶體緩衝區百分比會視需求指定可指派給虛擬機器的可用記憶體數量。The memory buffer percentage specifies the amount of available memory that will be assigned to the virtual machine if needed. 百分比是根據虛擬機器上所執行應用程式和服務實際需要的記憶體數量。The percentage is based on the amount of memory that is actually needed by the applications and services that run on the virtual machine. 這會以百分比表示,因為它會隨著虛擬機器需求不同而變更。It is expressed as a percentage because it changes depending on the virtual machine requirements.
        • 百分比的計算方式如下:記憶體緩衝區數量 = 虛擬機器所需的記憶體/(記憶體緩衝區值/100)。The percentage is calculated as follows: Amount of memory buffer = memory needed by the virtual machine/ (memory buffer value/100).
        • 例如,若提交給虛擬機器的記憶體為 1000 MB,而緩衝區為 20%,則會額外配置 20% (200 MB) 做為緩衝區,使得配置給該虛擬機器的實體記憶體總共有 1200 MB。For example, if the memory that is committed to the virtual machine is 1000 MB and the buffer is 20%, then an additional buffer of 20% (200 MB) will be allocated for a total of 1200 MB of physical memory allocated to the virtual machine.
    • 記憶體權重:完全使用記憶體資源時,要配置給虛擬機器的優先順序。Memory weight: The priority that is allocated to a virtual machine when the memory resources are in full use. 如果您設定高優先順序值,則配置記憶體資源時會提高虛擬機器的優先順序。If you set a high priority value, it will prioritize a virtual machine when the memory resources are allocated. 如果您設定低優先順序,則若記憶體資源不足時可能會無法啟動虛擬機器。If you set a low priority, a virtual machine might be unable to start if memory resources are insufficient.

設定處理器節流Configure processor throttling

  1. 在虛擬機器 > [內容] > [進階] ,按一下 [CPU 優先順序] 。In the virtual machine > Properties > Advanced, click CPU Priority.

  2. 選取虛擬機器的優先順序值。Select a priority value for the virtual machine. 這些值指定虛擬機器間平衡 CPU 資源的方式,並對應至 Hyper-V 中的相對權重值:These values specify how the CPU resources are balanced between virtual machine, and correspond to the relative weight value in Hyper-V:

    • 高:相對權重值為 200High—Relative weight value of 200
    • 標準:相對權重值為 100Normal—Relative weight value of 100
    • 低:相對權重值為 50Low—Relative weight value of 50
    • 自訂:介於 1 到 10000 之間支援的相對權重值Custom—Relative weight values that are supported are between 1 and 10000
  3. 在 [保留 CPU 週期 (%)] 中,指定一個應保留給某個虛擬機器之邏輯處理器上的 CPU 資源百分比。In Reserve CPU cycles (%), specify the percentage of the CPU resources on one logical processor that should be reserved for a virtual machine. 當虛擬機器執行的應用程式特別耗用 CPU 資源,而且您想要確保基本最低的 CPU 資源層級時,這十分有用。This is useful when a virtual machine runs applications that are particularly CPU-intensive, and you want to ensure a minimal level of CPU resources. 設為零表示不保留特定的 CPU 百分比。A zero setting indicates that no specific CPU percentage is reserved.

  4. 在 [限制 CPU 週期 (%)] 中,指定一個邏輯處理器上可供虛擬機器耗用的 CPU 資源百分比上限。In Limit CPU cycles (%), specify the maximum percentage of the CPU resources on one logical processor that the virtual machine should consume. 配置給虛擬機器的資源將不會多於此百分比。The virtual machine will not be allocated more than this percentage.

設定記憶體節流設定Configure memory throttling

  1. 在虛擬機器 > [內容] > [一般] ,按一下 [記憶體] 。In the virtual machine > Properties > General, click Memory.

  2. 選取 [靜態] ,指定應指派給虛擬機器的固定記憶體數量。Select Static to specify that a fixed amount of memory should be assigned to a virtual machine.

  3. 選取 [動態] ,指定虛擬機器的動態記憶體設定,如下所示:Select Dynamic to specify the dynamic memory settings for a virtual machine, as follows:

    • 在 [啟動記憶體] 中,指定啟動虛擬機器時,配置給虛擬記憶體的記憶體數量。In Startup memory, specify the amount of memory that is allocated to the virtual machine when it starts up. 此記憶體值應至少設為虛擬機器作業系統與應用程式執行時所需的最低記憶體數量。The memory value should be set at least to the minimum amount of memory that is required for the virtual machine operating system and applications to run.
    • 在 [記憶體下限] 中,指定可讓閒置的虛擬機器將記憶體耗用量降到啟動記憶體需求以下的記憶體數量。In Minimum memory, specify an amount of memory that allows an idle virtual machine to scale back the memory consumption below the startup memory requirement. 如此就有更多記憶體可供其他虛擬機器使用。This makes more memory available for use by other virtual machines.
    • 在 [記憶體上限] 中,指定配置給虛擬記憶體的記憶體數量上限。In Maximum memory, specify the maximum amount of memory that is allocated to a virtual machine. 預設值是 1 TB。The default setting is 1 TB.
    • 在 [記憶體緩衝區百分比] 中,指定當需求上升時,指派給虛擬機器的可用記憶體數量。In Memory buffer percentage, specify the amount of available memory that will be assigned to a virtual machine if the need arises. 此百分比應該根據虛擬機器上執行的應用程式與服務實際所需的記憶體數量。The percentage should be based on the amount of memory that is actually needed by the applications and services that run on the virtual machine. 記憶體緩衝區百分比應比照下列方式計算:記憶體緩衝區數量 = 虛擬機器所需的記憶體/ (記憶體緩衝區值/100)。The memory buffer percentage should be calculated as follows: Amount of memory buffer = memory that is needed by the virtual machine/ (memory buffer value/100). 例如,若提交給虛擬機器的記憶體為 1000 MB,而緩衝區為 20%,則會額外配置 20% (200 MB) 做為緩衝區,使得配置給該虛擬機器的實體記憶體總共有 1200 MB。For example, if the memory that is committed to the virtual machine is 1000 MB and the buffer is 20%, then an additional buffer of 20% (200 MB) will be allocated for a total of 1200 MB of physical memory allocated to the virtual machine.

設定虛擬 NUMAConfigure virtual NUMA

設定、部署和管理 VMM 的虛擬非統一記憶體存取 (NUMA)。You configure, deploy, and manage virtual Non-Uniform Memory Access (NUMA) in VMM. 虛擬 NUMA 具有下列屬性︰Virtual NUMA has the following properties:

  • NUMA 是個用於多處理器系統的記憶體架構。在此類系統中,處理器存取記憶體的時間會因記憶體與處理器間的相對位置而有所不同。NUMA is a memory architecture that is used in multiprocessor systems, where the time that is required for a processor to access memory depends on the location of the memory relative to the processor. 在 NUMA 系統中,處理器存取本機記憶體 (直接連接至該處理器的記憶體) 的速度快於存取非本機記憶體 (連接至其他處理器的記憶體) 的速度。On a NUMA system, a processor can access the local memory (the memory that is directly attached to the processor) faster than the non-local memory (the memory that is attached to another processor). NUMA 嘗試拉近處理器與所用記憶體之間的速度差距。NUMA attempts to close the gap between the speed of processors and the memory that they use. 為了達到此目的,NUMA 會為各處理器提供不同的記憶體,因此有助於避免因多個處理器試圖存取相同記憶體而造成的效能下降現象。To do so, NUMA provides separate memory on a per-processor basis, thus This helps to avoid the performance degradation that occurs when multiple processors try to access the same memory. 專用記憶體的每個區塊稱為 NUMA 節點。Each block of dedicated memory is known as a NUMA node.
  • 虛擬 NUMA 可讓需要處理較多任務的較大型工作負載得以順利發展。相較於使用實體 NUMA 硬體來執行非虛擬電腦,這樣的工作負載可於虛擬環境中執行而不會造成效能的大幅下降。Virtual NUMA enables the deployment of larger and more mission-critical workloads that can be run without significant performance degradation in a virtualized environment, when compared to running non-virtualized computers with physical NUMA hardware. 建立新的虛擬機器時,Hyper-V 會依預設使用與 Hyper-V 主機 NUMA 拓樸同步的客體設定值。When a new virtual machine is created, by default Hyper-V uses values for the guest settings that are in sync with the Hyper-V host NUMA topology. 例如,若某主機具有 16 個核心與 64 GB,並在兩個 NUMA 節點平均分配,每個實體處理器通訊端有兩個 NUMA 節點,則在此具 16 個虛擬處理器的主機上建立的虛擬機器將會擁有最高每節點處理器數目 (8 個)、最高每通訊端節點數量 (2 個) 及最高每節點記憶體總量 (32 GB)。For example, if a host has 16 cores and 64 GB divided evenly between two NUMA nodes with two NUMA nodes per physical processor socket, then a virtual machine that is created on the host with 16 virtual processors will have the maximum number of processors per node setting set to eight, maximum nodes per socket set to two, and maximum memory per node set to 32 GB.
  • NUMA 跨越可進行啟用或停用。NUMA spanning can be enabled or disabled. 啟用跨越時,各個虛擬 NUMA 節點可配置非本機記憶體,且相較於在 Hyper-V 主機的基礎硬體 NUMA 節點上的可用處理器數目,系統管理員部署的虛擬機器可於每個虛擬 NUMA 節點中擁有更多虛擬處理器。With spanning enabled, individual virtual NUMA nodes can allocate non-local memory, and an administrator can deploy a virtual machine that has more virtual processors per virtual NUMA node than the number of processors that are available on the underlying hardware NUMA node on the Hyper-V host. 虛擬機器的 NUMA 跨越會產生效能成本,因為虛擬機器會存取非本機 NUMA 節點上的記憶體。NUMA spanning for a virtual machine does incur a performance cost because virtual machines access memory on non-local NUMA nodes.

請依指示設定 VM的 虛擬 NUMA︰Set up virtual NUMA for VMs as follows:

  1. 在虛擬機器 > [內容] > [進階] ,按一下 [虛擬 NUMA] 。In the virtual machine > Properties > Advanced, click Virtual NUMA.
  2. 在 [每個虛擬 NUMA 節點的處理器上限] 中,指定屬於相同虛擬機器,且可在一個虛擬 NUMA 節點上同時使用的虛擬處理器最大數量。In Maximum processors per virtual NUMA node, specify the maximum number of virtual processors that belong to the same virtual machine and that can be used concurrently on a virtual NUMA node. 設定此設定以確保最大頻寬。Configure this setting to ensure maximum bandwidth. 不同 NUMA 虛擬機器以使用不同的 NUMA 節點。different NUMA virtual machines to use different NUMA nodes. 其最小值為 1,最大值為 32。The minimum limit is 1 and the maximum is 32.
  3. 在 [每個虛擬 NUMA 節點的最大記憶體 (MB)] 中,指定可配置到單一虛擬 NUMA 節點的最高記憶體數量 (MB)。In Maximum memory per virtual NUMA node (MB), specify the maximum amount of memory (MB) that can be allocated to a single virtual NUMA node. 其最小值為 8 MB,最大值為 256 GB。The minimum limit is 8 MB and the maximum is 256 GB.
  4. 在 [每個通訊端的虛擬 NUMA 節點上限] 中,指定單一通訊端上可允許之虛擬 NUMA 節點的最高數量。In Maximum virtual NUMA nodes per socket, specify the maximum number of virtual NUMA nodes that are allowed on a single socket. 其最小值為 1,最大值為 64。The minimum number is 1 and the maximum is 64.
  5. 若要啟用跨越,請按一下 [允許虛擬機器跨越硬體 NUMA 節點] 。To enable spanning, click Allow virtual machine to span hardware NUMA nodes.