Thomas Krause wrote:
> Ok, first of all the syntax of the si_power tool should be the same
> regardless of the method used IME.
>
> There should also be a good default that works in most cases (probably the
> ssh way).
>
> Maybe the best way would be to create a separate si_power configuration file
> that defines the possible power primitives and the methods used to achieve
> them. In the cluster.txt we would then only specify the name of the method
> to use:
>
> <group>
> <name>cluster1</name>
> <image>RHEL5</image>
> <override>RHEL5</override>
> <node>node001-node100</node>
> <power-control>wol,ssh</power-control>
> </group>
>
> The si_power config file could look like:
> <command name="on" defaultMethod="wol">
> <method name="wol">wol %h</method>
> <method name="ipmi">ipmitool -I lan -A NONE -U USERID -H %H power
> on</method>
> </command>
>
> <command name="off" defaultMethod="ssh">
> <method name="ssh">ssh -l root %H init 0</method>
> <method name="ipmi">ipmitool -I lan -A NONE -U USERID -H %H power
> on</method>
> </command>
>
> <command name="custom_command">
> ...
> </command>
>
> si_power would then first find the command node in the config file for the
> action specified on the command line (on, off, etc.). If it has found the
> command, it would try to find the method name given in the cluster.txt. If
> multiple method names are separated by comma (ssh, wol), it will try them
> one by one until it finds a method for this command. If nothing matches or
> if the power-control node in cluster.txt is empty it will use the default
> method.
>
> Although this is somewhat more difficult to implement, it should be very
> easy to extent. Also since this would not be limited to power management, we
> could even name this something more general like si_action.
>
> What do you think?
Agree. Except that IMHO the commands should be more controlled, I mean,
I really like the si_power configuration file to define the basic
primitives, but I wouldn't try multiple methods on the same clients,
this would probably lead to errors or unexpected behaviours. Instead I
would explicitly set all the available/working commands inside the
<power-control> attribute in cluster.xml, removing the "defaultMethod"
attribute.
So, I would rewrite your example in this way:
=== cluster.xml ===
<group>
<name>cluster1</name>
<image>RHEL5</image>
<override>RHEL5</override>
<node>node001-node100</node>
<power-control>
<!--
The following primitives are defined in
si_power.conf (see below)
-->
<on>wol</on>
<off>ipmi-ibm-e326m</off>
<reboot>ipmi-ibm-e326m</reboot>
<shutdown>ssh</shutdown>
</power-control>
</group>
=== si_power.conf (using a syntax similar to cluster.xml) ===
<!-- %H will be automatically expanded in the hostname of the clients -->
<!-- Define other wildcards here -->
<command>
<!-- Name of the basic primitive (used in cluster.xml) -->
<name>on</name>
<!-- Primitive implementation alternatives -->
<method>
<name>wol</name>
<command-line>wol %H</command-line>
</method>
<method>
<name>ipmi-ibm-e326m</name>
<command-line>ipmitool -I lan -A NONE -U USERID -H %H power
on</command-line>
</method>
</command>
<command>
<!-- Name of the basic primitive (used in cluster.xml) -->
<name>off</name>
<!-- Primitive implementation alternatives -->
<method>
<name>ssh</name>
<command-line>ssh %H poweroff</command-line>
</method>
<method>
<name>ipmi-ibm-e326m</name>
<command-line>ipmitool -I lan -A NONE -U USERID -H %H power
off</command-line>
</method>
</command>
<command>
<!-- Name of the basic primitive (used in cluster.xml) -->
<name>reboot</name>
<!-- Primitive implementation alternatives -->
<method>
<name>ssh</name>
<command-line>ssh %H init 6</command-line>
</method>
<method>
<name>ipmi-ibm-e326m</name>
<command-line>ipmitool -I lan -A NONE -U USERID -H %H power
cycle</command-line>
</method>
</command>
<command>
<!-- Name of the basic primitive (used in cluster.xml) -->
<name>shutdown</name>
<!-- Primitive implementation alternatives -->
<method>
<name>ssh</name>
<command-line>ssh %H init 0</command-line>
</method>
</command>
...
In this way we can provide a basic skel of officially supported si_power
primitives and each user can easily implement his own preferred methods
(and maybe share them with the community).
-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
[email protected]
https://lists.sourceforge.net/lists/listinfo/sisuite-users