From 6fc3a4c0755bec150b592df3e574311e210f83f2 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Wed, 28 Apr 2021 09:47:52 -0700 Subject: [PATCH] Collect openstack logs This will aid debugging of nova 500 errors when doing the trivial boots of cirros to validate the cloud is functional. Change-Id: Idd6d406e3a5a6ea5dd046c61c391c8f6147a9168 --- .zuul.d/jobs.yaml | 1 + .../dib-nodepool/collect-openstack-logs.yaml | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 playbooks/dib-nodepool/collect-openstack-logs.yaml diff --git a/.zuul.d/jobs.yaml b/.zuul.d/jobs.yaml index 57e4651b..24ca7dbd 100644 --- a/.zuul.d/jobs.yaml +++ b/.zuul.d/jobs.yaml @@ -139,6 +139,7 @@ under nodepool, using source versions of dependencies such as nodepool, dib, openstacksdk and glean. parent: nodepool-functional-container-openstack-siblings-base + post-run: playbooks/dib-nodepool/collect-openstack-logs.yaml vars: nodepool_debug: true diff --git a/playbooks/dib-nodepool/collect-openstack-logs.yaml b/playbooks/dib-nodepool/collect-openstack-logs.yaml new file mode 100644 index 00000000..2bf319b8 --- /dev/null +++ b/playbooks/dib-nodepool/collect-openstack-logs.yaml @@ -0,0 +1,21 @@ +- hosts: all + tasks: + - name: Copy openstack logs + ignore_errors: yes + block: + - name: Make openstack logs dir + become: true + file: + path: /var/log/nodepool/openstack + state: directory + mode: '0755' + - name: Write out openstack logs + become: true + shell: + cmd: | + u="" + name="" + for u in $(systemctl list-unit-files | grep devstack | awk '{print $1}'); do + name=$(echo $u | sed 's/devstack@/screen-/' | sed 's/\.service//') + journalctl -o short-precise --unit $u > /var/log/nodepool/openstack/$name.txt + done