[luci] luci: Support method attribute for fence ipmilan
by Ryan McCabe
commit 87860b577052ef5599018414cee7a966029409dd
Author: Ryan McCabe <rmccabe(a)redhat.com>
Date: Mon Nov 21 11:12:55 2016 -0500
luci: Support method attribute for fence ipmilan
Support the method to fence attribute (onoff|cycle) for fence_ipmilan,
fence_ilo3, fence_ilo4, fence_imm, and fence_idrac.
Signed-off-by: Ryan McCabe <rmccabe(a)redhat.com>
luci/templates/fence_devices.html | 55 +++++++++++++++++++++++++++++++++++++
luci/validation/validate_fence.py | 1 +
2 files changed, 56 insertions(+), 0 deletions(-)
---
diff --git a/luci/templates/fence_devices.html b/luci/templates/fence_devices.html
index e776b92..a7d70ac 100644
--- a/luci/templates/fence_devices.html
+++ b/luci/templates/fence_devices.html
@@ -2300,6 +2300,17 @@
py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('delay')}"/>
</td>
</tr>
+ <tr>
+ <td>Method to Fence</td>
+ <td>
+ <select name="method">
+ <option value="onoff"
+ py:attrs="(not cur_fencedev or not cur_fencedev.getAttribute('method')) and {'selected':'selected'} or {}">onoff</option>
+ <option value="cycle"
+ py:attrs="cur_fencedev and cur_fencedev.getAttribute('method') == 'cycle' and {'selected':'selected'} or {}">cycle</option>
+ </select>
+ </td>
+ </tr>
</table>
<py:if test="cur_fencedev">
@@ -2423,6 +2434,17 @@
py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('delay')}"/>
</td>
</tr>
+ <tr>
+ <td>Method to Fence</td>
+ <td>
+ <select name="method">
+ <option value="onoff"
+ py:attrs="(not cur_fencedev or not cur_fencedev.getAttribute('method')) and {'selected':'selected'} or {}">onoff</option>
+ <option value="cycle"
+ py:attrs="cur_fencedev and cur_fencedev.getAttribute('method') == 'cycle' and {'selected':'selected'} or {}">cycle</option>
+ </select>
+ </td>
+ </tr>
</table>
<py:if test="cur_fencedev">
@@ -2950,6 +2972,17 @@
py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('delay')}"/>
</td>
</tr>
+ <tr>
+ <td>Method to Fence</td>
+ <td>
+ <select name="method">
+ <option value="onoff"
+ py:attrs="(not cur_fencedev or not cur_fencedev.getAttribute('method')) and {'selected':'selected'} or {}">onoff</option>
+ <option value="cycle"
+ py:attrs="cur_fencedev and cur_fencedev.getAttribute('method') == 'cycle' and {'selected':'selected'} or {}">cycle</option>
+ </select>
+ </td>
+ </tr>
</table>
<py:if test="cur_fencedev">
@@ -3073,6 +3106,17 @@
py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('delay')}"/>
</td>
</tr>
+ <tr>
+ <td>Method to Fence</td>
+ <td>
+ <select name="method">
+ <option value="onoff"
+ py:attrs="(not cur_fencedev or not cur_fencedev.getAttribute('method')) and {'selected':'selected'} or {}">onoff</option>
+ <option value="cycle"
+ py:attrs="cur_fencedev and cur_fencedev.getAttribute('method') == 'cycle' and {'selected':'selected'} or {}">cycle</option>
+ </select>
+ </td>
+ </tr>
</table>
<py:if test="cur_fencedev">
@@ -3196,6 +3240,17 @@
py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('delay')}"/>
</td>
</tr>
+ <tr>
+ <td>Method to Fence</td>
+ <td>
+ <select name="method">
+ <option value="onoff"
+ py:attrs="(not cur_fencedev or not cur_fencedev.getAttribute('method')) and {'selected':'selected'} or {}">onoff</option>
+ <option value="cycle"
+ py:attrs="cur_fencedev and cur_fencedev.getAttribute('method') == 'cycle' and {'selected':'selected'} or {}">cycle</option>
+ </select>
+ </td>
+ </tr>
</table>
<py:if test="cur_fencedev">
diff --git a/luci/validation/validate_fence.py b/luci/validation/validate_fence.py
index 2236670..a3f27bd 100644
--- a/luci/validation/validate_fence.py
+++ b/luci/validation/validate_fence.py
@@ -510,6 +510,7 @@ def val_ipmilan_fd(fencedev, fence_name, **kw):
('privlvl', False),
('timeout', False),
('power_wait', False),
+ ('method', False),
('delay', False),
)
7 years, 5 months
[luci] luci: Fix cluster shutdown action
by Ryan McCabe
commit 0a937d3eaef154340eef7e1dba084d45aeb530b7
Author: Ryan McCabe <rmccabe(a)redhat.com>
Date: Thu Nov 3 09:50:20 2016 -0400
luci: Fix cluster shutdown action
When stopping all nodes in a cluster, first disable all
services to prevent services bouncing around and potentially hanging
due to loss of quorum.
Resolves: rhbz#1316970
Signed-off-by: Ryan McCabe <rmccabe(a)redhat.com>
luci/controllers/cluster.py | 17 +++++++++++------
1 files changed, 11 insertions(+), 6 deletions(-)
---
diff --git a/luci/controllers/cluster.py b/luci/controllers/cluster.py
index c8afce5..dff875a 100644
--- a/luci/controllers/cluster.py
+++ b/luci/controllers/cluster.py
@@ -450,12 +450,17 @@ class IndividualClusterController(BaseController):
except NotAuthorizedError, e:
flash(e, status="warning")
redirect(tmpl_context.cluster_url)
-
- log.info('User "%s" stopped nodes "%s" in cluster "%s"'
- % (self.username, ', '.join(cur_list), self.name))
- flash(_("Stopping nodes: %s") % ', '.join(cur_list),
- status='info')
- rh.cluster_node_stop(self.name, cur_list)
+ if len(cur_list) == len(self.model.getNodes()):
+ log.info('User "%s" stopped all nodes in cluster "%s"'
+ % (self.username, self.name))
+ flash(_("Stopping all nodes"), status='info')
+ rh.cluster_stop(self.name)
+ else:
+ log.info('User "%s" stopped nodes "%s" in cluster "%s"'
+ % (self.username, ', '.join(cur_list), self.name))
+ flash(_("Stopping nodes: %s") % ', '.join(cur_list),
+ status='info')
+ rh.cluster_node_stop(self.name, cur_list)
elif command == 'Delete':
try:
permission_membership(self.name)
7 years, 6 months
[luci] luci: Add support for Oracle Data Guard resources
by Ryan McCabe
commit dd9ec976e0faf2c46ff864c571dca32df1ddb14b
Author: Ryan McCabe <rmccabe(a)redhat.com>
Date: Wed Nov 2 15:38:34 2016 -0400
luci: Add support for Oracle Data Guard resources
Add support for Oracle Data Guard resources.
Resolves: rhbz#1316952
Signed-off-by: Ryan McCabe <rmccabe(a)redhat.com>
luci/lib/ClusterConf/ModelBuilder.py | 3 +-
luci/lib/ClusterConf/OraDG.py | 18 +++++++++
luci/templates/resource_list.html | 67 ++++++++++++++++++++++++++++++++++
luci/validation/validate_resource.py | 14 +++++++
4 files changed, 101 insertions(+), 1 deletions(-)
---
diff --git a/luci/lib/ClusterConf/ModelBuilder.py b/luci/lib/ClusterConf/ModelBuilder.py
index a73dfd0..e53d3c5 100644
--- a/luci/lib/ClusterConf/ModelBuilder.py
+++ b/luci/lib/ClusterConf/ModelBuilder.py
@@ -65,7 +65,7 @@ import Event
import Ip, Script, NFSClient, NFSExport, NFSServer, Fs, Samba, Smb, Apache, \
Named, Condor, DRBD, LVM, MySQL, OpenLDAP, Postgres8, Tomcat5, \
Tomcat6, SAPDatabase, SAPInstance, SybaseASE, Netfs, Clusterfs, \
- OracleDB, OracleListener, OracleInstance, BindMount
+ OracleDB, OracleListener, OracleInstance, BindMount, OraDG
# Children of resource types
import Action
@@ -133,6 +133,7 @@ TAGNAMES = {
OracleDB.TAG_NAME: OracleDB.OracleDB,
OracleListener.TAG_NAME: OracleListener.OracleListener,
OracleInstance.TAG_NAME: OracleInstance.OracleInstance,
+ OraDG.TAG_NAME: OraDG.OraDG,
BindMount.TAG_NAME: BindMount.BindMount,
Action.TAG_NAME: Action.Action,
}
diff --git a/luci/lib/ClusterConf/OraDG.py b/luci/lib/ClusterConf/OraDG.py
new file mode 100644
index 0000000..c39b704
--- /dev/null
+++ b/luci/lib/ClusterConf/OraDG.py
@@ -0,0 +1,18 @@
+# Copyright (C) 2016 Red Hat, Inc.
+#
+# This program is free software; you can redistribute
+# it and/or modify it under the terms of version 2 of the
+# GNU General Public License as published by the
+# Free Software Foundation.
+
+from BaseResource import BaseResource
+from gettext import gettext as _
+
+TAG_NAME = 'oradg'
+RESOURCE_TYPE = _('Oracle Data Guard Failover Instance')
+
+class OraDG(BaseResource):
+ def __init__(self):
+ BaseResource.__init__(self)
+ self.TAG_NAME = TAG_NAME
+ self.resource_type = RESOURCE_TYPE
diff --git a/luci/templates/resource_list.html b/luci/templates/resource_list.html
index ae489e8..bc11496 100644
--- a/luci/templates/resource_list.html
+++ b/luci/templates/resource_list.html
@@ -1911,6 +1911,71 @@
</table>
</div>
+<div py:def="oradg_resource(res, form_id, parent_id, isref)" name="oradg" id="oradg_resource" class="row rescfg"
+ py:with="global_resource = res and isref != 0"
+ py:attrs="res and {'id': 'global_res_%s' % res.getName(), 'name': res.getName()}">
+ <input name="global" type="hidden" value="1" py:if="global_resource"/>
+ <input name="parent_id" type="hidden" value="${parent_id}"/>
+ <input name="form_id" type="hidden" value="${form_id}"/>
+ <input name="oldname" type="hidden"
+ py:attrs="res and {'value':res.getAttribute('name')} or {}" />
+ <input name="type" type="hidden" value="oradg" />
+
+ <h3>Oracle Data Guard Failover Instance</h3>
+ <table class="formtable">
+ <tr>
+ <td>Instance Name (SID) of Oracle Instance</td>
+ <td>
+ <input type="text" class="text" name="resourcename"
+ py:attrs="res and {'value':res.getAttribute('name'), 'disabled':global_resource and 'disabled' or None} or {}" />
+ </td>
+ </tr>
+ <tr>
+ <td>Oracle User Name</td>
+ <td>
+ <input type="text" class="text" name="user"
+ py:attrs="res and {'value':res.getAttribute('user'), 'disabled':global_resource and 'disabled' or None} or {}" />
+ </td>
+ </tr>
+ <tr>
+ <td>Oracle Application Home Directory</td>
+ <td>
+ <input type="text" class="text" name="home"
+ py:attrs="res and {'value':res.getAttribute('home'), 'disabled':global_resource and 'disabled' or None} or {}" />
+ </td>
+ </tr>
+ <tr>
+ <td>List of Oracle Listeners (optional, separated by spaces)</td>
+ <td>
+ <input type="text" class="text" name="listeners"
+ py:attrs="res and {'value':res.getAttribute('listeners'), 'disabled':global_resource and 'disabled' or None} or {}" />
+ </td>
+ </tr>
+ <tr>
+ <td>Virtual Hostname (optional)</td>
+ <td>
+ <input type="text" class="text" name="vhost"
+ py:attrs="res and {'value':res.getAttribute('vhost'), 'disabled':global_resource and 'disabled' or None} or {}" />
+ </td>
+ </tr>
+ <tr>
+ <td>Path to Lock File (optional)</td>
+ <td>
+ <input type="text" class="text" name="lockfile"
+ py:attrs="res and {'value':res.getAttribute('lockfile'), 'disabled':global_resource and 'disabled' or None} or {}" />
+ </td>
+ </tr>
+ <tr>
+ <td>TNS_ADMIN (path to tnsnames.ora) (optional)</td>
+ <td>
+ <input type="text" class="text" name="tns_admin"
+ py:attrs="res and {'value':res.getAttribute('tns_admin'), 'disabled':global_resource and 'disabled' or None} or {}" />
+ </td>
+ </tr>
+ ${res_footer(res)}
+ </table>
+</div>
+
<div py:def="resource_container(model)" id="resource_container" class="hidden">
${ip_resource(None,None,None,0)}
${fs_resource(None,None,None,0)}
@@ -1940,6 +2005,7 @@ ${drbd_resource(None,None,None,0)}
${vm_resource(None,None,None,0)}
${condor_resource(None,None,None,0)}
${bindmount_resource(None,None,None,0)}
+${oradg_resource(None,None,None,0)}
<py:if test="model">
<py:for each="res in model.getResources()">
@@ -2003,6 +2069,7 @@ ${bindmount_resource(None,None,None,0)}
<option name="oracledb_resource" value="oracledb_resource">Oracle 10g/11g Failover Instance</option>
<option name="orainstance_resource" value="orainstance_resource">Oracle 10g/11g Instance</option>
<option name="oralistener_resource" value="oralistener_resource">Oracle 10g/11g Listener</option>
+ <option name="oradg_resource" value="oradg_resource">Oracle Data Guard Instance</option>
<option name="openldap_resource" value="openldap_resource">Open LDAP</option>
<option name="postgres8_resource" value="postgres8_resource">PostgreSQL 8</option>
<option name="SAPDatabase_resource" value="SAPDatabase_resource">SAP Database</option>
diff --git a/luci/validation/validate_resource.py b/luci/validation/validate_resource.py
index 9611180..b2519ca 100644
--- a/luci/validation/validate_resource.py
+++ b/luci/validation/validate_resource.py
@@ -36,6 +36,7 @@ from luci.lib.ClusterConf.RefObject import RefObject
from luci.lib.ClusterConf.OracleInstance import OracleInstance
from luci.lib.ClusterConf.OracleListener import OracleListener
from luci.lib.ClusterConf.BindMount import BindMount
+from luci.lib.ClusterConf.OraDG import OraDG
from luci.lib.helpers import ugettext as _
from xml.dom import minidom
@@ -533,6 +534,18 @@ def addOracleListener(res, rname, model, **kw):
errors = config_resource(params, res, rname, **kw)
return errors
+def addOraDG(res, rname, model, **kw):
+ params = (
+ ('user', _('Oracle User Name'), True, None),
+ ('home', _('Oracle Home Directory'), True, None),
+ ('listeners', _('Oracle listeners'), False, None),
+ ('vhost', _('Virtual Hostname'), False, None),
+ ('lockfile', _('Path to lock file'), False, None),
+ ('tns_admin', _('Value for TNS_ADMIN'), False, None),
+ )
+ errors = config_resource(params, res, rname, **kw)
+ return errors
+
def addNamed(res, rname, model, **kw):
params = (
('config_file', _('named config file'), False, None),
@@ -594,6 +607,7 @@ resource_table = {
'oracledb': ( addOracleDB, OracleDB ),
'orainstance': ( addOracleInstance, OracleInstance ),
'oralistener': ( addOracleListener, OracleListener ),
+ 'oradg': ( addOraDG, OraDG ),
'ASEHAagent': ( addSybaseASE, SybaseASE ),
'named': ( addNamed, Named ),
'drbd': ( addDRBD, DRBD ),
7 years, 6 months
[luci] luci: Add support for fence_ilo_ssh fence devices
by Ryan McCabe
commit 28e940b54633804e54f72ade75db1c0291e95e2f
Author: Ryan McCabe <rmccabe(a)redhat.com>
Date: Wed Nov 2 13:51:47 2016 -0400
luci: Add support for fence_ilo_ssh fence devices
Add support for fence_ilo_ssh, fence_ilo3_ssh, and fence_ilo4_ssh fence devices.
Resolves: rhbz#1337718
Signed-off-by: Ryan McCabe <rmccabe(a)redhat.com>
luci/lib/ClusterConf/FenceDeviceAttr.py | 6 +
luci/templates/fence_devices.html | 441 +++++++++++++++++++++++++++++++
luci/templates/fence_instances.html | 33 +++
luci/validation/validate_fence.py | 29 ++
4 files changed, 509 insertions(+), 0 deletions(-)
---
diff --git a/luci/lib/ClusterConf/FenceDeviceAttr.py b/luci/lib/ClusterConf/FenceDeviceAttr.py
index 570589d..2f6469b 100644
--- a/luci/lib/ClusterConf/FenceDeviceAttr.py
+++ b/luci/lib/ClusterConf/FenceDeviceAttr.py
@@ -33,6 +33,9 @@ FENCE_OPTS = {
'fence_ilo3': 'HP iLO3 Device',
'fence_ilo4': 'HP iLO4 Device',
'fence_ilo_moonshot': 'HP Moonshot iLO Device',
+ 'fence_ilo_ssh': 'HP iLO Device Over SSH',
+ 'fence_ilo3_ssh': 'HP iLO3 Device Over SSH',
+ 'fence_ilo4_ssh': 'HP iLO4 Device Over SSH',
'fence_ipmilan': 'IPMI Lan',
'fence_idrac': 'Dell iDRAC',
'fence_imm': 'IBM Integrated Management Module',
@@ -101,6 +104,9 @@ FENCE_SHARED = {
'fence_ilo3': False,
'fence_ilo4': False,
'fence_ilo_moonshot': False,
+ 'fence_ilo_ssh': False,
+ 'fence_ilo3_ssh': False,
+ 'fence_ilo4_ssh': False,
'fence_ilo_mp': False,
'fence_ipmilan': False,
'fence_idrac': False,
diff --git a/luci/templates/fence_devices.html b/luci/templates/fence_devices.html
index 8b2969a..e776b92 100644
--- a/luci/templates/fence_devices.html
+++ b/luci/templates/fence_devices.html
@@ -5213,6 +5213,441 @@
<input type="hidden" name="fence_type" value="fence_ilo_moonshot" />
</div>
+<div py:def="fence_ilo_ssh(cur_fencedev, ni)" id="fence_ilo_ssh" class="fencedevform row"
+ py:attrs="cur_fencedev and {'id': 'fd_%s' % cur_fencedev.getName()}">
+ <table class="formtable">
+ <tr>
+ <td>Fence Type</td>
+ <td>HP iLO over SSH</td>
+ </tr>
+ <tr>
+ <td>Name</td>
+ <td>
+ <input name="name" type="text" class="text"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getName()} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>IP Address or Hostname</td>
+ <td>
+ <input name="ipaddr" type="text" class="text"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('ipaddr')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Login</td>
+ <td>
+ <input name="login" type="text" class="text"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('login')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Password</td>
+ <td>
+ <input name="passwd" type="password" class="text" autocomplete="off"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('passwd')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <span title="Full path to a script to generate fence password">Password Script (optional)</span>
+ </td>
+ <td>
+ <input type="text" class="text" name="passwd_script"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('passwd_script')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>SSH</td>
+ <td>
+ <input type="checkbox" class="checkbox" name="secure"
+ py:attrs="(not cur_fencedev or (cur_fencedev and cur_fencedev.getAttribute('secure'))) and {'checked': 'checked'}"/>
+ <label class="choice">Use SSH</label>
+ </td>
+ </tr>
+ <tr py:if="0">
+ <td>SSH Options</td>
+ <td>
+ <input type="text" class="text" name="ssh_options"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('ssh_options')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Path to SSH Identity File</td>
+ <td>
+ <input type="text" class="text" name="identity_file"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('identity_file')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>TCP Port</td>
+ <td>
+ <input type="text" class="text" name="ipport"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('ipport')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Force Command Prompt</td>
+ <td>
+ <input type="text" class="text" name="cmd_prompt"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('cmd_prompt')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Method to Fence</td>
+ <td>
+ <select name="method">
+ <option value="onoff"
+ py:attrs="(not cur_fencedev or not cur_fencedev.getAttribute('method')) and {'selected':'selected'} or {}">onoff</option>
+ <option value="cycle"
+ py:attrs="cur_fencedev and cur_fencedev.getAttribute('method') == 'cycle' and {'selected':'selected'} or {}">cycle</option>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td>Power Wait (seconds)</td>
+ <td>
+ <input type="text" class="text" name="power_wait"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_wait')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Delay (seconds)</td>
+ <td>
+ <input name="delay" type="text" class="text"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('delay')}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Power Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="power_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Shell Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="shell_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('shell_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Login Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="login_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('login_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Times to Retry Power On Operation</td>
+ <td>
+ <input type="text" class="text" name="retry_on"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('retry_on')} or {}"/>
+ </td>
+ </tr>
+ </table>
+
+ <py:if test="cur_fencedev">
+ <input type="hidden"
+ name="orig_name" value="${cur_fencedev.getName()}"/>
+ <input type="hidden"
+ name="existing_device" value="1" />
+ </py:if>
+
+ <input type="hidden" name="fence_type" value="fence_ilo_ssh" />
+</div>
+
+<div py:def="fence_ilo3_ssh(cur_fencedev, ni)" id="fence_ilo3_ssh" class="fencedevform row"
+ py:attrs="cur_fencedev and {'id': 'fd_%s' % cur_fencedev.getName()}">
+ <table class="formtable">
+ <tr>
+ <td>Fence Type</td>
+ <td>HP iLO3 over SSH</td>
+ </tr>
+ <tr>
+ <td>Name</td>
+ <td>
+ <input name="name" type="text" class="text"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getName()} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>IP Address or Hostname</td>
+ <td>
+ <input name="ipaddr" type="text" class="text"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('ipaddr')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Login</td>
+ <td>
+ <input name="login" type="text" class="text"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('login')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Password</td>
+ <td>
+ <input name="passwd" type="password" class="text" autocomplete="off"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('passwd')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <span title="Full path to a script to generate fence password">Password Script (optional)</span>
+ </td>
+ <td>
+ <input type="text" class="text" name="passwd_script"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('passwd_script')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>SSH</td>
+ <td>
+ <input type="checkbox" class="checkbox" name="secure"
+ py:attrs="(not cur_fencedev or (cur_fencedev and cur_fencedev.getAttribute('secure'))) and {'checked': 'checked'}"/>
+ <label class="choice">Use SSH</label>
+ </td>
+ </tr>
+ <tr py:if="0">
+ <td>SSH Options</td>
+ <td>
+ <input type="text" class="text" name="ssh_options"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('ssh_options')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Path to SSH Identity File</td>
+ <td>
+ <input type="text" class="text" name="identity_file"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('identity_file')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>TCP Port</td>
+ <td>
+ <input type="text" class="text" name="ipport"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('ipport')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Force Command Prompt</td>
+ <td>
+ <input type="text" class="text" name="cmd_prompt"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('cmd_prompt')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Method to Fence</td>
+ <td>
+ <select name="method">
+ <option value="onoff"
+ py:attrs="(not cur_fencedev or not cur_fencedev.getAttribute('method')) and {'selected':'selected'} or {}">onoff</option>
+ <option value="cycle"
+ py:attrs="cur_fencedev and cur_fencedev.getAttribute('method') == 'cycle' and {'selected':'selected'} or {}">cycle</option>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td>Power Wait (seconds)</td>
+ <td>
+ <input type="text" class="text" name="power_wait"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_wait')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Delay (seconds)</td>
+ <td>
+ <input name="delay" type="text" class="text"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('delay')}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Power Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="power_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Shell Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="shell_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('shell_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Login Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="login_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('login_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Times to Retry Power On Operation</td>
+ <td>
+ <input type="text" class="text" name="retry_on"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('retry_on')} or {}"/>
+ </td>
+ </tr>
+ </table>
+
+ <py:if test="cur_fencedev">
+ <input type="hidden"
+ name="orig_name" value="${cur_fencedev.getName()}"/>
+ <input type="hidden"
+ name="existing_device" value="1" />
+ </py:if>
+
+ <input type="hidden" name="fence_type" value="fence_ilo3_ssh" />
+</div>
+
+<div py:def="fence_ilo4_ssh(cur_fencedev, ni)" id="fence_ilo4_ssh" class="fencedevform row"
+ py:attrs="cur_fencedev and {'id': 'fd_%s' % cur_fencedev.getName()}">
+ <table class="formtable">
+ <tr>
+ <td>Fence Type</td>
+ <td>HP iLO4 over SSH</td>
+ </tr>
+ <tr>
+ <td>Name</td>
+ <td>
+ <input name="name" type="text" class="text"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getName()} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>IP Address or Hostname</td>
+ <td>
+ <input name="ipaddr" type="text" class="text"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('ipaddr')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Login</td>
+ <td>
+ <input name="login" type="text" class="text"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('login')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Password</td>
+ <td>
+ <input name="passwd" type="password" class="text" autocomplete="off"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('passwd')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <span title="Full path to a script to generate fence password">Password Script (optional)</span>
+ </td>
+ <td>
+ <input type="text" class="text" name="passwd_script"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('passwd_script')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>SSH</td>
+ <td>
+ <input type="checkbox" class="checkbox" name="secure"
+ py:attrs="(not cur_fencedev or (cur_fencedev and cur_fencedev.getAttribute('secure'))) and {'checked': 'checked'}"/>
+ <label class="choice">Use SSH</label>
+ </td>
+ </tr>
+ <tr py:if="0">
+ <td>SSH Options</td>
+ <td>
+ <input type="text" class="text" name="ssh_options"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('ssh_options')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Path to SSH Identity File</td>
+ <td>
+ <input type="text" class="text" name="identity_file"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('identity_file')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>TCP Port</td>
+ <td>
+ <input type="text" class="text" name="ipport"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('ipport')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Force Command Prompt</td>
+ <td>
+ <input type="text" class="text" name="cmd_prompt"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('cmd_prompt')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Method to Fence</td>
+ <td>
+ <select name="method">
+ <option value="onoff"
+ py:attrs="(not cur_fencedev or not cur_fencedev.getAttribute('method')) and {'selected':'selected'} or {}">onoff</option>
+ <option value="cycle"
+ py:attrs="cur_fencedev and cur_fencedev.getAttribute('method') == 'cycle' and {'selected':'selected'} or {}">cycle</option>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td>Power Wait (seconds)</td>
+ <td>
+ <input type="text" class="text" name="power_wait"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_wait')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Delay (seconds)</td>
+ <td>
+ <input name="delay" type="text" class="text"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('delay')}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Power Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="power_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Shell Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="shell_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('shell_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Login Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="login_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('login_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Times to Retry Power On Operation</td>
+ <td>
+ <input type="text" class="text" name="retry_on"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('retry_on')} or {}"/>
+ </td>
+ </tr>
+ </table>
+
+ <py:if test="cur_fencedev">
+ <input type="hidden"
+ name="orig_name" value="${cur_fencedev.getName()}"/>
+ <input type="hidden"
+ name="existing_device" value="1" />
+ </py:if>
+
+ <input type="hidden" name="fence_type" value="fence_ilo4_ssh" />
+</div>
+
<div py:def="fence_device_container" id="fence_device_container" class="hidden">
${fence_apc(None,0)}
${fence_apc_snmp(None,0)}
@@ -5239,6 +5674,9 @@ ${fence_ilo2(None,0)}
${fence_ilo3(None,0)}
${fence_ilo4(None,0)}
${fence_ilo_moonshot(None,0)}
+${fence_ilo_ssh(None,0)}
+${fence_ilo3_ssh(None,0)}
+${fence_ilo4_ssh(None,0)}
${fence_drac(None,0)}
${fence_rsa(None,0)}
${fence_rsb(None,0)}
@@ -5327,6 +5765,9 @@ ${fence_unknown(None,0)}
<option name="fence_ilo4" value="fence_ilo4">HP iLO4 Device</option>
<option name="fence_ilo_moonshot" value="fence_ilo_moonshot">HP Moonshot iLO Device</option>
<option name="fence_ilo_mp" value="fence_ilo_mp">HP iLO MP</option> <!-- needs work -->
+ <option name="fence_ilo_ssh" value="fence_ilo_ssh">HP iLO Device over SSH</option>
+ <option name="fence_ilo3_ssh" value="fence_ilo3_ssh">HP iLO3 Device over SSH</option>
+ <option name="fence_ilo4_ssh" value="fence_ilo4_ssh">HP iLO4 Device over SSH</option>
<option name="fence_bladecenter" value="fence_bladecenter">IBM BladeCenter</option>
<option py:if="cluster_version == 3" name="fence_ibmblade" value="fence_ibmblade">IBM BladeCenter SNMP</option>
<option name="fence_imm" value="fence_imm">IBM Integrated Management Module</option>
diff --git a/luci/templates/fence_instances.html b/luci/templates/fence_instances.html
index efef7cd..25e6e18 100644
--- a/luci/templates/fence_instances.html
+++ b/luci/templates/fence_instances.html
@@ -1000,6 +1000,36 @@
py:attrs="cur_fence_dev_id and {'value': cur_fence_dev_id} or {}" />
</div>
+<div py:def="fence_ilo_ssh_instance(cur_fence_inst, cur_fence_dev_id, fi_id, **kw)" id="fence_ilo_ssh_instance"
+ py:attrs="fi_id is not None and {'id': fi_id, 'class':'fenceinst'}">
+
+ <div class="emptyfenceinst">No additional parameters</div>
+ <input type="hidden" name="fence_type" value="fence_ilo_ssh" />
+ <input type="hidden" name="fence_instance" value="1" />
+ <input type="hidden" name="parent_fencedev"
+ py:attrs="cur_fence_dev_id and {'value': cur_fence_dev_id} or {}" />
+</div>
+
+<div py:def="fence_ilo3_ssh_instance(cur_fence_inst, cur_fence_dev_id, fi_id, **kw)" id="fence_ilo3_ssh_instance"
+ py:attrs="fi_id is not None and {'id': fi_id, 'class':'fenceinst'}">
+
+ <div class="emptyfenceinst">No additional parameters</div>
+ <input type="hidden" name="fence_type" value="fence_ilo3_ssh" />
+ <input type="hidden" name="fence_instance" value="1" />
+ <input type="hidden" name="parent_fencedev"
+ py:attrs="cur_fence_dev_id and {'value': cur_fence_dev_id} or {}" />
+</div>
+
+<div py:def="fence_ilo4_ssh_instance(cur_fence_inst, cur_fence_dev_id, fi_id, **kw)" id="fence_ilo4_ssh_instance"
+ py:attrs="fi_id is not None and {'id': fi_id, 'class':'fenceinst'}">
+
+ <div class="emptyfenceinst">No additional parameters</div>
+ <input type="hidden" name="fence_type" value="fence_ilo4_ssh" />
+ <input type="hidden" name="fence_instance" value="1" />
+ <input type="hidden" name="parent_fencedev"
+ py:attrs="cur_fence_dev_id and {'value': cur_fence_dev_id} or {}" />
+</div>
+
<div py:def="fence_ilo3_instance(cur_fence_inst, cur_fence_dev_id, fi_id, **kw)" id="fence_ilo3_instance"
py:attrs="fi_id is not None and {'id': fi_id, 'class':'fenceinst'}">
@@ -1346,6 +1376,9 @@ ${fence_ilo3_instance(None, None, None)}
${fence_ilo4_instance(None, None, None)}
${fence_ilo_moonshot_instance(None, None, None)}
${fence_ilo_mp_instance(None, None, None)}
+${fence_ilo_ssh_instance(None, None, None)}
+${fence_ilo3_ssh_instance(None, None, None)}
+${fence_ilo4_ssh_instance(None, None, None)}
${fence_rsa_instance(None, None, None)}
${fence_ipmilan_instance(None, None, None)}
${fence_kdump_instance(None, None, None, nodename=nodename)}
diff --git a/luci/validation/validate_fence.py b/luci/validation/validate_fence.py
index ad08e0a..2236670 100644
--- a/luci/validation/validate_fence.py
+++ b/luci/validation/validate_fence.py
@@ -844,6 +844,29 @@ def val_ilo_moonshot_fd(fencedev, fence_name, **kw):
errors = config_fence_attr(params, fencedev, fence_name, **kw)
return errors
+def val_ilo_ssh_fd(fencedev, fence_name, **kw):
+ params = (
+ ('ipaddr', True),
+ ('login', True),
+ ('ipport', False),
+ ('passwd', False),
+ ('passwd_script', False),
+ ('cmd_prompt', False),
+ ('power_wait', False),
+ ('delay', False),
+ ('power_timeout', False),
+ ('shell_timeout', False),
+ ('login_timeout', False),
+ ('retry_on', False),
+ ('secure', False),
+ ('method', False),
+# ('ssh_options', False),
+ ('identity_file', False),
+ )
+
+ errors = config_fence_attr(params, fencedev, fence_name, **kw)
+ return errors
+
def val_ipdu_fd(fencedev, fence_name, **kw):
params = (
('ipaddr', True),
@@ -935,6 +958,9 @@ FD_VALIDATE = {
'fence_ilo3': val_ipmilan_fd,
'fence_ilo4': val_ipmilan_fd,
'fence_ilo_moonshot': val_ilo_moonshot_fd,
+ 'fence_ilo_ssh': val_ilo_ssh_fd,
+ 'fence_ilo3_ssh': val_ilo_ssh_fd,
+ 'fence_ilo4_ssh': val_ilo_ssh_fd,
'fence_intelmodular': val_intelmodular_fd,
'fence_ipdu': val_ipdu_fd,
'fence_ipmilan': val_ipmilan_fd,
@@ -1369,6 +1395,9 @@ FI_VALIDATE = {
'fence_ilo3': val_noop_fi,
'fence_ilo4': val_noop_fi,
'fence_ilo_moonshot': val_noop_fi,
+ 'fence_ilo_ssh': val_noop_fi,
+ 'fence_ilo3_ssh': val_noop_fi,
+ 'fence_ilo4_ssh': val_noop_fi,
'fence_intelmodular': val_intelmodular_fi,
'fence_ipmilan': val_noop_fi,
'fence_kdump': val_kdump_fi,
7 years, 6 months
[luci] luci: Suport fence_ilo_moonshot
by Ryan McCabe
commit c47ced9645668a26e4a8a277b54a479adf626008
Author: Ryan McCabe <rmccabe(a)redhat.com>
Date: Wed Nov 2 10:42:21 2016 -0400
luci: Suport fence_ilo_moonshot
Add support for the fence_ilo_moonshot fence device
Resolves: rhbz#1337718
Signed-off-by: Ryan McCabe <rmccabe(a)redhat.com>
luci/lib/ClusterConf/FenceDeviceAttr.py | 2 +
luci/templates/fence_devices.html | 136 +++++++++++++++++++++++++++++++
luci/templates/fence_instances.html | 11 +++
luci/validation/validate_fence.py | 24 ++++++
4 files changed, 173 insertions(+), 0 deletions(-)
---
diff --git a/luci/lib/ClusterConf/FenceDeviceAttr.py b/luci/lib/ClusterConf/FenceDeviceAttr.py
index 6de49b8..570589d 100644
--- a/luci/lib/ClusterConf/FenceDeviceAttr.py
+++ b/luci/lib/ClusterConf/FenceDeviceAttr.py
@@ -32,6 +32,7 @@ FENCE_OPTS = {
'fence_ilo2': 'HP iLO2 Device',
'fence_ilo3': 'HP iLO3 Device',
'fence_ilo4': 'HP iLO4 Device',
+ 'fence_ilo_moonshot': 'HP Moonshot iLO Device',
'fence_ipmilan': 'IPMI Lan',
'fence_idrac': 'Dell iDRAC',
'fence_imm': 'IBM Integrated Management Module',
@@ -99,6 +100,7 @@ FENCE_SHARED = {
'fence_ilo2': False,
'fence_ilo3': False,
'fence_ilo4': False,
+ 'fence_ilo_moonshot': False,
'fence_ilo_mp': False,
'fence_ipmilan': False,
'fence_idrac': False,
diff --git a/luci/templates/fence_devices.html b/luci/templates/fence_devices.html
index ffbe295..8b2969a 100644
--- a/luci/templates/fence_devices.html
+++ b/luci/templates/fence_devices.html
@@ -5079,6 +5079,140 @@
<input type="hidden" name="fence_type" value="fence_hpblade" />
</div>
+<div py:def="fence_ilo_moonshot(cur_fencedev, ni)" id="fence_ilo_moonshot" class="fencedevform row"
+ py:attrs="cur_fencedev and {'id': 'fd_%s' % cur_fencedev.getName()}">
+ <table class="formtable">
+ <tr>
+ <td>Fence Type</td>
+ <td>HP Moonshot iLO</td>
+ </tr>
+ <tr>
+ <td>Name</td>
+ <td>
+ <input name="name" type="text" class="text"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getName()} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>IP Address or Hostname</td>
+ <td>
+ <input name="ipaddr" type="text" class="text"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('ipaddr')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Login</td>
+ <td>
+ <input name="login" type="text" class="text"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('login')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Password</td>
+ <td>
+ <input name="passwd" type="password" class="text" autocomplete="off"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('passwd')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <span title="Full path to a script to generate fence password">Password Script (optional)</span>
+ </td>
+ <td>
+ <input type="text" class="text" name="passwd_script"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('passwd_script')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>SSH</td>
+ <td>
+ <input type="checkbox" class="checkbox" name="secure"
+ py:attrs="cur_fencedev and cur_fencedev.getAttribute('secure') and {'checked': 'checked'}"/>
+ <label class="choice">Use SSH</label>
+ </td>
+ </tr>
+ <tr py:if="0">
+ <td>SSH Options</td>
+ <td>
+ <input type="text" class="text" name="ssh_options"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('ssh_options')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Path to SSH Identity File</td>
+ <td>
+ <input type="text" class="text" name="identity_file"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('identity_file')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>TCP Port</td>
+ <td>
+ <input type="text" class="text" name="ipport"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('ipport')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Force Command Prompt</td>
+ <td>
+ <input type="text" class="text" name="cmd_prompt"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('cmd_prompt')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Power Wait (seconds)</td>
+ <td>
+ <input type="text" class="text" name="power_wait"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_wait')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Delay (seconds)</td>
+ <td>
+ <input name="delay" type="text" class="text"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('delay')}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Power Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="power_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('power_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Shell Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="shell_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('shell_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Login Timeout (seconds)</td>
+ <td>
+ <input type="text" class="text" name="login_timeout"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('login_timeout')} or {}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>Times to Retry Power On Operation</td>
+ <td>
+ <input type="text" class="text" name="retry_on"
+ py:attrs="cur_fencedev and {'value': cur_fencedev.getAttribute('retry_on')} or {}"/>
+ </td>
+ </tr>
+ </table>
+
+ <py:if test="cur_fencedev">
+ <input type="hidden"
+ name="orig_name" value="${cur_fencedev.getName()}"/>
+ <input type="hidden"
+ name="existing_device" value="1" />
+ </py:if>
+
+ <input type="hidden" name="fence_type" value="fence_ilo_moonshot" />
+</div>
+
<div py:def="fence_device_container" id="fence_device_container" class="hidden">
${fence_apc(None,0)}
${fence_apc_snmp(None,0)}
@@ -5104,6 +5238,7 @@ ${fence_ilo(None,0)}
${fence_ilo2(None,0)}
${fence_ilo3(None,0)}
${fence_ilo4(None,0)}
+${fence_ilo_moonshot(None,0)}
${fence_drac(None,0)}
${fence_rsa(None,0)}
${fence_rsb(None,0)}
@@ -5190,6 +5325,7 @@ ${fence_unknown(None,0)}
<option name="fence_ilo2" value="fence_ilo2">HP iLO2 Device</option>
<option name="fence_ilo3" value="fence_ilo3">HP iLO3 Device</option>
<option name="fence_ilo4" value="fence_ilo4">HP iLO4 Device</option>
+ <option name="fence_ilo_moonshot" value="fence_ilo_moonshot">HP Moonshot iLO Device</option>
<option name="fence_ilo_mp" value="fence_ilo_mp">HP iLO MP</option> <!-- needs work -->
<option name="fence_bladecenter" value="fence_bladecenter">IBM BladeCenter</option>
<option py:if="cluster_version == 3" name="fence_ibmblade" value="fence_ibmblade">IBM BladeCenter SNMP</option>
diff --git a/luci/templates/fence_instances.html b/luci/templates/fence_instances.html
index 12315c1..efef7cd 100644
--- a/luci/templates/fence_instances.html
+++ b/luci/templates/fence_instances.html
@@ -990,6 +990,16 @@
py:attrs="cur_fence_dev_id and {'value': cur_fence_dev_id} or {}" />
</div>
+<div py:def="fence_ilo_moonshot_instance(cur_fence_inst, cur_fence_dev_id, fi_id, **kw)" id="fence_ilo_moonshot_instance"
+ py:attrs="fi_id is not None and {'id': fi_id, 'class':'fenceinst'}">
+
+ <div class="emptyfenceinst">No additional parameters</div>
+ <input type="hidden" name="fence_type" value="fence_ilo_moonshot" />
+ <input type="hidden" name="fence_instance" value="1" />
+ <input type="hidden" name="parent_fencedev"
+ py:attrs="cur_fence_dev_id and {'value': cur_fence_dev_id} or {}" />
+</div>
+
<div py:def="fence_ilo3_instance(cur_fence_inst, cur_fence_dev_id, fi_id, **kw)" id="fence_ilo3_instance"
py:attrs="fi_id is not None and {'id': fi_id, 'class':'fenceinst'}">
@@ -1334,6 +1344,7 @@ ${fence_ilo_instance(None, None, None)}
${fence_ilo2_instance(None, None, None)}
${fence_ilo3_instance(None, None, None)}
${fence_ilo4_instance(None, None, None)}
+${fence_ilo_moonshot_instance(None, None, None)}
${fence_ilo_mp_instance(None, None, None)}
${fence_rsa_instance(None, None, None)}
${fence_ipmilan_instance(None, None, None)}
diff --git a/luci/validation/validate_fence.py b/luci/validation/validate_fence.py
index 462d5bc..ad08e0a 100644
--- a/luci/validation/validate_fence.py
+++ b/luci/validation/validate_fence.py
@@ -822,6 +822,28 @@ def val_ilo_fd(fencedev, fence_name, **kw):
errors = config_fence_attr(params, fencedev, fence_name, **kw)
return errors
+def val_ilo_moonshot_fd(fencedev, fence_name, **kw):
+ params = (
+ ('ipaddr', True),
+ ('login', True),
+ ('ipport', False),
+ ('passwd', False),
+ ('passwd_script', False),
+ ('cmd_prompt', False),
+ ('power_wait', False),
+ ('delay', False),
+ ('power_timeout', False),
+ ('shell_timeout', False),
+ ('login_timeout', False),
+ ('retry_on', False),
+ ('secure', False),
+# ('ssh_options', False),
+ ('identity_file', False),
+ )
+
+ errors = config_fence_attr(params, fencedev, fence_name, **kw)
+ return errors
+
def val_ipdu_fd(fencedev, fence_name, **kw):
params = (
('ipaddr', True),
@@ -912,6 +934,7 @@ FD_VALIDATE = {
'fence_ilo2': val_ilo_fd,
'fence_ilo3': val_ipmilan_fd,
'fence_ilo4': val_ipmilan_fd,
+ 'fence_ilo_moonshot': val_ilo_moonshot_fd,
'fence_intelmodular': val_intelmodular_fd,
'fence_ipdu': val_ipdu_fd,
'fence_ipmilan': val_ipmilan_fd,
@@ -1345,6 +1368,7 @@ FI_VALIDATE = {
'fence_ilo2': val_noop_fi,
'fence_ilo3': val_noop_fi,
'fence_ilo4': val_noop_fi,
+ 'fence_ilo_moonshot': val_noop_fi,
'fence_intelmodular': val_intelmodular_fi,
'fence_ipmilan': val_noop_fi,
'fence_kdump': val_kdump_fi,
7 years, 6 months