Blame SOURCES/sos-bz1242507-openvswitch-collect-logs-db-bridges.patch

c81b6a
From 775b2bbfb28701ec2e687f0ece68a4558cef8740 Mon Sep 17 00:00:00 2001
c81b6a
From: Lee Yarwood <lyarwood@redhat.com>
c81b6a
Date: Tue, 17 Feb 2015 14:51:00 +0000
c81b6a
Subject: [PATCH] [openvswitch] Capture additional output for OVS bridges.
c81b6a
c81b6a
This includes `dump-flows` and `fdb/show` output useful for debugging
c81b6a
Openstack tenant and L3 networking issues.
c81b6a
c81b6a
Signed-off-by: Lee Yarwood <lyarwood@redhat.com>
c81b6a
---
c81b6a
 sos/plugins/openvswitch.py | 8 ++++++++
c81b6a
 1 file changed, 8 insertions(+)
c81b6a
c81b6a
diff --git a/sos/plugins/openvswitch.py b/sos/plugins/openvswitch.py
c81b6a
index 3611671..5200563 100644
c81b6a
--- a/sos/plugins/openvswitch.py
c81b6a
+++ b/sos/plugins/openvswitch.py
c81b6a
@@ -32,6 +32,14 @@ class OpenVSwitch(Plugin):
c81b6a
         # to the Open vSwitch server, avoiding hangs when running sosreport.
c81b6a
         self.add_cmd_output("ovs-vsctl -t 5 show")
c81b6a
 
c81b6a
+        # Gather additional output for each OVS bridge on the host.
c81b6a
+        br_list_result = self.call_ext_prog("ovs-vsctl list-br")
c81b6a
+        if br_list_result['status'] == 0:
c81b6a
+            for br in br_list_result['output'].splitlines():
c81b6a
+                self.add_cmd_output("ovs-ofctl show %s" % br)
c81b6a
+                self.add_cmd_output("ovs-ofctl dump-flows %s" % br)
c81b6a
+                self.add_cmd_output("ovs-appctl fdb/show %s" % br)
c81b6a
+
c81b6a
 
c81b6a
 class RedHatOpenVSwitch(OpenVSwitch, RedHatPlugin):
c81b6a
 
c81b6a
-- 
c81b6a
1.8.3.1
c81b6a
c81b6a
From 21aff64a58a3e0f3fc5065b2e18ca3d489e16a51 Mon Sep 17 00:00:00 2001
c81b6a
From: Flavio Leitner <fbl@redhat.com>
c81b6a
Date: Fri, 19 Jun 2015 21:55:56 -0300
c81b6a
Subject: [PATCH] [openvswitch] capture the logs
c81b6a
c81b6a
Both ovs-vswitchd.log and ovsdb-server.log are useful
c81b6a
for troubleshooting.
c81b6a
c81b6a
Signed-off-by: Flavio Leitner <fbl@redhat.com>
c81b6a
---
c81b6a
 sos/plugins/openvswitch.py | 4 ++++
c81b6a
 1 file changed, 4 insertions(+)
c81b6a
c81b6a
diff --git a/sos/plugins/openvswitch.py b/sos/plugins/openvswitch.py
c81b6a
index fbf3a90..1d75608 100644
c81b6a
--- a/sos/plugins/openvswitch.py
c81b6a
+++ b/sos/plugins/openvswitch.py
c81b6a
@@ -24,6 +24,10 @@ class OpenVSwitch(Plugin):
c81b6a
     profiles = ('network', 'virt')
c81b6a
 
c81b6a
     def setup(self):
c81b6a
+        self.add_copy_spec([
c81b6a
+            "/var/log/openvswitch/ovs-vswitchd.log",
c81b6a
+            "/var/log/openvswitch/ovsdb-server.log"
c81b6a
+        ])
c81b6a
         # The '-s' option enables dumping of packet counters on the
c81b6a
         # ports.
c81b6a
         self.add_cmd_output("ovs-dpctl -s show")
c81b6a
-- 
c81b6a
1.8.3.1
c81b6a
c81b6a
From f92205495113a8403066e911baeb4f5ee59c2101 Mon Sep 17 00:00:00 2001
c81b6a
From: Flavio Leitner <fbl@redhat.com>
c81b6a
Date: Fri, 19 Jun 2015 22:05:52 -0300
c81b6a
Subject: [PATCH] [openvswitch] dump and capture the database
c81b6a
c81b6a
The database contains all the vswitch configuration and
c81b6a
is essential to understand and replicate the environment.
c81b6a
c81b6a
Signed-off-by: Flavio Leitner <fbl@redhat.com>
c81b6a
---
c81b6a
 sos/plugins/openvswitch.py | 3 +++
c81b6a
 1 file changed, 3 insertions(+)
c81b6a
c81b6a
diff --git a/sos/plugins/openvswitch.py b/sos/plugins/openvswitch.py
c81b6a
index 1d75608..4dd15b2 100644
c81b6a
--- a/sos/plugins/openvswitch.py
c81b6a
+++ b/sos/plugins/openvswitch.py
c81b6a
@@ -44,6 +44,9 @@ class OpenVSwitch(Plugin):
c81b6a
                 self.add_cmd_output("ovs-ofctl dump-flows %s" % br)
c81b6a
                 self.add_cmd_output("ovs-appctl fdb/show %s" % br)
c81b6a
 
c81b6a
+        # Gather the database.
c81b6a
+        self.add_cmd_output("ovsdb-client dump")
c81b6a
+
c81b6a
 
c81b6a
 class RedHatOpenVSwitch(OpenVSwitch, RedHatPlugin):
c81b6a
 
c81b6a
-- 
c81b6a
1.8.3.1
c81b6a
c81b6a
From 4a57c54216242acb009fdb107d52712decfdfc1e Mon Sep 17 00:00:00 2001
c81b6a
From: "Bryn M. Reeves" <bmr@redhat.com>
c81b6a
Date: Mon, 6 Jul 2015 17:31:44 +0100
c81b6a
Subject: [PATCH] [openvswitch] consolidate self.add_cmd_output() calls
c81b6a
c81b6a
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
c81b6a
---
c81b6a
 sos/plugins/openvswitch.py | 28 ++++++++++++++++------------
c81b6a
 1 file changed, 16 insertions(+), 12 deletions(-)
c81b6a
c81b6a
diff --git a/sos/plugins/openvswitch.py b/sos/plugins/openvswitch.py
c81b6a
index 4dd15b2..8d691dc 100644
c81b6a
--- a/sos/plugins/openvswitch.py
c81b6a
+++ b/sos/plugins/openvswitch.py
c81b6a
@@ -24,28 +24,32 @@ class OpenVSwitch(Plugin):
c81b6a
     profiles = ('network', 'virt')
c81b6a
 
c81b6a
     def setup(self):
c81b6a
+
c81b6a
         self.add_copy_spec([
c81b6a
             "/var/log/openvswitch/ovs-vswitchd.log",
c81b6a
             "/var/log/openvswitch/ovsdb-server.log"
c81b6a
         ])
c81b6a
-        # The '-s' option enables dumping of packet counters on the
c81b6a
-        # ports.
c81b6a
-        self.add_cmd_output("ovs-dpctl -s show")
c81b6a
 
c81b6a
-        # The '-t 5' adds an upper bound on how long to wait to connect
c81b6a
-        # to the Open vSwitch server, avoiding hangs when running sosreport.
c81b6a
-        self.add_cmd_output("ovs-vsctl -t 5 show")
c81b6a
+        self.add_cmd_output([
c81b6a
+            # The '-s' option enables dumping of packet counters on the
c81b6a
+            # ports.
c81b6a
+            "ovs-dpctl -s show",
c81b6a
+            # The '-t 5' adds an upper bound on how long to wait to connect
c81b6a
+            # to the Open vSwitch server, avoiding hangs when running sos.
c81b6a
+            "ovs-vsctl -t 5 show",
c81b6a
+            # Gather the database.
c81b6a
+            "ovsdb-client dump"
c81b6a
+        ])
c81b6a
 
c81b6a
         # Gather additional output for each OVS bridge on the host.
c81b6a
         br_list_result = self.call_ext_prog("ovs-vsctl list-br")
c81b6a
         if br_list_result['status'] == 0:
c81b6a
             for br in br_list_result['output'].splitlines():
c81b6a
-                self.add_cmd_output("ovs-ofctl show %s" % br)
c81b6a
-                self.add_cmd_output("ovs-ofctl dump-flows %s" % br)
c81b6a
-                self.add_cmd_output("ovs-appctl fdb/show %s" % br)
c81b6a
-
c81b6a
-        # Gather the database.
c81b6a
-        self.add_cmd_output("ovsdb-client dump")
c81b6a
+                self.add_cmd_output([
c81b6a
+                    "ovs-ofctl show %s" % br,
c81b6a
+                    "ovs-ofctl dump-flows %s" % br,
c81b6a
+                    "ovs-appctl fdb/show %s" % br
c81b6a
+                ])
c81b6a
 
c81b6a
 
c81b6a
 class RedHatOpenVSwitch(OpenVSwitch, RedHatPlugin):
c81b6a
-- 
c81b6a
1.8.3.1
c81b6a