All,
I have recently discovered that our ESX host Power Profile is set to Balanced. This contradicts us setting the power policy inside the bios to maximum performance and I believe is causing performance issues within our host.
Unfortuanlity, this wasn't discovered at first and now I have several esx host that need the profile updated to high performance.
I have found that the policy is defined in VMware.Vim.HostPowerPolicy.
$a = get-vmhost ESXhost1 | get-view
Then showing the information from this:
$a.Config.PowerSystemInfo.CurrentPolicy
Key : 1
Name : PowerPolicy.static.name
ShortName : static
Description : PowerPolicy.static.description
DynamicType :
DynamicProperty :
Above is how I need all my host set. The default is below:
Key : 2
Name : PowerPolicy.dynamic.name
ShortName : dynamic
Description : PowerPolicy.dynamic.description
DynamicType :
DynamicProperty :
I would appreciate any help from anyone on being able to update these values. There isn't any cmdlets to complete these task.
Sure, only requires a small change
$tgtPowerPolicy = "static"
$clusterName = "MyCluster"
Get-View -ViewType ClusterComputeResource -Property Name,Host -Filter @{"Name"=$clusterName} | %{
Get-View $_.Host -Property "ConfigManager","Config.PowerSystemInfo","Config.PowerSystemCapability" | %{
$powerSys = Get-View $_.ConfigManager.PowerSystem
$key = $_.Config.PowerSystemCapability.AvailablePolicy |
where {$_.ShortName -eq $tgtPowerPolicy} | Select -ExpandProperty Key
$powerSys.ConfigurePowerPolicy($key)
}
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Something like this should do the trick
$tgtPowerPolicy = "static"
Get-View -ViewType HostSystem -Property "ConfigManager","Config.PowerSystemInfo","Config.PowerSystemCapability" `
-Filter @{"Config.PowerSystemInfo.CurrentPolicy.ShortName"="dynamic"} | %{
$powerSys = Get-View $_.ConfigManager.PowerSystem
$key = $_.Config.PowerSystemCapability.AvailablePolicy |
where {$_.ShortName -eq $tgtPowerPolicy} | Select -ExpandProperty Key
$powerSys.ConfigurePowerPolicy($key)
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
LucD,
This appears to work on all host in a virtual center which is awesome. However, is there a way to narrow this down per cluster? I want to work my way up Test, QA, Prod, etc..
Sure, only requires a small change
$tgtPowerPolicy = "static"
$clusterName = "MyCluster"
Get-View -ViewType ClusterComputeResource -Property Name,Host -Filter @{"Name"=$clusterName} | %{
Get-View $_.Host -Property "ConfigManager","Config.PowerSystemInfo","Config.PowerSystemCapability" | %{
$powerSys = Get-View $_.ConfigManager.PowerSystem
$key = $_.Config.PowerSystemCapability.AvailablePolicy |
where {$_.ShortName -eq $tgtPowerPolicy} | Select -ExpandProperty Key
$powerSys.ConfigurePowerPolicy($key)
}
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
As always, thanks LUCD
