cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [Cluster-devel] conga luci/site/luci/Extensions/StorageReport. ...
@ 2006-10-05 16:11 kupcevic
  0 siblings, 0 replies; 5+ messages in thread
From: kupcevic @ 2006-10-05 16:11 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	kupcevic at sourceware.org	2006-10-05 16:11:38

Modified files:
	luci/site/luci/Extensions: StorageReport.py 
	                           conga_storage_constants.py 
	ricci/modules/storage: ExtendedFS.cpp GFS1.cpp GFS2.cpp 
	                       SwapFS.cpp UnsupportedFS.cpp 

Log message:
	Move FS pretty names from ricci to luci

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/StorageReport.py.diff?cvsroot=cluster&r1=1.7&r2=1.8
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/conga_storage_constants.py.diff?cvsroot=cluster&r1=1.5&r2=1.6
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/ExtendedFS.cpp.diff?cvsroot=cluster&r1=1.5&r2=1.6
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/GFS1.cpp.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/GFS2.cpp.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/SwapFS.cpp.diff?cvsroot=cluster&r1=1.6&r2=1.7
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/UnsupportedFS.cpp.diff?cvsroot=cluster&r1=1.1&r2=1.2

--- conga/luci/site/luci/Extensions/StorageReport.py	2006/09/26 03:17:41	1.7
+++ conga/luci/site/luci/Extensions/StorageReport.py	2006/10/05 16:11:37	1.8
@@ -1669,7 +1669,7 @@
     if id == CONTENT_FS_TYPE:
         fs_type = c_xml.getAttribute('fs_type')
         id += '_' + fs_type
-        name = fs_type
+        name = get_pretty_fs_name(fs_type)
     elif id == CONTENT_NONE_TYPE:
         name = 'Empty'
     elif id == CONTENT_MS_TYPE:
--- conga/luci/site/luci/Extensions/conga_storage_constants.py	2006/09/26 04:56:52	1.5
+++ conga/luci/site/luci/Extensions/conga_storage_constants.py	2006/10/05 16:11:37	1.6
@@ -147,3 +147,38 @@
     if name in PRETTY_PROP_NAMES:
         return PRETTY_PROP_NAMES[name]
     return name
+
+
+
+def get_pretty_fs_name(name):
+    PRETTY_FS_NAMES = {'ext'      : "Linux Extended FS",
+                       'swap'     : "Swap",
+                       'gfs1'     : "GFS1 - Global FS v.1",
+                       'gfs2'     : "GFS2 - Global FS v.2",
+                       'minix'    : "Minix FS",
+                       'ufs'      : "Unix Fast FS",
+                       'xfs'      : "SGI XFS",
+                       'isofs'    : "ISO 9660 CD-ROM FS",
+                       'cramfs'   : "Cram FS",
+                       'raiserfs' : "Reiser FS",
+                       'jffs'     : "Journalled Flash FS v.1",
+                       'jffs2'    : "Journalled Flash FS v.2",
+                       'squashfs' : "Squash FS",
+                       'vfat'     : "MS vfat FS",
+                       'msdos'    : "MS-DOS FS",
+                       'affs'     : "Amiga FS",
+                       'befs'     : "BeOS FS",
+                       'bfs'      : "SCO UnixWare BFS",
+                       'jfs'      : "Journaled Filesystem (JFS)",
+                       'efs'      : "efs",
+                       'freevxfs' : "Veritas Filesystem (VxFS)",
+                       'hfsplus'  : "Macintosh extended FS",
+                       'hfs'      : "Macintosh FS",
+                       'ncpfs'    : "ncpfs",
+                       'ocfs2'    : "Oracle Clustered FS v.2",
+                       'relayfs'  : "Relay FS",
+                       'udf'      : "Universal Disk Format"}
+    
+    if name in PRETTY_FS_NAMES:
+        return PRETTY_FS_NAMES[name]
+    return name
--- conga/ricci/modules/storage/ExtendedFS.cpp	2006/09/26 03:02:57	1.5
+++ conga/ricci/modules/storage/ExtendedFS.cpp	2006/10/05 16:11:38	1.6
@@ -33,7 +33,7 @@
 
 
 const static String MKE2FS_path("/sbin/mke2fs");
-const String ExtendedFS::PRETTY_NAME("Linux Extended FS");
+const String ExtendedFS::PRETTY_NAME("ext");
 
 
 
--- conga/ricci/modules/storage/GFS1.cpp	2006/09/26 03:17:41	1.1
+++ conga/ricci/modules/storage/GFS1.cpp	2006/10/05 16:11:38	1.2
@@ -39,7 +39,7 @@
 #include "gfs_ondisk.h"
 
 
-const String GFS1::PRETTY_NAME("GFS1 - Global FS v.1");
+const String GFS1::PRETTY_NAME("gfs1");
 const static String gfs1_module("gfs");
 
 const static String MKFS_GFS1_path("/sbin/mkfs.gfs");
--- conga/ricci/modules/storage/GFS2.cpp	2006/09/26 03:17:41	1.1
+++ conga/ricci/modules/storage/GFS2.cpp	2006/10/05 16:11:38	1.2
@@ -45,7 +45,7 @@
 #include "gfs2_ondisk.h"
 
 
-const String GFS2::PRETTY_NAME("GFS2 - Global FS v.2");
+const String GFS2::PRETTY_NAME("gfs2");
 const static String gfs2_module("gfs2");
 
 const static String MKFS_GFS2_path("/sbin/mkfs.gfs2");
--- conga/ricci/modules/storage/SwapFS.cpp	2006/09/26 03:37:43	1.6
+++ conga/ricci/modules/storage/SwapFS.cpp	2006/10/05 16:11:38	1.7
@@ -31,7 +31,7 @@
 using namespace std;
 
 
-const String SwapFS::PRETTY_NAME("Swap");
+const String SwapFS::PRETTY_NAME("swap");
 
 
 SwapFS::SwapFS(const String& path) :
--- conga/ricci/modules/storage/UnsupportedFS.cpp	2006/09/26 03:17:41	1.1
+++ conga/ricci/modules/storage/UnsupportedFS.cpp	2006/10/05 16:11:38	1.2
@@ -32,76 +32,76 @@
   String magic(FileMagic::get_description(path));
   magic = utils::to_lower(magic);
   if (magic.find("minix filesystem") != magic.npos) {
-    _name   = "Minix FS";
+    _name   = "minix";
     _module = "minix";
   } else if (magic.find("unix fast file") != magic.npos) {
-    _name   = "Unix Fast FS";
+    _name   = "ufs";
     _module = "ufs";
   } else if (magic.find("sgi xfs") != magic.npos) {
-    _name   = "SGI XFS";
+    _name   = "xfs";
     _module = "xfs";
   } else if (magic.find("iso 9660 cd-rom") != magic.npos) {
-    _name   = "ISO 9660 CD-ROM FS";
+    _name   = "isofs";
     _module = "isofs";
   } else if (magic.find("linux compressed rom file system") != magic.npos) {
-    _name   = "CramFS";
+    _name   = "cramfs";
     _module = "cramfs";
   } else if (magic.find("reiserfs") != magic.npos) {
-    _name   = "Reiser FS";
+    _name   = "reiserfs";
     _module = "reiserfs";
   } else if (magic.find("linux journalled flash file system") != magic.npos) {
-    _name   = "Journalled Flash FS v.1";
+    _name   = "jffs";
     _module = "jffs";
   } else if (magic.find("jffs2") != magic.npos) {
-    _name   = "Journalled Flash FS v.1";
+    _name   = "jffs2";
     _module = "jffs2";
   } else if (magic.find("squashfs") != magic.npos) {
-    _name   = "SquashFS";
+    _name   = "squashfs";
     _module = "squashfs";
   } else if (magic.find("fat (12 bit)") != magic.npos ||
 	     magic.find("fat (16 bit)") != magic.npos ||
 	     magic.find("fat (32 bit)") != magic.npos) {
-    _name   = "MS vfat FS";
+    _name   = "vfat";
     _module = "vfat";
   } else if (magic.find("msdos") != magic.npos ||
 	     magic.find("ms-dos") != magic.npos) {
-    _name   = "MS-DOS FS";
+    _name   = "msdos";
     _module = "msdos";
   } else if (magic.find("affs") != magic.npos) {
-    _name   = "Amiga FS";
+    _name   = "affs";
     _module = "affs";
   } else if (magic.find("befs") != magic.npos) {
-    _name   = "BeOS FS";
+    _name   = "befs";
     _module = "befs";
   } else if (magic.find("bfs") != magic.npos) {
-    _name   = "SCO UnixWare BFS";
+    _name   = "bfs";
     _module = "bfs";
   } else if (magic.find("jfs") != magic.npos) {
-    _name   = "Journaled Filesystem (JFS)";
+    _name   = "jfs";
     _module = "jfs";
   } else if (magic.find("efs") != magic.npos) {
     _name   = "efs";
     _module = "efs";
   } else if (magic.find("vxfs") != magic.npos) {
-    _name   = "Veritas Filesystem (VxFS)";
+    _name   = "freevxfs";
     _module = "freevxfs";
   } else if (magic.find("hfsplus") != magic.npos) {
-    _name   = "Macintosh FS (extended)";
+    _name   = "hfsplus";
     _module = "hfsplus";
   } else if (magic.find("hfs") != magic.npos) {
-    _name   = "Macintosh FS";
+    _name   = "hfs";
     _module = "hfs";
   } else if (magic.find("ncpfs") != magic.npos) {
     _name   = "ncpfs";
     _module = "ncpfs";
   } else if (magic.find("ocfs2") != magic.npos) {
-    _name   = "Oracle Clustered FS v.2";
+    _name   = "ocfs2";
     _module = "ocfs2";
   } else if (magic.find("relayfs") != magic.npos) {
-    _name   = "Relay FS";
+    _name   = "relayfs";
     _module = "relayfs";
   } else if (magic.find("udf") != magic.npos) {
-    _name   = "Universal Disk Format";
+    _name   = "udf";
     _module = "udf";
     
     



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Cluster-devel] conga luci/site/luci/Extensions/StorageReport. ...
@ 2006-11-29 18:26 rmccabe
  0 siblings, 0 replies; 5+ messages in thread
From: rmccabe @ 2006-11-29 18:26 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Branch: 	RHEL5
Changes by:	rmccabe at sourceware.org	2006-11-29 18:26:53

Modified files:
	luci/site/luci/Extensions: StorageReport.py 
	ricci/modules/storage: LVM.cpp 

Log message:
	fix for bz #217703
	
	Related: bz217703

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/StorageReport.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.20&r2=1.20.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/LVM.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.7.2.1&r2=1.7.2.2

--- conga/luci/site/luci/Extensions/StorageReport.py	2006/10/16 19:49:09	1.20
+++ conga/luci/site/luci/Extensions/StorageReport.py	2006/11/29 18:26:53	1.20.2.1
@@ -1409,7 +1409,7 @@
                 # clvmd error
                 error  = True
                 url   += '?' + STONAME + '=' + storagename + '&' + PAGETYPE + '=' + STORAGE
-                msg    = 'clvmd (clustered LVM daemon) is not running on ' + storagename + '. Start it and try again.'
+                msg    = 'either clvmd (clustered LVM daemon) is not running or is not cluster-enabled on ' + storagename
             elif code == 5:
                 # not quorate
                 error  = True
--- conga/ricci/modules/storage/LVM.cpp	2006/11/01 22:06:55	1.7.2.1
+++ conga/ricci/modules/storage/LVM.cpp	2006/11/29 18:26:53	1.7.2.2
@@ -644,7 +644,8 @@
 bool 
 LVM::clustered_available()
 {
-  return get_locking_type() == "2";
+  String locking_type = get_locking_type();
+  return (locking_type == "2" || locking_type == "3");
 }
 
 bool
@@ -713,7 +714,7 @@
 void 
 LVM::check_locking()
 {
-  if (get_locking_type() == "2") {
+  if (clustered_available()) {
     if (!cluster_quorate())
       throw ClusterNotQuorateError();
     



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Cluster-devel] conga luci/site/luci/Extensions/StorageReport. ...
@ 2007-03-05 20:14 kupcevic
  0 siblings, 0 replies; 5+ messages in thread
From: kupcevic @ 2007-03-05 20:14 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Branch: 	RHEL5
Changes by:	kupcevic at sourceware.org	2007-03-05 20:14:00

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=RHEL5&r1=1.20.2.2&r2=1.20.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/README.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.4.1&r2=1.1.4.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/ClusterNotRunningError.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=NONE&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/LVMClusterLockingError.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=NONE&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/ClusterNotQuorateError.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.2&r2=1.2.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/ClvmdError.h.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.2&r2=1.2.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/LV.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.6.2.1&r2=1.6.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/LVM.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.7.2.4&r2=1.7.2.5
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/PV.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.4.2.1&r2=1.4.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/VG.cpp.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.8.2.1&r2=1.8.2.2

--- conga/luci/site/luci/Extensions/StorageReport.py	2006/12/08 18:27:32	1.20.2.2
+++ conga/luci/site/luci/Extensions/StorageReport.py	2007/03/05 20:13:59	1.20.2.3
@@ -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
--- conga/ricci/test_suite/README	2007/03/01 00:31:20	1.1.4.1
+++ conga/ricci/test_suite/README	2007/03/05 20:13:59	1.1.4.2
@@ -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
--- conga/ricci/modules/storage/ClusterNotQuorateError.h	2006/08/10 22:53:09	1.2
+++ conga/ricci/modules/storage/ClusterNotQuorateError.h	2007/03/05 20:13:59	1.2.2.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()
     {}
   
--- conga/ricci/modules/storage/ClvmdError.h	2006/08/10 22:53:09	1.2
+++ conga/ricci/modules/storage/ClvmdError.h	2007/03/05 20:13:59	1.2.2.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()
     {}
   
--- conga/ricci/modules/storage/LV.cpp	2006/12/12 13:26:24	1.6.2.1
+++ conga/ricci/modules/storage/LV.cpp	2007/03/05 20:13:59	1.6.2.2
@@ -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());
--- conga/ricci/modules/storage/LVM.cpp	2007/01/17 14:41:13	1.7.2.4
+++ conga/ricci/modules/storage/LVM.cpp	2007/03/05 20:13:59	1.7.2.5
@@ -29,6 +29,8 @@
 #include "defines.h"
 #include "ClvmdError.h"
 #include "ClusterNotQuorateError.h"
+#include "ClusterNotRunningError.h"
+#include "LVMClusterLockingError.h"
 
 #include <vector>
 
@@ -162,8 +164,11 @@
   int status;
   if (utils::execute(LVM_BIN_PATH, args, out, err, status))
     throw command_not_found_error_msg(LVM_BIN_PATH);
-  if (status != 0)
+  if (status != 0) {
+    if (err.find("Skipping clustered") != err.npos)
+      throw LVMClusterLockingError();
     throw String("lvdisplay failed");
+  }
   
   vector<String> lines = utils::split(out, "\n");
   for (vector<String>::iterator iter = lines.begin();
@@ -213,8 +218,11 @@
   int status;
   if (utils::execute(LVM_BIN_PATH, args, out, err, status))
     throw command_not_found_error_msg(LVM_BIN_PATH);
-  if (status != 0)
+  if (status != 0) {
+    if (err.find("Skipping clustered") != err.npos)
+      throw LVMClusterLockingError();
     throw String("lvs failed");
+  }
   
   String line = utils::strip(out);
   vector<String> words = utils::split(line, ";");
@@ -268,8 +276,11 @@
   args.push_back("lv_name,vg_name,origin");
   if (utils::execute(LVM_BIN_PATH, args, out, err, status))
     throw command_not_found_error_msg(LVM_BIN_PATH);
-  if (status != 0)
+  if (status != 0) {
+    if (err.find("Skipping clustered") != err.npos)
+      throw LVMClusterLockingError();
     throw String("lvs failed");
+  }
   vector<String> lines = utils::split(out, "\n");
   for (vector<String>::iterator iter = lines.begin();
        iter != lines.end();
@@ -381,8 +392,11 @@
   args.push_back("-c");
   if (utils::execute(LVM_BIN_PATH, args, out, err, status))
     throw command_not_found_error_msg(LVM_BIN_PATH);
-  if (status != 0)
+  if (status != 0) {
+    if (err.find("Skipping clustered") != err.npos)
+      throw LVMClusterLockingError();
     throw String("lvdisplay failed");
+  }
   vector<String> lines = utils::split(out, "\n");
   for (vector<String>::iterator iter = lines.begin();
        iter != lines.end();
@@ -441,7 +455,7 @@
 {
   if (clustered &&
       !clustered_enabled())
-    throw ClvmdError();
+    throw LVMClusterLockingError();
   
   vector<String> args;
   args.push_back("vgcreate");
@@ -524,7 +538,7 @@
 {
   if (clustered &&
       !clustered_enabled())
-    throw ClvmdError();
+    throw LVMClusterLockingError();
   
   vector<String> args;
   args.push_back("vgchange");
@@ -701,6 +715,8 @@
 bool
 cluster_quorate()
 {
+  // called only if cluster locking is enabled
+  
   bool use_magma = true;
   if (access("/sbin/magma_tool", X_OK)) 
     use_magma = false;
@@ -714,11 +730,8 @@
     if (utils::execute("/sbin/magma_tool", args, out, err, status))
       throw command_not_found_error_msg("magma_tool");
     if (status)
-      throw String("cluster tools: magma_tool errored");
-    if (out.find("Quorate") != out.npos)
-      return true;
-    else
-      return false;
+      throw ClusterNotRunningError();
+    return out.find("Quorate") != out.npos;
   } else {
     // use cman_tool
     String cman_tool_path = "/sbin/cman_tool";
@@ -732,7 +745,7 @@
     if (utils::execute(cman_tool_path, args, out, err, status))
       throw command_not_found_error_msg("cman_tool");
     if (status)
-      throw String("cluster tools: cman_tool errored");
+      throw ClusterNotRunningError();
     
     long long quorum = -1;
     long long votes = -1;
@@ -756,7 +769,7 @@
     
     if (quorum <= 0 ||
 	votes < 0)
-      throw String("Unable to retrieve cluster quorum info");
+      throw String("Unable to determine cluster quorum status");
     return votes >= quorum;
   }
 }
@@ -824,8 +837,11 @@
   //    args.push_back(vgname);
   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();
@@ -873,11 +889,14 @@
     throw command_not_found_error_msg(LVM_BIN_PATH);
   
   bool use_pvdisplay = false;
-  if (status)
+  if (status) {
+    if (err.find("Skipping clustered") != err.npos)
+      throw LVMClusterLockingError();
     // wouldn't `pvdisplay -c` fail if `pvs` has already failed?
     // `pvs` fails if it cannot read one hard drive (common in SANs), 
     // while pvdisplay reports without failure
     use_pvdisplay = true;
+  }
   
   if (use_pvdisplay) {
     args.clear();
@@ -885,8 +904,11 @@
     args.push_back("-c");
     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("pvs and pvdisplay failed");
+    }
     
     vector<String> lines = utils::split(utils::strip(out), "\n");
     for (vector<String>::iterator iter = lines.begin();
--- conga/ricci/modules/storage/PV.cpp	2006/12/12 13:26:24	1.4.2.1
+++ conga/ricci/modules/storage/PV.cpp	2007/03/05 20:14:00	1.4.2.2
@@ -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);
--- conga/ricci/modules/storage/VG.cpp	2006/12/12 13:26:24	1.8.2.1
+++ conga/ricci/modules/storage/VG.cpp	2007/03/05 20:14:00	1.8.2.2
@@ -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();



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Cluster-devel] conga luci/site/luci/Extensions/StorageReport. ...
@ 2007-03-05 20:22 kupcevic
  0 siblings, 0 replies; 5+ messages in thread
From: kupcevic @ 2007-03-05 20:22 UTC (permalink / raw)
  To: cluster-devel.redhat.com

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

--- conga/luci/site/luci/Extensions/StorageReport.py	2006/12/06 22:34:09	1.22
+++ conga/luci/site/luci/Extensions/StorageReport.py	2007/03/05 20:22:35	1.22.2.1
@@ -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
--- conga/ricci/test_suite/README	2006/10/27 19:30:30	1.1
+++ conga/ricci/test_suite/README	2007/03/05 20:22:35	1.1.2.1
@@ -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
--- conga/ricci/modules/storage/ClusterNotQuorateError.h	2006/08/10 22:53:09	1.2
+++ conga/ricci/modules/storage/ClusterNotQuorateError.h	2007/03/05 20:22:36	1.2.4.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()
     {}
   
--- conga/ricci/modules/storage/ClvmdError.h	2006/08/10 22:53:09	1.2
+++ conga/ricci/modules/storage/ClvmdError.h	2007/03/05 20:22:36	1.2.4.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()
     {}
   
--- conga/ricci/modules/storage/LV.cpp	2006/12/12 13:11:51	1.7
+++ conga/ricci/modules/storage/LV.cpp	2007/03/05 20:22:36	1.7.2.1
@@ -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());
--- conga/ricci/modules/storage/LVM.cpp	2007/01/16 17:05:27	1.11
+++ conga/ricci/modules/storage/LVM.cpp	2007/03/05 20:22:36	1.11.2.1
@@ -29,6 +29,8 @@
 #include "defines.h"
 #include "ClvmdError.h"
 #include "ClusterNotQuorateError.h"
+#include "ClusterNotRunningError.h"
+#include "LVMClusterLockingError.h"
 
 #include <vector>
 
@@ -162,8 +164,11 @@
   int status;
   if (utils::execute(LVM_BIN_PATH, args, out, err, status))
     throw command_not_found_error_msg(LVM_BIN_PATH);
-  if (status != 0)
+  if (status != 0) {
+    if (err.find("Skipping clustered") != err.npos)
+      throw LVMClusterLockingError();
     throw String("lvdisplay failed");
+  }
   
   vector<String> lines = utils::split(out, "\n");
   for (vector<String>::iterator iter = lines.begin();
@@ -213,8 +218,11 @@
   int status;
   if (utils::execute(LVM_BIN_PATH, args, out, err, status))
     throw command_not_found_error_msg(LVM_BIN_PATH);
-  if (status != 0)
+  if (status != 0) {
+    if (err.find("Skipping clustered") != err.npos)
+      throw LVMClusterLockingError();
     throw String("lvs failed");
+  }
   
   String line = utils::strip(out);
   vector<String> words = utils::split(line, ";");
@@ -268,8 +276,11 @@
   args.push_back("lv_name,vg_name,origin");
   if (utils::execute(LVM_BIN_PATH, args, out, err, status))
     throw command_not_found_error_msg(LVM_BIN_PATH);
-  if (status != 0)
+  if (status != 0) {
+    if (err.find("Skipping clustered") != err.npos)
+      throw LVMClusterLockingError();
     throw String("lvs failed");
+  }
   vector<String> lines = utils::split(out, "\n");
   for (vector<String>::iterator iter = lines.begin();
        iter != lines.end();
@@ -381,8 +392,11 @@
   args.push_back("-c");
   if (utils::execute(LVM_BIN_PATH, args, out, err, status))
     throw command_not_found_error_msg(LVM_BIN_PATH);
-  if (status != 0)
+  if (status != 0) {
+    if (err.find("Skipping clustered") != err.npos)
+      throw LVMClusterLockingError();
     throw String("lvdisplay failed");
+  }
   vector<String> lines = utils::split(out, "\n");
   for (vector<String>::iterator iter = lines.begin();
        iter != lines.end();
@@ -441,7 +455,7 @@
 {
   if (clustered &&
       !clustered_enabled())
-    throw ClvmdError();
+    throw LVMClusterLockingError();
   
   vector<String> args;
   args.push_back("vgcreate");
@@ -524,7 +538,7 @@
 {
   if (clustered &&
       !clustered_enabled())
-    throw ClvmdError();
+    throw LVMClusterLockingError();
   
   vector<String> args;
   args.push_back("vgchange");
@@ -701,6 +715,8 @@
 bool
 cluster_quorate()
 {
+  // called only if cluster locking is enabled
+  
   bool use_magma = true;
   if (access("/sbin/magma_tool", X_OK)) 
     use_magma = false;
@@ -714,11 +730,8 @@
     if (utils::execute("/sbin/magma_tool", args, out, err, status))
       throw command_not_found_error_msg("magma_tool");
     if (status)
-      throw String("cluster tools: magma_tool errored");
-    if (out.find("Quorate") != out.npos)
-      return true;
-    else
-      return false;
+      throw ClusterNotRunningError();
+    return out.find("Quorate") != out.npos;
   } else {
     // use cman_tool
     String cman_tool_path = "/sbin/cman_tool";
@@ -732,7 +745,7 @@
     if (utils::execute(cman_tool_path, args, out, err, status))
       throw command_not_found_error_msg("cman_tool");
     if (status)
-      throw String("cluster tools: cman_tool errored");
+      throw ClusterNotRunningError();
     
     long long quorum = -1;
     long long votes = -1;
@@ -756,7 +769,7 @@
     
     if (quorum <= 0 ||
 	votes < 0)
-      throw String("Unable to retrieve cluster quorum info");
+      throw String("Unable to determine cluster quorum status");
     return votes >= quorum;
   }
 }
@@ -824,8 +837,11 @@
   //    args.push_back(vgname);
   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();
@@ -873,11 +889,14 @@
     throw command_not_found_error_msg(LVM_BIN_PATH);
   
   bool use_pvdisplay = false;
-  if (status)
+  if (status) {
+    if (err.find("Skipping clustered") != err.npos)
+      throw LVMClusterLockingError();
     // wouldn't `pvdisplay -c` fail if `pvs` has already failed?
     // `pvs` fails if it cannot read one hard drive (common in SANs), 
     // while pvdisplay reports without failure
     use_pvdisplay = true;
+  }
   
   if (use_pvdisplay) {
     args.clear();
@@ -885,8 +904,11 @@
     args.push_back("-c");
     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("pvs and pvdisplay failed");
+    }
     
     vector<String> lines = utils::split(utils::strip(out), "\n");
     for (vector<String>::iterator iter = lines.begin();
--- conga/ricci/modules/storage/PV.cpp	2006/12/12 13:11:51	1.5
+++ conga/ricci/modules/storage/PV.cpp	2007/03/05 20:22:36	1.5.2.1
@@ -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);
--- conga/ricci/modules/storage/VG.cpp	2006/12/12 13:11:51	1.9
+++ conga/ricci/modules/storage/VG.cpp	2007/03/05 20:22:36	1.9.2.1
@@ -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();



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Cluster-devel] conga luci/site/luci/Extensions/StorageReport. ...
@ 2007-03-05 20:45 kupcevic
  0 siblings, 0 replies; 5+ messages in thread
From: kupcevic @ 2007-03-05 20:45 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	kupcevic at sourceware.org	2007-03-05 20:45:18

Modified files:
	luci/site/luci/Extensions: StorageReport.py 
	ricci/docs     : storage_api.html 
	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&r1=1.22&r2=1.23
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/docs/storage_api.html.diff?cvsroot=cluster&r1=1.6&r2=1.7
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/test_suite/README.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/ClusterNotRunningError.h.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/LVMClusterLockingError.h.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/ClusterNotQuorateError.h.diff?cvsroot=cluster&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/ClvmdError.h.diff?cvsroot=cluster&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/LV.cpp.diff?cvsroot=cluster&r1=1.7&r2=1.8
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/LVM.cpp.diff?cvsroot=cluster&r1=1.11&r2=1.12
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/PV.cpp.diff?cvsroot=cluster&r1=1.5&r2=1.6
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/storage/VG.cpp.diff?cvsroot=cluster&r1=1.9&r2=1.10

--- conga/luci/site/luci/Extensions/StorageReport.py	2006/12/06 22:34:09	1.22
+++ conga/luci/site/luci/Extensions/StorageReport.py	2007/03/05 20:45:17	1.23
@@ -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
--- conga/ricci/docs/storage_api.html	2006/12/12 13:11:50	1.6
+++ conga/ricci/docs/storage_api.html	2007/03/05 20:45:17	1.7
@@ -78,6 +78,13 @@
 	operations to hang until quorum is regained. User should make
 	cluster quorate before continuing. 
 	</P>
+	<LI><P>6 ??? cluster locking not enabled<BR>LVM is not configured to use cluster
+	locking mechanism, but some volumes are marked clustered. 
+	User should enable cluster locking. 
+	</P>
+	<LI><P>7 ??? cluster not running on node<BR>LVM is configured to use cluster
+	locking mechanism, but cluster is not running on local node. 
+	</P>
 </UL>
 <P><BR><BR>
 </P>
--- conga/ricci/test_suite/README	2006/10/27 19:30:30	1.1
+++ conga/ricci/test_suite/README	2007/03/05 20:45:17	1.2
@@ -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
--- conga/ricci/modules/storage/ClusterNotRunningError.h	2007/03/05 20:13:59	1.1
+++ conga/ricci/modules/storage/ClusterNotRunningError.h	2007/03/05 20:45:17	1.2
@@ -0,0 +1,41 @@
+/*
+  Copyright Red Hat, Inc. 2007
+
+  This program is free software; you can redistribute it and/or modify it
+  under the terms of the GNU General Public License as published by the
+  Free Software Foundation; either version 2, or (at your option) any
+  later version.
+
+  This program is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program; see the file COPYING.  If not, write to the
+  Free Software Foundation, Inc.,  675 Mass Ave, Cambridge, 
+  MA 02139, USA.
+*/
+/*
+ * Author: Stanko Kupcevic <kupcevic@redhat.com>
+ */
+
+
+#ifndef ClusterNotRunningError_h
+#define ClusterNotRunningError_h
+
+#include "Except.h"
+
+
+class ClusterNotRunningError : public Except
+{
+ public:
+  ClusterNotRunningError()
+    : Except(7, String("Cluster infrastructure is not active")) {}
+  virtual ~ClusterNotRunningError()
+    {}
+  
+};
+
+
+#endif  // ClusterNotRunningError_h
--- conga/ricci/modules/storage/LVMClusterLockingError.h	2007/03/05 20:14:00	1.1
+++ conga/ricci/modules/storage/LVMClusterLockingError.h	2007/03/05 20:45:17	1.2
@@ -0,0 +1,41 @@
+/*
+  Copyright Red Hat, Inc. 2007
+
+  This program is free software; you can redistribute it and/or modify it
+  under the terms of the GNU General Public License as published by the
+  Free Software Foundation; either version 2, or (at your option) any
+  later version.
+
+  This program is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program; see the file COPYING.  If not, write to the
+  Free Software Foundation, Inc.,  675 Mass Ave, Cambridge, 
+  MA 02139, USA.
+*/
+/*
+ * Author: Stanko Kupcevic <kupcevic@redhat.com>
+ */
+
+
+#ifndef LVMClusterLockingError_h
+#define LVMClusterLockingError_h
+
+#include "Except.h"
+
+
+class LVMClusterLockingError : public Except
+{
+ public:
+  LVMClusterLockingError()
+    : Except(6, String("LVM cluster locking is not enabled")) {}
+  virtual ~LVMClusterLockingError()
+    {}
+  
+};
+
+
+#endif  // LVMClusterLockingError_h
--- conga/ricci/modules/storage/ClusterNotQuorateError.h	2006/08/10 22:53:09	1.2
+++ conga/ricci/modules/storage/ClusterNotQuorateError.h	2007/03/05 20:45:17	1.3
@@ -31,7 +31,7 @@
 {
  public:
   ClusterNotQuorateError()
-    : Except(5, String("Quorum required, but cluster not quorate")) {}
+    : Except(5, String("Cluster is not quorate")) {}
   virtual ~ClusterNotQuorateError()
     {}
   
--- conga/ricci/modules/storage/ClvmdError.h	2006/08/10 22:53:09	1.2
+++ conga/ricci/modules/storage/ClvmdError.h	2007/03/05 20:45:17	1.3
@@ -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()
     {}
   
--- conga/ricci/modules/storage/LV.cpp	2006/12/12 13:11:51	1.7
+++ conga/ricci/modules/storage/LV.cpp	2007/03/05 20:45:17	1.8
@@ -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());
--- conga/ricci/modules/storage/LVM.cpp	2007/01/16 17:05:27	1.11
+++ conga/ricci/modules/storage/LVM.cpp	2007/03/05 20:45:17	1.12
@@ -29,6 +29,8 @@
 #include "defines.h"
 #include "ClvmdError.h"
 #include "ClusterNotQuorateError.h"
+#include "ClusterNotRunningError.h"
+#include "LVMClusterLockingError.h"
 
 #include <vector>
 
@@ -162,8 +164,11 @@
   int status;
   if (utils::execute(LVM_BIN_PATH, args, out, err, status))
     throw command_not_found_error_msg(LVM_BIN_PATH);
-  if (status != 0)
+  if (status != 0) {
+    if (err.find("Skipping clustered") != err.npos)
+      throw LVMClusterLockingError();
     throw String("lvdisplay failed");
+  }
   
   vector<String> lines = utils::split(out, "\n");
   for (vector<String>::iterator iter = lines.begin();
@@ -213,8 +218,11 @@
   int status;
   if (utils::execute(LVM_BIN_PATH, args, out, err, status))
     throw command_not_found_error_msg(LVM_BIN_PATH);
-  if (status != 0)
+  if (status != 0) {
+    if (err.find("Skipping clustered") != err.npos)
+      throw LVMClusterLockingError();
     throw String("lvs failed");
+  }
   
   String line = utils::strip(out);
   vector<String> words = utils::split(line, ";");
@@ -268,8 +276,11 @@
   args.push_back("lv_name,vg_name,origin");
   if (utils::execute(LVM_BIN_PATH, args, out, err, status))
     throw command_not_found_error_msg(LVM_BIN_PATH);
-  if (status != 0)
+  if (status != 0) {
+    if (err.find("Skipping clustered") != err.npos)
+      throw LVMClusterLockingError();
     throw String("lvs failed");
+  }
   vector<String> lines = utils::split(out, "\n");
   for (vector<String>::iterator iter = lines.begin();
        iter != lines.end();
@@ -381,8 +392,11 @@
   args.push_back("-c");
   if (utils::execute(LVM_BIN_PATH, args, out, err, status))
     throw command_not_found_error_msg(LVM_BIN_PATH);
-  if (status != 0)
+  if (status != 0) {
+    if (err.find("Skipping clustered") != err.npos)
+      throw LVMClusterLockingError();
     throw String("lvdisplay failed");
+  }
   vector<String> lines = utils::split(out, "\n");
   for (vector<String>::iterator iter = lines.begin();
        iter != lines.end();
@@ -441,7 +455,7 @@
 {
   if (clustered &&
       !clustered_enabled())
-    throw ClvmdError();
+    throw LVMClusterLockingError();
   
   vector<String> args;
   args.push_back("vgcreate");
@@ -524,7 +538,7 @@
 {
   if (clustered &&
       !clustered_enabled())
-    throw ClvmdError();
+    throw LVMClusterLockingError();
   
   vector<String> args;
   args.push_back("vgchange");
@@ -701,6 +715,8 @@
 bool
 cluster_quorate()
 {
+  // called only if cluster locking is enabled
+  
   bool use_magma = true;
   if (access("/sbin/magma_tool", X_OK)) 
     use_magma = false;
@@ -714,11 +730,8 @@
     if (utils::execute("/sbin/magma_tool", args, out, err, status))
       throw command_not_found_error_msg("magma_tool");
     if (status)
-      throw String("cluster tools: magma_tool errored");
-    if (out.find("Quorate") != out.npos)
-      return true;
-    else
-      return false;
+      throw ClusterNotRunningError();
+    return out.find("Quorate") != out.npos;
   } else {
     // use cman_tool
     String cman_tool_path = "/sbin/cman_tool";
@@ -732,7 +745,7 @@
     if (utils::execute(cman_tool_path, args, out, err, status))
       throw command_not_found_error_msg("cman_tool");
     if (status)
-      throw String("cluster tools: cman_tool errored");
+      throw ClusterNotRunningError();
     
     long long quorum = -1;
     long long votes = -1;
@@ -756,7 +769,7 @@
     
     if (quorum <= 0 ||
 	votes < 0)
-      throw String("Unable to retrieve cluster quorum info");
+      throw String("Unable to determine cluster quorum status");
     return votes >= quorum;
   }
 }
@@ -824,8 +837,11 @@
   //    args.push_back(vgname);
   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();
@@ -873,11 +889,14 @@
     throw command_not_found_error_msg(LVM_BIN_PATH);
   
   bool use_pvdisplay = false;
-  if (status)
+  if (status) {
+    if (err.find("Skipping clustered") != err.npos)
+      throw LVMClusterLockingError();
     // wouldn't `pvdisplay -c` fail if `pvs` has already failed?
     // `pvs` fails if it cannot read one hard drive (common in SANs), 
     // while pvdisplay reports without failure
     use_pvdisplay = true;
+  }
   
   if (use_pvdisplay) {
     args.clear();
@@ -885,8 +904,11 @@
     args.push_back("-c");
     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("pvs and pvdisplay failed");
+    }
     
     vector<String> lines = utils::split(utils::strip(out), "\n");
     for (vector<String>::iterator iter = lines.begin();
--- conga/ricci/modules/storage/PV.cpp	2006/12/12 13:11:51	1.5
+++ conga/ricci/modules/storage/PV.cpp	2007/03/05 20:45:17	1.6
@@ -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);
--- conga/ricci/modules/storage/VG.cpp	2006/12/12 13:11:51	1.9
+++ conga/ricci/modules/storage/VG.cpp	2007/03/05 20:45:17	1.10
@@ -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();



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-03-05 20:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-05 20:45 [Cluster-devel] conga luci/site/luci/Extensions/StorageReport. kupcevic
  -- strict thread matches above, loose matches on Subject: below --
2007-03-05 20:22 kupcevic
2007-03-05 20:14 kupcevic
2006-11-29 18:26 rmccabe
2006-10-05 16:11 kupcevic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).