Blame SOURCES/sos-bz1083656-cluster-data-ownership.patch

c81b6a
From bb1e81e0d3d738f2f333175fc32987ed473edd8d Mon Sep 17 00:00:00 2001
c81b6a
From: Shane Bradley <sbradley@redhat.com>
c81b6a
Date: Fri, 6 Feb 2015 11:24:26 -0500
c81b6a
Subject: [PATCH] [cluster] remove some files and commands that are no longer
c81b6a
 needed
c81b6a
c81b6a
Removed some of the files and commands that are no longer needed on
c81b6a
RHEL6+.  In addition, the gfs_lockdump option did not capture gfs2 lock
c81b6a
dumps.  The option is now called gfs2_lockdump and will mount the
c81b6a
/sys/kernel/debug directory and the gfs2 lockdumps will be copied from
c81b6a
that mount point.
c81b6a
c81b6a
In addition added a couple files that are needed for pacemaker/dlm.
c81b6a
c81b6a
Resolves: rhbz#1083656
c81b6a
c81b6a
Signed-off-by: Shane Bradley <sbradley@redhat.com>
c81b6a
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
c81b6a
---
c81b6a
 sos/plugins/cluster.py | 66 +++++++++++++++++++++++++++++---------------------
c81b6a
 1 file changed, 39 insertions(+), 27 deletions(-)
c81b6a
c81b6a
diff --git a/sos/plugins/cluster.py b/sos/plugins/cluster.py
c81b6a
index 9b5eb22..a84d3e2 100644
c81b6a
--- a/sos/plugins/cluster.py
c81b6a
+++ b/sos/plugins/cluster.py
c81b6a
@@ -14,18 +14,19 @@
c81b6a
 
c81b6a
 from sos.plugins import Plugin, RedHatPlugin
c81b6a
 import re
c81b6a
+import os.path
c81b6a
 from glob import glob
c81b6a
 from datetime import datetime, timedelta
c81b6a
 
c81b6a
 
c81b6a
 class Cluster(Plugin, RedHatPlugin):
c81b6a
-    """Red Hat Cluster Suite and GFS
c81b6a
+    """Red Hat Cluster High Availability and GFS2
c81b6a
     """
c81b6a
 
c81b6a
     plugin_name = 'cluster'
c81b6a
     profiles = ('cluster',)
c81b6a
     option_list = [
c81b6a
-        ("gfslockdump", 'gather output of gfs lockdumps', 'slow', False),
c81b6a
+        ("gfs2lockdump", 'gather output of gfs2 lockdumps', 'slow', False),
c81b6a
         ("crm_from", 'specify the start time for crm_report', 'fast', False),
c81b6a
         ('lockdump', 'gather dlm lockdumps', 'slow', False)
c81b6a
     ]
c81b6a
@@ -42,12 +43,16 @@ class Cluster(Plugin, RedHatPlugin):
c81b6a
 
c81b6a
     files = ["/etc/cluster/cluster.conf"]
c81b6a
 
c81b6a
+    debugfs_path = "/sys/kernel/debug"
c81b6a
+    _debugfs_cleanup = False
c81b6a
+
c81b6a
     def setup(self):
c81b6a
 
c81b6a
         self.add_copy_spec([
c81b6a
             "/etc/cluster.conf",
c81b6a
-            "/etc/cluster.xml",
c81b6a
             "/etc/cluster",
c81b6a
+            "/etc/sysconfig/dlm",
c81b6a
+            "/etc/sysconfig/pacemaker",
c81b6a
             "/etc/sysconfig/cluster",
c81b6a
             "/etc/sysconfig/cman",
c81b6a
             "/etc/fence_virt.conf",
c81b6a
@@ -56,12 +61,12 @@ class Cluster(Plugin, RedHatPlugin):
c81b6a
             "/var/lib/luci/etc",
c81b6a
             "/var/log/cluster",
c81b6a
             "/var/log/luci",
c81b6a
-            "/etc/fence_virt.conf",
c81b6a
             "/sys/fs/gfs2/*/withdraw"
c81b6a
         ])
c81b6a
 
c81b6a
-        if self.get_option('gfslockdump'):
c81b6a
-            self.do_gfslockdump()
c81b6a
+        if self.get_option('gfs2lockdump'):
c81b6a
+            if self._mount_debug():
c81b6a
+                self.add_copy_spec(["/sys/kernel/debug/gfs2/*"])
c81b6a
 
c81b6a
         if self.get_option('lockdump'):
c81b6a
             self.do_lockdump()
c81b6a
@@ -81,7 +86,6 @@ class Cluster(Plugin, RedHatPlugin):
c81b6a
             "corosync-quorumtool -s",
c81b6a
             "corosync-cpgtool",
c81b6a
             "corosync-objctl",
c81b6a
-            "group_tool ls -g1",
c81b6a
             "gfs_control ls -n",
c81b6a
             "gfs_control dump",
c81b6a
             "fence_tool dump",
c81b6a
@@ -108,26 +112,29 @@ class Cluster(Plugin, RedHatPlugin):
c81b6a
                             % (crm_dest, crm_from))
c81b6a
 
c81b6a
     def do_lockdump(self):
c81b6a
-        dlm_tool = "dlm_tool ls"
c81b6a
-        result = self.call_ext_prog(dlm_tool)
c81b6a
-        if result['status'] != 0:
c81b6a
-            return
c81b6a
-
c81b6a
-        lock_exp = r'^name\s+([^\s]+)$'
c81b6a
-        lock_re = re.compile(lock_exp, re.MULTILINE)
c81b6a
-        for lockspace in lock_re.findall(result['output']):
c81b6a
-            self.add_cmd_output(
c81b6a
-                "dlm_tool lockdebug -svw '%s'" % lockspace,
c81b6a
-                suggest_filename="dlm_locks_%s" % lockspace
c81b6a
-            )
c81b6a
-
c81b6a
-    def do_gfslockdump(self):
c81b6a
-        mnt_exp = r'^\S+\s+([^\s]+)\s+gfs\s+.*$'
c81b6a
-        for mnt in self.do_regex_find_all(mnt_exp, "/proc/mounts"):
c81b6a
-            self.add_cmd_output(
c81b6a
-                "gfs_tool lockdump %s" % mnt,
c81b6a
-                suggest_filename="gfs_lockdump_" + self.mangle_command(mnt)
c81b6a
-            )
c81b6a
+        if self._mount_debug():
c81b6a
+            dlm_tool = "dlm_tool ls"
c81b6a
+            result = self.call_ext_prog(dlm_tool)
c81b6a
+            if result['status'] != 0:
c81b6a
+                return
c81b6a
+
c81b6a
+            lock_exp = r'^name\s+([^\s]+)$'
c81b6a
+            lock_re = re.compile(lock_exp, re.MULTILINE)
c81b6a
+            for lockspace in lock_re.findall(result['output']):
c81b6a
+                self.add_cmd_output(
c81b6a
+                    "dlm_tool lockdebug -svw '%s'" % lockspace,
c81b6a
+                    suggest_filename="dlm_locks_%s" % lockspace
c81b6a
+                )
c81b6a
+
c81b6a
+    def _mount_debug(self):
c81b6a
+        if not os.path.ismount(self.debugfs_path):
c81b6a
+            self._debugfs_cleanup = True
c81b6a
+            r = self.call_ext_prog("mount -t debugfs debugfs %s"
c81b6a
+                                   % self.debugfs_path)
c81b6a
+            if r['status'] != 0:
c81b6a
+                self._log_error("debugfs not mounted and mount attempt failed")
c81b6a
+                self._debugfs_cleanup = False
c81b6a
+        return os.path.ismount(self.debugfs_path)
c81b6a
 
c81b6a
     def postproc(self):
c81b6a
         for cluster_conf in glob("/etc/cluster/cluster.conf*"):
c81b6a
@@ -148,6 +155,11 @@ class Cluster(Plugin, RedHatPlugin):
c81b6a
             r"(.*fence.*\.passwd=)(.*)",
c81b6a
             r"\1******"
c81b6a
         )
c81b6a
+        if self._debugfs_cleanup and os.path.ismount(self.debugfs_path):
c81b6a
+            r = self.call_ext_prog("umount %s" % self.debugfs_path)
c81b6a
+            if r['status'] != 0:
c81b6a
+                self._log_error("could not unmount %s" % self.debugfs_path)
c81b6a
+
c81b6a
         return
c81b6a
 
c81b6a
 # vim: et ts=4 sw=4
c81b6a
-- 
c81b6a
1.8.3.1
c81b6a
c81b6a
From 55aebeabb2d2c87c695041cff426afaa6bd2808a Mon Sep 17 00:00:00 2001
c81b6a
From: Shane Bradley <sbradley@redhat.com>
c81b6a
Date: Tue, 17 Feb 2015 13:54:01 -0500
c81b6a
Subject: [PATCH] [cluster] add a couple pcs commands to the cluster plugin
c81b6a
c81b6a
There are 3 pcs commands added to cluster plugin to get
c81b6a
information about the status of pacemaker cluster.
c81b6a
c81b6a
Signed-off-by: Shane Bradley <sbradley@redhat.com>
c81b6a
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
c81b6a
---
c81b6a
 sos/plugins/cluster.py | 5 ++++-
c81b6a
 1 file changed, 4 insertions(+), 1 deletion(-)
c81b6a
c81b6a
diff --git a/sos/plugins/cluster.py b/sos/plugins/cluster.py
c81b6a
index 7aeed44..bd2cf8a 100644
c81b6a
--- a/sos/plugins/cluster.py
c81b6a
+++ b/sos/plugins/cluster.py
c81b6a
@@ -92,7 +92,10 @@ class Cluster(Plugin, RedHatPlugin):
c81b6a
             "fence_tool dump",
c81b6a
             "dlm_tool dump",
c81b6a
             "dlm_tool ls -n",
c81b6a
-            "mkqdisk -L"
c81b6a
+            "mkqdisk -L",
c81b6a
+            "pcs config",
c81b6a
+            "pcs status",
c81b6a
+            "pcs property list --all"
c81b6a
         ])
c81b6a
 
c81b6a
         # crm_report needs to be given a --from "YYYY-MM-DD HH:MM:SS" start
c81b6a
-- 
c81b6a
1.8.3.1
c81b6a