[Linux-cluster] Adding a new fencing script ?

Dave Gavin dgavin at davegavin.com
Wed Aug 1 16:12:15 UTC 2007

On Wed, August 1, 2007 9:57 am, jim parsons wrote:
> On Wed, 2007-08-01 at 09:09 -0400, Dave Gavin wrote:
>>  I have a couple of Server Tech devices controlling the power for the
>> servers in
>> my cluster and they don't seem to have a fence script. I modified a copy
>> of the
>> brocade script to work with the Server Tech device and the script is in
>> /sbin
>> with the permissions/ownership matching the other fence_* scripts. Can
>> anyone
>> point me at a how-to or a doc somewhere on adding this script to the
>> drop-down
>> in system-config-cluster ?
> Hi Dave,
> Adding a new fence form to s-c-c is kind of a daunting task...I'll
> explain below; but in the meanwhile, have you considered donating your
> fence agent under a gpl variant? It would be nice for cluster users to
> have ServerTech support...
> Anyhow, yes, you should be able to drop your agent into /sbin with
> similar permisions to other agents.
> You don't need s-c-c, of course, to use your agent...you can edit the
> cluster.conf file directly and add it there. Under the fencedevices
> section, include an entry for your agent and set the agent attribute to
> whatever you named it (agent='fence_dave').
> Put shared attributes in the fencedevice section and node specific attrs
> under the clusternode->fence->method->device tag. Then propagate the new
> file...first run ccs_tool update and then cman_tool version -r...man
> these comands for details - but dont forget to incerment the
> config_version attribute in the conf file before propagating a new one.
> Here is a rough outline of how to add it to s-c-c:
> First add the form fields to one of the windows in fence.glade. Just
> follow the conventions for naming along the lines of the other agent
> forms that you find there. In each of the three windows that contain
> fence forms, there is a device column and an instance column...both will
> need to be extended for your new agent.
> Next, you will need to edit the python file FenceHandler.py...This
> should be the only other file you need to touch. I would pick an
> existing agent and follow it through the file, noticing all of the
> places it is set...for example, for each fence device and fence
> instance, there is a populate method, a validate method, a clear form
> method, and a process_widgets method entry. Then there are a few hash
> maps to add to. There are comments in the file to assist in adding a new
> fence type.
> In summary, add forms to glade file, then edit FenceHandler.py
> -J

HI Jim,

   Yeow! Daunting pretty much captures it 8-)

   I tried hacking the files and got a bit dizzy figuring out which
labelN/entryN/tableN was available - I actually got through changing  
fence.glade and then FenceHandler.py just blew me away.... I guess I'll
give up on the gui and just use the command line tools to update and
propagate the cluster configuration from now on.

  Playing it safe, I added two brocade fence devices to the config using
s-c-c and then manually edited that cluster.conf, changing the
fence_brocade to fence_servertech (the other options are OK for what I
need). I was then able to propagate this to the other node OK. Started
up fenced and no smoke so far.... I have to go to our co-locate to do
the serious testing, so that'll be tomorrow.

  I'd be happy to pass my script on as GPL (it's just a modified version
of fence_brocade - someone else did the heavy lifting), how would I go
about that ?

 Thanks very much for the quick and detailed answer,

Being shot out of a cannon will always be better than being squeezed
out of a tube.  That is why God made fast motorcycles, Bubba....
  "Song of the Sausage Creature" Hunter S. Thompson (RIP 02/20/2005)

More information about the Linux-cluster mailing list