Thomas Krause wrote: > I needed a simple tool to power off and restart my clients. So I wrote a > small utility that can query the power status of clients and remotely > restart or shutdown them.
This is absolutely useful and I think your implementation could be a nice start. Thanks for raising this topic again. After some thought with another interested sysadmin we decided that probably the best approach to support any kind of power control mechanism is to define a special tag in cluster.xml (via si_clusterconfig). The value of this attribute will be used to specify the command to control the power of any specific group of clients. For example this could be a group defined by si_clusterconfig to control IBM e326m servers via BMC and ipmitool: <group> <name>cluster1</name> <image>RHEL5</image> <override>RHEL5</override> <node>node001-node100</node> <power-control>ipmitool -I lan -A NONE -U USERID -H</power-control> </group> The <power-control> command above should be expanded by si_power in some parallel tasks in the form: ipmitool -I lan -A NONE -U USERID -H node001 power on ipmitool -I lan -A NONE -U USERID -H node002 power on ... ipmitool -I lan -A NONE -U USERID -H node100 power on And maybe a reasonable syntax for si_power should be in this case: # si_power -n cluster1 power on The same for "power off", "power status" and "power cycle" and in part the specific si_power command passed as argument would depend on the particular syntax of the power control method. Your implementation (power control via ssh) is a particular case and it can be expressed in this way: <group> <name>cluster2</name> <image>Ubuntu8.04</image> <override>Ubuntu8.04</override> <node>host1-host20</node> <power-control>ssh -l root</power-control> </group> And the si_power syntax would be: power off: # si_power -n cluster2 init 0 reboot: # si_power -n cluster2 init 6 Ok, this is a good example because it needs a different power control method to power on clients respect to power off and reboot: the WOL (BTW see this python script http://gsd.di.uminho.pt/jpo/software/wakeonlan/mini-howto/wolpython.txt). So, probably a more generic approach would be to differentiate each single operations inside the <power-control> object. But maybe in this way the syntax would become too much difficult to read / understand. Re-writing the previous example (and supposing wol is the command to turn on clients via WOL): <group> <name>cluster2</name> <image>Ubuntu8.04</image> <override>Ubuntu8.04</override> <node>host1-host20</node> <power-control> <poweron>wol %H</poweron> <poweroff>ssh -l root %H init 0</poweroff> <reboot>ssh -l root %H init 6</reboot> </power-control> </group> The special character %H would be resolved in each single host name by si_power. Another possible way could be to implement all the possible (known) power control methods directly by specific SystemImager commands (si_power_ipmi, si_power_wol, si_power_ssh, etc.) or by si_power options, but I don't like this approach, because it's a lot of development work, it doesn't scale at all, and can lead to many bugs and errors due to different versions of the particular power control methods (ipmi, wol, etc.). In conclusion I would prefer a more generic approach, providing in SystemImager all the abstract primitives to define all the possible commands to control the clients' power. Other ideas, criticisms, appreciations, suggestions, etc. are welcome. -Andrea ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ sisuite-users mailing list sisuite-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sisuite-users