[Linux-HA] heartbeat 2.0.2 + stonith

Alan Robertson alanr at unix.sh
Tue Oct 4 05:58:41 MDT 2005


announces at genos.es wrote:
> Hi
> 
> I'm trying to configure a stonith device using heartbeat 2.0.2. The main
> goal is to use my own stonith plugin to control some PDU devices.
> I use the ssh stonith device...

There's your problem then.  You shouldn't use the ssh STONITH plugin. 
It is only for testing.  It is not for use in writing your own STONITH 
plugin.

You probably want to use the "external" plugin to write your own STONITH 
plugin in the shell or whatever.


> How do I pass the "config info" for ssh stonith? I try with attribute
> "hostlist" but it doesn't work...

Ssh is simply the wrong approach.

 > I have also tried with null device but
> it says the same error message.

Same for the null device - except maybe more so.

> And then, how can I make my own plugin? It will be so simple as sending
> some data to a TCP port like this: 
> 
> echo "shutdown-server"| netcat 172.16.74.14 10010

I don't know what netcat is, nor what shutdown-server is, but you do NOT 
want a graceful shutdown for a STONITH operation.

But, if it's a power off, or similar, then you might want to look at the 
source for the external/ssh plugin and use it as a model to write your 
own plugin.

That's a better approach.  You can see a couple of examples - one in the 
shell, and one in python in /usr/lib/stonith/plugins/external.  You must 
support the following commands from your script for it to be fully 
supported:
	gethosts
	reset
	status
	getconfignames
	status
	getinfo-devid
	getinfo-devname
	getinfo-devdescr
	getinfo-devurl
	getinfo-xml

If you can power off the device, and power it on, then you should also 
support the
	off
	on
commands.

I worry when someone blindly sends a command to somewhere and doesn't 
check the return code, so if checking the result is hard using netcat, 
then I'd consider writing something in 'C', or using some other tool to 
connect to the device.

We have a telnet-like library call you can make from 'C', if you like...


-- 
     Alan Robertson <alanr at unix.sh>

"Openness is the foundation and preservative of friendship...  Let me 
claim from you at all times your undisguised opinions." - William 
Wilberforce



More information about the Linux-HA mailing list