fence-agents: RHEL6 - fence_rackswitch: Add metadata generation for C-based fence agents
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 9f626e816fa55477d388d26a03ecdb0b16451961
Parent: 3ba91d26d78c9929415ce1fe029e5c7603ede494
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Fri Dec 9 10:05:31 2011 +0100
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Tue Feb 21 14:38:02 2012 +0100
fence_rackswitch: Add metadata generation for C-based fence agents
This should be part of previous patch: fence_rackswitch: Add metadata output for fence_rackswitch agent
Resolves: rhbz#714841 (partial)
---
fence/agents/ipmilan/Makefile.am | 15 +++++++--------
fence/agents/rackswitch/Makefile.am | 9 +++------
make/fencemanc.mk | 2 +-
3 files changed, 11 insertions(+), 15 deletions(-)
diff --git a/fence/agents/ipmilan/Makefile.am b/fence/agents/ipmilan/Makefile.am
index 4868dc6..f237f92 100644
--- a/fence/agents/ipmilan/Makefile.am
+++ b/fence/agents/ipmilan/Makefile.am
@@ -1,17 +1,16 @@
MAINTAINERCLEANFILES = Makefile.in
-sbin_PROGRAMS = fence_ipmilan
+TARGET = fence_ipmilan
+
+sbin_PROGRAMS = $(TARGET)
noinst_HEADERS = expect.h
fence_ipmilan_SOURCES = expect.c ipmilan.c
-man_MANS = fence_ipmilan.8
+dist_man_MANS = $(TARGET).8
-fence_ipmilan.8: fence_ipmilan $(top_srcdir)/fence/agents/lib/fence2man.xsl
- set -e && \
- ./$^ -o metadata > .$@.tmp && \
- xsltproc $(top_srcdir)/fence/agents/lib/fence2man.xsl .$@.tmp > $@
+include $(top_srcdir)/make/fencemanc.mk
-clean-local:
- rm -f *.8 .*.8.tmp
+clean-local: clean-man
+ rm -f $(TARGET)
diff --git a/fence/agents/rackswitch/Makefile.am b/fence/agents/rackswitch/Makefile.am
index b6369e4..d2c9e1f 100644
--- a/fence/agents/rackswitch/Makefile.am
+++ b/fence/agents/rackswitch/Makefile.am
@@ -10,10 +10,7 @@ fence_rackswitch_SOURCES = do_rack.c
dist_man_MANS = $(TARGET).8
-fence_rackswitch.8: fence_rackswitch $(top_srcdir)/fence/agents/lib/fence2man.xsl
- set -e && \
- ./$^ -o metadata > .$@.tmp && \
- xsltproc $(top_srcdir)/fence/agents/lib/fence2man.xsl .$@.tmp > $@
+include $(top_srcdir)/make/fencemanc.mk
-clean-local:
- rm -f *.8 .*.8.tmp
\ No newline at end of file
+clean-local: clean-man
+ rm -f $(TARGET)
\ No newline at end of file
diff --git a/make/fencemanc.mk b/make/fencemanc.mk
index 70ee773..9c904b6 100644
--- a/make/fencemanc.mk
+++ b/make/fencemanc.mk
@@ -1,6 +1,6 @@
%.8: $(TARGET) $(top_srcdir)/fence/agents/lib/fence2man.xsl
set -e && \
- ./$(TARGET) -o metadata > .$@.tmp && \
+ ./$^ -o metadata > .$@.tmp && \
xsltproc $(top_srcdir)/fence/agents/lib/fence2man.xsl .$@.tmp > $@
clean-man:
12 years, 2 months
fence-agents: RHEL6 - fence_rackswitch: Add metadata output for fence_rackswitch agent
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 3ba91d26d78c9929415ce1fe029e5c7603ede494
Parent: 6a0643acb9929a89396ed2b19b04e46491366bfa
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Fri Dec 9 10:01:18 2011 +0100
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Tue Feb 21 14:37:54 2012 +0100
fence_rackswitch: Add metadata output for fence_rackswitch agent
Adding this feature allow us to generate manual pages directly from XML,
so both GUI tools and manual pages can see same feature.
Makefile for fence_ipmilan is modified because it can reuse same snippets
Resolves: rhbz#714841 (partial)
---
fence/agents/rackswitch/Makefile.am | 8 +++
fence/agents/rackswitch/do_rack.c | 46 ++++++++++++++++++-
fence/agents/rackswitch/fence_rackswitch.8 | 70 ----------------------------
make/fencemanc.mk | 7 +++
4 files changed, 60 insertions(+), 71 deletions(-)
diff --git a/fence/agents/rackswitch/Makefile.am b/fence/agents/rackswitch/Makefile.am
index 29cbef8..b6369e4 100644
--- a/fence/agents/rackswitch/Makefile.am
+++ b/fence/agents/rackswitch/Makefile.am
@@ -9,3 +9,11 @@ noinst_HEADERS = do_rack.h
fence_rackswitch_SOURCES = do_rack.c
dist_man_MANS = $(TARGET).8
+
+fence_rackswitch.8: fence_rackswitch $(top_srcdir)/fence/agents/lib/fence2man.xsl
+ set -e && \
+ ./$^ -o metadata > .$@.tmp && \
+ xsltproc $(top_srcdir)/fence/agents/lib/fence2man.xsl .$@.tmp > $@
+
+clean-local:
+ rm -f *.8 .*.8.tmp
\ No newline at end of file
diff --git a/fence/agents/rackswitch/do_rack.c b/fence/agents/rackswitch/do_rack.c
index 854b475..67d24a2 100644
--- a/fence/agents/rackswitch/do_rack.c
+++ b/fence/agents/rackswitch/do_rack.c
@@ -158,6 +158,40 @@ static void print_usage(void)
+static void print_metadata(void)
+{
+ printf("<?xml version=\"1.0\" ?>\n"
+ "<resource-agent name=\"fence_rackswitch\" shortdesc=\"fence_rackswitch - I/O Fencing agent for RackSaver RackSwitch\" >\n"
+ "<longdesc>fence_rackswitch is an I/O Fencing agent which can be used with the RackSaver RackSwitch. It logs into the RackSwitch and boots a specified plug. Using the http interface to the RackSwitch should be avoided while a GFS cluster is running because the connection may interfere with the operation of this agent.</longdesc>\n"
+ "<vendor-url>http://www.bladenetwork.net</vendor-url>\n"
+ "<parameters>\n"
+ "<parameter name=\"ipaddr\" unique=\"1\" required=\"1\">\n"
+ "\t<getopt mixed=\"-a <ip>\" />\n"
+ "\t<content type=\"string\" />\n"
+ "\t<shortdesc lang=\"en\">IP Address or Hostname</shortdesc>\n"
+ "</parameter>\n"
+ "<parameter name=\"login\" unique=\"1\" required=\"1\">\n"
+ "\t<getopt mixed=\"-l <name>\" />\n"
+ "\t<content type=\"string\" />\n"
+ "\t<shortdesc lang=\"en\">Login Name</shortdesc>\n"
+ "</parameter>\n"
+ "<parameter name=\"passwd\" unique=\"1\" required=\"0\">\n"
+ "\t<getopt mixed=\"-p <password>\" />\n"
+ "\t<content type=\"string\" />\n"
+ "\t<shortdesc lang=\"en\">Login password or passphrase</shortdesc>\n"
+ "</parameter>\n"
+ "<parameter name=\"passwd_script\" unique=\"1\" required=\"0\">\n"
+ "\t<getopt mixed=\"-S <script>\" />\n"
+ "\t<content type=\"string\" />\n"
+ "\t<shortdesc lang=\"en\">Script to retrieve password</shortdesc>\n"
+ "</parameter>\n"
+ "</parameters>\n"
+ "<actions>\n"
+ "\t<action name=\"metadata\" />\n"
+ "</actions>\n"
+ "</resource-agent>\n");
+}
+
static void get_options(int argc, char **argv)
{
int c;
@@ -167,7 +201,7 @@ static void get_options(int argc, char **argv)
/*
* Command line input
*/
- while ((c = getopt(argc, argv, "ha:n:l:p:S:vqVd")) != -1)
+ while ((c = getopt(argc, argv, "ha:n:l:p:S:vqVdo:")) != -1)
{
switch(c)
{
@@ -220,6 +254,16 @@ static void get_options(int argc, char **argv)
fprintf(stderr, "Please use '-h' for usage.\n");
exit(DID_FAILURE);
break;
+
+ case 'o':
+ if (strncasecmp(optarg, "metadata", 254) == 0) {
+ print_metadata();
+ exit(DID_SUCCESS);
+ } else {
+ fprintf(stderr, "Only 'metadata' option is aviable for this fence agent\n");
+ exit(DID_FAILURE);
+ }
+ break;
default:
fprintf(stderr, "Bad programmer! You forgot to catch the %c flag\n", c);
diff --git a/fence/agents/rackswitch/fence_rackswitch.8 b/fence/agents/rackswitch/fence_rackswitch.8
deleted file mode 100644
index fc64a79..0000000
--- a/fence/agents/rackswitch/fence_rackswitch.8
+++ /dev/null
@@ -1,70 +0,0 @@
-.TH fence_rackswitch 8
-
-.SH NAME
-fence_rackswitch - I/O Fencing agent for RackSaver RackSwitch
-
-.SH SYNOPSIS
-.B
-fence_rackswitch
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_rackswitch is an I/O Fencing agent which can be used with the RackSaver
-RackSwitch. It logs into the RackSwitch and boots a specified plug.
-Using the http interface to the RackSwitch should be avoided while a GFS cluster is
-running because the connection may interfere with the operation of this agent.
-
-fence_rackswitch accepts options on the command line as well as from stdin.
-fenced sends the options through stdin when it execs the agent. fence_rackswitch
-can be run by itself with command line options which is useful for testing.
-
-Vendor URL: http://www.bladenetwork.net
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress\fP
-IP address of the switch.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-n\fP \fIplug\fP
-The plug number to power cycle.
-.TP
-\fB-p\fP \fIpassword\fP
-Password for login.
-.TP
-\fB-S\fP \fIpath\fR
-Full path to an executable to generate the password for login.
-.TP
-\fB-l\fP \fIusername\fP
-Username for login.
-.TP
-\fB-q\fP
-Quiet operation. Only print out error messages.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_rackswitch.
-.TP
-\fIipaddr = < ip >\fR
-IP address of the switch.
-.TP
-\fIusername = < param >\fR
-Username for login.
-.TP
-\fIpassword = < param >\fR
-Password for login.
-.TP
-\fIpasswd_script = < param >\fR
-Full path to an executable to generate the password for login.
-.TP
-\fIport = < param >\fR
-The port (outlet) number to act upon.
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/make/fencemanc.mk b/make/fencemanc.mk
new file mode 100644
index 0000000..70ee773
--- /dev/null
+++ b/make/fencemanc.mk
@@ -0,0 +1,7 @@
+%.8: $(TARGET) $(top_srcdir)/fence/agents/lib/fence2man.xsl
+ set -e && \
+ ./$(TARGET) -o metadata > .$@.tmp && \
+ xsltproc $(top_srcdir)/fence/agents/lib/fence2man.xsl .$@.tmp > $@
+
+clean-man:
+ rm -f *.8 .*.8.tmp
12 years, 2 months
fence-agents: RHEL6 - fencing-agents: Add metadata output for fence agents in perl
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 6a0643acb9929a89396ed2b19b04e46491366bfa
Parent: 36884392cb77980d63f8d284684c0a8f3a67b483
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Thu Nov 24 14:33:40 2011 +0100
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Tue Feb 21 14:37:42 2012 +0100
fencing-agents: Add metadata output for fence agents in perl
Fencing agents written in PERL usually did not have option to print
XML metadata about its feature. Adding this feature also allow us
to generate manual pages directly from XML, so both GUI tools and manual
pages can see same feature.
Resolves: rhbz#714841 (partial)
---
fence/agents/baytech/Makefile.am | 3 +-
fence/agents/baytech/fence_baytech.8 | 84 --------------------------
fence/agents/baytech/fence_baytech.pl | 64 ++++++++++++++++++++-
fence/agents/brocade/Makefile.am | 3 +-
fence/agents/brocade/fence_brocade.8 | 84 --------------------------
fence/agents/brocade/fence_brocade.pl | 64 ++++++++++++++++++++-
fence/agents/bullpap/Makefile.am | 3 +-
fence/agents/bullpap/fence_bullpap.8 | 73 -----------------------
fence/agents/bullpap/fence_bullpap.pl | 68 ++++++++++++++++++++-
fence/agents/cpint/Makefile.am | 3 +-
fence/agents/cpint/fence_cpint.8 | 54 -----------------
fence/agents/cpint/fence_cpint.pl | 37 +++++++++++-
fence/agents/drac/Makefile.am | 3 +-
fence/agents/drac/fence_drac.8 | 105 ---------------------------------
fence/agents/drac/fence_drac.pl | 87 +++++++++++++++++++++++++++-
fence/agents/egenera/Makefile.am | 3 +-
fence/agents/egenera/fence_egenera.8 | 84 --------------------------
fence/agents/egenera/fence_egenera.pl | 61 +++++++++++++++++++
fence/agents/lib/fence2man.xsl | 4 +-
fence/agents/mcdata/Makefile.am | 3 +-
fence/agents/mcdata/fence_mcdata.8 | 84 --------------------------
fence/agents/mcdata/fence_mcdata.pl | 65 ++++++++++++++++++++-
fence/agents/vixel/Makefile.am | 3 +-
fence/agents/vixel/fence_vixel.8 | 72 ----------------------
fence/agents/vixel/fence_vixel.pl | 57 +++++++++++++++++-
fence/agents/xcat/Makefile.am | 3 +-
fence/agents/xcat/fence_xcat.8 | 63 --------------------
fence/agents/xcat/fence_xcat.pl | 56 ++++++++++++++++-
fence/agents/zvm/Makefile.am | 3 +-
fence/agents/zvm/fence_zvm.8 | 64 --------------------
fence/agents/zvm/fence_zvm.pl | 50 +++++++++++++++-
make/fencemanperl.mk | 7 ++
32 files changed, 625 insertions(+), 792 deletions(-)
diff --git a/fence/agents/baytech/Makefile.am b/fence/agents/baytech/Makefile.am
index 9ad50ec..5288efa 100644
--- a/fence/agents/baytech/Makefile.am
+++ b/fence/agents/baytech/Makefile.am
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET)
dist_man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fencemanperl.mk
-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/baytech/fence_baytech.8 b/fence/agents/baytech/fence_baytech.8
deleted file mode 100644
index aa17955..0000000
--- a/fence/agents/baytech/fence_baytech.8
+++ /dev/null
@@ -1,84 +0,0 @@
-.TH fence_baytech 8
-
-.SH NAME
-fence_baytech - I/O Fencing agent for Baytech RPC switches in combination with a Cyclades Terminal Server
-
-.SH SYNOPSIS
-.B
-fence_baytech
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-
-This fencing agent is written for the Baytech RPC27-20nc in combination with
-a Cyclades terminal server. The Cyclades TS exports the RPC's serial port
-via a Telnet interface. Other interfaces, such as SSH, are possible.
-However, this script relies upon the assumption that Telnet is used. Future
-features to this agent would allow the agent to work with a multitude of
-different communication protocols such as Telnet, SSH or Kermit.
-
-The other assumption that is made is that Outlet names do not end in space.
-The name "Foo" and "Foo " are identical when the RPC prints them with
-the status command.
-
-fence_baytech accepts options on the command line as well as from stdin.
-fenced sends parameters through stdin when it execs the agent. fence_baytech
-can be run by itself with command line options which is useful for testing.
-
-Vendor URL: http://www.baytech.net
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIhost\fP
-IP address or hostname to connect to.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-l\fP \fIlogin\fP
-Username name for the switch.
-.TP
-\fB-n\fP \fIport\fP
-The name of the outlet to act upon.
-.TP
-\fB-o\fP \fIaction\fP
-The action required. This can be on, off, status or reboot (default)
-.TP
-\fB-p\fP \fIpassword\fP
-Password for login.
-.TP
-\fB-S\fP \fIpath\fR
-Full path to an executable to generate the password for login.
-.TP
-\fB-q\fP
-Quiet mode: print only error messages.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_baytech.
-.TP
-\fIhost = < hostname | ip >\fR
-IP address or hostname to connect to.
-.TP
-\fIlogin = < param >\fR
-Login name.
-.TP
-\fIaction = < param >\fR
-The action required. This can be on, off, status or reboot (default)
-.TP
-\fIpasswd = < param >\fR
-Password for login.
-.TP
-\fIpasswd_script = < param >\fR
-Full path to an executable to generate the password for login.
-.TP
-\fIoutlet = < param >\fR
-The name of the outlet to act upon.
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/agents/baytech/fence_baytech.pl b/fence/agents/baytech/fence_baytech.pl
index b625968..c978ec5 100644
--- a/fence/agents/baytech/fence_baytech.pl
+++ b/fence/agents/baytech/fence_baytech.pl
@@ -63,7 +63,7 @@ sub usage
print " -D debugging output\n";
print " -h usage\n";
print " -l string user name\n";
- print " -o string action: on,off,status or reboot (default)\n";
+ print " -o string action: on,off,status, reboot (default) or metadata\n";
print " -n string outlet name\n";
print " -p string password\n";
print " -S path script to run to retrieve password\n";
@@ -96,6 +96,64 @@ sub version
exit 0;
}
+sub print_metadata
+{
+print '<?xml version="1.0" ?>
+<resource-agent name="fence_baytech" shortdesc="I/O Fencing agent for Baytech RPC switches in combination with a Cyclades Terminal Server" >
+<longdesc>
+This fencing agent is written for the Baytech RPC27-20nc in combination with a Cyclades terminal server. The Cyclades TS exports the RPC\'s serial port via a Telnet interface. Other interfaces, such as SSH, are possible. However, this script relies upon the assumption that Telnet is used.
+
+The other assumption that is made is that Outlet names do not end in space. The name "Foo" and "Foo " are identical when the RPC prints them with the status command.
+</longdesc>
+<vendor-url>http://www.baytech.net</vendor-url>
+<parameters>
+ <parameter name="action" unique="1" required="1">
+ <getopt mixed="-o <action>" />
+ <content type="string" default="disable" />
+ <shortdesc lang="en">Fencing Action</shortdesc>
+ </parameter>
+ <parameter name="ipaddr" unique="1" required="1">
+ <getopt mixed="-a <ip>" />
+ <content type="string" />
+ <shortdesc lang="en">IP Address or Hostname</shortdesc>
+ </parameter>
+ <parameter name="login" unique="1" required="1">
+ <getopt mixed="-l <name>" />
+ <content type="string" />
+ <shortdesc lang="en">Login Name</shortdesc>
+ </parameter>
+ <parameter name="passwd" unique="1" required="0">
+ <getopt mixed="-p <password>" />
+ <content type="string" />
+ <shortdesc lang="en">Login password or passphrase</shortdesc>
+ </parameter>
+ <parameter name="passwd_script" unique="1" required="0">
+ <getopt mixed="-S <script>" />
+ <content type="string" />
+ <shortdesc lang="en">Script to retrieve password</shortdesc>
+ </parameter>
+ <parameter name="port" unique="1" required="1">
+ <getopt mixed="-n <id>" />
+ <content type="string" />
+ <shortdesc lang="en">Physical plug number or name of virtual machine</shortdesc>
+ </parameter>
+ <parameter name="help" unique="1" required="0">
+ <getopt mixed="-h" />
+ <content type="string" />
+ <shortdesc lang="en">Display help and exit</shortdesc>
+ </parameter>
+</parameters>
+<actions>
+ <action name="enable" />
+ <action name="disable" />
+ <action name="status" />
+ <action name="metadata" />
+</actions>
+</resource-agent>
+';
+}
+
+
# Get operating paramters, either with getopts or from STDIN
sub get_options
{
@@ -108,6 +166,10 @@ sub get_options
fail_usage "Unkown parameter." if (@ARGV > 0);
+ if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
} else {
get_options_stdin();
}
diff --git a/fence/agents/brocade/Makefile.am b/fence/agents/brocade/Makefile.am
index f4281ab..ed3394d 100644
--- a/fence/agents/brocade/Makefile.am
+++ b/fence/agents/brocade/Makefile.am
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET)
dist_man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fencemanperl.mk
-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/brocade/fence_brocade.8 b/fence/agents/brocade/fence_brocade.8
deleted file mode 100644
index 812a3f9..0000000
--- a/fence/agents/brocade/fence_brocade.8
+++ /dev/null
@@ -1,84 +0,0 @@
-.TH fence_brocade 8
-
-.SH NAME
-fence_brocade - I/O Fencing agent for Brocade FC switches
-
-.SH SYNOPSIS
-.B
-fence_brocade
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_brocade is an I/O Fencing agent which can be used with Brocade FC
-switches. It logs into a Brocade switch via telnet and disables a specified
-port. Disabling the port which a machine is connected to effectively fences
-that machine. Lengthy telnet connections to the switch should be avoided
-while a GFS cluster is running because the connection will block any necessary
-fencing actions.
-
-fence_brocade accepts options on the command line as well as from stdin.
-fenced sends parameters through stdin when it execs the agent. fence_brocade
-can be run by itself with command line options which is useful for testing.
-
-After a fence operation has taken place the fenced machine can no longer connect
-to the Brocade FC switch. When the fenced machine is ready to be brought back
-into the GFS cluster (after reboot) the port on the Brocade FC switch needs to
-be enabled. This can be done by running fence_brocade and specifying the
-enable action.
-
-Vendor URL: http://www.brocade.com
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress\fP
-IP address of the switch.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-l\fP \fIlogin\fP
-Login name for the switch.
-.TP
-\fB-n\fP \fIport\fP
-The port number to disable on the switch.
-.TP
-\fB-o\fP \fIaction\fP
-The action required. disable (default) or enable.
-.TP
-\fB-p\fP \fIpassword\fP
-Password for login.
-.TP
-\fB-S\fP \fIpath\fR
-Full path to an executable to generate the password for login.
-.TP
-\fB-q\fP
-Quiet mode: print only error messages.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_brocade.
-.TP
-\fIipaddr = < hostname | ip >\fR
-IP address or hostname of the switch.
-.TP
-\fIlogin = < param >\fR
-Login name.
-.TP
-\fIoption = < param >\fR
-The action required. disable (default) or enable.
-.TP
-\fIpasswd = < param >\fR
-Password for login.
-.TP
-\fIpasswd_script = < param >\fR
-Full path to an executable to generate the password for login.
-.TP
-\fIport = < param >\fR
-The port number to disable on the switch.
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/agents/brocade/fence_brocade.pl b/fence/agents/brocade/fence_brocade.pl
index 933cecf..b6d3f45 100644
--- a/fence/agents/brocade/fence_brocade.pl
+++ b/fence/agents/brocade/fence_brocade.pl
@@ -40,7 +40,7 @@ sub usage
print " -h usage\n";
print " -l <name> Login name\n";
print " -n <num> Port number to operate on\n";
- print " -o <string> Action: disable (default) or enable\n";
+ print " -o <string> Action: disable (default), enable or metadata\n";
print " -p <string> Password for login\n";
print " -S <path> Script to run to retrieve password\n";
print " -q quiet mode\n";
@@ -73,6 +73,63 @@ sub version
exit 0;
}
+sub print_metadata
+{
+print '<?xml version="1.0" ?>
+<resource-agent name="fence_brocade" shortdesc="Fence agent for Brocade over telnet" >
+<longdesc>
+fence_brocade is an I/O Fencing agent which can be used with Brocade FC switches. It logs into a Brocade switch via telnet and disables a specified port. Disabling the port which a machine is connected to effectively fences that machine. Lengthy telnet connections to the switch should be avoided while a GFS cluster is running because the connection will block any necessary fencing actions.
+
+After a fence operation has taken place the fenced machine can no longer connect to the Brocade FC switch. When the fenced machine is ready to be brought back into the GFS cluster (after reboot) the port on the Brocade FC switch needs to be enabled. This can be done by running fence_brocade and specifying the enable action.
+</longdesc>
+<vendor-url>http://www.brocade.com</vendor-url>
+<parameters>
+ <parameter name="action" unique="1" required="1">
+ <getopt mixed="-o <action>" />
+ <content type="string" default="disable" />
+ <shortdesc lang="en">Fencing Action</shortdesc>
+ </parameter>
+ <parameter name="ipaddr" unique="1" required="1">
+ <getopt mixed="-a <ip>" />
+ <content type="string" />
+ <shortdesc lang="en">IP Address or Hostname</shortdesc>
+ </parameter>
+ <parameter name="login" unique="1" required="1">
+ <getopt mixed="-l <name>" />
+ <content type="string" />
+ <shortdesc lang="en">Login Name</shortdesc>
+ </parameter>
+ <parameter name="passwd" unique="1" required="0">
+ <getopt mixed="-p <password>" />
+ <content type="string" />
+ <shortdesc lang="en">Login password or passphrase</shortdesc>
+ </parameter>
+ <parameter name="passwd_script" unique="1" required="0">
+ <getopt mixed="-S <script>" />
+ <content type="string" />
+ <shortdesc lang="en">Script to retrieve password</shortdesc>
+ </parameter>
+ <parameter name="port" unique="1" required="1">
+ <getopt mixed="-n <id>" />
+ <content type="string" />
+ <shortdesc lang="en">Physical plug number or name of virtual machine</shortdesc>
+ </parameter>
+ <parameter name="help" unique="1" required="0">
+ <getopt mixed="-h" />
+ <content type="string" />
+ <shortdesc lang="en">Display help and exit</shortdesc>
+ </parameter>
+</parameters>
+<actions>
+ <action name="enable" />
+ <action name="disable" />
+ <action name="status" />
+ <action name="metadata" />
+</actions>
+</resource-agent>
+';
+}
+
if (@ARGV > 0) {
getopts("a:hl:n:o:p:S:qV") || fail_usage ;
@@ -82,6 +139,11 @@ if (@ARGV > 0) {
fail_usage "Unknown parameter." if (@ARGV > 0);
+ if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
+
if (defined $opt_S) {
$pwd_script_out = `$opt_S`;
chomp($pwd_script_out);
diff --git a/fence/agents/bullpap/Makefile.am b/fence/agents/bullpap/Makefile.am
index a708d4f..b454007 100644
--- a/fence/agents/bullpap/Makefile.am
+++ b/fence/agents/bullpap/Makefile.am
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET)
dist_man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fencemanperl.mk
-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/bullpap/fence_bullpap.8 b/fence/agents/bullpap/fence_bullpap.8
deleted file mode 100644
index 1404c75..0000000
--- a/fence/agents/bullpap/fence_bullpap.8
+++ /dev/null
@@ -1,73 +0,0 @@
-.TH fence_bullpap 8
-
-.SH NAME
-fence_bullpap - I/O Fencing agent for Bull FAME architecture controlled by a
-PAP management console.
-
-.SH SYNOPSIS
-.B
-fence_bullpap
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_bullpap is an I/O Fencing agent which can be used with Bull's NovaScale
-machines controlled by PAP management consoles. This agent calls Bull's
-support software provided by the NSMasterHW RPM available from Bull.
-
-fence_bullpap accepts options on the command line as well as from stdin.
-fenced sends the options through stdin when it execs the agent. fence_bullpap
-can be run by itself with command line options which is useful for testing.
-
-Vendor URL: http://www.bull.com
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress\fP
-IP address or hostname of the PAP management console.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-l\fP \fIlogin\fP
-Login with administrative privileges.
-.TP
-\fB-d\fP \fIdomain\fP
-This is the domain name of the Bull machine to power-cycle.
-.TP
-\fB-o\fP \fIoption\fP
-Action to perform (on, off, reboot, status).
-.TP
-\fB-p\fP \fIpassword\fP
-Password for login.
-.TP
-\fB-S\fP \fIpath\fR
-Full path to an executable to generate the password for login.
-.TP
-\fB-q\fP
-Quiet operation. Only print out error messages.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIipaddr = < hostname | ip >\fR
-IP address or hostname of the PAP management console.
-.TP
-\fIlogin= < param >\fR
-Login with administrative privileges.
-.TP
-\fIdomain = < param >\fR
-This is the domain name of the Bull machine to power-cycle.
-.TP
-\fIoption = < param >\fR
-Action to perform (on, off, reboot, status).
-.TP
-\fIpasswd = < param >\fR
-Password for login.
-.TP
-\fIpasswd_script = < param >\fR
-Full path to an executable to generate the password for login.
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/agents/bullpap/fence_bullpap.pl b/fence/agents/bullpap/fence_bullpap.pl
index 6915f57..3309c18 100644
--- a/fence/agents/bullpap/fence_bullpap.pl
+++ b/fence/agents/bullpap/fence_bullpap.pl
@@ -20,8 +20,6 @@ my $pname = $_;
$action = "reboot"; # Default fence action
my $bulldir = "/usr/local/bull/NSMasterHW/bin";
-stat($bulldir);
-die "NSMasterHW not installed correctly" if ! -d _;
# WARNING!! Do not add code bewteen "#BEGIN_VERSION_GENERATION" and
# "#END_VERSION_GENERATION" It is generated by the Makefile
@@ -44,7 +42,7 @@ sub usage
print " -h usage\n";
print " -l <name> Login name\n";
print " -d <domain> Domain to operate on\n";
- print " -o <string> Action: on, off, reboot (default) or status\n";
+ print " -o <string> Action: on, off, reboot (default), status or metadata\n";
print " -p <string> Password for login\n";
print " -S <path> Script to run to retrieve password\n";
print " -q quiet mode\n";
@@ -86,6 +84,62 @@ sub version
exit 0;
}
+sub print_metadata
+{
+print '<?xml version="1.0" ?>
+<resource-agent name="fence_bullpap" shortdesc="I/O Fencing agent for Bull FAME architecture controlled by a PAP management console." >
+<longdesc>
+fence_bullpap is an I/O Fencing agent which can be used with Bull\'s NovaScale machines controlled by PAP management consoles. This agent calls Bull\'s support software provided by the NSMasterHW RPM available from Bull.
+</longdesc>
+<vendor-url>http://www.bull.com</vendor-url>
+<parameters>
+ <parameter name="action" unique="1" required="1">
+ <getopt mixed="-o <action>" />
+ <content type="string" default="reboot" />
+ <shortdesc lang="en">Fencing Action</shortdesc>
+ </parameter>
+ <parameter name="ipaddr" unique="1" required="1">
+ <getopt mixed="-a <ip>" />
+ <content type="string" />
+ <shortdesc lang="en">IP Address or Hostname</shortdesc>
+ </parameter>
+ <parameter name="login" unique="1" required="1">
+ <getopt mixed="-l <name>" />
+ <content type="string" />
+ <shortdesc lang="en">Login Name</shortdesc>
+ </parameter>
+ <parameter name="passwd" unique="1" required="0">
+ <getopt mixed="-p <password>" />
+ <content type="string" />
+ <shortdesc lang="en">Login password or passphrase</shortdesc>
+ </parameter>
+ <parameter name="passwd_script" unique="1" required="0">
+ <getopt mixed="-S <script>" />
+ <content type="string" />
+ <shortdesc lang="en">Script to retrieve password</shortdesc>
+ </parameter>
+ <parameter name="domain" unique="1" required="1">
+ <getopt mixed="-d <domain>" />
+ <content type="string" />
+ <shortdesc lang="en">Domain name of the Bull machine to power-cycle</shortdesc>
+ </parameter>
+ <parameter name="help" unique="1" required="0">
+ <getopt mixed="-h" />
+ <content type="string" />
+ <shortdesc lang="en">Display help and exit</shortdesc>
+ </parameter>
+</parameters>
+<actions>
+ <action name="on" />
+ <action name="off" />
+ <action name="reboot" />
+ <action name="status" />
+ <action name="metadata" />
+</actions>
+</resource-agent>
+';
+}
+
sub get_options_stdin
{
my $opt;
@@ -224,6 +278,11 @@ if (@ARGV > 0)
usage if defined $opt_h;
version if defined $opt_V;
+ if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
+
$host = $opt_a if defined $opt_a;
$login = $opt_l if defined $opt_l;
$passwd = $opt_p if defined $opt_p;
@@ -269,6 +328,9 @@ else
fail "failed: no password" unless defined $passwd;
}
+stat($bulldir);
+die "NSMasterHW not installed correctly" if ! -d _;
+
# convert $action to lower case
$_=$action;
if (/^on$/i) { $action = "on"; }
diff --git a/fence/agents/cpint/Makefile.am b/fence/agents/cpint/Makefile.am
index c02480a..e9fee26 100644
--- a/fence/agents/cpint/Makefile.am
+++ b/fence/agents/cpint/Makefile.am
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET)
dist_man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fencemanperl.mk
-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/cpint/fence_cpint.8 b/fence/agents/cpint/fence_cpint.8
deleted file mode 100644
index e9f1c5d..0000000
--- a/fence/agents/cpint/fence_cpint.8
+++ /dev/null
@@ -1,54 +0,0 @@
-.TH fence_cpint 8
-
-.SH NAME
-fence_cpint - I/O Fencing agent for GFS on s390 and zSeries VM clusters
-
-.SH SYNOPSIS
-.B
-fence_cpint
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_cpint is an I/O Fencing agent used on a virtual machine running GFS in a
-s390 or zSeries VM cluster.
-It uses the cpint package to send a CP LOGOFF command to the specified virtual
-machine.
-For fence_cpint to execute correctly, you must have the cpint module installed,
-and hcp in your PATH.
-\fBNOTE:\fP for fence_cpint to send a command to another virtual machine, the
-machine executing it must either be a privilege class C user or it must be
-the secondary user of the virtual machine to be fenced. This means that unless
-all of you GULM server nodes are privilege class C, fence_cpint can only be
-used with SLM.
-
-fence_cpint accepts options on the command line as well as from stdin.
-fence_node sends the options through stdin when it execs the agent.
-fence_cpint can be run by itself with command line options which is useful for
-testing.
-
-Vendor URL: http://www.ibm.com
-
-.SH OPTIONS
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-u\fP \fIuserid\fP
-userid of the virtual machine to fence (required).
-.TP
-\fB-q\fP
-quiet mode, no output.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_cpint.
-.TP
-\fIuserid = < parm >\fP
-userid of the virtual machine to fence (required).
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/agents/cpint/fence_cpint.pl b/fence/agents/cpint/fence_cpint.pl
index dc17eed..d3c016a 100644
--- a/fence/agents/cpint/fence_cpint.pl
+++ b/fence/agents/cpint/fence_cpint.pl
@@ -36,6 +36,7 @@ sub usage
print "\n";
print "Options:\n";
print " -h usage\n";
+ print " -o metadata print XML metadata for fence agent\n";
print " -u <string> userid of the virtual machine to fence\n";
print " -q quiet mode\n";
print " -V Version\n";
@@ -66,6 +67,35 @@ sub version
exit 0;
}
+sub print_metadata
+{
+print '<?xml version="1.0" ?>
+<resource-agent name="fence_cpint" shortdesc="I/O Fencing agent for GFS on s390 and zSeries VM clusters" >
+<longdesc>
+fence_cpint is an I/O Fencing agent used on a virtual machine running GFS in a s390 or zSeries VM cluster. It uses the cpint package to send a CP LOGOFF command to the specified virtual machine. For fence_cpint to execute correctly, you must have the cpint module installed, and hcp in your PATH.
+
+NOTE: for fence_cpint to send a command to another virtual machine, the machine executing it must either be a privilege class C user or it must be the secondary user of the virtual machine to be fenced. This means that unless all of you GULM server nodes are privilege class C, fence_cpint can only be used with SLM.
+</longdesc>
+<vendor-url>http://www.ibm.com</vendor-url>
+<parameters>
+ <parameter name="userid" unique="1" required="1">
+ <getopt mixed="-u <userid>" />
+ <content type="string" />
+ <shortdesc lang="en">Userid of the virtual machine to fence</shortdesc>
+ </parameter>
+ <parameter name="help" unique="1" required="0">
+ <getopt mixed="-h" />
+ <content type="string" />
+ <shortdesc lang="en">Display help and exit</shortdesc>
+ </parameter>
+</parameters>
+<actions>
+ <action name="metadata" />
+</actions>
+</resource-agent>
+';
+}
+
sub get_options_stdin
{
my $opt;
@@ -121,12 +151,17 @@ sub get_options_stdin
}
if (@ARGV > 0){
- getopts("hqu:V") || fail_usage;
+ getopts("hqu:Vo:") || fail_usage;
usage if defined $opt_h;
version if defined $opt_V;
fail_usage "Unkown parameter." if (@ARGV > 0);
+ if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
+
fail_usage "No '-u' flag specified." unless defined $opt_u;
} else {
get_options_stdin();
diff --git a/fence/agents/drac/Makefile.am b/fence/agents/drac/Makefile.am
index 0a7de40..c9cdeda 100644
--- a/fence/agents/drac/Makefile.am
+++ b/fence/agents/drac/Makefile.am
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET)
dist_man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fencemanperl.mk
-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/drac/fence_drac.8 b/fence/agents/drac/fence_drac.8
deleted file mode 100644
index 3660c5a..0000000
--- a/fence/agents/drac/fence_drac.8
+++ /dev/null
@@ -1,105 +0,0 @@
-.TH fence_drac 8
-
-.SH NAME
-fence_drac - fencing agent for Dell Remote Access Card
-
-.SH SYNOPSIS
-.B
-fence_drac
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_drac is an I/O Fencing agent which can be used with the Dell Remote
-Access Card (DRAC). This card provides remote access to controlling
-power to a server. It logs into the DRAC through the telnet interface of
-the card. By default, the telnet interface is not enabled. To enable the
-interface, you will need to use the racadm command in the racser-devel rpm
-available from Dell. To enable telnet on the DRAC:
-
-[root]# racadm config -g cfgSerial -o cfgSerialTelnetEnable 1
-
-[root]# racadm racreset
-
-fence_drac accepts options on the command line as well as from stdin.
-Fenced sends parameters through stdin when it execs the agent. fence_drac
-can be run by itself with command line options. This is useful for testing
-and for turning outlets on or off from scripts.
-
-Vendor URL: http://www.dell.com
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress\fR
-IP address or hostname of the switch.
-.TP
-\fB-c\fP \fIcmd_prompt\fR
-Force fence_drac to use cmd_prompt as the command prompt
-.TP
-\fB-d\fP \fIdracversion\fR
-Force fence_drac to treat the device as though it was for the specified drac version
-.TP
-\fB-D\fP \fIdumpfile\fR
-Debug file of the telnet interaction
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-l\fP \fIlogin\fR
-Login name.
-.TP
-\fB-m\fP \fImodulename\fR
-The module name of the blade when using DRAC/MC firmware.
-.TP
-\fB-o\fP \fIaction\fR
-The action required. reboot (default), off, on or status.
-.TP
-\fB-p\fP \fIpassword\fR
-Password for login.
-.TP
-\fB-S\fP \fIpath\fR
-Full path to an executable to generate the password for login.
-.TP
-\fB-f\fP \fIseconds\fR
-Wait X seconds before fencing is started
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIaction = < param >\fR
-The action required. reboot (default), off, on or status.
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_apc.
-.TP
-\fIcmd_prompt = < param >\fr
-Force fence_drac to use cmd_prompt as the command prompt
-.TP
-\fIdrac_version = < param >\fr
-Force fence_drac to treat the device as though it was for the specified drac version.
-.TP
-\fIdebug = < dumpfile >\fR
-Debug file of the telnet interaction
-.TP
-\fIipaddr = < hostname | ip >\fR
-IP address or hostname of the switch.
-.TP
-\fIlogin = < param >\fR
-Login name.
-.TP
-\fImodulename = < param >\fr
-The module name of the blade when using DRAC/MC firmware.
-.TP
-\fIpasswd = < param >\fR
-Password for login.
-.TP
-\fIpasswd_script = < param >\fR
-Full path to an executable to generate the password for login.
-.TP
-\fIdelay = < param >\fR
-Wait X seconds before fencing is started
-.TP
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/agents/drac/fence_drac.pl b/fence/agents/drac/fence_drac.pl
index e28ed98..5e1b966 100644
--- a/fence/agents/drac/fence_drac.pl
+++ b/fence/agents/drac/fence_drac.pl
@@ -74,7 +74,7 @@ sub usage
print " -h usage\n";
print " -l <name> Login name\n";
print " -m <modulename> DRAC/MC module name\n";
- print " -o <string> Action: reboot (default), off or on\n";
+ print " -o <string> Action: reboot (default), off, on or metadata\n";
print " -p <string> Login password\n";
print " -S <path> Script to run to retrieve password\n";
print " -f <seconds> Wait X seconds before fencing is started\n";
@@ -130,6 +130,86 @@ sub version
exit 0;
}
+sub print_metadata
+{
+print '<?xml version="1.0" ?>
+<resource-agent name="fence_drac" shortdesc="fencing agent for Dell Remote Access Card" >
+<longdesc>
+fence_drac is an I/O Fencing agent which can be used with the Dell Remote Access Card (DRAC). This card provides remote access to controlling power to a server. It logs into the DRAC through the telnet interface of the card. By default, the telnet interface is not enabled. To enable the interface, you will need to use the racadm command in the racser-devel rpm available from Dell. To enable telnet on the DRAC:
+
+[root]# racadm config -g cfgSerial -o cfgSerialTelnetEnable 1
+
+[root]# racadm racreset
+</longdesc>
+<vendor-url>http://www.dell.com</vendor-url>
+<parameters>
+ <parameter name="action" unique="1" required="1">
+ <getopt mixed="-o <action>" />
+ <content type="string" default="reboot" />
+ <shortdesc lang="en">Fencing Action</shortdesc>
+ </parameter>
+ <parameter name="ipaddr" unique="1" required="1">
+ <getopt mixed="-a <ip>" />
+ <content type="string" />
+ <shortdesc lang="en">IP Address or Hostname</shortdesc>
+ </parameter>
+ <parameter name="login" unique="1" required="1">
+ <getopt mixed="-l <name>" />
+ <content type="string" />
+ <shortdesc lang="en">Login Name</shortdesc>
+ </parameter>
+ <parameter name="passwd" unique="1" required="0">
+ <getopt mixed="-p <password>" />
+ <content type="string" />
+ <shortdesc lang="en">Login password or passphrase</shortdesc>
+ </parameter>
+ <parameter name="passwd_script" unique="1" required="0">
+ <getopt mixed="-S <script>" />
+ <content type="string" />
+ <shortdesc lang="en">Script to retrieve password</shortdesc>
+ </parameter>
+ <parameter name="cmd_prompt" unique="1" required="0">
+ <getopt mixed="-c <prompt>" />
+ <content type="string" />
+ <shortdesc lang="en">Force fence_drac to use cmd_prompt as the command prompt</shortdesc>
+ </parameter>
+ <parameter name="drac_version" unique="1" required="0">
+ <getopt mixed="-d <version>" />
+ <content type="string" />
+ <shortdesc lang="en">Force fence_drac to treat the device as though it was for the specified drac version</shortdesc>
+ </parameter>
+ <parameter name="module_name" unique="1" required="0">
+ <getopt mixed="-m <modulename>" />
+ <content type="string"/>
+ <shortdesc lang="en">The module name of the blade when using DRAC/MC firmware.</shortdesc>
+ </parameter>
+ <parameter name="debug" unique="1" required="0">
+ <getopt mixed="-D <dumpfile>" />
+ <content type="string"/>
+ <shortdesc lang="en">Debug file of the telnet interaction</shortdesc>
+ </parameter>
+ <parameter name="delay" unique="1" required="0">
+ <getopt mixed="-f <seconds>" />
+ <content type="string" default="0"/>
+ <shortdesc lang="en">Wait X seconds before fencing is started</shortdesc>
+ </parameter>
+ <parameter name="help" unique="1" required="0">
+ <getopt mixed="-h" />
+ <content type="string" />
+ <shortdesc lang="en">Display help and exit</shortdesc>
+ </parameter>
+</parameters>
+<actions>
+ <action name="on" />
+ <action name="off" />
+ <action name="reboot" />
+ <action name="status" />
+ <action name="metadata" />
+</actions>
+</resource-agent>
+';
+}
+
sub login
{
@@ -597,6 +677,11 @@ if (@ARGV > 0) {
fail_usage "Unknown parameter." if (@ARGV > 0);
+ if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
+
fail_usage "No '-a' flag specified." unless defined $opt_a;
$address = $opt_a;
diff --git a/fence/agents/egenera/Makefile.am b/fence/agents/egenera/Makefile.am
index 5cbb555..6cd82a6 100644
--- a/fence/agents/egenera/Makefile.am
+++ b/fence/agents/egenera/Makefile.am
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET)
dist_man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fencemanperl.mk
-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/egenera/fence_egenera.8 b/fence/agents/egenera/fence_egenera.8
deleted file mode 100644
index 3823d7c..0000000
--- a/fence/agents/egenera/fence_egenera.8
+++ /dev/null
@@ -1,84 +0,0 @@
-.TH fence_egenera 8
-
-.SH NAME
-fence_egenera - I/O Fencing agent for the Egenera BladeFrame
-
-.SH SYNOPSIS
-.B
-fence_egenera
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_egenera is an I/O Fencing agent which can be used with the Egenera
-BladeFrame. It logs into a control blade (cserver) via ssh and operates
-on a processing blade (pserver) identified by the pserver name and the
-logical process area network (LPAN) that it is in. fence_egenera requires
-that ssh keys have been setup so that the fence_egenera does not require
-a password to authenticate. Refer to ssh(8) for more information on setting
-up ssh keys.
-
-fence_egenera accepts options on the command line as well as from stdin.
-Fenced sends parameters through stdin when it execs the agent. fence_egenera
-can also be run by itself with command line options.
-
-Vendor URL: http://www.egenera.com
-
-.SH OPTIONS
-.TP
-\fB-c\fP \fIcserver\fR
-The cserver to ssh to. cserver can be in the form user@hostname to
-specify a different user to login as.
-.TP
-\fB-u\fP \fIuser\fR
-Login name. Default login name is 'root'
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-l\fP \fIlpan\fR
-the lpan to operate on
-.TP
-\fB-o\fP \fIaction\fR
-The action required. reboot (default), off, on or status.
-.TP
-\fB-p\fP \fIpserver\fR
-the pserver to operate on
-.TP
-\fB-f\fP \fIseconds\fR
-Wait X seconds before fencing is started
-.TP
-\fB-q\fP
-quite mode. suppress output.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIaction = < param >\fR
-The action required. reboot (default), off, on or status.
-.TP
-\fIuser = < param >\fR
-Login name. Default login name is 'root'
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_apc.
-.TP
-\fIcserver = < param >\fR
-The cserver to ssh to. cserver can be in the form user@hostname to
-specify a different user to login as.
-.TP
-\fIlpan = < param >\fR
-The lpan to operate on
-.TP
-\fIpserver = < param >\fR
-The pserver to operate on
-.TP
-\fIesh = < param >\fR
-The path to the esh command on the cserver (default is /opt/panmgr/bin/esh)
-.TP
-\fIdelay = < param >\fR
-Wait X seconds before fencing is started
-
-.SH SEE ALSO
-fence(8), fence_node(8), ssh(8)
diff --git a/fence/agents/egenera/fence_egenera.pl b/fence/agents/egenera/fence_egenera.pl
index f09ff32..6270cee 100644
--- a/fence/agents/egenera/fence_egenera.pl
+++ b/fence/agents/egenera/fence_egenera.pl
@@ -74,6 +74,62 @@ sub version
exit 0;
}
+sub print_metadata
+{
+print '<?xml version="1.0" ?>
+<resource-agent name="fence_egenera" shortdesc="I/O Fencing agent for the Egenera BladeFrame" >
+<longdesc>
+fence_egenera is an I/O Fencing agent which can be used with the Egenera BladeFrame. It logs into a control blade (cserver) via ssh and operates on a process ing blade (pserver) identified by the pserver name and the logical process area network (LPAN) that it is in. fence_egenera requires that ssh keys have been setup so that the fence_egenera does not require a password to authenticate. Refer to ssh(8) for more information on setting up ssh keys.
+</longdesc>
+<vendor-url>http://www.bull.com</vendor-url>
+<parameters>
+ <parameter name="action" unique="1" required="1">
+ <getopt mixed="-o <action>" />
+ <content type="string" default="reboot" />
+ <shortdesc lang="en">Fencing Action</shortdesc>
+ </parameter>
+ <parameter name="cserver" unique="1" required="1">
+ <getopt mixed="-c <cserver>" />
+ <content type="string" />
+ <shortdesc lang="en">The cserver to ssh to. cserver can be in the form user@hostname to specify a different user to login as.</shortdesc>
+ </parameter>
+ <parameter name="pserver" unique="1" required="1">
+ <getopt mixed="-p <pserver>" />
+ <content type="string" />
+ <shortdesc lang="en">The pserver to operate on.</shortdesc>
+ </parameter>
+ <parameter name="user" unique="1" required="1">
+ <getopt mixed="-u <name>" />
+ <content type="string" default="root" />
+ <shortdesc lang="en">Login Name</shortdesc>
+ </parameter>
+ <parameter name="lpan" unique="1" required="1">
+ <getopt mixed="-l <lpan>" />
+ <content type="string" />
+ <shortdesc lang="en">The lpan to operate on.</shortdesc>
+ </parameter>
+ <parameter name="delay" unique="1" required="0">
+ <getopt mixed="-f <seconds>" />
+ <content type="string" default="0"/>
+ <shortdesc lang="en">Wait X seconds before fencing is started</shortdesc>
+ </parameter>
+ <parameter name="help" unique="1" required="0">
+ <getopt mixed="-h" />
+ <content type="string" />
+ <shortdesc lang="en">Display help and exit</shortdesc>
+ </parameter>
+</parameters>
+<actions>
+ <action name="on" />
+ <action name="off" />
+ <action name="reboot" />
+ <action name="status" />
+ <action name="metadata" />
+</actions>
+</resource-agent>
+';
+}
+
if (@ARGV > 0)
{
getopts("c:hl:o:p:u:qVf:") || fail_usage ;
@@ -83,6 +139,11 @@ if (@ARGV > 0)
fail_usage "Unkown parameter." if (@ARGV > 0);
+ if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
+
$cserv = $opt_c if defined $opt_c;
$lpan = $opt_l if defined $opt_l;
$pserv = $opt_p if defined $opt_p;
diff --git a/fence/agents/lib/fence2man.xsl b/fence/agents/lib/fence2man.xsl
index 563b3a4..0fd71be 100644
--- a/fence/agents/lib/fence2man.xsl
+++ b/fence/agents/lib/fence2man.xsl
@@ -17,9 +17,11 @@
<xsl:choose>
<xsl:when test="@name = 'on'">Power on machine.</xsl:when>
<xsl:when test="@name = 'off'">Power off machine.</xsl:when>
+<xsl:when test="@name = 'enable'">Enable fabric access.</xsl:when>
+<xsl:when test="@name = 'disable'">Disable fabric access.</xsl:when>
<xsl:when test="@name = 'reboot'">Reboot machine.</xsl:when>
<xsl:when test="@name = 'monitor'">Check if fencing device is running. List available plugs/virtual machines or get status of machine (if it does not support more).</xsl:when>
-<xsl:when test="@name = 'meta-data'">Display the XML metadata describing this resource.</xsl:when>
+<xsl:when test="@name = 'metadata'">Display the XML metadata describing this resource.</xsl:when>
<xsl:when test="@name = 'list'">List available plugs with aliases/virtual machines if there is support for more then one device. Returns N/A otherwise.</xsl:when>
<xsl:when test="@name = 'status'">This returns the status of the plug/virtual machine.</xsl:when>
<!-- Ehhh -->
diff --git a/fence/agents/mcdata/Makefile.am b/fence/agents/mcdata/Makefile.am
index f9953f5..f1a5939 100644
--- a/fence/agents/mcdata/Makefile.am
+++ b/fence/agents/mcdata/Makefile.am
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET)
dist_man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fencemanperl.mk
-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/mcdata/fence_mcdata.8 b/fence/agents/mcdata/fence_mcdata.8
deleted file mode 100644
index c52ffd6..0000000
--- a/fence/agents/mcdata/fence_mcdata.8
+++ /dev/null
@@ -1,84 +0,0 @@
-.TH fence_mcdata 8
-
-.SH NAME
-fence_mcdata - I/O Fencing agent for McData FC switches
-
-.SH SYNOPSIS
-.B
-fence_mcdata
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_mcdata is an I/O Fencing agent which can be used with McData FC
-switches. It logs into a McData switch via telnet and disables a specified
-port. Disabling the port which a machine is connected to effectively fences
-that machine. Lengthy telnet connections to the switch should be avoided
-while a GFS cluster is running because the connection will block any necessary
-fencing actions.
-
-fence_mcdata accepts options on the command line as well as from stdin.
-fenced sends parameters through stdin when it execs the agent. fence_mcdata
-can be run by itself with command line options which is useful for testing.
-
-After a fence operation has taken place the fenced machine can no longer connect
-to the McData FC switch. When the fenced machine is ready to be brought back
-into the GFS cluster (after reboot) the port on the McData FC switch needs to
-be enabled. This can be done by running fence_mcdata and specifying the
-enable action.
-
-Vendor URL: http://www.brocade.com
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress\fP
-IP address of the switch.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-l\fP \fIlogin\fP
-Username name for the switch.
-.TP
-\fB-n\fP \fIport\fP
-The port number to disable on the switch.
-.TP
-\fB-o\fP \fIaction\fP
-The action required. disable (default) or enable.
-.TP
-\fB-p\fP \fIpassword\fP
-Password for login.
-.TP
-\fB-S\fP \fIpath\fR
-Full path to an executable to generate the password for login.
-.TP
-\fB-q\fP
-Quiet mode: print only error messages.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_mcdata.
-.TP
-\fIipaddr = < hostname | ip >\fR
-IP address or hostname of the switch.
-.TP
-\fIlogin = < param >\fR
-Login name.
-.TP
-\fIoption = < param >\fR
-The action required. disable (default) or enable.
-.TP
-\fIpasswd = < param >\fR
-Password for login.
-.TP
-\fIpasswd_script = < param >\fR
-Full path to an executable to generate the password for login.
-.TP
-\fIport = < param >\fR
-The port number to disable on the switch.
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/agents/mcdata/fence_mcdata.pl b/fence/agents/mcdata/fence_mcdata.pl
index 7a01d1d..a469a1c 100644
--- a/fence/agents/mcdata/fence_mcdata.pl
+++ b/fence/agents/mcdata/fence_mcdata.pl
@@ -46,7 +46,7 @@ sub usage
print " -h usage\n";
print " -l <name> Login name\n";
print " -n <num> Port number to disable\n";
- print " -o <string> Action: disable (default) or enable\n";
+ print " -o <string> Action: disable (default), enable or metadata\n";
print " -p <string> Password for login\n";
print " -S <path> Script to run to retrieve login password\n";
print " -q quiet mode\n";
@@ -79,6 +79,64 @@ sub version
exit 0;
}
+sub print_metadata
+{
+print '<?xml version="1.0" ?>
+<resource-agent name="fence_mcdata" shortdesc="I/O Fencing agent for McData FC switches" >
+<longdesc>
+fence_mcdata is an I/O Fencing agent which can be used with McData FC switches. It logs into a McData switch via telnet and disables a specified port. Disabling the port which a machine is connected to effectively fences that machine. Lengthy telnet connections to the switch should be avoided while a GFS cluster is running because the connection will block any necessary fencing actions.
+
+After a fence operation has taken place the fenced machine can no longer connect to the McData FC switch. When the fenced machine is ready to be brought back into the GFS cluster (after reboot) the port on the McData FC switch needs to be enabled. This can be done by running fence_mcdata and specifying the enable action.
+</longdesc>
+<vendor-url>http://www.brocade.com</vendor-url>
+<parameters>
+ <parameter name="action" unique="1" required="1">
+ <getopt mixed="-o <action>" />
+ <content type="string" default="disable" />
+ <shortdesc lang="en">Fencing Action</shortdesc>
+ </parameter>
+ <parameter name="ipaddr" unique="1" required="1">
+ <getopt mixed="-a <ip>" />
+ <content type="string" />
+ <shortdesc lang="en">IP Address or Hostname</shortdesc>
+ </parameter>
+ <parameter name="login" unique="1" required="1">
+ <getopt mixed="-l <name>" />
+ <content type="string" />
+ <shortdesc lang="en">Login Name</shortdesc>
+ </parameter>
+ <parameter name="passwd" unique="1" required="0">
+ <getopt mixed="-p <password>" />
+ <content type="string" />
+ <shortdesc lang="en">Login password or passphrase</shortdesc>
+ </parameter>
+ <parameter name="passwd_script" unique="1" required="0">
+ <getopt mixed="-S <script>" />
+ <content type="string" />
+ <shortdesc lang="en">Script to retrieve password</shortdesc>
+ </parameter>
+ <parameter name="port" unique="1" required="1">
+ <getopt mixed="-n <id>" />
+ <content type="string" />
+ <shortdesc lang="en">Physical plug number or name of virtual machine</shortdesc>
+ </parameter>
+ <parameter name="help" unique="1" required="0">
+ <getopt mixed="-h" />
+ <content type="string" />
+ <shortdesc lang="en">Display help and exit</shortdesc>
+ </parameter>
+</parameters>
+<actions>
+ <action name="enable" />
+ <action name="disable" />
+ <action name="status" />
+ <action name="metadata" />
+</actions>
+</resource-agent>
+';
+}
+
+
sub get_options_stdin
{
my $opt;
@@ -153,6 +211,11 @@ if (@ARGV > 0) {
fail_usage "Unknown parameter." if (@ARGV > 0);
+ if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
+
fail_usage "No '-a' flag specified." unless defined $opt_a;
fail_usage "No '-n' flag specified." unless defined $opt_n;
fail_usage "No '-l' flag specified." unless defined $opt_l;
diff --git a/fence/agents/vixel/Makefile.am b/fence/agents/vixel/Makefile.am
index f3e1339..64d6010 100644
--- a/fence/agents/vixel/Makefile.am
+++ b/fence/agents/vixel/Makefile.am
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET)
dist_man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fencemanperl.mk
-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/vixel/fence_vixel.8 b/fence/agents/vixel/fence_vixel.8
deleted file mode 100644
index 83db14f..0000000
--- a/fence/agents/vixel/fence_vixel.8
+++ /dev/null
@@ -1,72 +0,0 @@
-.TH fence_vixel 8
-
-.SH NAME
-fence_vixel - I/O Fencing agent for Vixel FC switches
-
-.SH SYNOPSIS
-.B
-fence_vixel
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_vixel is an I/O Fencing agent which can be used with Vixel FC switches.
-It logs into a Vixel switch via telnet and removes the specified port from the
-zone. Removing the zone access from the port disables the port from being able
-to access the storage.
-
-fence_vixel accepts options on the command line as well as from stdin.
-fenced sends parameters through stdin when it execs the agent. fence_vixel
-can be run by itself with command line options which is useful for testing.
-
-After a fence operation has taken place the fenced machine can no longer
-connect to the Vixel FC switch. When the fenced machine is ready to be brought
-back into the GFS cluster (after reboot) the port on the Vixel FC switch needs
-to be enabled. In order to do this, log into the Vixel FC switch. Then go to:
-
-config->zones->config <port> <comma-separated-list-of-ports-in-the-zone>
-
-Then apply
-
-Consult the Vixel manual for details
-
-Vendor URL: http://www.emulex.com
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress\fP
-IP address of the switch.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-n\fP \fIport\fP
-The port number to remove zoning from on the switch.
-.TP
-\fB-p\fP \fIpassword\fP
-Password for login.
-.TP
-\fB-S\fP \fIpath\fR
-Full path to an executable to generate the password for login.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_vixel.
-.TP
-\fIipaddr = < hostname | ip >\fR
-IP address or hostname of the switch.
-.TP
-\fIpasswd = < param >\fR
-Password for login.
-.TP
-\fIpasswd_script = < param >\fR
-Full path to an executable to generate the password for login.
-.TP
-\fIport = < param >\fR
-The port number to remove zoning from on the switch.
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/agents/vixel/fence_vixel.pl b/fence/agents/vixel/fence_vixel.pl
index 470d4c7..59b9ff0 100644
--- a/fence/agents/vixel/fence_vixel.pl
+++ b/fence/agents/vixel/fence_vixel.pl
@@ -34,6 +34,7 @@ sub usage
print "Options:\n";
print " -a <ip> IP address or hostname of switch\n";
print " -h Usage\n";
+ print " -o metadata print XML metadata for fence agent\n";
print " -n <num> Port number to disable\n";
print " -p <string> Password for login\n";
print " -S <path> Script to run to retrieve login password\n";
@@ -66,14 +67,68 @@ sub version
exit 0;
}
+sub print_metadata
+{
+print '<?xml version="1.0" ?>
+<resource-agent name="fence_vixel" shortdesc="I/O Fencing agent for Vixel FC switches" >
+<longdesc>
+fence_vixel is an I/O Fencing agent which can be used with Vixel FC switches. It logs into a Vixel switch via telnet and removes the specified port from the zone. Removing the zone access from the port disables the port from being able to access the storage.
+
+After a fence operation has taken place the fenced machine can no longer connect to the Vixel FC switch. When the fenced machine is ready to be brought back into the GFS cluster (after reboot) the port on the Vixel FC switch needs to be enabled. In order to do this, log into the Vixel FC switch. Then go to:
+
+config->zones->config <port> <comma-separated-list-of-ports-in-the-zone>
+
+Then apply. Consult the Vixel manual for details.
+</longdesc>
+<vendor-url>http://www.emulex.com</vendor-url>
+<parameters>
+ <parameter name="ipaddr" unique="1" required="1">
+ <getopt mixed="-a <ip>" />
+ <content type="string" />
+ <shortdesc lang="en">IP Address or Hostname</shortdesc>
+ </parameter>
+ <parameter name="passwd" unique="1" required="0">
+ <getopt mixed="-p <password>" />
+ <content type="string" />
+ <shortdesc lang="en">Login password or passphrase</shortdesc>
+ </parameter>
+ <parameter name="passwd_script" unique="1" required="0">
+ <getopt mixed="-S <script>" />
+ <content type="string" />
+ <shortdesc lang="en">Script to retrieve password</shortdesc>
+ </parameter>
+ <parameter name="port" unique="1" required="1">
+ <getopt mixed="-n <id>" />
+ <content type="string" />
+ <shortdesc lang="en">Physical plug number or name of virtual machine</shortdesc>
+ </parameter>
+ <parameter name="help" unique="1" required="0">
+ <getopt mixed="-h" />
+ <content type="string" />
+ <shortdesc lang="en">Display help and exit</shortdesc>
+ </parameter>
+</parameters>
+<actions>
+ <action name="metadata" />
+</actions>
+</resource-agent>
+';
+}
+
+
if (@ARGV > 0) {
- getopts("a:hn:p:S:V") || fail_usage ;
+ getopts("a:hn:p:S:Vo:") || fail_usage ;
usage if defined $opt_h;
version if defined $opt_V;
fail_usage "Unknown parameter." if (@ARGV > 0);
+ if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
+
fail_usage "No '-a' flag specified." unless defined $opt_a;
if (defined $opt_S) {
diff --git a/fence/agents/xcat/Makefile.am b/fence/agents/xcat/Makefile.am
index de54526..27c289c 100644
--- a/fence/agents/xcat/Makefile.am
+++ b/fence/agents/xcat/Makefile.am
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET)
dist_man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fencemanperl.mk
-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/xcat/fence_xcat.8 b/fence/agents/xcat/fence_xcat.8
deleted file mode 100644
index 719f896..0000000
--- a/fence/agents/xcat/fence_xcat.8
+++ /dev/null
@@ -1,63 +0,0 @@
-.TH fence_xcat 8
-
-.SH NAME
-fence_xcat - I/O Fencing agent for xcat environments
-
-.SH SYNOPSIS
-.B
-fence_xcat
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_xcat is a wrapper to the rpower(1) command that is distributed
-with the xCAT project available at http://www.xcat.org. Use of
-fence_xcat requires that xcat has already been properly configured
-for your environment. Refer to xCAT(1) for more information on
-configuring xCAT.
-
-fence_xcat accepts options on the command line as well as from stdin.
-fenced sends parameters through stdin when it execs the agent. fence_xcat
-can be run by itself with command line options which is useful for testing.
-
-NOTE: It is recommended that fence_bladecenter(8) is used instead of fence_xcat if
-the bladecenter firmware supports telnet. This interface is much cleaner and
-easier to setup.
-
-Vendor URL: http://www.xcat.org
-
-.SH OPTIONS
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-n\fP \fInodename\fP
-The nodename as defined in nodelist.tab of the xCAT setup.
-.TP
-\fB-o\fP \fIaction\fP
-The action required. on, off, reset (default) or stat.
-.TP
-\fB-r\fP \fIrpower\fP
-The path to the rpower binary.
-.TP
-\fB-q\fP
-Quiet mode: print only error messages.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_xcat.
-.TP
-\fInodename = < param >\fR
-The nodename as defined in nodelist.tab of the xCAT setup.
-.TP
-\fIaction = < param >\fR
-The action required. on, off, reset (default) or stat.
-.TP
-\fIrpower = < param >\fR
-The path to the rpower binary.
-
-.SH SEE ALSO
-fence(8), fence_node(8), fence_bladecenter(8), nodelist.tab(8), rpower(1), xCAT(1)
diff --git a/fence/agents/xcat/fence_xcat.pl b/fence/agents/xcat/fence_xcat.pl
index 2d8166a..f984ec1 100644
--- a/fence/agents/xcat/fence_xcat.pl
+++ b/fence/agents/xcat/fence_xcat.pl
@@ -38,7 +38,7 @@ sub usage
print "Options:\n";
print " -h usage\n";
print " -n <name> nodename\n";
- print " -o <string> Action: on | off | reset (default) | stat\n";
+ print " -o <string> Action: on, off, reset (default), status or metadata\n";
print " -r <rpower> rpower command\n";
print " -q quiet mode\n";
print " -V version\n";
@@ -70,6 +70,49 @@ sub version
exit 0;
}
+sub print_metadata
+{
+print '<?xml version="1.0" ?>
+<resource-agent name="fence_xcat" shortdesc="I/O Fencing agent for xcat environments" >
+<longdesc>
+fence_xcat is a wrapper to the rpower(1) command that is distributed with the xCAT project available at http://www.xcat.org. Use of fence_xcat requires that xcat has already been properly configured for your environment. Refer to xCAT(1) for more information on configuring xCAT.
+
+NOTE: It is recommended that fence_bladecenter(8) is used instead of fence_xcat if the bladecenter firmware supports telnet. This interface is much cleaner and easier to setup.
+</longdesc>
+<vendor-url>http://www.xcat.org</vendor-url>
+<parameters>
+ <parameter name="action" unique="1" required="1">
+ <getopt mixed="-o <action>" />
+ <content type="string" default="restart" />
+ <shortdesc lang="en">Fencing Action</shortdesc>
+ </parameter>
+ <parameter name="nodename" unique="1" required="1">
+ <getopt mixed="-n <nodename>" />
+ <content type="string" />
+ <shortdesc lang="en">The nodename as defined in nodelist.tab of the xCAT setup.</shortdesc>
+ </parameter>
+ <parameter name="rpower" unique="1" required="0">
+ <getopt mixed="-r <rpower>" />
+ <content type="string" />
+ <shortdesc lang="en">The path to the rpower binary.</shortdesc>
+ </parameter>
+ <parameter name="help" unique="1" required="0">
+ <getopt mixed="-h" />
+ <content type="string" />
+ <shortdesc lang="en">Display help and exit</shortdesc>
+ </parameter>
+</parameters>
+<actions>
+ <action name="on" />
+ <action name="off" />
+ <action name="status" />
+ <action name="metadata" />
+</actions>
+</resource-agent>
+';
+}
+
+
sub get_options_stdin
{
my $opt;
@@ -128,10 +171,15 @@ if (@ARGV > 0) {
fail_usage "Unknown parameter." if (@ARGV > 0);
+ if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
+
fail_usage "No '-n' flag specified." unless defined $opt_n;
$opt_o=lc($opt_o);
fail_usage "Unrecognised action '$opt_o' for '-o' flag"
- unless $opt_o =~ /^(on|off|reset|stat)$/;
+ unless $opt_o =~ /^(on|off|reset|stat|status)$/;
} else {
get_options_stdin();
@@ -139,7 +187,7 @@ if (@ARGV > 0) {
fail "failed: no plug number" unless defined $opt_n;
$opt_o=lc($opt_o);
fail "failed: unrecognised action: $opt_o"
- unless $opt_o =~ /^(on|off|reset|stat)$/;
+ unless $opt_o =~ /^(on|off|reset|stat|status)$/;
}
pipe (RDR,WTR);
@@ -173,7 +221,7 @@ while (<RDR>)
{
$status = $2;
- if (($opt_o eq $2) || ($opt_o eq "stat"))
+ if (($opt_o eq $2) || ($opt_o =~ /stat/i) || ($opt_o =~ /status/i))
{
$found=1;
last;
diff --git a/fence/agents/zvm/Makefile.am b/fence/agents/zvm/Makefile.am
index a75cf66..3ce3d82 100644
--- a/fence/agents/zvm/Makefile.am
+++ b/fence/agents/zvm/Makefile.am
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET)
dist_man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fencemanperl.mk
-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/zvm/fence_zvm.8 b/fence/agents/zvm/fence_zvm.8
deleted file mode 100644
index c58d8ae..0000000
--- a/fence/agents/zvm/fence_zvm.8
+++ /dev/null
@@ -1,64 +0,0 @@
-.TH fence_zvm 8
-
-.SH NAME
-fence_zvm - I/O Fencing agent for GFS on s390 and zSeries VM clusters
-
-.SH SYNOPSIS
-.B
-fence_zvm
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_zvm is an I/O Fencing agent used on a GFS virtual machine in a s390 or zSeries VM cluster.
-It uses the s3270 program to log the specified virtual machine out of VM.
-For fence_zvm to execute correctly, you must have s3270 in your PATH.
-
-fence_zvm accepts options on the command line as well as from stdin.
-fence_node sends the options through stdin when it execs the agent.
-fence_zvm can be run by itself with command line options which is useful
-for testing.
-
-Vendor URL: http://www.ibm.com
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress\fP
-IP address or hostname of the Physical machine (required).
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-u\fP \fIuserid\fP
-userid of the virtual machine to fence (required).
-.TP
-\fB-p\fP \fIpassword\fP
-password of the virtual machine to fence (required).
-.TP
-\fB-S\fP \fIpath\fR
-Full path to an executable to generate the password of the virtual machine to fence.
-.TP
-\fB-q\fP
-quiet mode, no output.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIagent = < param >\fP
-This option is used by fence_node(8) and is ignored by fence_zvm.
-.TP
-\fIipaddr = < hostname | ip >\fP
-IP address or hostname of the Physical machine (required).
-.TP
-\fIpasswd = < param >\fP
-password of the virtual machine to fence (required).
-.TP
-\fIpasswd_script = < param >\fR
-Full path to an executable to generate the password of the virtual machine to fence.
-.TP
-\fIuserid = < param >\fP
-userid of the virtual machine to fence (required).
-
-.SH SEE ALSO
-fence(8), fenced(8), fence_node(8)
diff --git a/fence/agents/zvm/fence_zvm.pl b/fence/agents/zvm/fence_zvm.pl
index f90125a..e6386e4 100644
--- a/fence/agents/zvm/fence_zvm.pl
+++ b/fence/agents/zvm/fence_zvm.pl
@@ -40,6 +40,7 @@ sub usage
print "Options:\n";
print " -a <ip> IP address or hostname of the physical s390\n";
print " -h usage\n";
+ print " -o metadata print XML metadata for fence agent\n";
print " -u <string> userid of the virtual machine to fence\n";
print " -p <string> Password\n";
print " -S <path> Script to run to retrieve login password\n";
@@ -73,6 +74,48 @@ sub version
exit 0;
}
+sub print_metadata
+{
+print '<?xml version="1.0" ?>
+<resource-agent name="fence_zvm" shortdesc="I/O Fencing agent for GFS on s390 and zSeries VM clusters" >
+<longdesc>
+fence_zvm is an I/O Fencing agent used on a GFS virtual machine in a s390 or zSeries VM cluster. It uses the s3270 program to log the specified virtual machine out of VM. For fence_zvm to execute correctly, you must have s3270 in your PATH.
+</longdesc>
+<vendor-url>http://www.ibm.com</vendor-url>
+<parameters>
+ <parameter name="ipaddr" unique="1" required="1">
+ <getopt mixed="-a <ip>" />
+ <content type="string" />
+ <shortdesc lang="en">IP Address or Hostname</shortdesc>
+ </parameter>
+ <parameter name="userid" unique="1" required="1">
+ <getopt mixed="-u <userid>" />
+ <content type="string" />
+ <shortdesc lang="en">Userid of the virtual machine to fence</shortdesc>
+ </parameter>
+ <parameter name="passwd" unique="1" required="0">
+ <getopt mixed="-p <password>" />
+ <content type="string" />
+ <shortdesc lang="en">Login password or passphrase</shortdesc>
+ </parameter>
+ <parameter name="passwd_script" unique="1" required="0">
+ <getopt mixed="-S <script>" />
+ <content type="string" />
+ <shortdesc lang="en">Script to retrieve password</shortdesc>
+ </parameter>
+ <parameter name="help" unique="1" required="0">
+ <getopt mixed="-h" />
+ <content type="string" />
+ <shortdesc lang="en">Display help and exit</shortdesc>
+ </parameter>
+</parameters>
+<actions>
+ <action name="metadata" />
+</actions>
+</resource-agent>
+';
+}
+
sub do_read
{
@@ -282,12 +325,17 @@ sub get_options_stdin
}
if (@ARGV > 0){
- getopts("a:hp:S:qr:u:V") || fail_usage;
+ getopts("a:hp:S:qr:u:Vo:") || fail_usage;
usage if defined $opt_h;
version if defined $opt_V;
fail_usage "Unkown parameter." if (@ARGV > 0);
+ if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
+
fail_usage "No '-a' flag specified." unless defined $opt_a;
if (defined $opt_S) {
diff --git a/make/fencemanperl.mk b/make/fencemanperl.mk
new file mode 100644
index 0000000..74c1508
--- /dev/null
+++ b/make/fencemanperl.mk
@@ -0,0 +1,7 @@
+%.8: $(TARGET) $(top_srcdir)/fence/agents/lib/fence2man.xsl
+ set -e && \
+ perl $(TARGET) -o metadata > .$@.tmp && \
+ xsltproc $(top_srcdir)/fence/agents/lib/fence2man.xsl .$@.tmp > $@
+
+clean-man:
+ rm -f *.8 .*.8.tmp
12 years, 2 months
fence-agents: RHEL6 - fence_vmware_soap: Support for 100+ VM in VMWare
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 36884392cb77980d63f8d284684c0a8f3a67b483
Parent: 403df6dc257546eb18fb7dde82d00d14416b659a
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Thu Jan 5 17:30:43 2012 +0100
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Sat Feb 18 14:56:13 2012 +0100
fence_vmware_soap: Support for 100+ VM in VMWare
In previous version, we did not try to get all results for VM. This
updated version fixes this issue by using proper SOAP API
Resolves: rhbz#772597
---
fence/agents/vmware_soap/fence_vmware_soap.py | 34 +++++++++++++++++--------
1 files changed, 23 insertions(+), 11 deletions(-)
diff --git a/fence/agents/vmware_soap/fence_vmware_soap.py b/fence/agents/vmware_soap/fence_vmware_soap.py
index f9344ff..9bebd08 100644
--- a/fence/agents/vmware_soap/fence_vmware_soap.py
+++ b/fence/agents/vmware_soap/fence_vmware_soap.py
@@ -39,6 +39,17 @@ def soap_login(options):
options["mo_SessionManager"] = mo_SessionManager
return conn
+def process_results(results, machines, uuid, mappingToUUID):
+ for m in results.objects:
+ info = {}
+ for i in m.propSet:
+ info[i.name] = i.val
+ machines[info["name"]] = (info["config.uuid"], info["summary.runtime.powerState"])
+ uuid[info["config.uuid"]] = info["summary.runtime.powerState"]
+ mappingToUUID[m.obj.value] = info["config.uuid"]
+
+ return (machines, uuid, mappingToUUID)
+
def get_power_status(conn, options):
mo_ViewManager = Property(options["ServiceContent"].viewManager.value)
mo_ViewManager._type = "ViewManager"
@@ -78,18 +89,19 @@ def get_power_status(conn, options):
except Exception, ex:
fail(EC_STATUS)
- machines = { }
- uuid = { }
- mappingToUUID = { }
+ (machines, uuid, mappingToUUID) = process_results(raw_machines, {}, {}, {})
+
+ # Probably need to loop over the ContinueRetreive if there are more results after 1 iteration.
+ while (hasattr(raw_machines, 'token') == True):
+ try:
+ raw_machines = conn.service.ContinueRetrievePropertiesEx(mo_PropertyCollector, raw_machines.token)
+ except Exception, ex:
+ fail(EC_STATUS)
+ (more_machines, more_uuid, more_mappingToUUID) = process_results(raw_machines, {}, {}, {})
+ machines.update(more_machines)
+ uuid.update(more_uuid)
+ mappingToUUID.update(more_mappingToUUID)
- for m in raw_machines.objects:
- info = {}
- for i in m.propSet:
- info[i.name] = i.val
- machines[info["name"]] = (info["config.uuid"], info["summary.runtime.powerState"])
- uuid[info["config.uuid"]] = info["summary.runtime.powerState"]
- mappingToUUID[m.obj.value] = info["config.uuid"]
-
if ["list", "monitor"].count(options["-o"]) == 1:
return machines
else:
12 years, 2 months
fence-agents: RHEL6 - fence_ipmilan: Possible buffer overflow
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 403df6dc257546eb18fb7dde82d00d14416b659a
Parent: cebc142bc880de0b012fcd69e70a6f9ccfe8a168
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Thu Jan 5 14:08:42 2012 +0100
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Sat Feb 18 14:55:04 2012 +0100
fence_ipmilan: Possible buffer overflow
Problems found by Coverity Scan.
Resolves: rhbz#771936
---
fence/agents/ipmilan/ipmilan.c | 24 ++++++++++++++++++------
1 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/fence/agents/ipmilan/ipmilan.c b/fence/agents/ipmilan/ipmilan.c
index 46814a8..33b6496 100644
--- a/fence/agents/ipmilan/ipmilan.c
+++ b/fence/agents/ipmilan/ipmilan.c
@@ -332,11 +332,11 @@ build_cmd(char *command, size_t cmdlen, struct ipmi *ipmi, int op, int nopass)
static int
ipmi_spawn(struct ipmi *ipmi, const char *cmd, const char *cmd_print)
{
- dbg_printf(ipmi, 1, "Spawning: '%s'...\n", cmd_print);
if (!ipmi) {
errno = EINVAL;
return -1;
}
+ dbg_printf(ipmi, 1, "Spawning: '%s'...\n", cmd_print);
if (ipmi->i_pid != -1) {
dbg_printf(ipmi, 1, "Can't spawn: PID %d running\n",
@@ -805,19 +805,22 @@ get_options_stdin(char *ip, size_t iplen,
} else if (!strcasecmp(name, "lanplus")) {
(*lanplus) = 1;
} else if (!strcasecmp(name,"timeout")) {
- if ((sscanf(val,"%d",timeout)!=1) || *timeout<1) {
+ if ((!val) || (sscanf(val,"%d",timeout)!=1) || *timeout<1) {
*timeout=DEFAULT_TIMEOUT;
}
} else if (!strcasecmp(name,"power_wait")) {
- if ((sscanf(val,"%d",power_wait)!=1) || *power_wait<1) {
+ if ((!val) || (sscanf(val,"%d",power_wait)!=1) || *power_wait<1) {
*power_wait=DEFAULT_POWER_WAIT;
}
} else if (!strcasecmp(name,"cipher")) {
- if ((sscanf(val,"%d",cipher)!=1) || *cipher<0) {
+ if ((!val) || (sscanf(val,"%d",cipher)!=1) || *cipher<0) {
*cipher=-1;
}
} else if (!strcasecmp(name,"method")) {
- strncpy (method, val, methodlen);
+ if (val)
+ strncpy (method, val, methodlen);
+ else
+ method[0] = 0;
} else if (!strcasecmp(name, "option") ||
!strcasecmp(name, "operation") ||
!strcasecmp(name, "action")) {
@@ -983,40 +986,47 @@ main(int argc, char **argv)
case 'A':
/* Auth type */
strncpy(authtype, optarg, sizeof(authtype));
+ authtype[sizeof(authtype)-1] = 0;
break;
case 'L':
/* Privilege level - ipmitool defaults
* to ADMINISTRATOR if nothing is given
*/
strncpy(privlvl, optarg, sizeof(privlvl));
+ privlvl[sizeof(privlvl)-1] = 0;
break;
case 'a':
case 'i':
/* IP address */
strncpy(ip, optarg, sizeof(ip));
+ ip[sizeof(ip)-1] = 0;
break;
case 'l':
/* user / login */
strncpy(user, optarg, sizeof(user));
+ user[sizeof(user)-1] = 0;
break;
case 'p':
/* password */
strncpy(passwd, optarg, sizeof(passwd));
+ passwd[sizeof(passwd)-1] = 0;
break;
case 'P':
lanplus = 1;
break;
case 'S':
strncpy(pwd_script, optarg, sizeof(pwd_script));
- pwd_script[sizeof(pwd_script) - 1] = '\0';
+ pwd_script[sizeof(pwd_script)-1] = 0;
break;
case 'o':
/* Operation */
strncpy(op, optarg, sizeof(op));
+ op[sizeof(op)-1] = 0;
break;
case 'f':
/* Delay */
strncpy(delay, optarg, sizeof(delay));
+ delay[sizeof(delay)-1] = 0;
break;
case 't':
/* Timeout */
@@ -1039,6 +1049,7 @@ main(int argc, char **argv)
case 'M':
/* Reboot method */
strncpy(method, optarg, sizeof(method));
+ method[sizeof(method)-1] = 0;
break;
case 'v':
verbose++;
@@ -1077,6 +1088,7 @@ main(int argc, char **argv)
fp = popen(pwd_script, "r");
if (fp != NULL) {
ssize_t len = fread(pwd_buf, 1, sizeof(pwd_buf), fp);
+ pwd_buf[sizeof(pwd_buf)-1] = 0;
if (len > 0) {
char *p;
p = strchr(pwd_buf, '\n');
12 years, 2 months
fence-agents: RHEL6 - fence_vmware_soap: Support for alias names as ports
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: cebc142bc880de0b012fcd69e70a6f9ccfe8a168
Parent: 4aa16fe367f3637f694d1792f40aad6eac3fe447
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Fri Dec 9 09:30:12 2011 +0100
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Sat Feb 18 14:53:42 2012 +0100
fence_vmware_soap: Support for alias names as ports
Extending fence agent to support (-n / port) can use alias names of VM.
They can be obtained using 'list' action. This feature won't work correctly
if you have several VM with same name, in that case you should use either
full path or UUID.
Resolves: rhbz#771211
---
fence/agents/vmware_soap/fence_vmware_soap.py | 35 ++++++++++++++++--------
1 files changed, 23 insertions(+), 12 deletions(-)
diff --git a/fence/agents/vmware_soap/fence_vmware_soap.py b/fence/agents/vmware_soap/fence_vmware_soap.py
index 2718560..f9344ff 100644
--- a/fence/agents/vmware_soap/fence_vmware_soap.py
+++ b/fence/agents/vmware_soap/fence_vmware_soap.py
@@ -94,18 +94,28 @@ def get_power_status(conn, options):
return machines
else:
if options.has_key("-U") == False:
- ## Transform InventoryPath to UUID
- mo_SearchIndex = Property(options["ServiceContent"].searchIndex.value)
- mo_SearchIndex._type = "SearchIndex"
+ if options["-n"].startswith('/'):
+ ## Transform InventoryPath to UUID
+ mo_SearchIndex = Property(options["ServiceContent"].searchIndex.value)
+ mo_SearchIndex._type = "SearchIndex"
- vm = conn.service.FindByInventoryPath(mo_SearchIndex, options["-n"])
+ vm = conn.service.FindByInventoryPath(mo_SearchIndex, options["-n"])
- try:
- options["-U"] = mappingToUUID[vm.value]
- except KeyError, ex:
- fail(EC_STATUS)
- except AttributeError, ex:
- fail(EC_STATUS)
+ try:
+ options["-U"] = mappingToUUID[vm.value]
+ except KeyError, ex:
+ fail(EC_STATUS)
+ except AttributeError, ex:
+ fail(EC_STATUS)
+ else:
+ ## Name of virtual machine instead of path
+ ## warning: if you have same names of machines this won't work correctly
+ try:
+ (options["-U"], _) = machines[options["-n"]]
+ except KeyError, ex:
+ fail(EC_STATUS)
+ except AttributeError, ex:
+ fail(EC_STATUS)
try:
if uuid[options["-U"]] == "poweredOn":
@@ -149,8 +159,9 @@ which can be used with the virtual machines managed by VMWare products \
that have SOAP API v4.1+. \
\n.P\n\
Name of virtual machine (-n / port) has to be used in inventory path \
-format (e.g. /datacenter/vm/Discovered virtual machine/myMachine). Alternatively \
-you can use UUID (-U / uuid) to access virtual machine."
+format (e.g. /datacenter/vm/Discovered virtual machine/myMachine). \
+In the cases when name of yours VM is unique you can use it instead. \
+Alternatively you can always use UUID (-U / uuid) to access virtual machine."
docs["vendorurl"] = "http://www.vmware.com"
show_docs(options, docs)
12 years, 2 months
cluster: STABLE32 - cman: fix bad merge from coverity branch
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: b4ca5bbb924ef9ef8e574a171e178f9440a28932
Parent: 494856c7148789ecaa0477a7a274a9b207de8553
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Mon Feb 20 20:19:19 2012 +0100
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Mon Feb 20 20:19:19 2012 +0100
cman: fix bad merge from coverity branch
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/daemon/cman-preconfig.c | 41 -----------------------------------------
1 files changed, 0 insertions(+), 41 deletions(-)
diff --git a/cman/daemon/cman-preconfig.c b/cman/daemon/cman-preconfig.c
index c4ee0b3..d88ff3d 100644
--- a/cman/daemon/cman-preconfig.c
+++ b/cman/daemon/cman-preconfig.c
@@ -806,47 +806,6 @@ static int get_nodename(struct objdb_iface_ver0 *objdb)
objdb_get_int(objdb, object_handle, "port", &portnum, mcast_portnum);
}
- /* Check for broadcast */
- if (!objdb_get_string(objdb, object_handle, "broadcast", &str)) {
- if (strcmp(str, "yes") == 0) {
- mcast_name = strdup("255.255.255.255");
- if (!mcast_name)
- return -1;
- transport = TX_MECH_UDPB;
- }
- }
-
- /* Check for transport */
- if (!objdb_get_string(objdb, object_handle, "transport", &str)) {
- if (strcmp(str, "udp") == 0) {
- if (transport != TX_MECH_UDPB) {
- transport = TX_MECH_UDP;
- }
- } else if (strcmp(str, "udpb") == 0) {
- transport = TX_MECH_UDPB;
- } else if (strcmp(str, "udpu") == 0) {
- if (transport != TX_MECH_UDPB) {
- transport = TX_MECH_UDPU;
- } else {
- snprintf(error_reason, sizeof(error_reason) - 1, "Transport and broadcast option are mutually exclusive");
- write_cman_pipe("Transport and broadcast option are mutually exclusive");
- return -1;
- }
- } else if (strcmp(str, "rdma") == 0) {
- if (transport != TX_MECH_UDPB) {
- transport = TX_MECH_RDMA;
- } else {
- snprintf(error_reason, sizeof(error_reason) - 1, "Transport and broadcast option are mutually exclusive");
- write_cman_pipe("Transport and broadcast option are mutually exclusive");
- return -1;
- }
- } else {
- snprintf(error_reason, sizeof(error_reason) - 1, "Transport option value can be one of udp, udpb, udpu, rdma");
- write_cman_pipe("Transport option value can be one of udp, udpb, udpu, rdma");
- return -1;
- }
- }
-
if (add_ifaddr(objdb, mcast_name, nodename, portnum, ttl,
PRIMARY_IFACE, transport)) {
write_cman_pipe(error_reason);
12 years, 2 months
cluster: RHEL6 - qdiskd: small tiny little cleanup
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 3624e3e0deed9eb3e6b4325a9ac3249dcb0a110a
Parent: 9d9f4836dd6c62fa1379c6d7f4e82eee265508cf
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Sat Feb 18 04:56:21 2012 +0100
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Mon Feb 20 11:46:55 2012 -0500
qdiskd: small tiny little cleanup
Resolves: rhbz#678372
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
cman/qdisk/iostate.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/cman/qdisk/iostate.c b/cman/qdisk/iostate.c
index 06c6831..9050276 100644
--- a/cman/qdisk/iostate.c
+++ b/cman/qdisk/iostate.c
@@ -8,6 +8,7 @@
#include <stdint.h>
#include "platform.h"
#include "iostate.h"
+#include "../daemon/cnxman-socket.h"
static iostate_t main_state = 0;
static int main_incarnation = 0;
@@ -104,7 +105,7 @@ io_nanny_thread(void *arg)
/* Whine on CMAN api */
whine_state = (int32_t)current_main_state;
swab32(whine_state);
- cman_send_data(ch, &whine_state, sizeof(int32_t), 0, 178, 0);
+ cman_send_data(ch, &whine_state, sizeof(int32_t), 0, CLUSTER_PORT_QDISKD , 0);
/* Don't log things twice */
if (logged_incarnation == current_main_incarnation)
12 years, 2 months
cluster: RHEL6 - qdiskd: Make multipath issues go away
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 3b9975dd964a32f8d673f171a7e052f0e4af6c5d
Parent: 00af883f58ab5eb58f6dfcbe5e4d71a469c2a74e
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Fri May 6 10:14:04 2011 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Mon Feb 20 11:45:22 2012 -0500
qdiskd: Make multipath issues go away
Qdiskd hsitorically has required significant tuning to work around
delays which occur during multipath failover, overloaded I/O, and LUN
trespasses in both device-mapper-multipath and EMC PowerPath
environments.
This patch goes a very long way towards eliminating false evictions
when these conditions occur by making qdiskd whine to the other
cluster members when it detects hung system calls. When a cluster
member whines, it indicates the source of the problem (which system
call is hung), and the act of receiving a whine from a host indicates
that qdiskd is operational, but that I/O is hung. Hung I/O is different
from losing storage entirely (where you get I/O errors).
Possible problems:
- Receive queue getting very full, causing messages to become blocked on
a node where I/O is hung. 1) that would take a very long time, and 2)
node should get evicted at that point anyway.
Resolves: rhbz#678372
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/qdisk/Makefile | 2 +-
cman/qdisk/disk.h | 6 ++++++
cman/qdisk/iostate.c | 16 +++++++++++++---
cman/qdisk/iostate.h | 4 +++-
cman/qdisk/main.c | 45 ++++++++++++++++++++++++++++++++++++++++++---
5 files changed, 65 insertions(+), 8 deletions(-)
diff --git a/cman/qdisk/Makefile b/cman/qdisk/Makefile
index 68e20cd..e3bb5f7 100644
--- a/cman/qdisk/Makefile
+++ b/cman/qdisk/Makefile
@@ -40,7 +40,7 @@ ${TARGET1}: ${SHAREDOBJS} ${OBJS1}
$(CC) -o $@ $^ $(EXTRA_LDFLAGS) $(LDFLAGS)
${TARGET2}: ${SHAREDOBJS} ${OBJS2}
- $(CC) -o $@ $^ $(LDFLAGS)
+ $(CC) -o $@ $^ $(EXTRA_LDFLAGS) $(LDFLAGS)
depends:
$(MAKE) -C ../lib all
diff --git a/cman/qdisk/disk.h b/cman/qdisk/disk.h
index 93d15fe..fd80fa6 100644
--- a/cman/qdisk/disk.h
+++ b/cman/qdisk/disk.h
@@ -273,6 +273,12 @@ typedef struct {
status_block_t ni_status;
} node_info_t;
+typedef struct {
+ qd_ctx *ctx;
+ node_info_t *ni;
+ size_t ni_len;
+} qd_priv_t;
+
int qd_write_status(qd_ctx *ctx, int nid, disk_node_state_t state,
disk_msg_t *msg, memb_mask_t mask, memb_mask_t master);
int qd_init(qd_ctx *ctx, cman_handle_t ch_admin,
diff --git a/cman/qdisk/iostate.c b/cman/qdisk/iostate.c
index 0199da4..06c6831 100644
--- a/cman/qdisk/iostate.c
+++ b/cman/qdisk/iostate.c
@@ -1,9 +1,12 @@
#include <pthread.h>
+#include <libcman.h>
#include <iostate.h>
#include <unistd.h>
#include <time.h>
#include <sys/time.h>
#include <liblogthread.h>
+#include <stdint.h>
+#include "platform.h"
#include "iostate.h"
static iostate_t main_state = 0;
@@ -26,7 +29,7 @@ static struct state_table io_state_table[] = {
{ STATE_LSEEK, "seek" },
{ -1, NULL } };
-static const char *
+const char *
state_to_string(iostate_t state)
{
static const char *ret = "unknown";
@@ -65,6 +68,8 @@ io_nanny_thread(void *arg)
iostate_t last_main_state = 0, current_main_state = 0;
int last_main_incarnation = 0, current_main_incarnation = 0;
int logged_incarnation = 0;
+ cman_handle_t ch = (cman_handle_t)arg;
+ int32_t whine_state;
/* Start with wherever we're at now */
pthread_mutex_lock(&state_mutex);
@@ -96,6 +101,11 @@ io_nanny_thread(void *arg)
continue;
}
+ /* Whine on CMAN api */
+ whine_state = (int32_t)current_main_state;
+ swab32(whine_state);
+ cman_send_data(ch, &whine_state, sizeof(int32_t), 0, 178, 0);
+
/* Don't log things twice */
if (logged_incarnation == current_main_incarnation)
continue;
@@ -114,7 +124,7 @@ io_nanny_thread(void *arg)
int
-io_nanny_start(int timeout)
+io_nanny_start(cman_handle_t ch, int timeout)
{
int ret;
@@ -124,7 +134,7 @@ io_nanny_start(int timeout)
qdisk_timeout = timeout;
thread_active = 1;
- ret = pthread_create(&io_nanny_tid, NULL, io_nanny_thread, NULL);
+ ret = pthread_create(&io_nanny_tid, NULL, io_nanny_thread, ch);
pthread_mutex_unlock(&state_mutex);
return ret;
diff --git a/cman/qdisk/iostate.h b/cman/qdisk/iostate.h
index 7dd7bf6..a65b1d4 100644
--- a/cman/qdisk/iostate.h
+++ b/cman/qdisk/iostate.h
@@ -11,7 +11,9 @@ typedef enum {
void io_state(iostate_t state);
-int io_nanny_start(int timeout);
+int io_nanny_start(cman_handle_t ch, int timeout);
int io_nanny_stop(void);
+const char * state_to_string(iostate_t state);
+
#endif
diff --git a/cman/qdisk/main.c b/cman/qdisk/main.c
index a90e82c..d613d84 100644
--- a/cman/qdisk/main.c
+++ b/cman/qdisk/main.c
@@ -915,7 +915,8 @@ cman_wait(cman_handle_t ch, struct timeval *_tv)
static void
process_cman_event(cman_handle_t handle, void *private, int reason, int arg)
{
- qd_ctx *ctx = (qd_ctx *)private;
+ qd_priv_t *qp = (qd_priv_t *)private;
+ qd_ctx *ctx = qp->ctx;
switch(reason) {
case CMAN_REASON_PORTOPENED:
@@ -1926,6 +1927,33 @@ check_stop_cman(qd_ctx *ctx)
do { static int _logged=0; if (!_logged) { _logged=1; logt_print(level, fmt, ##args); } } while(0)
+static void
+qdisk_whine(cman_handle_t h, void *privdata, char *buf, int len,
+ uint8_t port, int nodeid)
+{
+ int32_t dstate;
+ qd_priv_t *qp = (qd_priv_t *)privdata;
+ node_info_t *ni = qp->ni;
+
+ if (len != sizeof(dstate)) {
+ return;
+ }
+
+ dstate = *((int32_t*)buf);
+
+ if (nodeid == (qp->ctx->qc_my_id))
+ return;
+
+ swab32(dstate);
+
+ if (dstate) {
+ logt_print(LOG_NOTICE, "qdiskd on node %d reports hung %s()\n", nodeid,
+ state_to_string(dstate));
+ ni[nodeid-1].ni_misses = 0;
+ }
+}
+
+
int
main(int argc, char **argv)
{
@@ -1939,6 +1967,7 @@ main(int argc, char **argv)
char device[128];
pid_t pid;
quorum_header_t qh;
+ qd_priv_t qp;
if (check_process_running(argv[0], &pid) && pid !=getpid()) {
printf("QDisk services already running\n");
@@ -2001,13 +2030,23 @@ main(int argc, char **argv)
/* For cman notifications we need two sockets - one for events,
one for config change callbacks */
- ch_user = cman_init(&ctx);
+ qp.ctx = &ctx;
+ qp.ni = &ni[0];
+ qp.ni_len = MAX_NODES_DISK;
+
+ ch_user = cman_init(&qp);
if (cman_start_notification(ch_user, process_cman_event) != 0) {
logt_print(LOG_CRIT, "Could not register with CMAN: %s\n",
strerror(errno));
goto out;
}
+ if (cman_start_recv_data(ch_user, qdisk_whine, 178) != 0) {
+ logt_print(LOG_CRIT, "Could not register with CMAN: %s\n",
+ strerror(errno));
+ goto out;
+ }
+
memset(&me, 0, sizeof(me));
if (cman_get_node(ch_admin, CMAN_NODEID_US, &me) < 0) {
logt_print(LOG_CRIT, "Could not determine local node ID: %s\n",
@@ -2108,7 +2147,7 @@ main(int argc, char **argv)
}
}
- io_nanny_start(ctx.qc_tko * ctx.qc_interval);
+ io_nanny_start(ch_user, ctx.qc_tko * ctx.qc_interval);
if (quorum_loop(&ctx, ni, MAX_NODES_DISK) == 0) {
/* Only clean up if we're exiting w/o error) */
12 years, 2 months
cluster: RHEL6 - cman: Allocate port in cnxman-socket.h for qdiskd
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 9d9f4836dd6c62fa1379c6d7f4e82eee265508cf
Parent: 3b9975dd964a32f8d673f171a7e052f0e4af6c5d
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Fri Feb 17 16:36:33 2012 -0500
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Mon Feb 20 11:46:24 2012 -0500
cman: Allocate port in cnxman-socket.h for qdiskd
Resolves: rhbz#678372
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/daemon/cnxman-socket.h | 1 +
cman/qdisk/main.c | 3 ++-
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/cman/daemon/cnxman-socket.h b/cman/daemon/cnxman-socket.h
index d243b40..e6bb5dd 100644
--- a/cman/daemon/cnxman-socket.h
+++ b/cman/daemon/cnxman-socket.h
@@ -68,6 +68,7 @@
#define CLUSTER_PORT_SERVICES 2
#define CLUSTER_PORT_SYSMAN 10 /* Remote execution daemon */
#define CLUSTER_PORT_CLVMD 11 /* Cluster LVM daemon */
+#define CLUSTER_PORT_QDISKD 178 /* Quorum disk daemon */
/* Port numbers above this will be blocked when the cluster is inquorate or in
* transition */
diff --git a/cman/qdisk/main.c b/cman/qdisk/main.c
index d613d84..fc714f6 100644
--- a/cman/qdisk/main.c
+++ b/cman/qdisk/main.c
@@ -25,6 +25,7 @@
#include <liblogthread.h>
#include "score.h"
#include "../daemon/cman.h"
+#include "../daemon/cnxman-socket.h"
#include <sys/syslog.h>
#define LOG_DAEMON_NAME "qdiskd"
@@ -2041,7 +2042,7 @@ main(int argc, char **argv)
goto out;
}
- if (cman_start_recv_data(ch_user, qdisk_whine, 178) != 0) {
+ if (cman_start_recv_data(ch_user, qdisk_whine, CLUSTER_PORT_QDISKD) != 0) {
logt_print(LOG_CRIT, "Could not register with CMAN: %s\n",
strerror(errno));
goto out;
12 years, 2 months