Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux-HA: Dev

[PATCH] Added a stonith plugin for a WTS MPC series switched rack PDU. Tested

 

 

Linux-HA dev RSS feed   Index | Next | Previous | View Threaded


chollya at satgate

Sep 2, 2009, 7:06 AM

Post #1 of 5 (1055 views)
Permalink
[PATCH] Added a stonith plugin for a WTS MPC series switched rack PDU. Tested

# HG changeset patch
# User Denis Chapligin <chollya [at] satgate>
# Date 1251900378 -10800
# Node ID 4f237a3f3798a955f3c05aa7ff948aa4a2cede93
# Parent 10b6d4ec44a1088499c5d092314254458d3dfd68
Added a stonith plugin for a WTS MPC series switched rack PDU. Tested
with MPC-8H and MPC-18H. Should be working with other MPC devices. Plugin is
based on the apcmastersnmp plugin.

diff -r 10b6d4ec44a1 -r 4f237a3f3798 lib/plugins/stonith/Makefile.am
--- a/lib/plugins/stonith/Makefile.am Fri Aug 14 12:02:34 2009 +0200
+++ b/lib/plugins/stonith/Makefile.am Wed Sep 02 17:06:18 2009 +0300
@@ -112,7 +112,8 @@
ssh.la \
suicide.la \
$(vacm_LIB) \
- wti_nps.la
+ wti_nps.la \
+ wti_mpc.la

apcmaster_la_SOURCES = apcmaster.c $(INCFILES)
apcmaster_la_LDFLAGS = -export-dynamic -module -avoid-version
@@ -186,6 +187,11 @@
wti_nps_la_LDFLAGS = -export-dynamic -module -avoid-version
wti_nps_la_LIBADD = $(top_builddir)/replace/libreplace.la $(GLIBLIB)

+wti_mpc_la_SOURCES= wti_mpc.c $(INCFILES)
+wti_mpc_la_LDFLAGS= -export-dynamic -module -avoid-version @SNMPLIB@ \
+ @CRYPTOLIB@
+wti_mpc_la_LIBADD = $(GLIBLIB)
+
suicide_la_SOURCES = suicide.c $(INCFILES)
suicide_la_LDFLAGS = -export-dynamic -module -avoid-version

_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


chollya at satgate

Sep 2, 2009, 7:11 AM

Post #2 of 5 (1003 views)
Permalink
Re: [PATCH] Added a stonith plugin for a WTS MPC series switched rack PDU. Tested [In reply to]

Hi

Due to limitations of the MPC device (it doesn't allows to assign same
plug name to the different plugs) this plugin uses GROUPS instead of
PLUGS. I mean - you have to connect your nodes to the MPC, using one or
more plugs, create a group and name it, using a node's uname. Then
just add node's plugs to that group. This should be done even for nodes,
that use single outlet.

On Wed, 02 Sep 2009 17:06:45 +0300
Denis Chapligin <chollya [at] satgate> wrote:

> # HG changeset patch
> # User Denis Chapligin <chollya [at] satgate>
> # Date 1251900378 -10800
> # Node ID 4f237a3f3798a955f3c05aa7ff948aa4a2cede93
> # Parent 10b6d4ec44a1088499c5d092314254458d3dfd68
> Added a stonith plugin for a WTS MPC series switched rack PDU. Tested
> with MPC-8H and MPC-18H. Should be working with other MPC devices.
> Plugin is based on the apcmastersnmp plugin.
>
> diff -r 10b6d4ec44a1 -r 4f237a3f3798 lib/plugins/stonith/Makefile.am
> --- a/lib/plugins/stonith/Makefile.am Fri Aug 14 12:02:34 2009
> +0200 +++ b/lib/plugins/stonith/Makefile.am Wed Sep 02
> 17:06:18 2009 +0300 @@ -112,7 +112,8 @@
> ssh.la \
> suicide.la \
> $(vacm_LIB) \
> - wti_nps.la
> + wti_nps.la \
> + wti_mpc.la
>
> apcmaster_la_SOURCES = apcmaster.c $(INCFILES)
> apcmaster_la_LDFLAGS = -export-dynamic -module -avoid-version
> @@ -186,6 +187,11 @@
> wti_nps_la_LDFLAGS = -export-dynamic -module -avoid-version
> wti_nps_la_LIBADD = $(top_builddir)/replace/libreplace.la
> $(GLIBLIB)
> +wti_mpc_la_SOURCES= wti_mpc.c $(INCFILES)
> +wti_mpc_la_LDFLAGS= -export-dynamic -module -avoid-version @SNMPLIB@
> \
> + @CRYPTOLIB@
> +wti_mpc_la_LIBADD = $(GLIBLIB)
> +
> suicide_la_SOURCES = suicide.c $(INCFILES)
> suicide_la_LDFLAGS = -export-dynamic -module -avoid-version
>


--
Denis Chapligin
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


dejanmm at fastmail

Sep 8, 2009, 3:29 AM

Post #3 of 5 (959 views)
Permalink
Re: [PATCH] Added a stonith plugin for a WTS MPC series switched rack PDU. Tested [In reply to]

Hi Denis,

On Wed, Sep 02, 2009 at 05:11:02PM +0300, Denis Chapligin wrote:
> Hi
>
> Due to limitations of the MPC device (it doesn't allows to assign same
> plug name to the different plugs) this plugin uses GROUPS instead of
> PLUGS. I mean - you have to connect your nodes to the MPC, using one or
> more plugs, create a group and name it, using a node's uname. Then
> just add node's plugs to that group. This should be done even for nodes,
> that use single outlet.

I suppose that resetting a GROUP resets a set of outlets?

When you say PLUG do you mean outlet?

In wti_mpc_set_config() in the outlet counting code the comments
and the OID name (OID_NUM_OUTLETS) don't match. Can you please
clarify that.

It would be great if you could also put together a short readme
which would list devices tested and how to configure them for use
with this plugin.

The patches are committed to the repository.

Many thanks for the contribution!

Cheers,

Dejan

>
> On Wed, 02 Sep 2009 17:06:45 +0300
> Denis Chapligin <chollya [at] satgate> wrote:
>
> > # HG changeset patch
> > # User Denis Chapligin <chollya [at] satgate>
> > # Date 1251900378 -10800
> > # Node ID 4f237a3f3798a955f3c05aa7ff948aa4a2cede93
> > # Parent 10b6d4ec44a1088499c5d092314254458d3dfd68
> > Added a stonith plugin for a WTS MPC series switched rack PDU. Tested
> > with MPC-8H and MPC-18H. Should be working with other MPC devices.
> > Plugin is based on the apcmastersnmp plugin.
> >
> > diff -r 10b6d4ec44a1 -r 4f237a3f3798 lib/plugins/stonith/Makefile.am
> > --- a/lib/plugins/stonith/Makefile.am Fri Aug 14 12:02:34 2009
> > +0200 +++ b/lib/plugins/stonith/Makefile.am Wed Sep 02
> > 17:06:18 2009 +0300 @@ -112,7 +112,8 @@
> > ssh.la \
> > suicide.la \
> > $(vacm_LIB) \
> > - wti_nps.la
> > + wti_nps.la \
> > + wti_mpc.la
> >
> > apcmaster_la_SOURCES = apcmaster.c $(INCFILES)
> > apcmaster_la_LDFLAGS = -export-dynamic -module -avoid-version
> > @@ -186,6 +187,11 @@
> > wti_nps_la_LDFLAGS = -export-dynamic -module -avoid-version
> > wti_nps_la_LIBADD = $(top_builddir)/replace/libreplace.la
> > $(GLIBLIB)
> > +wti_mpc_la_SOURCES= wti_mpc.c $(INCFILES)
> > +wti_mpc_la_LDFLAGS= -export-dynamic -module -avoid-version @SNMPLIB@
> > \
> > + @CRYPTOLIB@
> > +wti_mpc_la_LIBADD = $(GLIBLIB)
> > +
> > suicide_la_SOURCES = suicide.c $(INCFILES)
> > suicide_la_LDFLAGS = -export-dynamic -module -avoid-version
> >
>
>
> --
> Denis Chapligin
> _______________________________________________________
> Linux-HA-Dev: Linux-HA-Dev [at] lists
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


chollya at satgate

Sep 8, 2009, 4:23 AM

Post #4 of 5 (955 views)
Permalink
Re: [PATCH] Added a stonith plugin for a WTS MPC series switched rack PDU. Tested [In reply to]

Hi Dejan,

On Tue, 8 Sep 2009 12:29:32 +0200
Dejan Muhamedagic <dejanmm [at] fastmail> wrote:

> > Due to limitations of the MPC device (it doesn't allows to assign
> > same plug name to the different plugs) this plugin uses GROUPS
> > instead of PLUGS. I mean - you have to connect your nodes to the
> > MPC, using one or more plugs, create a group and name it, using a
> > node's uname. Then just add node's plugs to that group. This should
> > be done even for nodes, that use single outlet.
>
> I suppose that resetting a GROUP resets a set of outlets?

Sure!

> When you say PLUG do you mean outlet?

Yes, it is a WTI name for the outlet.

> In wti_mpc_set_config() in the outlet counting code the comments
> and the OID name (OID_NUM_OUTLETS) don't match. Can you please
> clarify that.

Mmm, that is because i've started with outlets, not groups. I switched
to groups later, when i figured that i can't use same name twice.

> It would be great if you could also put together a short readme
> which would list devices tested and how to configure them for use
> with this plugin.

Should i make a patch for this issue and comments issue above or just
post it here?

> The patches are committed to the repository.

Thanks!

--
Denis Chapligin
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


dejanmm at fastmail

Sep 8, 2009, 5:02 AM

Post #5 of 5 (957 views)
Permalink
Re: [PATCH] Added a stonith plugin for a WTS MPC series switched rack PDU. Tested [In reply to]

Hi Denis,

On Tue, Sep 08, 2009 at 02:23:51PM +0300, Denis Chapligin wrote:
> Hi Dejan,
>
> On Tue, 8 Sep 2009 12:29:32 +0200
> Dejan Muhamedagic <dejanmm [at] fastmail> wrote:
>
> > > Due to limitations of the MPC device (it doesn't allows to assign
> > > same plug name to the different plugs) this plugin uses GROUPS
> > > instead of PLUGS. I mean - you have to connect your nodes to the
> > > MPC, using one or more plugs, create a group and name it, using a
> > > node's uname. Then just add node's plugs to that group. This should
> > > be done even for nodes, that use single outlet.
> >
> > I suppose that resetting a GROUP resets a set of outlets?
>
> Sure!

Great. Actually, it makes our life much easier compared to
resetting all relevant outlets.

> > When you say PLUG do you mean outlet?
>
> Yes, it is a WTI name for the outlet.

OK.

> > In wti_mpc_set_config() in the outlet counting code the comments
> > and the OID name (OID_NUM_OUTLETS) don't match. Can you please
> > clarify that.
>
> Mmm, that is because i've started with outlets, not groups. I switched
> to groups later, when i figured that i can't use same name twice.

Perhaps I wasn't clear. You increase the outlet count number if
the returned value for that OID is not empty. The comments should
reflect that and the OID name should be changed. I referred to
this loop:

639 for (mo=1;mo<MAX_OUTLETS;mo++) {
640 snprintf(objname,MAX_STRING,OID_NUM_OUTLETS,mo);
641 if ((i = MPC_read(sd->sptr, objname, ASN_OCTET_STR)) == NULL) {
642 LOG(PIL_CRIT
643 , "%s: cannot read number of outlets."
644 , __FUNCTION__);
645 return (S_ACCESS);
646 }
647 if (strlen(i)) {
648 /* store the number of outlets */
649 sd->num_outlets++;
650 } else {
651 break;
652 }
653 }

> > It would be great if you could also put together a short readme
> > which would list devices tested and how to configure them for use
> > with this plugin.
>
> Should i make a patch for this issue and comments issue above or just
> post it here?

A patch would be better.

> > The patches are committed to the repository.
>
> Thanks!

Thanks to you for the contribution :)

Cheers,

Dejan

>
> --
> Denis Chapligin
> _______________________________________________________
> Linux-HA-Dev: Linux-HA-Dev [at] lists
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Linux-HA dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.