After a few minutes of digging, I found that the standard set of CLI's such as ESXCLI, vim-cmd, etc. do not provide a way to configure ESXi's power management settings but did find it was possible using my other favorite "not officially supported" CLI called vsish. Now, you can of course create a remote script using the vSphere API to configure this setting, but if you are looking to modify this within a kickstart script, this is route you will want to take.
To check whether your ESXi host supports power management, run the following command:
~ # vsish -e get /power/hardwareSupport
Hardware power management support {To view the current power management setting, run the following command:
CPU power management:Enhanced Intel SpeedStep(R)
Memory power management:Not available
}
~ # vsish -e get /power/currentPolicy
Host power management policy {Just like the vSphere Client, you have 4 options which maps to the "ID" property as seen above. You can get more details by querying each of the policy (1-4), here is an example:
ID: 2
Short name:dynamic
Long name:Balanced
Description:Reduce energy consumption with minimal performance compromise
}
~ # vsish -e get /power/policy/1
Host power management policy {Here's a quick table that maps the policy ID to power management policy which is the same order as shown in the vSphere Client:
ID: 1
Short name:static
Long name:High Performance
Description:Do not use any power management features
}
| Policy ID | Power Management Policy |
| 1 | High Performance |
| 2 | Balanced |
| 3 | Low Power |
| 3 | Custom |
To change the power management policy, run the following command:
~ # vsish -e set /power/currentPolicy 1So now you can integrate power management settings in your ESXi kickstart script for automated deployment and configurations!

And here is the *supported* powerCLI way http://www.hypervisor.fr/?p=3422 :)
ReplyDeleteVery interesting post as usual.
@Nitro,
DeleteThanks, but the key was "kickstart" script, meaning no remote commands. I definitely could have written a simple script leveraging the API :)
Hi William,
DeleteThe command works fine in scripts(KS) but after rebooting the server the currentPolicy is reversed to "Balanced".
Regards Denis
Can you try to run the command & then run /sbin/auto-backup.sh and see if that persists the change after a system reboot?
DeleteHi William,
ReplyDeleteIt does not help!
It's work only when you make the change trough the "vSphere client".
Do we have a another way to set it in our scripts?
Best Regards
Denis
Hi
ReplyDeleteThanks for this ticket!
In general, people are talking about setting a specific power management policy. Please, is it possible to retrieve the current processor frequency at runtime in VMware?With other hypervisors, they generally offer a "command"/ way to do it!
Thanks for your reply!!