どうも、Tです。
電源ポリシーの設定方法です。
スポンサーリンク
目次
やりたいこと
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)
ポリシー値 | 説明 |
1 | static:高パフォーマンス |
2 | dynamic:バランシング済み |
3 | low:省電力 |
4 | custom:カスタム |
確認
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 | Automation
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 this ca
https://vrandombites.co.uk/powercli/configure-multiple-esxi-power-policy/
まとめ
下記のでvSphere上のすべてのホストに一括設定が行えます。
$view = (Get-VMHost | Get-View) (Get-View $view.ConfigManager.PowerSystem).ConfigurePowerPolicy(1)