共用方式為


Set-SCHostReserve

修改主機群組的主機保留設定。

語法

Set-SCHostReserve
   -Enabled <Boolean>
   [-DiskIO]
   -HostReserve <HostReserveSettings>
   [-VMMServer <ServerConnection>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-SCHostReserve
   -Enabled <Boolean>
   [-Memory]
   -HostReserve <HostReserveSettings>
   [-VMMServer <ServerConnection>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-SCHostReserve
   -Enabled <Boolean>
   [-DiskSpace]
   -HostReserve <HostReserveSettings>
   [-VMMServer <ServerConnection>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-SCHostReserve
   -Enabled <Boolean>
   [-Network]
   -HostReserve <HostReserveSettings>
   [-VMMServer <ServerConnection>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-SCHostReserve
   -Enabled <Boolean>
   [-CPU]
   -HostReserve <HostReserveSettings>
   [-VMMServer <ServerConnection>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-SCHostReserve
   [-CPU]
   -HostReserve <HostReserveSettings>
   -StartOptimizationLevel <UInt64>
   [-VMMServer <ServerConnection>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-SCHostReserve
   [-CPU]
   -HostReserve <HostReserveSettings>
   -PlacementLevel <UInt64>
   [-VMMServer <ServerConnection>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-SCHostReserve
   [-CPU]
   -HostReserve <HostReserveSettings>
   -VMHostReserveLevel <UInt64>
   [-VMMServer <ServerConnection>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-SCHostReserve
   [-DiskIO]
   -HostReserve <HostReserveSettings>
   -VMHostReserveLevel <UInt64>
   [-VMMServer <ServerConnection>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-SCHostReserve
   [-DiskIO]
   -HostReserve <HostReserveSettings>
   -PlacementLevel <UInt64>
   [-VMMServer <ServerConnection>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-SCHostReserve
   [-DiskIO]
   [-Percent]
   -HostReserve <HostReserveSettings>
   [-VMMServer <ServerConnection>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-SCHostReserve
   [-DiskIO]
   -HostReserve <HostReserveSettings>
   -StartOptimizationLevel <UInt64>
   [-VMMServer <ServerConnection>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-SCHostReserve
   [-DiskIO]
   [-IOPS]
   -HostReserve <HostReserveSettings>
   [-VMMServer <ServerConnection>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-SCHostReserve
   [-DiskSpace]
   [-GB]
   -HostReserve <HostReserveSettings>
   [-VMMServer <ServerConnection>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-SCHostReserve
   [-DiskSpace]
   [-MB]
   -HostReserve <HostReserveSettings>
   [-VMMServer <ServerConnection>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-SCHostReserve
   [-DiskSpace]
   -HostReserve <HostReserveSettings>
   -VMHostReserveLevel <UInt64>
   [-VMMServer <ServerConnection>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-SCHostReserve
   [-DiskSpace]
   [-Percent]
   -HostReserve <HostReserveSettings>
   [-VMMServer <ServerConnection>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-SCHostReserve
   [-DiskSpace]
   -HostReserve <HostReserveSettings>
   -PlacementLevel <UInt64>
   [-VMMServer <ServerConnection>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-SCHostReserve
   [-DiskSpace]
   -HostReserve <HostReserveSettings>
   -StartOptimizationLevel <uint64>
   [-VMMServer <ServerConnection>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-SCHostReserve
   [-Memory]
   [-GB]
   -HostReserve <HostReserveSettings>
   [-VMMServer <ServerConnection>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-SCHostReserve
   [-Memory]
   -HostReserve <HostReserveSettings>
   -VMHostReserveLevel <UInt64>
   [-VMMServer <ServerConnection>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-SCHostReserve
   [-Memory]
   -HostReserve <HostReserveSettings>
   -PlacementLevel <UInt64>
   [-VMMServer <ServerConnection>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-SCHostReserve
   [-Memory]
   [-Percent]
   -HostReserve <HostReserveSettings>
   [-VMMServer <ServerConnection>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-SCHostReserve
   [-Memory]
   [-MB]
   -HostReserve <HostReserveSettings>
   [-VMMServer <ServerConnection>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-SCHostReserve
   [-Memory]
   -HostReserve <HostReserveSettings>
   -StartOptimizationLevel <UInt64>
   [-VMMServer <ServerConnection>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-SCHostReserve
   [-Network]
   -HostReserve <HostReserveSettings>
   -StartOptimizationLevel <UInt64>
   [-VMMServer <ServerConnection>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-SCHostReserve
   [-Network]
   [-Mbps]
   -HostReserve <HostReserveSettings>
   [-VMMServer <ServerConnection>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-SCHostReserve
   [-Network]
   -HostReserve <HostReserveSettings>
   -VMHostReserveLevel <UInt64>
   [-VMMServer <ServerConnection>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-SCHostReserve
   [-Network]
   [-Percent]
   -HostReserve <HostReserveSettings>
   [-VMMServer <ServerConnection>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-SCHostReserve
   [-Network]
   -HostReserve <HostReserveSettings>
   -PlacementLevel <UInt64>
   [-VMMServer <ServerConnection>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-SCHostReserve
   -Inherit <Boolean>
   -HostReserve <HostReserveSettings>
   [-VMMServer <ServerConnection>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Set-SCHostReserve Cmdlet 會修改主機群組的主機保留設定。 若要修改主機群組的主機保留設定,該主機群組不得從父主機群組繼承其設定。

當您設定主機保留層級時,單位參數,例如 GBPercentage,會指定其他層級的單位,例如 StartOptimizationLevelPlacementLevel

VMHostReserveLevelStartOptimizationLevelPlacementLevel 的值必須依序表示。 例如,StartOptimizationLevel 的值不能小於 VMHostReserveLevel的值,而 PlacementLevel 的值不能 小於 startOptimizationLevel的值。

當主機小於可用的 StartOptimizationLevel 指定數量時,動態優化會嘗試重新平衡負載。

因為另一個節點正在關閉,因此電源優化永遠不會強制主機擁有小於指定數量,PlacementLevel 可用。

範例

範例 1:修改指定主機群組的 CPU 主機保留和放置設定

PS C:\> $HostGroup = Get-SCVMHostGroup "HostGroup01"
PS C:\> $HostReserve = Get-SCHostReserve -VMHostGroup $HostGroup
PS C:\> $HostReserve | Set-SCHostReserve -CPU -PlacementLevel 75 -StartOptimizationLevel 80 -VMHostReserveLevel 90

第一個命令會取得名為 HostGroup01 的主機群組物件,並將物件儲存在$HostGroup變數中。

第二個命令會取得儲存在 $HostGroup 之主機群組的主機保留對象,然後將物件儲存在$HostReserve變數中。

最後一個命令會使用管線運算符,將儲存在 $HostReserve 中的主機保留傳遞至 Set-SCHostReserve Cmdlet,以更新主機保留和放置設定。

參數

-Confirm

在執行 Cmdlet 之前,提示您進行確認。

類型:SwitchParameter
別名:cf
Position:Named
預設值:False
必要:False
接受管線輸入:False
接受萬用字元:False

-CPU

指定主機保留 CPU 資源類型。

類型:SwitchParameter
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-DiskIO

指定主機保留磁碟 I/O 資源類型。

類型:SwitchParameter
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-DiskSpace

指定主機保留磁碟空間資源類型。

類型:SwitchParameter
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-Enabled

當設定為 $True 時啟用 物件,或在設定為 $False 時停用物件。 例如,如果您想要升級虛擬機範本上的軟體,您可以停用 VMM 連結庫中的範本物件,暫時防止使用者使用該物件。

類型:Boolean
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-GB

表示主機保留資源的單位以 GB 表示。

類型:SwitchParameter
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-HostReserve

指定主機保留設定物件。

類型:HostReserveSettings
Position:Named
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-Inherit

指出設定是否繼承自父主機群組。

類型:Boolean
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-IOPS

表示主機保留資源的單位是以每秒磁碟輸入/輸出作業 (IOPS) 表示。

類型:SwitchParameter
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-JobVariable

指定作業進度會追蹤並儲存在此參數所命名的變數中。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-MB

表示主機保留資源的單位是以 MB 表示。

類型:SwitchParameter
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-Mbps

表示主機保留資源的單位是以每秒 MB 位表示(Mbps)。

類型:SwitchParameter
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-Memory

指定主機保留記憶體資源類型。

類型:SwitchParameter
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-Network

指定主機保留網路 I/O 資源類型。

類型:SwitchParameter
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-Percent

表示主機保留資源的單位以百分比表示(%)。

類型:SwitchParameter
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-PlacementLevel

指定主機保留層級,高於可接受的位置。

類型:UInt64
Position:Named
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-PROTipID

指定觸發此動作之效能和資源優化提示 (PRO 提示) 的識別碼。 此參數可讓您稽核 PRO 秘訣。

類型:Guid
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-RunAsynchronously

表示作業會以異步方式執行,讓控件立即返回命令殼層。

類型:SwitchParameter
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-StartOptimizationLevel

指定啟動動態優化所在的主機保留層級。

類型:UInt64
Position:Named
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-VMHostReserveLevel

指定主機保留層級,如果啟動虛擬機需要低於此層級,放置會傳回錯誤。

類型:UInt64
Position:Named
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-VMMServer

指定 VMM 伺服器物件。

類型:ServerConnection
Position:Named
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-WhatIf

顯示 Cmdlet 執行時會發生什麼事。 Cmdlet 未執行。

類型:SwitchParameter
別名:wi
Position:Named
預設值:False
必要:False
接受管線輸入:False
接受萬用字元:False

輸出

HostReserve

此 Cmdlet 會傳回 HostReserve 物件。