aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCédric Jeanneret <cjeanner@redhat.com>2022-11-21 17:59:46 +0100
committerJake Hunsaker <jhunsake@redhat.com>2022-12-07 13:32:42 -0500
commite8f07275a2ce7ab8d323b565914e354e6fb3df95 (patch)
treed107fcb3818c8d516e11158b45b95fb1b2e8c15d
parentdfc023c35b85e4d4d665f18f89108f84d072e055 (diff)
downloadsos-e8f07275a2ce7ab8d323b565914e354e6fb3df95.tar.gz
[openstack_mistral] Collect mistral content itself
Logs as well as deploy information are located in /var/lib/mistral as well. Until now, this location was overlooked, and important information about the deploy state, configuration and potential errors were missing from the initial SOS-Report, leading to time loss for both Customer and Support. This patch intends to correct this situation, by ensuring the content is taken from the Undercloud. Notes: - this is especially important for OSP<17.0 - the location may content multiple subdirectories - the location will contain the history of the different actions done by the operator - mistral logs are moved from the openstack_instack plugin to the new openstack_mistral for the sake of consistency. The "instack" name is deprecated in OSP. Signed-off-by: Cédric Jeanneret <cjeanner@redhat.com>
-rw-r--r--sos/report/plugins/openstack_instack.py2
-rw-r--r--sos/report/plugins/openstack_mistral.py48
2 files changed, 48 insertions, 2 deletions
diff --git a/sos/report/plugins/openstack_instack.py b/sos/report/plugins/openstack_instack.py
index 582ced7b..7c0e096a 100644
--- a/sos/report/plugins/openstack_instack.py
+++ b/sos/report/plugins/openstack_instack.py
@@ -44,12 +44,10 @@ class OpenStackInstack(Plugin):
if self.get_option("all_logs"):
self.add_copy_spec([
- "/var/log/mistral/",
"/var/log/zaqar/",
])
else:
self.add_copy_spec([
- "/var/log/mistral/*.log",
"/var/log/zaqar/*.log",
])
diff --git a/sos/report/plugins/openstack_mistral.py b/sos/report/plugins/openstack_mistral.py
new file mode 100644
index 00000000..6751a36b
--- /dev/null
+++ b/sos/report/plugins/openstack_mistral.py
@@ -0,0 +1,48 @@
+# Copyright (C) 2022 Red Hat, Inc.
+
+# This file is part of the sos project: https://github.com/sosreport/sos
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions of
+# version 2 of the GNU General Public License.
+#
+# See the LICENSE file in the source distribution for further information.
+
+from sos.report.plugins import Plugin, RedHatPlugin
+
+
+MISTRAL_DIRECTORIES = [
+ '/var/log/mistral/',
+ '/var/lib/mistral/',
+ ]
+MISTRAL_LOGS = [
+ '/var/log/mistral/*.log',
+ '/var/lib/mistral/*/*.log',
+ ]
+
+
+class OpenStackMistral(Plugin, RedHatPlugin):
+ '''Gather Mistral directories content, both data from /var/lib/mistral
+ and its log from /var/log/mistral if it exists (older OSP).
+ The data also embed logs for the ansible runs launched via the service,
+ meaning we'll be able to properly debug failures therein. The rest of the
+ data are the generated environment files, also really useful in order
+ to debug an issue at deploy or day-2 operations.
+ We filter out on the presence of any "mistral" related container on the
+ host - usually the Undercloud presents mistral_engine, mistral_executor
+ and mistral_api.
+ '''
+
+ short_desc = 'OpenStack Mistral'
+
+ plugin_name = "openstack_mistral"
+ profiles = ('openstack', 'openstack_undercloud')
+ containers = ('.*mistral_engine',)
+
+ def setup(self):
+ if self.get_option('all_log'):
+ self.add_copy_spec(MISTRAL_DIRECTORIES)
+ else:
+ self.add_copy_spec(MISTRAL_LOGS)
+
+# vim: set et ts=4 sw=4 :