conga luci/site/luci/Extensions/StorageReport. ...
CVSROOT: /cvs/cluster
Module name: conga
Branch: RHEL4
Changes by: kupcevic at sourceware.org 2007-03-05 20:22:36
Modified files:
luci/site/luci/Extensions: StorageReport.py ricci/test_suite: README
ricci/modules/storage: ClusterNotQuorateError.h ClvmdError.h
LV.cpp LVM.cpp PV.cpp VG.cpp
Added files:
ricci/modules/storage: ClusterNotRunningError.h
LVMClusterLockingError.h
Log message:
modstorage: Improve error reporting of clustered nodes
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/StorageReport.py.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.22&r2=1.22.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/README.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/ClusterNotRunningError.h.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=NONE&r2=1.1.4.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/LVMClusterLockingError.h.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=NONE&r2=1.1.4.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/ClusterNotQuorateError.h.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.2&r2=1.2.4.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/ClvmdError.h.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.2&r2=1.2.4.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/LV.cpp.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.7&r2=1.7.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/LVM.cpp.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.11&r2=1.11.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/PV.cpp.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.5&r2=1.5.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/VG.cpp.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.9&r2=1.9.2.1
luci/site/luci/Extensions/StorageReport.py +12 -2
@@ -1409,13 +1409,23 @@ # clvmd error error = True url += '?' + STONAME + '=' + storagename + '&' + PAGETYPE + '=' + STORAGE - msg = 'either clvmd (clustered LVM daemon) is not running or is not cluster-enabled on ' + storagename + msg = 'clvmd (clustered LVM daemon) is not running on ' + storagename elif code == 5: # not quorate error = True url += '?' + STONAME + '=' + storagename + '&' + PAGETYPE + '=' + STORAGE msg = 'Cluster quorum is required, and yet cluster is not quorate. Start cluster, and try again.' - elif code > 5: + elif code == 6: + # LVM cluster locking not enabled + error = True + url += '?' + STONAME + '=' + storagename + '&' + PAGETYPE + '=' + STORAGE + msg = 'LVM cluster locking is not enabled on ' + storagename + elif code == 7: + # cluster not running + error = True + url += '?' + STONAME + '=' + storagename + '&' + PAGETYPE + '=' + STORAGE + msg = 'Cluster infrastructure is not running on ' + storagename + elif code > 8: error = True url += '?' + STONAME + '=' + storagename + '&' + PAGETYPE + '=' + STORAGE msg = err_msg
ricci/test_suite/README +5 -4
@@ -1,14 +1,15 @@ -1. make SSL certs +1. generate SSL cert/key pair ./generate_certs.sh this step needs to be performed only once (cert can be used for multiple riccis - each requires authentication) 2. modify ricci/authenticate.xml, writing root password of machine hosting ricci to 'password' attribute -3. run ./ricci_test ricci_hostname ricci/authenticate.xml - you are authenticated to that ricci, and don't have to repeat authentication to it +3. execute `./send_to_ricci ricci_hostname ricci/authenticate.xml` + from now on, you are authenticated to that ricci, and don't have to repeat authentication to it 4. pick/modify one of XML files check ../docs/ for API -5. execute ./ricci_test ricci_hostname xml_file +5. execute `./send_to_ricci ricci_hostname xml_file` ricci's response will be printed to stdout +... 15. send ricci/unauthenticate.xml to unauthenticate from that ricci
ricci/modules/storage/ClusterNotQuorateError.h +1 -1
@@ -31,7 +31,7 @@ { public: ClusterNotQuorateError() - : Except(5, String("Quorum required, but cluster not quorate")) {} + : Except(5, String("Cluster is not quorate")) {} virtual ~ClusterNotQuorateError() {}
ricci/modules/storage/ClvmdError.h +1 -1
@@ -31,7 +31,7 @@ { public: ClvmdError() - : Except(4, String("clvmd required, but unable to start. Start cluster infrastructure.")) {} + : Except(4, String("clvmd failed to start")) {} virtual ~ClvmdError() {}
ricci/modules/storage/LV.cpp +4 -4
@@ -29,7 +29,7 @@ #include "utils.h" #include "ContentFactory.h" #include "ContentNone.h" -#include "ClvmdError.h" +#include "LVMClusterLockingError.h" using namespace std;
@@ -47,7 +47,7 @@ // if VG is marked as clustered, but cluster locking is not available, throw if (!LVM::clustered_enabled() && bd_temp.props.get("clustered").get_bool()) - throw ClvmdError(); + throw LVMClusterLockingError(); String lvname = bd_temp.props.get("lvname").get_string();
@@ -184,7 +184,7 @@ // if VG is marked as clustered, but cluster locking is not available, throw if (_props.get("clustered").get_bool() && !LVM::clustered_enabled()) - throw ClvmdError(); + throw LVMClusterLockingError(); // snapshots neither resize nor replace content, see LV()
@@ -248,7 +248,7 @@ // if VG is marked as clustered, but cluster locking is not available, throw if (_props.get("clustered").get_bool() && !LVM::clustered_enabled()) - throw ClvmdError(); + throw LVMClusterLockingError(); content->remove(); LVM::lvremove(path());
ricci/modules/storage/LVM.cpp +38 -16
148 lines not on this page · raw message
ricci/modules/storage/PV.cpp +4 -4
@@ -25,7 +25,7 @@ #include "LVM.h" #include "MapperFactory.h" #include "utils.h" -#include "ClvmdError.h" +#include "LVMClusterLockingError.h" using namespace std;
@@ -96,7 +96,7 @@ // if VG is marked as clustered, but cluster locking is not available, throw if (!LVM::clustered_enabled() && LVM::vg_clustered(vgname)) - throw ClvmdError(); + throw LVMClusterLockingError(); if (vg->sources.size() == 1) {
@@ -124,7 +124,7 @@ if (!LVM::clustered_enabled() && (LVM::vg_clustered(vgname_old) || LVM::vg_clustered(vgname_new))) - throw ClvmdError(); + throw LVMClusterLockingError(); counting_auto_ptr<Mapper> vg_old =
@@ -155,7 +155,7 @@ // if VG is marked as clustered, but cluster locking is not available, throw if (!LVM::clustered_enabled() && LVM::vg_clustered(vgname)) - throw ClvmdError(); + throw LVMClusterLockingError(); LVM::pvcreate(path);
ricci/modules/storage/VG.cpp +8 -5
@@ -28,7 +28,7 @@ #include "defines.h" #include "utils.h" #include "MidAir.h" -#include "ClvmdError.h" +#include "LVMClusterLockingError.h"; #include "Time.h"
@@ -55,8 +55,11 @@ int status; if (utils::execute(LVM_BIN_PATH, args, out, err, status)) throw command_not_found_error_msg(LVM_BIN_PATH); - if (status) + if (status) { + if (err.find("Skipping clustered") != err.npos) + throw LVMClusterLockingError(); throw String("vgs failed"); + } vector<String> lines = utils::split(out, "\n"); for (vector<String>::iterator iter = lines.begin(); iter != lines.end();
@@ -208,7 +211,7 @@ // if VG is marked as clustered, but cluster locking is not available, throw if (_props.get("clustered").get_bool() && !LVM::clustered_enabled()) - throw ClvmdError(); + throw LVMClusterLockingError(); String vgname; try {
@@ -253,7 +256,7 @@ // if VG is marked as clustered, but cluster locking is not available, throw if (_props.get("clustered").get_bool() && !LVM::clustered_enabled()) - throw ClvmdError(); + throw LVMClusterLockingError(); String vgname = _props.get("vgname").get_string(); LVM::vgremove(vgname);
@@ -279,7 +282,7 @@ if (clustered && !LVM::clustered_enabled()) - throw ClvmdError(); + throw LVMClusterLockingError(); try { utils::clear_cache();