VMware Cloud Community
hum_mike
Contributor
Contributor
Jump to solution

Need to Update Power Management Profile on ESXi 5.1 host

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.


Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

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

View solution in original post

Reply
0 Kudos
4 Replies
LucD
Leadership
Leadership
Jump to solution

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

hum_mike
Contributor
Contributor
Jump to solution

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..

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

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

Reply
0 Kudos
hum_mike
Contributor
Contributor
Jump to solution

As always, thanks LUCD

Reply
0 Kudos