Adding support for an unsupported power controller in Emulab
As a continuation of sorts to my previous post, I thought I would also do a short description of adding support for an unsupported power controller. The IBM Bladecenter is more or less unsupported by Emulab in all respects, the switches and the integrated power controller are unsupported and even the blade servers grudgingly resist running any vanilla FreeBSD images that come with the Emulab source.
Add a case to /usr/testbed/bin/power to include a new power type, I'll use "mynewpower" in this example. Edit this file and include the perl module you will be putting your code in by adding this to the top:
Somewhere around line 332 you'll find the beginning of the IF you'll need to add your case to:
Implement the code
Now just create a perl package power_mynewpower.pm and implement the mynewpower_nodectrl($type,$cmd,@nodes) subroutine. As far as I can tell, the $cmd value that is most important for experimental nodes is the "cycle" command. Here is a sample file:
In our case, this routine executes a bash script which logs in and reboots the specified node from the bladecenter.
Add the type to the database
Add a new row into the 'node_types' table:
Now just follow the instructions on the Emulab Wiki for adding nodes that use the power type. Emulab will automatically find your implemented perl module and run the specified subroutine when it attempts to perform a power operation on a node which has a "mynewpower" power manager. You should be good to go! Feedback is very welcome.