[Linux-HA] heartbeat 2.0.2 + stonith

Dave Blaschke debltc at us.ibm.com
Tue Oct 4 09:38:39 MDT 2005


announces at genos.es wrote:

>Thanks. Now I have modified the cib.xml which uses an example stonith
>plugin:
>...................
>
>         <primitive id="lampara_stonith" class="stonith"
>type="external/test">
>           <instance_attributes>
>             <attributes>
>               <nvpair name="ST_HOSTLIST" value="heartbeat1" />
>             </attributes>
>           </instance_attributes>
>         </primitive>
>
>.....................
>
>Now heartbeat runs without errors, but, when I simulate an error
>condition (a resource which doesn't stop), it doesn't fence the node. I
>can read the following in log files:
>
>
>pengine[3326]: 2005/10/04_16:36:58 info: mask(stages.c:stage6):
>Scheduling Node heartbeat1 for shutdown
>pengine[3326]: 2005/10/04_16:36:58 WARN: mask(stages.c:stage6):
>Scheduling Node heartbeat1 for STONITH
>
>
>But It doesn't call my external/test stonith plugin. 
>
>Later I can read:
>
>stonithd[15626]: 2005/10/04_16:09:49 info: Failed to STONITH the node
>heartbeat1: optype=1, op_result=2
>  
>
This message indicates that the ST_GENERIC_RESET operation failed with 
S_ACCESS, usually indicating that the STONITH device cannot be 
accessed.  Are you sure that there's an executable file test in the 
/usr/lib/stonith/plugins/external/ directory that can process all of the 
commands that Alan listed below?

>
>What I have done wrong?
>
>Thanks
>
>
>El mar, 04-10-2005 a las 13:58, Alan Robertson escribió:
>  
>
>>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...
>>    
>>
>
>_______________________________________________
>Linux-HA mailing list
>Linux-HA at lists.linux-ha.org
>http://lists.linux-ha.org/mailman/listinfo/linux-ha
>See also: http://linux-ha.org/ReportingProblems
>
>
>  
>



More information about the Linux-HA mailing list