From mboxrd@z Thu Jan 1 00:00:00 1970 From: rmccabe@sourceware.org Date: 23 Apr 2008 17:33:43 -0000 Subject: [Cluster-devel] conga luci/cluster/fence-macros luci/cluster/f ... Message-ID: <20080423173343.6842.qmail@sourceware.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit CVSROOT: /cvs/cluster Module name: conga Changes by: rmccabe at sourceware.org 2008-04-23 17:33:40 Modified files: luci/cluster : fence-macros form-macros resource-form-macros validate_fence.js luci/init.d : luci luci/site/luci/Extensions: FenceHandler.py LuciClusterInfo.py StorageReport.py cluster_adapters.py homebase_adapters.py luci/site/luci/var: Data.fs luci/site/luci/var/certs: cacert.config luci/utils : luci_admin ricci/modules/cluster/clumon/src/common: Makefile ricci/modules/cluster/clumon/src/snmp-agent: Makefile Log message: Fixes from RHEL 4 and 5 Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/fence-macros.diff?cvsroot=cluster&r1=1.2&r2=1.3 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/form-macros.diff?cvsroot=cluster&r1=1.222&r2=1.223 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/resource-form-macros.diff?cvsroot=cluster&r1=1.49&r2=1.50 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/cluster/validate_fence.js.diff?cvsroot=cluster&r1=1.13&r2=1.14 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/init.d/luci.diff?cvsroot=cluster&r1=1.21&r2=1.22 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/FenceHandler.py.diff?cvsroot=cluster&r1=1.30&r2=1.31 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/LuciClusterInfo.py.diff?cvsroot=cluster&r1=1.19&r2=1.20 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/StorageReport.py.diff?cvsroot=cluster&r1=1.29&r2=1.30 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&r1=1.282&r2=1.283 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/homebase_adapters.py.diff?cvsroot=cluster&r1=1.58&r2=1.59 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/var/Data.fs.diff?cvsroot=cluster&r1=1.32&r2=1.33 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/var/certs/cacert.config.diff?cvsroot=cluster&r1=1.1&r2=1.2 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/utils/luci_admin.diff?cvsroot=cluster&r1=1.58&r2=1.59 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/clumon/src/common/Makefile.diff?cvsroot=cluster&r1=1.6&r2=1.7 http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/clumon/src/snmp-agent/Makefile.diff?cvsroot=cluster&r1=1.8&r2=1.9 --- conga/luci/cluster/fence-macros 2008/01/02 20:52:22 1.2 +++ conga/luci/cluster/fence-macros 2008/04/23 17:33:37 1.3 @@ -77,6 +77,9 @@

Add a Sharable Fence Device

+ + @@ -136,6 +139,9 @@

Configure a Fence Device

+ + @@ -188,6 +194,10 @@ + + + + @@ -329,6 +339,7 @@ + @@ -610,6 +621,19 @@ value cur_fencedev/passwd_script | nothing" /> + + + Use SSH + + + + + + @@ -670,6 +694,19 @@ value cur_fencedev/passwd_script | nothing" /> + + + Use SSH (DRAC5 only) + + + + + + @@ -701,8 +738,8 @@ Hostname - + @@ -742,6 +779,66 @@ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Fence TypeFujitsu Siemens RemoteView Service Board (RSB)
Name + +
Hostname + +
Login + +
Password + +
+ Password Script (optional) + + +
+ + + + + + + +
+
+
@@ -1321,10 +1418,9 @@ Use Lanplus - + + tal:attributes="checked python: (cur_fencedev and cur_fencedev.has_key('lanplus') and (cur_fencedev['lanplus'] == '1' or cur_fencedev['lanplus'].lower() == 'true')) and 'checked' or ''" /> @@ -1376,6 +1472,7 @@ + @@ -1466,6 +1563,19 @@ tal:attributes="value cur_instance/switch | nothing" /> + + + Use SSH + + + + + +
@@ -1549,6 +1659,19 @@ tal:attributes="value cur_instance/port | nothing" /> + + + Use SSH + + + + + +
@@ -1777,6 +1900,19 @@ tal:attributes="value cur_instance/blade | nothing" /> + + + Use SSH + + + + + +
@@ -1849,8 +1985,8 @@ Node name - + --- conga/luci/cluster/form-macros 2008/02/08 21:47:55 1.222 +++ conga/luci/cluster/form-macros 2008/04/23 17:33:37 1.223 @@ -512,6 +512,9 @@ global cluster_node_status_str python: (nodeinfo['nodestate'] == '0' and 'Cluster member' or (nodeinfo['nodestate'] == '1' and 'Currently not a cluster participant' or 'This node is not responding'))" /> + + -
--- conga/luci/cluster/resource-form-macros 2008/03/06 21:27:16 1.49 +++ conga/luci/cluster/resource-form-macros 2008/04/23 17:33:37 1.50 @@ -146,7 +146,10 @@ - + + + + @@ -199,7 +202,11 @@ - + + + + + @@ -387,11 +394,12 @@
Monitor link + + checked python:(monitor_link and monitor_link.lower() == 'true' or monitor_link== '1') and 'checked' or ''" />
--- conga/luci/cluster/validate_fence.js 2008/01/02 20:52:22 1.13 +++ conga/luci/cluster/validate_fence.js 2008/04/23 17:33:37 1.14 @@ -8,17 +8,17 @@ */ var fence_inst_validator = []; -fence_inst_validator['apc'] = [ 'port', 'switch' ]; -fence_inst_validator['bladecenter'] = [ 'blade' ]; +fence_inst_validator['apc'] = [ 'port', 'switch', 'secure' ]; +fence_inst_validator['bladecenter'] = [ 'blade', 'secure' ]; fence_inst_validator['brocade'] = [ 'port' ]; fence_inst_validator['bullpap'] = [ 'domain' ]; fence_inst_validator['egenera'] = [ 'lpan', 'pserver' ]; -fence_inst_validator['gndb'] = [ 'ipaddress' ]; +fence_inst_validator['gnbd'] = [ 'ipaddress' ]; fence_inst_validator['mcdata'] = [ 'port' ]; fence_inst_validator['sanbox2'] = [ 'port' ]; fence_inst_validator['scsi'] = [ 'nodename' ]; fence_inst_validator['vixel'] = [ 'port' ]; -fence_inst_validator['wti'] = [ 'port' ]; +fence_inst_validator['wti'] = [ 'port', 'secure' ]; fence_inst_validator['xvm'] = [ 'domain' ]; var fence_validator = []; @@ -26,15 +26,16 @@ fence_validator['bladecenter'] = [ 'ipaddr', 'login', 'passwd', 'passwd_script' ]; fence_validator['brocade'] = [ 'ipaddr', 'login', 'passwd', 'passwd_script' ]; fence_validator['bullpap'] = [ 'ipaddr', 'login', 'passwd', 'passwd_script' ]; -fence_validator['drac'] = [ 'ipaddr', 'login', 'passwd', 'passwd_script' ]; +fence_validator['drac'] = [ 'ipaddr', 'login', 'passwd', 'passwd_script', 'secure' ]; fence_validator['egenera'] = [ 'cserver' ]; fence_validator['gnbd'] = [ 'servers' ]; -fence_validator['ilo'] = [ 'hostname', 'login', 'passwd', 'passwd_script' ]; +fence_validator['ilo'] = [ 'hostname', 'login', 'passwd', 'passwd_script', 'secure' ]; fence_validator['ipmilan'] = [ 'ipaddr', 'login', 'passwd', 'passwd_script', 'lanplus', 'auth' ]; fence_validator['manual'] = []; fence_validator['mcdata'] = [ 'ipaddr', 'login', 'passwd', 'passwd_script' ]; fence_validator['rps10'] = [ 'device', 'port']; -fence_validator['rsa'] = [ 'hostname', 'login', 'passwd', 'passwd_script' ]; +fence_validator['rsa'] = [ 'ipaddr', 'login', 'passwd', 'passwd_script' ]; +fence_validator['rsb'] = [ 'ipaddr', 'login', 'passwd', 'passwd_script' ]; fence_validator['sanbox2'] = [ 'ipaddr', 'login', 'passwd', 'passwd_script' ]; fence_validator['scsi'] = []; fence_validator['unknown'] = []; @@ -76,7 +77,8 @@ return (errors); } - if (errors && errors.length > 0 && form.passwd_script && !str_is_blank(form.passwd_script.value)) + if (errors && errors.length > 0 && + form.passwd_script && !str_is_blank(form.passwd_script.value)) { clr_form_err(form_elem); return (null); @@ -125,6 +127,9 @@ field_validator['port'] = validate_field_str; field_validator['passwd_script'] = validate_field_noop; +/* iLO, DRAC5, WTI, APC, Bladecenter */ +field_validator['secure'] = validate_field_noop; + /* IPMI fence device */ field_validator['lanplus'] = validate_field_noop; field_validator['auth'] = validate_field_ipmilan_auth; --- conga/luci/init.d/luci 2008/02/05 18:41:46 1.21 +++ conga/luci/init.d/luci 2008/04/23 17:33:37 1.22 @@ -75,7 +75,7 @@ rm -f -- "$HTTPS_PRIVKEY" "$HTTPS_PUBKEY" /usr/bin/openssl genrsa -out "$HTTPS_PRIVKEY" "$KEY_BITS" >&/dev/null - /usr/bin/openssl req -new -x509 -key "$HTTPS_PRIVKEY" -out "$HTTPS_PUBKEY" -days "$KEY_LIFE_DAYS" -config /var/lib/luci/var/certs/cacert.config + /usr/bin/openssl req -new -x509 -key "$HTTPS_PRIVKEY" -out "$HTTPS_PUBKEY" -days "$KEY_LIFE_DAYS" -set_serial "$(/bin/date +%s)" -config /var/lib/luci/var/certs/cacert.config /bin/chmod -- 600 "$HTTPS_PRIVKEY" /bin/chmod -- 644 "$HTTPS_PUBKEY" /bin/chown -- $LUCI_USER:$LUCI_GROUP "$HTTPS_PRIVKEY" "$HTTPS_PUBKEY" --- conga/luci/site/luci/Extensions/FenceHandler.py 2008/01/17 16:36:30 1.30 +++ conga/luci/site/luci/Extensions/FenceHandler.py 2008/04/23 17:33:37 1.31 @@ -543,10 +543,10 @@ errors = list() try: - hostname = form['hostname'].strip() + hostname = form['ipaddr'].strip() if not hostname: raise Exception, 'blank' - fencedev.addAttribute('hostname', hostname) + fencedev.addAttribute('ipaddr', hostname) except Exception, e: errors.append(FD_PROVIDE_HOSTNAME) @@ -654,6 +654,12 @@ except: pass + use_ssh = form.has_key('secure') and (form['secure'] == '1' or form['secure'].lower() == 'true') + if use_ssh: + fencedev.addAttribute('secure', '1') + else: + fencedev.removeAttribute('secure') + return errors def val_rps10_fd(form, fencedev): @@ -803,6 +809,12 @@ if not has_passwd: errors.append(FD_PROVIDE_PASSWD) + use_ssh = form.has_key('secure') and (form['secure'] == '1' or form['secure'].lower() == 'true') + if use_ssh: + fencedev.addAttribute('secure', '1') + else: + fencedev.removeAttribute('secure') + return errors FD_VALIDATE = { @@ -822,6 +834,7 @@ 'fence_ipmilan': val_ipmilan_fd, 'fence_drac': val_drac_fd, 'fence_rsa': val_rsa_fd, + 'fence_rsb': val_rsa_fd, # same params as rsa 'fence_rps10': val_rps10_fd, 'fence_manual': val_noop_fd } @@ -902,6 +915,12 @@ except Exception, e: errors.append(FI_PROVIDE_SWITCH) + use_ssh = form.has_key('secure') and (form['secure'] == '1' or form['secure'].lower() == 'true') + if use_ssh: + fenceinst.addAttribute('secure', '1') + else: + fenceinst.removeAttribute('secure') + return errors def val_wti_fi(form, fenceinst): @@ -915,6 +934,12 @@ except Exception, e: errors.append(FI_PROVIDE_PORT) + use_ssh = form.has_key('secure') and (form['secure'] == '1' or form['secure'].lower() == 'true') + if use_ssh: + fenceinst.addAttribute('secure', '1') + else: + fenceinst.removeAttribute('secure') + return errors def val_brocade_fi(form, fenceinst): @@ -980,6 +1005,12 @@ except Exception, e: errors.append(FI_PROVIDE_BLADE) + use_ssh = form.has_key('secure') and (form['secure'] == '1' or form['secure'].lower() == 'true') + if use_ssh: + fenceinst.addAttribute('secure', '1') + else: + fenceinst.removeAttribute('secure') + return errors def val_mcdata_fi(form, fenceinst): @@ -1082,6 +1113,7 @@ 'fence_ipmilan': val_noop_fi, 'fence_drac': val_noop_fi, 'fence_rsa': val_noop_fi, + 'fence_rsb': val_noop_fi, 'fence_rps10': val_noop_fi } --- conga/luci/site/luci/Extensions/LuciClusterInfo.py 2008/01/15 04:41:40 1.19 +++ conga/luci/site/luci/Extensions/LuciClusterInfo.py 2008/04/23 17:33:37 1.20 @@ -575,14 +575,24 @@ return {} clumap = {} + try: cluster_os = model.getClusterOS() - if cluster_os.find('Tikanga'): + if cluster_os.find('Tikanga') != -1: + clumap['os_major'] = 5 os_minor = int(cluster_os[cluster_os.find('5.') + 2]) + clumap['os_minor'] = os_minor if os_minor > 1: clumap['vm_migration_choice'] = True - except: - pass + elif cluster_os.find('Nahant') != -1: + clumap['os_major'] = 4 + os_minor = int(cluster_os[cluster_os.find('Update ') + 7]) + clumap['os_minor'] = os_minor + if os_minor > 6: + clumap['has_fence_ssh'] = True + except Exception, e: + if LUCI_DEBUG_MODE is True: + luci_log.debug_verbose('GCI0a: %r %s' % (e, str(e))) if not model: try: @@ -1626,7 +1636,9 @@ clu_map = {} try: - os_str = resolveOSType(rc.os()) + os_str = rc.os() + clu_map['os_full'] = os_str + os_str = resolveOSType(os_str) clu_map['os'] = os_str clu_map['isVirtualized'] = rc.dom0() except: --- conga/luci/site/luci/Extensions/StorageReport.py 2007/11/06 19:29:15 1.29 +++ conga/luci/site/luci/Extensions/StorageReport.py 2008/04/23 17:33:37 1.30 @@ -1,4 +1,4 @@ -# Copyright (C) 2006-2007 Red Hat, Inc. +# Copyright (C) 2006-2008 Red Hat, Inc. # # This program is free software; you can redistribute # it and/or modify it under the terms of version 2 of the --- conga/luci/site/luci/Extensions/cluster_adapters.py 2008/03/05 23:08:58 1.282 +++ conga/luci/site/luci/Extensions/cluster_adapters.py 2008/04/23 17:33:37 1.283 @@ -1017,7 +1017,7 @@ luci_log.debug_verbose('validateFdom0: no model') return (False, { 'errors': [ 'Unable to retrieve the cluster configuration for %s. The configuration XML may contain errors' % clustername ]}) - ret = validate_fdom(self, request) + ret = validate_fdom(model, request) if ret[0] is not True: return ret --- conga/luci/site/luci/Extensions/homebase_adapters.py 2008/02/05 20:59:38 1.58 +++ conga/luci/site/luci/Extensions/homebase_adapters.py 2008/04/23 17:33:37 1.59 @@ -206,6 +206,12 @@ except: cur_host_trusted = not check_certs + trust_shown = False + try: + trust_shown = request.form.has_key('trust_shown') + except: + trust_shown = False + cur_host_fp = None try: cur_host_fp = request.form['host_fingerprint'].strip() @@ -399,6 +405,12 @@ % (e, str(e))) errors.append('The number of systems entered could not be determined.') + trust_shown = False + try: + trust_shown = request.form.has_key('trust_shown') + except: + trust_shown = False + incomplete = False i = 0 while i < num_storage: @@ -617,29 +629,29 @@ luci_log.debug_verbose('VAC5: %s' % err_msg) continue - cur_os = resolveOSType(rc.os()) - if cur_os != cluster_os: - if LUCI_DEBUG_MODE is True: - luci_log.debug_verbose('VAC5a: "%s" / "%s" -> "%s"' \ - % (cluster_os, rc.os(), cur_os)) - incomplete = True - cur_system['errors'] = True - - if not prev_auth: - try: - rc.unauth() - except Exception, e: - if LUCI_DEBUG_MODE is True: - luci_log.debug_verbose('VAC6: %s: %r %s' \ - % (cur_host, e, str(e))) - - err_msg = 'Node %s reports its cluster version is %s and we expect %s' \ - % (cur_host, cur_os, cluster_os) - - errors.append(err_msg) - if LUCI_DEBUG_MODE is True: - luci_log.debug_verbose('VAC7: %s' % err_msg) - continue + #cur_os = resolveOSType(rc.os()) + #if cur_os != cluster_os: + # if LUCI_DEBUG_MODE is True: + # luci_log.debug_verbose('VAC5a: "%s" / "%s" -> "%s"' \ + # % (cluster_os, rc.os(), cur_os)) + # incomplete = True + # cur_system['errors'] = True + + # if not prev_auth: + # try: + # rc.unauth() + # except Exception, e: + # if LUCI_DEBUG_MODE is True: + # luci_log.debug_verbose('VAC6: %s: %r %s' \ + # % (cur_host, e, str(e))) + + # err_msg = 'Node %s reports its cluster version is %s and we expect %s' \ + # % (cur_host, cur_os, cluster_os) + + # errors.append(err_msg) + # if LUCI_DEBUG_MODE is True: + # luci_log.debug_verbose('VAC7: %s' % err_msg) + # continue else: incomplete = True Binary files /cvs/cluster/conga/luci/site/luci/var/Data.fs 2008/03/24 23:22:09 1.32 and /cvs/cluster/conga/luci/site/luci/var/Data.fs 2008/04/23 17:33:37 1.33 differ rcsdiff: /cvs/cluster/conga/luci/site/luci/var/Data.fs: diff failed --- conga/luci/site/luci/var/certs/cacert.config 2006/06/02 00:14:28 1.1 +++ conga/luci/site/luci/var/certs/cacert.config 2008/04/23 17:33:39 1.2 @@ -6,10 +6,10 @@ [ req_distinguished_name ] C = US ST = State or Province -L = Locality -O = Organization Name -OU = Organizational Unit Name -CN = Common Name -emailAddress = root at localhost +L = Conga +O = Conga +OU = Conga +CN = luci server +emailAddress = luci at localhost [ req_attributes ] --- conga/luci/utils/luci_admin 2008/01/02 20:52:24 1.58 +++ conga/luci/utils/luci_admin 2008/04/23 17:33:39 1.59 @@ -10,6 +10,7 @@ import sys, os, pwd from select import select from stat import S_ISREG +from time import time import types import xml import xml.dom @@ -1051,7 +1052,7 @@ # /usr/bin/openssl req -new -x509 -key /var/lib/luci/var/certs/privkey.pem -out /var/lib/luci/var/certs/cacert.pem -days 1825 -config /var/lib/luci/var/certs/cacert.config command = '/usr/bin/openssl' - args = [ command, 'req', '-new', '-x509', '-key', SSL_PRIVKEY_PATH, '-out', SSL_PUBKEY_PATH, '-days', '1825', '-config', SSL_KEYCONFIG_PATH ] + args = [ command, 'req', '-new', '-x509', '-key', SSL_PRIVKEY_PATH, '-out', SSL_PUBKEY_PATH, '-days', '1825', '-set_serial', str(int(time())), '-config', SSL_KEYCONFIG_PATH ] exec_cmd(command, args) # take ownership and restrict access --- conga/ricci/modules/cluster/clumon/src/common/Makefile 2008/01/02 20:47:36 1.6 +++ conga/ricci/modules/cluster/clumon/src/common/Makefile 2008/04/23 17:33:39 1.7 @@ -18,7 +18,7 @@ OBJECTS = Cluster.o Node.o Service.o ClusterMonitor.o INCLUDE += -I ../include -CXXFLAGS += -DPARANOIA=$(PARANOID) +CXXFLAGS += -DPARANOIA=$(PARANOID) -fPIC all: ${TARGET} --- conga/ricci/modules/cluster/clumon/src/snmp-agent/Makefile 2008/01/02 20:47:36 1.8 +++ conga/ricci/modules/cluster/clumon/src/snmp-agent/Makefile 2008/04/23 17:33:39 1.9 @@ -17,15 +17,16 @@ SNMP_LDLAGS = `net-snmp-config --libs` INCLUDE += -I ../include -CFLAGS += $(SNMP_CFLAGS) -DPARANOIA=$(PARANOID) -CXXFLAGS += $(SNMP_CFLAGS) -DPARANOIA=$(PARANOID) -LDFLAGS += -shared $(SNMP_LDLAGS) +CFLAGS += -fPIC $(SNMP_CFLAGS) -DPARANOIA=$(PARANOID) +CXXFLAGS += -fPIC $(SNMP_CFLAGS) -DPARANOIA=$(PARANOID) +LDFLAGS += -fPIC -shared $(SNMP_LDLAGS) ifeq ($(PARANOID), 1) LDFLAGS += ${top_srcdir}/common/paranoid/*.o else LDFLAGS += ${top_srcdir}/common/*.o endif +LDFLAGS += ../common/*.o LDFLAGS += -lcman