This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

cluster: STABLE3 - [fencing] Fence agent for HP iLO2 MP


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=beb2da8139a20d81af6bb1e11a6de66838cf0c90
Commit:        beb2da8139a20d81af6bb1e11a6de66838cf0c90
Parent:        df5af75eb7d1c2978340ac3bcd1dd4402d7840c2
Author:        Marek 'marx' Grac <mgrac@redhat.com>
AuthorDate:    Thu Jul 30 12:22:44 2009 +0200
Committer:     Marek 'marx' Grac <mgrac@redhat.com>
CommitterDate: Thu Jul 30 12:22:44 2009 +0200

[fencing] Fence agent for HP iLO2 MP

New fence agent for HP iLO2 MP used in Blade Servers. It uses SMASH
interface over telnet/ssh. fence_ilo uses RIBCL over SSL what is not
supported on these machines.
---
 fence/agents/ilo_mp/Makefile        |    5 +++
 fence/agents/ilo_mp/fence_ilo_mp.py |   66 +++++++++++++++++++++++++++++++++++
 2 files changed, 71 insertions(+), 0 deletions(-)

diff --git a/fence/agents/ilo_mp/Makefile b/fence/agents/ilo_mp/Makefile
new file mode 100644
index 0000000..6405a8f
--- /dev/null
+++ b/fence/agents/ilo_mp/Makefile
@@ -0,0 +1,5 @@
+include ../../../make/defines.mk
+
+TARGET= fence_ilo_mp
+
+include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/ilo_mp/fence_ilo_mp.py b/fence/agents/ilo_mp/fence_ilo_mp.py
new file mode 100644
index 0000000..511ff4b
--- /dev/null
+++ b/fence/agents/ilo_mp/fence_ilo_mp.py
@@ -0,0 +1,66 @@
+#!/usr/bin/python
+
+##
+## Copyright (C) 2008 Red Hat, Inc. All Rights Reserved.
+##
+#####
+
+import sys, re, pexpect, socket
+sys.path.append("@FENCEAGENTSLIBDIR@")
+from fencing import *
+
+#BEGIN_VERSION_GENERATION
+FENCE_RELEASE_NAME=""
+REDHAT_COPYRIGHT=""
+BUILD_DATE=""
+#END_VERSION_GENERATION
+
+def get_power_status(conn, options):
+	conn.send("show /system1\n")
+	conn.log_expect(options, "EnabledState=(.*)", POWER_TIMEOUT)
+
+	status = conn.match.group(1)
+
+	if status.startswith("Enabled"):
+		return "on"
+	else:
+		return "off"
+
+def set_power_status(conn, options):
+	if options["-o"] == "on":
+		conn.send("start /system1\n")
+	else:
+		conn.send("stop -f /system1\n")
+	return
+
+def main():
+	device_opt = [  "help", "version", "agent", "quiet", "verbose", "debug",
+			"action", "ipaddr", "login", "passwd", "passwd_script",
+			"secure", "cmd_prompt", "ipport", "login_eol_lf",
+			"separator", "inet4_only", "inet6_only" ]
+
+	atexit.register(atexit_handler)
+	
+	options = check_input(device_opt, process_input(device_opt))
+	if 0 == options.has_key("-c"):
+		options["-c"] = "MP>"
+		
+	show_docs(options)
+	
+	conn = fence_login(options)
+	conn.send("SMCLP\n")
+
+	##
+	## Fence operations
+	####
+	fence_action(conn, options, set_power_status, get_power_status)
+
+	try:
+		conn.send("exit\n")
+	except exceptions.OSError:
+		pass
+	except pexpect.ExceptionPexpect:
+		pass
+
+if __name__ == "__main__":
+	main()


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]