HP servers come with a powerful out of band management interface called Integrated Lights out, or iLO. It has an extensive web interface and commercially available tools for centrally managing iLO devices and their servers.
But if you want to built your own tooling, integrate iLO management to your existing procedures or simply want to manage iLOs using a command-line interface, you’re stuck manually creating XML files and using a perl hack HP ships called locfg.pl.
Using the same XML interface as HP’s own management tools, here is a python library and command-line tool that make it a lot easier to do all the above. No manual XML writing, just call functions from either python or your shell(script).
Full usage documentation can be found following the links below, but here are some examples to wet your appetite:
Getting the chassis IP of a blade server, from python:
>>> ilo = hpilo.Ilo('example-server.int.kaarsemaker.net') >>> chassis = ilo.get_oa_info() >>> print chassis['ipaddress'] 10.42.128.101
Entering a license key and creating a user, from the shell:
$ hpilo_cli example-server.int.kaarsemaker.net activate_license key=$mykey $ hpilo_cli example-server.int.kaarsemaker.net add_user user_login=dennis \ password=hunter2 admin_priv=true
The available functions you can call are all documented in the pages linked below, but for detailed descriptions of all functions and especially their arguments, please refer to the ilo scripting guide as well.
This package also ships examples of more complete applications in the examples directory. This include an automated CA for managing SSL certificates, tooling to centralize iLO informatin in elastic search and an automated firmware updater. All of which are used in production by the author or other contributors.
This module is written with compatibility as main priority. Currently supported are:
iLOs can be managed both locally using hponcfg or remotely using the iLO’s built-in webserver. In the latter case, the requirements above concern the machine you run this code on, not the managed server.
There are several example applications in the examples/ directory. Note that while hpilo.py and hpilo_cli are compatible with python versions as old as 2.4, some examples may require new versions of python and have additional dependencies.