設定 VMM 中的動態和電源最佳化Set up dynamic and power optimization in VMM

重要

已不再支援此版本的 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) 的動態最佳化 (DO) 和電源最佳化。Read this article to learn about enabling dynamic optimization (DO) and power optimization for virtual machines (VMs) in the System Center - Virtual Machine Manager (VMM). 本文包括功能概觀、設定 BMC 進行電源最佳化的指示,以及如何啟用和執行這些功能的描述。The article includes features overview, instructions for setting up BMC for power optimization, and describes how to enable and run these features.

注意

VMM 2019 和更新版本支援計算和儲存體的動態最佳化。VMM 2019 and later supports dynamic optimization for Compute and Storage. VMM 2019 之前的版本僅支援計算的 DO,視您使用的 VMM 版本,使用適用的下列程序。Versions prior to VMM 2019 support DO for compute only, use the following procedures as applicable for the version of VMM you are using.

  • 動態最佳化:VMM 會使用動態最佳化,在主機叢集內執行 VM 和 VHD 的即時移轉。Dynamic optimization: Using dynamic optimization, VMM performs live migration of VMs and VHDs within a host cluster. 移轉會根據您指定的設定,來改善主機和叢集共用存放裝置之間的負載平衡 (叢集共用磁碟區 (CSV),檔案共用),以及更正 VM 的放置問題。The migration is based on the settings you specify, to improve load balancing among hosts and cluster shared storage (Cluster shared volumes (CSV), file shares), and to correct the placement issues for VMs.

    • 藉由跨主機移轉 VM,可對叢集中的主機執行計算動態最佳化 (主機最佳化),來將主機效能最佳化。Compute Dynamic optimization (Optimization of hosts) can be performed on hosts in a cluster to optimize host performance by migrating VMs across hosts. 您可以設定的主機效能閾值:CPU 與記憶體。Host performance thresholds you can set are: CPU and Memory.

    • 透過跨共用存放裝置移轉虛擬硬碟 (VHD),可對叢集共用存放裝置 (CSV、檔案共用) 執行儲存體動態最佳化 (磁碟空間最佳化,適用於 VMM 2019 和更新版本),來將儲存空間可用性最佳化。Storage Dynamic Optimization (Optimization of disk space, applicable for VMM 2019 and later) can be performed on cluster shared storage (CSV, file shares) to optimize storage space availability by migrating Virtual Hard Disks (VHD) across shared storage. 您可以為叢集共用存放裝置上的儲存空間閾值設定為沒有限制。You can set free storage space threshold on cluster shared storage.

  • 電源最佳化:電源最佳化是省電的動態最佳化功能,方法是關閉不需要的主機以符合叢集內資源需求,並在需要時重新開啟主機。Power optimization: Power optimization is a feature of dynamic optimization that saves energy by turning off hosts that aren't needed to meet resource requirements within a cluster, and turns them back on when they're needed.

VMM 支援計算動態最佳化 (VMM 2019 和更新版本中的計算和儲存體) 以及 Hyper-V 主機叢集上的電源最佳化。VMM supports compute dynamic optimization (both compute and storage in VMM 2019 and later) and power optimization on Hyper-V host clusters. 在支援即時移轉之 VMM 網狀架構中 VMWare 主機叢集上也支援計算動態最佳化和電源最佳化。Compute dynamic optimization and power optimization is also supported on VMware host clusters in the VMM fabric that support live migration.

在您開始使用 Intune 之前Before you start

在開始使用 DO 前請留意以下資訊。Note the following information before you start using the DO.

動態最佳化Dynamic optimization

  • 您可以在支援即時移轉的主機叢集上設定動態最佳化和電源最佳化。Dynamic optimization and power optimization can be configured on host clusters that support live migration.
  • 可以在主機群組上設定動態最佳化,以指定的頻率與增強移轉主機叢集內的虛擬機器和虛擬硬碟 (VHD)。Dynamic optimization can be configured on a host group, to migrate virtual machines and virtual hard disks (VHDs) within host clusters with a specified frequency and aggressiveness. VM 增強可決定在動態最佳化期間初始化移轉所需的負載不平衡數量。VM aggressiveness determines the amount of load imbalance that is required to initiate a migration during dynamic optimization.
  • 磁碟空間增強可決定低於磁碟空間閾值的可用儲存空間數量,在動態最佳化期間將 VHD 移轉至其他叢集共用存放裝置時磁碟空間閾值是必要的。Disk space aggressiveness determines the amount of free storage space below disk space threshold that is required to migrate VHDs to other cluster shared storage during dynamic optimization.
  • 依預設,即使已啟用自動移轉,系統會以每 10 分鐘的頻率,以中度增強移轉虛擬機器。By default, virtual machines are migrated every 10 minutes with medium aggressiveness, if automatic migration is enabled. 設定動態最佳化的頻率和增強時,系統管理員應將其他移轉的資源成本列入主機叢集中主機/共用存放裝置間平衡負載優勢的考量因素。When configuring frequency and aggressiveness for dynamic optimization, an administrator should factor in the resource cost of additional migrations against the advantages of balancing load among hosts/shared storage in a host cluster. 依預設,主機群組會繼承其父主機群組的動態最佳化設定。By default, a host group inherits Dynamic Optimization settings from its parent host group.
  • 如果您在沒有叢集的主機群組上設定動態最佳化,則不會有任何作用。If you set up dynamic optimization on a host group without a cluster it will have no effect.
  • 可對具有二或多個節點的叢集設定動態最佳化。Dynamic optimization can be set up for clusters with two or more nodes. 儲存體動態最佳化會需要在叢集中存在兩個或多個共用存放裝置檔案/磁碟區。Storage dynamic optimization will need two or more shared storage files/volumes to be present in the cluster. 如果主機群組包含不支援即時移轉的獨立主機或主機叢集,則動態最佳化不會執行於那些主機上。If a host group contains stand-alone hosts or host clusters that do not support live migration, dynamic optimization isn't performed on those hosts. 動態最佳化也會排除處於維護模式下的任何主機。Any hosts that are in maintenance mode also are excluded from dynamic optimization. 此外,VMM 只會移轉使用共用存放裝置的高可用性虛擬機器。In addition, VMM only migrates highly available virtual machines that use shared storage. 如果主機叢集包含非高可用性虛擬機器,則那些虛擬機器不會於動態最佳化期間進行移轉。If a host cluster contains virtual machines that are not highly available, those virtual machines are not migrated during Dynamic Optimization.
  • 使用 [VM 和服務] 工作區中的 [最佳化主機]/[最佳化磁碟空間] 動作,即可依需求對個別主機叢集使用動態最佳化。On-demand dynamic optimization is also available for individual host clusters by using the Optimize Hosts/ Optimize Disk space action in the VMs and Services workspace. 它在執行時不需要在主機群組上設定動態最佳化。It can be performed without configuring dynamic optimization on host groups. 對主機叢集要求動態最佳化後,VMM 會列出要移轉的虛擬機器/VHD,等候系統管理員核准。After dynamic optimization is requested for a host cluster, VMM lists the virtual machines/VHDs that will be migrated, for the administrator's approval. 最佳化主機會在叢集中跨主機執行 VM 負載平衡,而最佳化磁碟空間會在叢集中跨共用存放裝置移轉 VHD。Optimize Hosts performs VM load balancing across hosts in a cluster, while Optimize disk space migrates VHDs across Shared storage in a cluster.

節點公平性Node fairness

節點公平性是 Windows Server 2016 中的新功能。Node fairness is a new feature in Windows Server 2016. 它能識別負載較少的叢集節點,並將 VM 散發到那些節點上以平衡負載。It identifies cluster nodes with light loads, and distributes VMs to those node to balance load. 此功能與 VMM 的動態最佳化類似。This is similar to VMM's dynamic optimization. 為了避免可能的效能問題,請不要同時使用動態最佳化和節點公平性。To avoid potential performance issues, dynamic optimization and node fairness shouldn't work together. 為了確保不會發生此問題,VMM 會針對將動態最佳化設定為自動的主機群組,停用所有叢集中的節點公平性。To ensure this doesn't happen VMM disables node fairness in all clusters in a host group for which dynamic optimization is set to automatic. 如果您在 VMM 主控台之外啟用節點公平性,VMM 將會在動態最佳化下次重新整理時將該功能關閉。If you enable node fairness outside the VMM console, VMM will turn it off the next time that dynamic optimization refreshes. 如果您想要使用節點公平性,請停用動態最佳化,然後手動啟用節點公平性。If you do want to use node fairness, disable dynamic optimization, and then manually enable node fairness.

電源最佳化Power optimization

  • 若為電源最佳化,電腦必須具有可啟用頻外管理的基礎板管理控制器 (BMC)。For power optimization, the computers must have a baseboard management controller (BMC) that enables out-of-band management.
  • 電源最佳化可確定若作用中節點失敗時,叢集會維持仲裁。Power optimization ensures that a cluster maintains a quorum if an active node fails. 若為在 VMM 之外建立且新增至 VMM 的叢集,電源最佳化需要四個以上的節點。For clusters created outside VMM and added to VMM, Power Optimization requires more than four nodes. 而對叢集中每個增加的一或兩個節點而言,可關閉一個節點的電源。For each additional one or two nodes in a cluster, one node can be powered down. 舉例來說:For instance:
    • 對具有五或六個節點的叢集而言,可關閉一個節點的電源。One node can be powered down for a cluster of five or six nodes.
    • 對具有七或八個節點的叢集而言,可關閉兩個節點的電源。Two nodes can be powered down for a cluster of seven or eight nodes.
    • 對具有九或十個節點的叢集而言,可關閉三個節點的電源。Three nodes can be powered down for a cluster of nine or ten nodes.
  • VMM 建立叢集時,會建立仲裁磁碟,並使用該磁碟作為仲裁模型的一部分。When VMM creates a cluster, it creates a quorum disk and uses that disk as part of the quorum model. 若為 VMM 建立的叢集,可對具有三個以上節點的叢集設定「電源最佳化」。For clusters created by VMM, Power Optimization can be set up for clusters of more than three nodes. 這代表可關閉電源的節點數量如下:This means that the number of nodes that can be powered down is as follows:
    • 對具有四或五個節點的叢集而言,可關閉一個節點的電源。One node can be powered down for a cluster of four or five nodes.
    • 對具有六或七個節點的叢集而言,可關閉兩個節點的電源。Two nodes can be powered down for a cluster of six or seven nodes.
    • 對具有八或九個節點的叢集而言,可關閉三個節點的電源。Three nodes can be powered down for a cluster of eight or nine nodes.

設定 BMCConfigure BMC

若是 BMC 透過 WS-Management 支援 IMPI 1.5/2.0、DCMI 1.0 或 SMASH 1.0 的主機,您可以進行 BMC 設定,如下所示︰For hosts with BMC that supports IMPI 1.5/2.0, DCMI 1.0 or SMASH 1.0 over WS-Management you can figure BMC settings as follows:

  1. 建立具有主機上 BMC 存取權限的執行身分帳戶。Create a Run As account with permissions to access the BMC on a host.
  2. 按一下 [光纖] > [伺服器] > [所有主機] > [主機] > [內容] > [硬體] > [進階] > [BMC 設定] 。Click Fabric > Servers > All Hosts > host > Properties > Hardware > Advanced > BMC Setting.
  3. 若要啟用 VMM 管理,請選取 「This physical machine is configured for OOB management」 (此實體電腦已設定 OOB 管理。To enable VMM management, select This physical machine is configured for OOB management.
  4. 「This computer supports the specified OOB power management configuration provider」 (這部電腦支援指定的 OOB 電源管理設定提供者) 中,按一下支援的管理通訊協定。In This computer supports the specified OOB power management configuration provider, click the supported management protocol. 輸入 BMC 的 IP 位址,並接受 VMM 提供的預設通訊埠。Type in the IP address of the BMC, and accept the default port offered by VMM. 選取執行身分帳戶,然後按一下 [確定] 。Select the Run As account and click OK.

啟用主機群組的動態和電源最佳化Enable dynamic and power optimization for a host group

  1. 按一下 [光纖] > [伺服器] > [所有主機] ,然後選取您想要設定的主機群組。Click Fabric > Servers > All Hosts, and select the host group that you want to configure.

  2. 選取主機群組時,請按一下 [資料夾] > [內容] 群組 > [內容] 。With the host group selected, click Folder > Properties group > Properties.

  3. 在主機群組內容中,按一下 [動態最佳化] 。In the host group properties, click Dynamic Optimization.

  4. 「Specify dynamic optimization settings」 (指定動態最佳化設定) 中,清除 [使用父主機群組的動態最佳化設定] 核取方塊。In Specify dynamic optimization settings, clear the Use Dynamic Optimization settings from the parent host group check box.

  5. 在 [加強] 中,選取 [高] 、[中] 或 [低] 。In Aggressiveness, select High, Medium, or Low.

    VM 增強可決定在動態最佳化期間初始化移轉所需的負載不平衡數量。VM aggressiveness determines the amount of load imbalance that is required to initiate a migration during dynamic optimization.

    磁碟空間增強可決定低於磁碟空間閾值的可用儲存空間數量,在動態最佳化期間將 VHD 移轉至其他叢集共用存放裝置時磁碟空間閾值是必要的。Disk space aggressiveness determines the amount of free storage space below disk space threshold that is required to migrate VHDs to other cluster shared storage during dynamic optimization.

    當您設定動態最佳化的頻率和加強時,您應該嘗試根據在主機叢集中主機間平衡負載的優勢,來平衡其他移轉的資源成本。When you configure frequency and aggressiveness for dynamic optimization, you should try to balance the resource cost of additional migrations against the advantages of balancing load among hosts in a host cluster. 一開始,您可能會接受預設值 [中] 。Initially, you might accept the default value of Medium. 在觀察動態最佳化對您環境的影響之後,您可以增加此加強值。After you observe the effects of dynamic optimization in your environment, you can increase the aggressiveness.

  6. 若要讓 VMM 在不需要主機時予以關閉,並在需要主機時重新予以啟動,藉此來節省能源,請設定主機群組的電源最佳化。To help conserve energy by having VMM turn off hosts when they are not needed and turn them on again when they are needed, configure power optimization for the host group. 只有自動移轉虛擬機器來平衡負載時,才能使用電源最佳化。Power optimization is only available when virtual machines are being migrated automatically to balance load.

  7. 若要在主機群組中的合格主機叢集上,定期執行動態最佳化,請輸入下列設定:To periodically run dynamic optimization on qualifying host clusters in the host group, enter the following settings:

    1. 選取 [自動移轉虛擬機器來平衡負載] 核取方塊,以平衡共用存放裝置之間的可用儲存空間。Select the Automatically migrate virtual machines to balance load check box to balance free storage space across shared storage.
    2. 在 [頻率] 中,指定執行動態最佳化的頻率。In Frequency, specify how often to run dynamic Optimization. 您可以輸入 10 分鐘與 1440 分鐘 (24 小時) 之間的任何值。You can enter any value between 10 minutes and 1440 minutes (24 hours).
  8. 為每個列出的計算和儲存體 (適用於 VMM 2019) 資源設定閾值。Set thresholds for each of the compute and storage ( applicable for VMM 2019) resources listed. 若要變更資源的單位,請移至 [主機群組] > [屬性] > [主機保留] ,然後從下拉式功能表選擇單元。To change the units of the resources go to Host group> Properties > Host Reserves and choose the unit from the drop-down menu.

  9. 若要在主機群組上開啟電源最佳化,請選取 [啟用電源最佳化] 核取方塊。To turn on power optimization on the host group, select the Enable power optimization checkbox. 再按一下 [確定] 儲存變更。Click OK again to save your changes.

注意

如果具有相同檔案共用的主機群組之間的磁碟空間警告層級不相符,可能會導致在該檔案共用發生多個移轉,並可能會影響儲存體 DO 效能。If there is a mismatch of disk space warning levels between host groups having the same file share, it can result in multiple migrations to and from that file share and may impact storage DO performance. 我們建議您不要在已啟用儲存體動態最佳化的不同主機群組之間執行檔案共用。We recommended you not to do a file share across different host groups where storage dynamic optimization is enabled.

進行電源最佳化設定Configure power optimization settings

  1. 在 [網狀架構] 中瀏覽至主機群組並開啟 [屬性] 。In the Fabric navigate to the host group and open Properties.
  2. 按一下 [動態最佳化] > 「Specify dynamic optimization settings」 (指定動態最佳化設定) > [設定]Click Dynamic Optimization > Specify dynamic optimization settings > Settings.
  3. 在 [自訂電源最佳化排程] 中,變更下列任何資源的設定:CPU、記憶體、磁碟 I/O 或網路 I/O。In Customize Power Optimization Schedule, change the settings for any of these resources: CPU, memory, disk I/O , or network I/O.
  4. 在 [排程] 下方,選取您要執行電源最佳化的時數。Under Schedule, select the hours when you want power optimization to be performed. 按一下方塊,開啟或關閉該小時的電源最佳化。Click a box to turn power optimization on or off for that hour. VMM 會根據主機時區來套用排程。VMM applies the schedule according to the host time zone.

在主機叢集中依需求執行動態最佳化Run dynamic optimization on-demand in a host cluster

您可以在主機叢集上依需求執行動態最佳化。You can run dynamic optimization on demand on a host cluster. 若要這麼做,不需要在父主機群組上設定動態最佳化。To do this dynamic optimization doesn't need to be configured on the parent host group.

  1. 開啟 [網狀架構] > [伺服器] > [主機群組] ,然後瀏覽主機叢集。Open Fabric > Servers > Host Groups, and navigate the host cluster.

  2. 若要執行計算資源負載平衡,請按一下 [最佳化主機] 。To perform compute resource load balancing, click Optimize hosts. 若要在叢集共用存放裝置間執行儲存體負載平衡,請按一下 [最佳化磁碟] 。To perform storage load balancing across cluster shared storage, click Optimize disks.

    最佳化主機:VMM 會執行動態最佳化檢閱,判斷是否可以移轉 VHD 來改善主機叢集內的負載平衡。To Optimize hosts: VMM performs a dynamic optimization review to determine whether VHDs can be migrated to improve load balancing in the host cluster. 如果移轉 VM 可以改善負載平衡,則 VMM 會顯示一份清單,內含建議進行移轉的 VM 並指出目前和目標主機。If migration of VMs can improve load balancing, VMM displays a list of VMs that are recommended for migration, with the current and target hosts indicated. 這份清單會排除 VMM 中任何處於維護模式的主機,以及任何非高可用性虛擬機器。The list excludes any hosts that are in maintenance mode in VMM and any virtual machines that are not highly available.

    將磁碟空間最佳化:VMM 會執行動態最佳化檢閱,以判斷是否可以移轉 VHD,在考量 [動態最佳化] 頁面中設定的增強同時,符合可用儲存空間閾值 (磁碟空間)。To Optimize Disk Space: VMM performs a dynamic optimization review to determine whether VHDs can be migrated to meet the free storage space threshold (disk space) while considering aggressiveness set in the Dynamic Optimization page. 只有在任何叢集共用存放裝置違反磁碟空間閾值設定時,才會觸發動態最佳化。Dynamic Optimization will only be triggered when any cluster shared storage violates the disk space threshold set. 如果移轉 VHD 可以協助釋放在叢集中共用存放裝置中的儲存空間閾值,VMM 會顯示一份清單,內含建議進行移轉的 VHD,並指出目前和目標儲存空間。If migration of VHDs can help free the storage space threshold in shared storage in the cluster, VMM displays a list of VHDs that are recommended for migration, with the current and target storage space indicated. VHD 僅會透過相同的存放裝置分類來移轉至另一個共用存放裝置。VHDs will only migrate to another shared storage with the same storage classification.

  3. 按一下 [移轉] 。Click Migrate.

注意

如果 VHD 在某個存放裝置類型和另一個存放裝置類型之間移轉 (範例:從 CSV 移轉至 NAS 檔案共用),存放裝置移轉的速度可能會變慢。If VHDs are migrated between one storage type to another (Example: from a CSV to NAS file share), the storage migration will be slow. 即使閾值和增強的準則都符合,如果儲存體最佳化不會傳回要移轉的 VHD 清單:If the storage optimization does not return a list of VHDs to migrate even when the threshold and aggressiveness criteria are met: - 請使用 Get-SCStorageVolume Cmdlet 檢查 HostVolumeID。Check the HostVolumeID using Get-SCStorageVolume Cmdlet. 如果 HostVolumeID 傳回磁碟區的 Null,請重新整理 VM,然後再執行儲存體動態最佳化。If the HostVolumeID returns Null for the volume, refresh the VM and perform Storage Dynamic Optimization again. - 請使用 Get-SCHostResever cmdlet 檢查主機群組的 DiskSpacePlacementLevel。Check the DiskSpacePlacementLevel of the host group using the Get-SCHostResever cmdlet. 將 DiskSpacePlacementLevel 值設為與在 [動態最佳化精靈] 主機保留設定中所設的磁碟空間值相等。Set the DiskSpacePlacementLevel value equal to the value of Disk Space set in Host Reserve settings in the Dynamic Optimization wizard.

開啟/關閉在 VMM 中的電腦電源Power on/off a computer in VMM

  1. 按一下 [光纖] > [伺服器] > [所有主機] > 主機名稱。Click Fabric > Servers > All Hosts > host name.
  2. 在 [主機] 索引標籤的 [主機] 群組中,按一下 [開啟電源] 或 [關閉電源] 。On the Host tab, in the Host group click Power On or Power Off. 您可以在 BMC 記錄檔中檢視開啟和關閉電源事件的資訊 (按一下 [硬體] > [進階] > [BMC 記錄] )。You can view information about power on and off events in the BMC logs (click on Hardware > Advanced > BMC Logs).

後續步驟Next steps

深入了解佈建 VMLearn about provisioning VMs.