Modifying HP c-Class Blades via iLO and PowerShell

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:

$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"
}

And the XML for set_host_power.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>

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.

Comments

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

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

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

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

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

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

  6. RT @sixfootdad New blog post: Modifying HP c-Class Blades via iLO
    and PowerShell http://bit.ly/cBsVm9

    This comment was originally posted onTwitter

  7. New blog post: Modifying HP c-Class Blades via iLO and PowerShell http://bit.ly/cBsVm9

    This comment was originally posted onTwitter

Trackbacks

  1. […] Если в вашей инфраструктуре используется некоторое количество серверов с Linux или ESX, то автоматизировать процесс передачи настроек iLO2 можно будет например с помощью подключения к той-же утилите hponcfg через Telnet или SSH, например так как это описано в заметке Damian Karlson — Modifying HP c-Class Blades via iLO and PowerShell […]

  2. […] с ними разбираться. Но Алексей Максимов подсказал ссылку на другой вариант. Похожие […]

  3. […] Если в вашей инфраструктуре используется некоторое количество серверов с Linux или ESX, то автоматизировать процесс передачи настроек iLO2 можно будет например с помощью подключения к той-же утилите hponcfg через Telnet или SSH, например так как это описано в заметке Damian Karlson – Modifying HP c-Class Blades via iLO and PowerShell […]

  4. […] Damian Karlson’s blogpost on how to script the change (via the ILO). If you have a large number of hosts this is probably the way forward. […]

Speak Your Mind

*