cluster: RHEL57 - fsck.gfs2 stuck in pass1 on i686
by Bob Peterson
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 98ea28be22109e64107db447a829e0b8a42863b2
Parent: 99345341cc709bbb794ac1f2711b93dda349fc37
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Fri Jan 21 08:13:08 2011 -0600
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Fri Jan 21 08:17:30 2011 -0600
fsck.gfs2 stuck in pass1 on i686
This patch fixes a problem specific to 32-bit architectures.
The shift point calculation for determining where to start looking
for a desired value in the bitmap was wrong because it was
using sizeof(unsigned long) rather than sizeof(unsigned long long).
That caused the bitfit function to start in the wrong place, which
in some circumstances caused the same block to be returned repeatedly
which resulted in infinite loops in fsck.gfs2.
rhbz#667769
---
gfs2/libgfs2/fs_bits.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/gfs2/libgfs2/fs_bits.c b/gfs2/libgfs2/fs_bits.c
index ee9dfa7..69b16e9 100644
--- a/gfs2/libgfs2/fs_bits.c
+++ b/gfs2/libgfs2/fs_bits.c
@@ -77,7 +77,7 @@ static inline uint64_t gfs2_bit_search(const unsigned long long *ptr,
unsigned long gfs2_bitfit(const unsigned char *buf, const unsigned int len,
unsigned long goal, unsigned char state)
{
- unsigned long spoint = (goal << 1) & ((8 * sizeof(unsigned long)) - 1);
+ unsigned long spoint = (goal << 1) & ((8 * sizeof(unsigned long long)) - 1);
const unsigned long long *ptr = ((unsigned long long *)buf) + (goal >> 5);
const unsigned long long *end = (unsigned long long *)
(buf + ALIGN(len, sizeof(unsigned long long)));
13 years, 3 months
cluster: RHEL57 - fsck.gfs2: reports master/root dinodes as unused and fixes the bitmap
by Bob Peterson
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 99345341cc709bbb794ac1f2711b93dda349fc37
Parent: be158e9bd1c3c99475ff4f213c19b1732ab0f14d
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Thu Jan 20 15:09:14 2011 -0600
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Thu Jan 20 15:09:14 2011 -0600
fsck.gfs2: reports master/root dinodes as unused and fixes the bitmap
The problem is that the block map is not set at the point of
time when the master and root dinodes are checked. So fsck
sees the discrepancy between the on-disk bitmap (which is
correct) and the in-core blockmap (which hasn't been set
yet for these two system dinodes). So it complains improperly.
This is a simple fix. Long ago, I wrote a function called
resuscitate_metalist whose purpose was to make sure dinodes
get marked "in use" for each system dinode. It's called by
function check_system_inode, and by way of check_metalist.
The function is called for root and master, and therefore
all the system dinodes _within_ those directories are
marked properly in the block map, but nothing ever bothers
to mark the directories themselves. (Side note: the root
directory doesn't have system dinodes like master, so that's
moot).
The solution (this patch) is to set the block map
accordingly, prior to the other checks. Since those two
dinodes have no parent, nothing else is going to do it for
them.
rhbz#642797
---
gfs2/fsck/pass1.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/gfs2/fsck/pass1.c b/gfs2/fsck/pass1.c
index 3bdcf60..bced051 100644
--- a/gfs2/fsck/pass1.c
+++ b/gfs2/fsck/pass1.c
@@ -1305,11 +1305,21 @@ static int check_system_inodes(struct gfs2_sbd *sdp)
/*******************************************************************
******* Check the system inode integrity *************
*******************************************************************/
+ /* Mark the master system dinode as a "dinode" in the block map.
+ All other system dinodes in master will be taken care of by function
+ resuscitate_metalist. But master won't since it has no parent.*/
+ fsck_blockmap_set(sdp->master_dir,
+ sdp->master_dir->i_di.di_num.no_addr,
+ "master", gfs2_inode_dir);
if (check_system_inode(sdp, &sdp->master_dir, "master", build_master,
gfs2_inode_dir)) {
stack;
return -1;
}
+ /* Mark the root dinode as a "dinode" in the block map as we did
+ for master, since it has no parent. */
+ fsck_blockmap_set(sdp->md.rooti, sdp->md.rooti->i_di.di_num.no_addr,
+ "root", gfs2_inode_dir);
if (check_system_inode(sdp, &sdp->md.rooti, "root", build_root,
gfs2_inode_dir)) {
stack;
13 years, 3 months
cluster: RHEL6 - fsck.gfs2: reports master/root dinodes as unused and fixes the bitmap
by Bob Peterson
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 5710603c4af1d832f21a7583da5bd834606c4995
Parent: 679d1f0a1e95bae746d22889fd731fee979676ee
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Thu Jan 20 14:25:55 2011 -0600
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Thu Jan 20 14:29:46 2011 -0600
fsck.gfs2: reports master/root dinodes as unused and fixes the bitmap
The problem is that the block map is not set at the point of
time when the master and root dinodes are checked. So fsck
sees the discrepancy between the on-disk bitmap (which is
correct) and the in-core blockmap (which hasn't been set
yet for these two system dinodes). So it complains improperly.
This is a simple fix. Long ago, I wrote a function called
resuscitate_metalist whose purpose was to make sure dinodes
get marked "in use" for each system dinode. It's called by
function check_system_inode, and by way of check_metalist.
The function is called for root and master, and therefore
all the system dinodes _within_ those directories are
marked properly in the block map, but nothing ever bothers
to mark the directories themselves. (Side note: the root
directory doesn't have system dinodes like master, so that's
moot).
The solution (this patch) is to set the block map
accordingly, prior to the other checks. Since those two
dinodes have no parent, nothing else is going to do it for
them.
rhbz#663037
---
gfs2/fsck/pass1.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/gfs2/fsck/pass1.c b/gfs2/fsck/pass1.c
index 6613bd1..a7eb96d 100644
--- a/gfs2/fsck/pass1.c
+++ b/gfs2/fsck/pass1.c
@@ -1293,11 +1293,21 @@ static int check_system_inodes(struct gfs2_sbd *sdp)
/*******************************************************************
******* Check the system inode integrity *************
*******************************************************************/
+ /* Mark the master system dinode as a "dinode" in the block map.
+ All other system dinodes in master will be taken care of by function
+ resuscitate_metalist. But master won't since it has no parent.*/
+ fsck_blockmap_set(sdp->master_dir,
+ sdp->master_dir->i_di.di_num.no_addr,
+ "master", gfs2_inode_dir);
if (check_system_inode(sdp, &sdp->master_dir, "master", build_master,
gfs2_inode_dir)) {
stack;
return -1;
}
+ /* Mark the root dinode as a "dinode" in the block map as we did
+ for master, since it has no parent. */
+ fsck_blockmap_set(sdp->md.rooti, sdp->md.rooti->i_di.di_num.no_addr,
+ "root", gfs2_inode_dir);
if (check_system_inode(sdp, &sdp->md.rooti, "root", build_root,
gfs2_inode_dir)) {
stack;
13 years, 3 months
gfs2-utils: master - fsck.gfs2: reports master/root dinodes as unused and fixes the bitmap
by Bob Peterson
Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitd...
Commit: fdc45edc17d329f966acac1b0832a437ba8c6a3e
Parent: a93b053d08c2173ad3c834c8b73c9831aa8f514a
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Thu Jan 20 14:25:55 2011 -0600
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Thu Jan 20 14:33:03 2011 -0600
fsck.gfs2: reports master/root dinodes as unused and fixes the bitmap
The problem is that the block map is not set at the point of
time when the master and root dinodes are checked. So fsck
sees the discrepancy between the on-disk bitmap (which is
correct) and the in-core blockmap (which hasn't been set
yet for these two system dinodes). So it complains improperly.
This is a simple fix. Long ago, I wrote a function called
resuscitate_metalist whose purpose was to make sure dinodes
get marked "in use" for each system dinode. It's called by
function check_system_inode, and by way of check_metalist.
The function is called for root and master, and therefore
all the system dinodes _within_ those directories are
marked properly in the block map, but nothing ever bothers
to mark the directories themselves. (Side note: the root
directory doesn't have system dinodes like master, so that's
moot).
The solution (this patch) is to set the block map
accordingly, prior to the other checks. Since those two
dinodes have no parent, nothing else is going to do it for
them.
rhbz#663037
---
gfs2/fsck/pass1.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/gfs2/fsck/pass1.c b/gfs2/fsck/pass1.c
index 96c2310..0134941 100644
--- a/gfs2/fsck/pass1.c
+++ b/gfs2/fsck/pass1.c
@@ -1296,11 +1296,21 @@ static int check_system_inodes(struct gfs2_sbd *sdp)
/*******************************************************************
******* Check the system inode integrity *************
*******************************************************************/
+ /* Mark the master system dinode as a "dinode" in the block map.
+ All other system dinodes in master will be taken care of by function
+ resuscitate_metalist. But master won't since it has no parent.*/
+ fsck_blockmap_set(sdp->master_dir,
+ sdp->master_dir->i_di.di_num.no_addr,
+ "master", gfs2_inode_dir);
if (check_system_inode(sdp, &sdp->master_dir, "master", build_master,
gfs2_inode_dir)) {
stack;
return -1;
}
+ /* Mark the root dinode as a "dinode" in the block map as we did
+ for master, since it has no parent. */
+ fsck_blockmap_set(sdp->md.rooti, sdp->md.rooti->i_di.di_num.no_addr,
+ "root", gfs2_inode_dir);
if (check_system_inode(sdp, &sdp->md.rooti, "root", build_root,
gfs2_inode_dir)) {
stack;
13 years, 3 months
fence-agents: master - fence_eaton_snmp: New fence agent for Eaton devices
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=com...
Commit: 39e735e3091706af66ab7bd56135eee441878d51
Parent: 86f046acd2be7623c6966ceea9ee922c239a88b2
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Thu Jan 20 13:38:51 2011 +0100
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Thu Jan 20 13:38:51 2011 +0100
fence_eaton_snmp: New fence agent for Eaton devices
Fence agent for Eaton Managed ePDU (http://www.epdu.com).
Developed by Arnaud Quette <aquette.dev(a)gmail.com>
---
configure.ac | 1 +
fence/agents/Makefile.am | 1 +
fence/agents/eaton_snmp/Makefile.am | 16 +++
fence/agents/eaton_snmp/README | 20 +++
fence/agents/eaton_snmp/fence_eaton_snmp.py | 177 +++++++++++++++++++++++++++
5 files changed, 215 insertions(+), 0 deletions(-)
diff --git a/configure.ac b/configure.ac
index fd441e7..639769f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -224,6 +224,7 @@ AC_CONFIG_FILES([Makefile
fence/agents/cpint/Makefile
fence/agents/drac/Makefile
fence/agents/drac5/Makefile
+ fence/agents/eaton_snmp/Makefile
fence/agents/egenera/Makefile
fence/agents/eps/Makefile
fence/agents/ibmblade/Makefile
diff --git a/fence/agents/Makefile.am b/fence/agents/Makefile.am
index 3a91ed4..945b49b 100644
--- a/fence/agents/Makefile.am
+++ b/fence/agents/Makefile.am
@@ -13,6 +13,7 @@ SUBDIRS = lib \
cpint \
drac \
drac5 \
+ eaton_snmp \
egenera \
eps \
ibmblade \
diff --git a/fence/agents/eaton_snmp/Makefile.am b/fence/agents/eaton_snmp/Makefile.am
new file mode 100644
index 0000000..dad91c9
--- /dev/null
+++ b/fence/agents/eaton_snmp/Makefile.am
@@ -0,0 +1,16 @@
+MAINTAINERCLEANFILES = Makefile.in
+
+TARGET = fence_eaton_snmp
+
+EXTRA_DIST = $(TARGET).py \
+ README
+
+sbin_SCRIPTS = $(TARGET)
+
+dist_man_MANS = $(TARGET).8
+
+include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fenceman.mk
+
+clean-local: clean-man
+ rm -f $(TARGET)
diff --git a/fence/agents/eaton_snmp/README b/fence/agents/eaton_snmp/README
new file mode 100644
index 0000000..82619d7
--- /dev/null
+++ b/fence/agents/eaton_snmp/README
@@ -0,0 +1,20 @@
+This is an snmp based fence agent for Eaton power distribution units to be used
+with RHEL4 Red Hat Cluster Suite.
+
+In order to use this agent, you will need to have net-snmp-utils installed
+on every node in your cluster. net-snmp-utils is scheduled for inclusion
+in the base RHEL distribution for Update 4, and is yummable in FC5.
+
+To use the agent, cp the agent to the /sbin directory on every
+cluster node.
+
+Then define a <fencedevice> in the cluster.conf file with
+agent="fence_eaton_snmp" as an attribute, and use it that way.
+Note, please, that the GUI does not support this agent yet, and you will have
+to edit your cluster.conf by hand and then propagate it yourself. If you need
+help with this, email me at the address below.
+
+The interface for the fence_eaton_snmp agent is identical to the existing
+fence_apc_snmp agent, upon which it has been derived.
+
+--Arnaud Quette - ArnaudQuette(a)Eaton.com
diff --git a/fence/agents/eaton_snmp/fence_eaton_snmp.py b/fence/agents/eaton_snmp/fence_eaton_snmp.py
new file mode 100644
index 0000000..b02cfd1
--- /dev/null
+++ b/fence/agents/eaton_snmp/fence_eaton_snmp.py
@@ -0,0 +1,177 @@
+#!/usr/bin/python
+
+# The Following agent has been tested on:
+# - Eaton ePDU managed - SNMP v1
+
+import sys, re, pexpect
+sys.path.append("@FENCEAGENTSLIBDIR@")
+from fencing import *
+from fencing_snmp import *
+
+#BEGIN_VERSION_GENERATION
+RELEASE_VERSION="Eaton SNMP fence agent"
+REDHAT_COPYRIGHT=""
+BUILD_DATE=""
+#END_VERSION_GENERATION
+
+### CONSTANTS ###
+# oid defining fence device
+OID_SYS_OBJECT_ID='.1.3.6.1.2.1.1.2.0'
+
+### GLOBAL VARIABLES ###
+# Device - see EatonManagedePDU
+device=None
+
+# Port ID
+port_id=None
+# Switch ID
+switch_id=None
+
+# Classes describing Device params
+class EatonManagedePDU:
+ status_oid= '.1.3.6.1.4.1.534.6.6.6.1.2.2.1.3.%d'
+ control_oid= '.1.3.6.1.4.1.534.6.6.6.1.2.2.1.3.%d'
+ outlet_table_oid='.1.3.6.1.4.1.534.6.6.6.1.2.2.1.1'
+ ident_str="Eaton Managed ePDU"
+ state_off=0
+ state_on=1
+ state_cycling=2
+ turn_off=0
+ turn_on=1
+ turn_cycle=2
+ # FIXME: what's this?
+ has_switches=False
+
+### FUNCTIONS ###
+def eaton_set_device(conn,options):
+ global device
+
+ agents_dir={'.1.3.6.1.4.1.534.6.6.6':EatonManagedePDU}
+
+ # First resolve type of Eaton
+ eaton_type=conn.walk(OID_SYS_OBJECT_ID)
+
+ if (not ((len(eaton_type)==1) and (agents_dir.has_key(eaton_type[0][1])))):
+ eaton_type=[[None,None]]
+
+ device=agents_dir[eaton_type[0][1]]
+
+ conn.log_command("Trying %s"%(device.ident_str))
+
+def eaton_resolv_port_id(conn,options):
+ global port_id,switch_id,device
+
+ if (device==None):
+ eaton_set_device(conn,options)
+
+ # Now we resolv port_id/switch_id
+ if ((options["-n"].isdigit()) and ((not device.has_switches) or (options["-s"].isdigit()))):
+ port_id=int(options["-n"])
+
+ if (device.has_switches):
+ switch_id=int(options["-s"])
+ else:
+ table=conn.walk(device.outlet_table_oid,30)
+
+ for x in table:
+ if (x[1].strip('"')==options["-n"]):
+ t=x[0].split('.')
+ if (device.has_switches):
+ port_id=int(t[len(t)-1])
+ switch_id=int(t[len(t)-3])
+ else:
+ port_id=int(t[len(t)-1])
+
+ if (port_id==None):
+ fail_usage("Can't find port with name %s!"%(options["-n"]))
+
+def get_power_status(conn,options):
+ global port_id,switch_id,device
+
+ if (port_id==None):
+ eaton_resolv_port_id(conn,options)
+
+ oid=((device.has_switches) and device.status_oid%(switch_id,port_id) or device.status_oid%(port_id))
+
+ (oid,status)=conn.get(oid)
+ return (status==str(device.state_on) and "on" or "off")
+
+def set_power_status(conn, options):
+ global port_id,switch_id,device
+
+ if (port_id==None):
+ eaton_resolv_port_id(conn,options)
+
+ oid=((device.has_switches) and device.control_oid%(switch_id,port_id) or device.control_oid%(port_id))
+
+ conn.set(oid,(options["-o"]=="on" and device.turn_on or device.turn_off))
+
+
+def get_outlets_status(conn, options):
+ global device
+
+ result={}
+
+ if (device==None):
+ eaton_set_device(conn,options)
+
+ res_ports=conn.walk(device.outlet_table_oid,30)
+
+ for x in res_ports:
+ t=x[0].split('.')
+
+ port_num=((device.has_switches) and "%s:%s"%(t[len(t)-3],t[len(t)-1]) or "%s"%(t[len(t)-1]))
+
+ port_name=x[1].strip('"')
+ port_status=""
+ result[port_num]=(port_name,port_status)
+
+ return result
+
+# Define new options
+def eaton_snmp_define_defaults():
+ all_opt["snmp_version"]["default"]="1"
+ all_opt["community"]["default"]="private"
+
+# Main agent method
+def main():
+ device_opt = [ "help", "version", "agent", "quiet", "verbose", "debug",
+ "action", "ipaddr", "login", "passwd", "passwd_script",
+ "test", "port", "separator", "no_login", "no_password",
+ "snmp_version", "community", "snmp_auth_prot", "snmp_sec_level",
+ "snmp_priv_prot", "snmp_priv_passwd", "snmp_priv_passwd_script",
+ "udpport","inet4_only","inet6_only",
+ "power_timeout", "shell_timeout", "login_timeout", "power_wait" ]
+
+ atexit.register(atexit_handler)
+
+ snmp_define_defaults ()
+ eaton_snmp_define_defaults()
+
+ options=check_input(device_opt,process_input(device_opt))
+
+ ## Support for -n [switch]:[plug] notation that was used before
+ if ((options.has_key("-n")) and (-1 != options["-n"].find(":"))):
+ (switch, plug) = options["-n"].split(":", 1)
+ if ((switch.isdigit()) and (plug.isdigit())):
+ options["-s"] = switch
+ options["-n"] = plug
+
+ if (not (options.has_key("-s"))):
+ options["-s"]="1"
+
+ docs = { }
+ docs["shortdesc"] = "Fence agent for Eaton over SNMP"
+ docs["longdesc"] = "fence_eaton_snmp is an I/O Fencing agent \
+which can be used with the Eaton network power switch. It logs \
+into a device via SNMP and reboots a specified outlet. It supports \
+SNMP v1 and v3 with all combinations of authenticity/privacy settings."
+ docs["vendorurl"] = "http://powerquality.eaton.com"
+ show_docs(options, docs)
+
+ # Operate the fencing device
+ result = fence_action(FencingSnmp(options), options, set_power_status, get_power_status, get_outlets_status)
+
+ sys.exit(result)
+if __name__ == "__main__":
+ main()
13 years, 3 months
cluster: RHEL6 - library: Metadata are not correct if agent does not support on/off
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 679d1f0a1e95bae746d22889fd731fee979676ee
Parent: 810b997550ff8390876eebfe86835ac26661a78b
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Mon Oct 25 16:57:00 2010 +0200
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Thu Jan 20 10:22:35 2011 +0100
library: Metadata are not correct if agent does not support on/off
Metadata actions are generated according to option io_fencing. Currently
only fence_sanbox is affected as fence_ifmib accepts both enable/disable
and on/off (so io_fencing is not used)
Resolves: rhbz#623266
---
fence/agents/lib/fencing.py.py | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index da4b222..93756cc 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -483,9 +483,14 @@ def metadata(avail_opt, options, docs):
print "\t</parameter>"
print "</parameters>"
print "<actions>"
- print "\t<action name=\"on\" />"
- print "\t<action name=\"off\" />"
- print "\t<action name=\"reboot\" />"
+ if avail_opt.count("io_fencing") == 0:
+ print "\t<action name=\"on\" />"
+ print "\t<action name=\"off\" />"
+ print "\t<action name=\"reboot\" />"
+ else:
+ print "\t<action name=\"enable\" />"
+ print "\t<action name=\"disable\" />"
+
print "\t<action name=\"status\" />"
print "\t<action name=\"list\" />"
print "\t<action name=\"monitor\" />"
13 years, 3 months
cluster: RHEL6 - fence_ipmilan: Fix manual page to describe usage with HP iLO 3
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 810b997550ff8390876eebfe86835ac26661a78b
Parent: 0c6ceefc4c563016d2709eff3f1dee802a9749cb
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Thu Jan 13 15:02:11 2011 +0100
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Thu Jan 20 10:15:55 2011 +0100
fence_ipmilan: Fix manual page to describe usage with HP iLO 3
Resolves: rhbz#648892
---
fence/agents/ipmilan/ipmilan.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/fence/agents/ipmilan/ipmilan.c b/fence/agents/ipmilan/ipmilan.c
index 6130aeb..be36f58 100644
--- a/fence/agents/ipmilan/ipmilan.c
+++ b/fence/agents/ipmilan/ipmilan.c
@@ -866,7 +866,10 @@ static void print_xml_metadata(char *pname) {
printf("<longdesc>\n");
printf("fence_ipmilan is an I/O Fencing agent which can be used with "
"machines controlled by IPMI. This agent calls support software "
- "using ipmitool (http://ipmitool.sf.net/).");
+ "using ipmitool (http://ipmitool.sf.net/).\n\n"
+ "To use fence_ipmilan with HP iLO 3 you have to enable lanplus "
+ "option (lanplus / -P) and increase wait after operation to "
+ "4 seconds (power_wait=4 / -T 4)");
printf("</longdesc>\n");
printf("%s\n","<parameters>");
13 years, 3 months
cluster: RHEL6 - fence_ipmilan: Add "diag" option to support "ipmitool chassis power diag"
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 0c6ceefc4c563016d2709eff3f1dee802a9749cb
Parent: d3af317da0bccfe12814c06c0723c0dd1657df17
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Thu Jan 13 14:07:50 2011 +0100
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Thu Jan 20 10:14:28 2011 +0100
fence_ipmilan: Add "diag" option to support "ipmitool chassis power diag"
Resolves: rhbz#655764
---
fence/agents/ipmilan/ipmilan.c | 31 +++++++++++++++++++++++++++----
1 files changed, 27 insertions(+), 4 deletions(-)
diff --git a/fence/agents/ipmilan/ipmilan.c b/fence/agents/ipmilan/ipmilan.c
index 1503b58..6130aeb 100644
--- a/fence/agents/ipmilan/ipmilan.c
+++ b/fence/agents/ipmilan/ipmilan.c
@@ -26,6 +26,7 @@
#define ST_POWEROFF 2
#define ST_GENERIC_RESET 3
#define ST_CYCLE 4
+#define ST_DIAG 5
#define DEFAULT_TIMEOUT 20
#define DEFAULT_POWER_WAIT 2
@@ -164,7 +165,7 @@ struct xml_parameter_s xml_parameters[]={
{"passwd_script","-S",0,"string",NULL,"Script to retrieve password (if required)"},
{"lanplus","-P",0,"boolean",NULL,"Use Lanplus"},
{"login","-l",0,"string",NULL,"Username/Login (if required) to control power on IPMI device"},
- {"action","-o",0,"string","reboot","Operation to perform. Valid operations: on, off, reboot, status, list, monitor or metadata"},
+ {"action","-o",0,"string","reboot","Operation to perform. Valid operations: on, off, reboot, status, list, diag, monitor or metadata"},
{"timeout","-t",0,"string",NULL,"Timeout (sec) for IPMI operation"},
{"cipher","-C",0,"string",NULL,"Ciphersuite to use (same as ipmitool -C parameter)"},
{"method","-M",0,"string",DEFAULT_METHOD,"Method to fence (onoff or cycle)"},
@@ -303,6 +304,10 @@ build_cmd(char *command, size_t cmdlen, struct ipmi *ipmi, int op)
snprintf(arg, sizeof(arg),
"%s chassis power cycle", cmd);
break;
+ case ST_DIAG:
+ snprintf(arg, sizeof(arg),
+ "%s chassis power diag", cmd);
+ break;
}
strncpy(command, arg, cmdlen);
@@ -520,6 +525,16 @@ ipmi_cycle(struct ipmi *ipmi)
return ret;
}
+static int
+ipmi_diag(struct ipmi *ipmi)
+{
+ int ret;
+
+ ret = ipmi_op(ipmi, ST_DIAG, power_off_complete);
+
+ return ret;
+}
+
/**
Squash all our private data
@@ -812,7 +827,8 @@ printf(" -S <path> Script to retrieve password (if required)\n");
printf(" -l <login> Username/Login (if required) to control power\n"
" on IPMI device\n");
printf(" -o <op> Operation to perform.\n");
-printf(" Valid operations: on, off, reboot, status, list or monitor\n");
+printf(" Valid operations: on, off, reboot, status,\n");
+printf(" diag, list or monitor\n");
printf(" -t <timeout> Timeout (sec) for IPMI operation (default %d)\n",DEFAULT_TIMEOUT);
printf(" -T <timeout> Wait X seconds after on/off operation\n");
printf(" -f <timeout> Wait X seconds before fencing is started\n");
@@ -877,6 +893,7 @@ static void print_xml_metadata(char *pname) {
printf("\t<action name=\"%s\" />\n", "off");
printf("\t<action name=\"%s\" />\n", "reboot");
printf("\t<action name=\"%s\" />\n", "status");
+ printf("\t<action name=\"%s\" />\n", "diag");
printf("\t<action name=\"%s\" />\n", "list");
printf("\t<action name=\"%s\" />\n", "monitor");
printf("\t<action name=\"%s\" />\n", "metadata");
@@ -1049,9 +1066,9 @@ main(int argc, char **argv)
if (strcasecmp(op, "off") && strcasecmp(op, "on") &&
strcasecmp(op, "status") && strcasecmp(op, "reboot") &&
strcasecmp(op, "monitor") && strcasecmp(op, "list") &&
- strcasecmp(op, "metadata")) {
+ strcasecmp(op, "metadata") && strcasecmp(op, "diag")) {
fail_exit("operation must be 'on', 'off', 'status', "
- "'reboot', 'list', 'monitor' or 'metadata'");
+ "'reboot', 'diag', 'list', 'monitor' or 'metadata'");
}
if (strlen(authtype) &&
@@ -1149,6 +1166,12 @@ main(int argc, char **argv)
ret=0;
translated_ret = ERR_OK;
print_final_status=0;
+ } else if (!strcasecmp(op, "diag")) {
+ printf("Pulsing diagnostic interrupt to machine @ IPMI:%s...", ip);
+ fflush(stdout);
+ ret = ipmi_diag(i);
+ translated_ret = (ret==0?ERR_ON_SUCCESSFUL:ERR_ON_FAIL);
+ ret = 0;
}
13 years, 3 months
fence-agents: master - fence_ipmilan: Fix manual page to describe usage with HP iLO 3
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=com...
Commit: 86f046acd2be7623c6966ceea9ee922c239a88b2
Parent: d514afae60061d0ded31910d0c6c6c0f43459f82
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Thu Jan 13 15:02:11 2011 +0100
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Thu Jan 13 15:02:11 2011 +0100
fence_ipmilan: Fix manual page to describe usage with HP iLO 3
Resolves: rhbz#648892
---
fence/agents/ipmilan/ipmilan.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/fence/agents/ipmilan/ipmilan.c b/fence/agents/ipmilan/ipmilan.c
index 2411b42..d34ced5 100644
--- a/fence/agents/ipmilan/ipmilan.c
+++ b/fence/agents/ipmilan/ipmilan.c
@@ -869,7 +869,10 @@ static void print_xml_metadata(char *pname) {
printf("<longdesc>\n");
printf("fence_ipmilan is an I/O Fencing agent which can be used with "
"machines controlled by IPMI. This agent calls support software "
- "using ipmitool (http://ipmitool.sf.net/).");
+ "using ipmitool (http://ipmitool.sf.net/).\n\n"
+ "To use fence_ipmilan with HP iLO 3 you have to enable lanplus "
+ "option (lanplus / -P) and increase wait after operation to "
+ "4 seconds (power_wait=4 / -T 4)");
printf("</longdesc>\n");
printf("%s\n","<parameters>");
13 years, 3 months
fence-agents: master - fence_ipmilan: Add "diag" option to support "ipmitool chassis power diag"
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=com...
Commit: d514afae60061d0ded31910d0c6c6c0f43459f82
Parent: d168962374ab52999d1be46fa218fb66066833da
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Thu Jan 13 14:07:50 2011 +0100
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Thu Jan 13 14:07:50 2011 +0100
fence_ipmilan: Add "diag" option to support "ipmitool chassis power diag"
Resolves: rhbz#655764
---
fence/agents/ipmilan/ipmilan.c | 31 +++++++++++++++++++++++++++----
1 files changed, 27 insertions(+), 4 deletions(-)
diff --git a/fence/agents/ipmilan/ipmilan.c b/fence/agents/ipmilan/ipmilan.c
index 0832e0b..2411b42 100644
--- a/fence/agents/ipmilan/ipmilan.c
+++ b/fence/agents/ipmilan/ipmilan.c
@@ -29,6 +29,7 @@
#define ST_POWEROFF 2
#define ST_GENERIC_RESET 3
#define ST_CYCLE 4
+#define ST_DIAG 5
#define DEFAULT_TIMEOUT 20
#define DEFAULT_POWER_WAIT 2
@@ -167,7 +168,7 @@ struct xml_parameter_s xml_parameters[]={
{"passwd_script","-S",0,"string",NULL,"Script to retrieve password (if required)"},
{"lanplus","-P",0,"boolean",NULL,"Use Lanplus"},
{"login","-l",0,"string",NULL,"Username/Login (if required) to control power on IPMI device"},
- {"action","-o",0,"string","reboot","Operation to perform. Valid operations: on, off, reboot, status, list, monitor or metadata"},
+ {"action","-o",0,"string","reboot","Operation to perform. Valid operations: on, off, reboot, status, list, diag, monitor or metadata"},
{"timeout","-t",0,"string",NULL,"Timeout (sec) for IPMI operation"},
{"cipher","-C",0,"string",NULL,"Ciphersuite to use (same as ipmitool -C parameter)"},
{"method","-M",0,"string",DEFAULT_METHOD,"Method to fence (onoff or cycle)"},
@@ -306,6 +307,10 @@ build_cmd(char *command, size_t cmdlen, struct ipmi *ipmi, int op)
snprintf(arg, sizeof(arg),
"%s chassis power cycle", cmd);
break;
+ case ST_DIAG:
+ snprintf(arg, sizeof(arg),
+ "%s chassis power diag", cmd);
+ break;
}
strncpy(command, arg, cmdlen);
@@ -523,6 +528,16 @@ ipmi_cycle(struct ipmi *ipmi)
return ret;
}
+static int
+ipmi_diag(struct ipmi *ipmi)
+{
+ int ret;
+
+ ret = ipmi_op(ipmi, ST_DIAG, power_off_complete);
+
+ return ret;
+}
+
/**
Squash all our private data
@@ -815,7 +830,8 @@ printf(" -S <path> Script to retrieve password (if required)\n");
printf(" -l <login> Username/Login (if required) to control power\n"
" on IPMI device\n");
printf(" -o <op> Operation to perform.\n");
-printf(" Valid operations: on, off, reboot, status, list or monitor\n");
+printf(" Valid operations: on, off, reboot, status,\n");
+printf(" diag, list or monitor\n");
printf(" -t <timeout> Timeout (sec) for IPMI operation (default %d)\n",DEFAULT_TIMEOUT);
printf(" -T <timeout> Wait X seconds after on/off operation\n");
printf(" -f <timeout> Wait X seconds before fencing is started\n");
@@ -880,6 +896,7 @@ static void print_xml_metadata(char *pname) {
printf("\t<action name=\"%s\" />\n", "off");
printf("\t<action name=\"%s\" />\n", "reboot");
printf("\t<action name=\"%s\" />\n", "status");
+ printf("\t<action name=\"%s\" />\n", "diag");
printf("\t<action name=\"%s\" />\n", "list");
printf("\t<action name=\"%s\" />\n", "monitor");
printf("\t<action name=\"%s\" />\n", "metadata");
@@ -1052,9 +1069,9 @@ main(int argc, char **argv)
if (strcasecmp(op, "off") && strcasecmp(op, "on") &&
strcasecmp(op, "status") && strcasecmp(op, "reboot") &&
strcasecmp(op, "monitor") && strcasecmp(op, "list") &&
- strcasecmp(op, "metadata")) {
+ strcasecmp(op, "metadata") && strcasecmp(op, "diag")) {
fail_exit("operation must be 'on', 'off', 'status', "
- "'reboot', 'list', 'monitor' or 'metadata'");
+ "'reboot', 'diag', 'list', 'monitor' or 'metadata'");
}
if (strlen(authtype) &&
@@ -1152,6 +1169,12 @@ main(int argc, char **argv)
ret=0;
translated_ret = ERR_OK;
print_final_status=0;
+ } else if (!strcasecmp(op, "diag")) {
+ printf("Pulsing diagnostic interrupt to machine @ IPMI:%s...", ip);
+ fflush(stdout);
+ ret = ipmi_diag(i);
+ translated_ret = (ret==0?ERR_ON_SUCCESSFUL:ERR_ON_FAIL);
+ ret = 0;
}
13 years, 3 months