【PowerCLI】ESXiホストの電源ポリシーの変更

どうも、Tです。

電源ポリシーの設定方法です。

スポンサーリンク
アドセンス1

やりたいこと

ESXiの電源ポリシーをPowerCLIで設定したい。

設定

形式

$view = (Get-VMHost $ESXiホスト名もしくはIP | Get-View)
(Get-View $view.ConfigManager.PowerSystem).ConfigurePowerPolicy($ポリシーの値)

サンプル

$view = (Get-VMHost -Nmae testesxi001* | Get-View)
(Get-View $view.ConfigManager.PowerSystem).ConfigurePowerPolicy(1)

ポリシー値説明
1static:高パフォーマンス
2dynamic:バランシング済み
3low:省電力
4custom:カスタム

確認

Get-VMHost | Sort | Select-Object Name,
@{ N="CurrentPolicy"; E={$_.ExtensionData.config.PowerSystemInfo.CurrentPolicy.ShortName}},
@{ N="CurrentPolicyKey"; E={$_.ExtensionData.config.PowerSystemInfo.CurrentPolicy.Key}},
@{ N="AvailablePolicies"; E={$_.ExtensionData.config.PowerSystemCapability.AvailablePolicy.ShortName}}

参考

how to modify vSphere power policy with powercli
Hi, I'm looking a way to modify the power management settings for the hosts with powercli. switching between the 4 policy and getting info on hosts having thi...
https://vrandombites.co.uk/powercli/configure-multiple-esxi-power-policy/

まとめ

下記のでvSphere上のすべてのホストに一括設定が行えます。

$view = (Get-VMHost | Get-View)
(Get-View $view.ConfigManager.PowerSystem).ConfigurePowerPolicy(1)
スポンサーリンク
アドセンス1
アドセンス1
ブログランキング・にほんブログ村へ

シェアする

フォローする