Ok, so the title might be a tad misleading, we’re not actually *using* PowerShell to modify iLO settings, but rather using PowerShell’s quick and easy ability to loop through an array of enclosures in order to make the iLO changes.
In my case, I have a large number of c-Class blades functioning as ESXi hosts. I needed a way to set the HP power regulator setting to Static High Performance Mode, instead of going into each individual iLO or BIOS to make the change.
You will need a few things in order for this to work correctly. First, you’ll need PuTTy (the venerable Telnet/SSH client) and Plink (the command line front-end to PuTTy). Second you’ll need the XML below (borrowed from HP’s Lights-Out Scripting Samples for Windows). Upload the XML to a web host that is accessible by all HP c-Class blade enclosures, and enter the IP address or fully qualified domain name for the enclosures’ Onboard Administrator into the $OBAs variable.
The PowerShell script:
[powershell]
$OBAs = @("hp_enclosure_one","hp_enclosure_two","hp_enclosure_three")
foreach ($OBA in $OBAs) {
./plink.exe -telnet -login -l username -pw password $OBA "hponcfg all http://webhost/set_host_power.xml"
}
[/powershell]
And the XML for set_host_power.xml:
[xml]
<RIBCL VERSION="2.0">
<LOGIN USER_LOGIN="adminname" PASSWORD="password">
<SERVER_INFO MODE="write">
<SET_HOST_POWER_SAVER HOST_POWER_SAVER="4"/>
</SERVER_INFO>
</LOGIN>
</RIBCL>
[/xml]
Notes: You can connect using plink.exe using the -ssh flag instead of -telnet, however it is required that you’ve already connected to all enclosures and accepted their certificate details.
The user credentials in the RIBCL XML are ignored, and passthrough from the OBA to each individual server’s iLO is used, unless the NOAUTOLOGIN flag is used in the hponcfg command string.
Nishant says
I didn’t get the your script at all. how one can run .
My requirement is to get information of power regulator setting on all blade. How should i do it from my terminal server
Keith Templin says
I was doing something similar to this, but for mass updating firmware revisions. Adding this power shell will help me out in automating the physical work. My blog http://torxsmind.blogspot.com/ has the setups to setup IIS and to mount a ISO over http.
Damian Karlson says
Very cool, thank you!
Ed Grigson says
Great tip Damian – I didn’t even realise you could set this via the ILO. Shame it still requires a server reboot to take affect.
Stacy says
I know this is an old post, but just found it and used it to make power regulator setting changes for blades in multiple enclosures. Had to make a couple of tweaks but eventually got it to work, thanks for posting! (So excited, still a powershell noob) Regarding Ed’s comment – Unless you are changing to or from OS Control Mode, I don’t think a reboot is required. “With the exception of the OS Control mode, Power Regulator modes configured through iLO do not require a reboot and are effective immediately.”
Damian Karlson says
Glad it was of some help, Stacy! 🙂
JimPoshible says
RT @eekygeeky: RT @sixfootdad New blog post: Modifying HP c-Class Blades via iLO
and PowerShell http://bit.ly/cBsVm9
This comment was originally posted onTwitter
MaxTrinidad says
RT @eekygeeky: RT @sixfootdad New blog post: Modifying HP c-Class Blades via iLO
and PowerShell http://bit.ly/cBsVm9
This comment was originally posted onTwitter
eekygeeky says
RT @sixfootdad New blog post: Modifying HP c-Class Blades via iLO
and PowerShell http://bit.ly/cBsVm9
This comment was originally posted onTwitter
sixfootdad says
New blog post: Modifying HP c-Class Blades via iLO and PowerShell http://bit.ly/cBsVm9
This comment was originally posted onTwitter