Skip to content

Commit

Permalink
Collect ovn logs as much as possible
Browse files Browse the repository at this point in the history
The sosreport limits to collect logs at maximum of 25 MB in a given
collection passed into add_copy_spec method. so this may lead into
logs wouldn't have fully collected when user collected sos report
without --all-logs option.
Hence this commit ensures logs and dbs collected as much as possible
when --all-logs option is not specified.

Signed-off-by: Periyasamy Palanisamy <[email protected]>
  • Loading branch information
pperiyasamy committed Aug 16, 2023
1 parent 4e2f003 commit d2be21d
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions sos/report/plugins/openshift_ovn.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,33 @@ class OpenshiftOVN(Plugin, RedHatPlugin):
profiles = ('openshift',)

def setup(self):
all_logs = self.get_option("all_logs")

self.add_copy_spec([
"/var/lib/ovn/etc/ovnnb_db.db",
"/var/lib/ovn/etc/ovnsb_db.db",
"/var/lib/openvswitch/etc/keys",
"/var/log/openvswitch/libreswan.log",
"/var/log/openvswitch/ovs-monitor-ipsec.log"
])
# Collect ovn interconnect specific files if exists.
"/var/lib/openvswitch/etc/keys"
], sizelimit=300)

# Collect ovn interconnect specific db files if exists.
self.add_copy_spec([
"/var/lib/ovn-ic/etc/ovnnb_db.db",
"/var/lib/ovn-ic/etc/ovnsb_db.db",
"/var/lib/ovn-ic/etc/libovsdb*log*"
])
"/var/lib/ovn-ic/etc/ovnsb_db.db"
], sizelimit=300)

# Collect ipsec logs for openvswitch and additionally libovsdb
# logs in case of ovn interconnect setup.
if not all_logs:
self.add_copy_spec([
"/var/log/openvswitch/libreswan.log",
"/var/log/openvswitch/ovs-monitor-ipsec.log"
])
self.add_copy_spec([
"/var/lib/ovn-ic/etc/libovsdb.log",
"/var/lib/ovn-ic/etc/libovsdb*log.gz"
], sizelimit=100)
else:
self.add_copy_spec("/var/lib/ovn-ic/etc/libovsdb*log*")

# The ovn cluster/status is not valid anymore for interconnect setup.
self.add_cmd_output([
Expand Down

0 comments on commit d2be21d

Please sign in to comment.