Power controllers make life much easier for testbed admins, allowing remote power cycling of individual nodes in the testbed. Traditionally, Emulab has used controllable power distribution units to do this. But you can also now take advantage of the builtin management interfaces that many server-class machines have (e.g., Dell's DRACs, HP's iLo, or IPMI). If you do not have any such hardware, you should skip this page.
If your nodes support IPMI, see the IPMI Setup page for configuring power control and serial-over-LAN (SOL) consoles.
Currently we support a couple of families of power controllers: the serial-controlled BayTech RPC family and the network-controlled APC AP family. There is no guarantee that all models in these families work, but we know that the following models do:
- Baytech RPC14
- Baytech RPC27
- APC AP9210 (deprecated)
- APC AP7960
- APC AP7941
Basically, any unit that uses the Baytech CLI or the APC MIB should work.
Note: Setting up the power controllers before you add your nodes makes adding the nodes remotely much easier. The process being: power off all nodes, then power on what you want to be the first node. It should show up in the new node page on the Emulab web portal. You can then add it as "pc1". Then power on the second node, etc.
Step 1 - Configure the power controller hardware
What happens here depends on the type of power controller.
For IP models (the APC) you need to make sure that they have IP addresses and that SNMP is enabled.
For the RPC serial models, you need to have
capture running on the
appropriate serial ports so that the
power command can connect to
them. You also need to ensure that the 'status menu' is disabled so that
they do not output a full status screen before the command prompt. There is
a configuration menu option in the CLI to disable this.
Step 2 - Adding power controllers to the database
For both serial and network-controlled units, you will need to add entries for the node type and the node, to the database. Unfortunately, you have to speak mysql, we have not scripted this task yet:
boss> mysql tbdb mysql> insert into `node_types` (class,type) values ('power','APC');
mysql> insert into `node_types` (class,type) values ('power','RPC27');
depending on what you have. You will then need to add an entry to the 'nodes' table for each instance of the power controller you have. Something like:
mysql> insert into `nodes` (node_id,type,phys_nodeid,role,priority, status,eventstate,op_mode,allocstate) values ('powerN','APC','powerN','powerctrl',10001, 'down','ISUP','NONE','FREE_DIRTY');
'node_id' and 'phys_nodeid' should be identical and be your name of the power controller (e.g. "power1", "power2", etc.). 'type' will be the same as what you added to node_types above. 'role' should always be 'powerctrl'. 'priority' is used to order all nodes in node listings (e.g., in web pages); we pick a high number for power controllers so they will come after regular nodes. Each power controller should have a different value. All other fields should be exactly as shown.
Step 3 - Interfaces and wires table entries
If you have a network power controller, you will need to add entries in the 'interfaces' and 'wires' tables:
boss> wap addinterface -b SPEED -I AAA.AAA.AAA.AAA -M MMM.MMM.MMM.MMM -e other powerN eth0
Set the SPEED to one of 100Mb,1Gb,10Gb,40Gb, or 100Gb. The -I and -M arguments reflect the IP address and mask assigned to the power controller (e.g. 10.11.12.8, 255.255.255.0).
Wires table entries are strictly informational. You can put them in if you want to keep track of the cable numbers. However, if they are properly entered, you can use snmpit to perform some basic functions on the connected switch ports. First, add the interface for the control net switch port that the power controller is attached to:
boss> wap addinterface -b SPEED myctrlswitch "MODULE/PORT"
Set the SPEED as above, and see the Initial Switch Setup page for more info on MODULE and PORT numbers.
Then add the wire:
boss> wap addwire -t Power powerN:eth0 0,1 myctrlswitch:MODULE/PORT MODULE,PORT
Step 4 - Adding the Outlets
The final step is to add 'outlets' table entries for all nodes that are controlled by the power controllers. For each node there should be an entry of the form:
boss> mysql tbdb mysql> insert into `outlets` (node_id,power_id,outlet) values ('pcN','powerN',NNN);
where 'node_id' is the name of the node which is being power controlled, 'power_id' is the nodes table name of the power controller that the node is connected to, and 'outlet' is an integer telling which outlet on the power controller the node is connected to. All power controllers we support have outlets numbered 1,2,..N, where N is the maximum number of outlets on the controller (typically 8, 16, or 24). So the value of this field should be from 1 to N.
Note that you have not yet actually added any nodes to the testbed, so you should use the name that you intend to assign to each node when it is added later. The power control subsystem will work during bootstrap without there being state in the database for a node, but it is important that this field eventually match an entry in the 'nodes' table later. It is okay to use placeholder values for 'node_id' in the outlets table and then change them later to match the nodes table entries.
Step 5 - Testing
After all of the state has been added to the database, you can use the
power command to test the configuration. If you have serial consoles and
have already done the console setup, then you can
console <node> to see
if the machine reboots by looking for the BIOS screen or other bootstrap
output. If you do not have serial consoles or have console setup, you will
have physically be in front of the machine to see if the outlet properly
cycles. To power cycle a node:
boss> wap power cycle pcN