From a71506b31cf8803d45ee4c7f8844491293327554 Mon Sep 17 00:00:00 2001 From: Sanjay Chari Date: Thu, 26 May 2022 11:43:59 +0530 Subject: [PATCH] Add playbook to clean up sqlalchemy collectd configuration Browbeat adds configuration for sqlalchemy collectd on the configuration files of many Openstack API containers on controller hosts. This causes issues in the next overcloud deployment. This patch adds a playbook to clean up sqlalchemy collectd configuration. Closes-Bug: #1975693 Change-Id: I2574676aa444f76e11cec91d9e0e2a66282301ac --- .../install/cleanup_sqlalchemy_collectd.yml | 15 +++++++ .../tasks/main.yml | 39 +++++++++++++++++++ .../cleanup_sqlalchemy_collectd/vars/16.yml | 19 +++++++++ .../cleanup_sqlalchemy_collectd/vars/17.yml | 19 +++++++++ doc/source/usage.rst | 13 ++++++- 5 files changed, 104 insertions(+), 1 deletion(-) create mode 100644 ansible/install/cleanup_sqlalchemy_collectd.yml create mode 100644 ansible/install/roles/cleanup_sqlalchemy_collectd/tasks/main.yml create mode 100644 ansible/install/roles/cleanup_sqlalchemy_collectd/vars/16.yml create mode 100644 ansible/install/roles/cleanup_sqlalchemy_collectd/vars/17.yml diff --git a/ansible/install/cleanup_sqlalchemy_collectd.yml b/ansible/install/cleanup_sqlalchemy_collectd.yml new file mode 100644 index 000000000..e3726b0cc --- /dev/null +++ b/ansible/install/cleanup_sqlalchemy_collectd.yml @@ -0,0 +1,15 @@ +--- +# +# Playbook to clean up sqlalchemy collectd configuration on controller hosts. +# The sqlalchemy collectd configuration on containers from a previous deployment +# causes issues in the next overcloud deployment. + +- hosts: Controller + strategy: free + remote_user: "{{ host_remote_user }}" + + roles: + - { role: osp_version } + - { role: containers } + - { role: common } + - { role: cleanup_sqlalchemy_collectd } diff --git a/ansible/install/roles/cleanup_sqlalchemy_collectd/tasks/main.yml b/ansible/install/roles/cleanup_sqlalchemy_collectd/tasks/main.yml new file mode 100644 index 000000000..dd3fc8f23 --- /dev/null +++ b/ansible/install/roles/cleanup_sqlalchemy_collectd/tasks/main.yml @@ -0,0 +1,39 @@ +- name: Fetch mysql svc file paths + include_vars: + file: "vars/{{ rhosp_major }}.yml" + +- name: Get mysql string + shell: "crudini --get {{item.value.path}} database connection" + become: true + register: db_connections + with_dict: "{{ mysql_svcs }}" + +- name: Remove collectd configuration from mysql string + ini_file: + backup: true + dest: "{{ item.item.value.path }}" + section: database + option: connection + value: "{{ item.stdout[:item.stdout.index('&plugin=collectd')] }}" + with_items: "{{ db_connections.results }}" + become: true + +- name: restart containers + shell: podman restart {{ item }} + become: true + with_items: + - cinder_api + - cinder_api_cron + - cinder_scheduler + - nova_conductor + - nova_api_cron + - nova_scheduler + - nova_vnc_proxy + - nova_api + - nova_metadata + - neutron_api + - keystone + - heat_api + - heat_engine + - heat_api_cron + - heat_api_cfn diff --git a/ansible/install/roles/cleanup_sqlalchemy_collectd/vars/16.yml b/ansible/install/roles/cleanup_sqlalchemy_collectd/vars/16.yml new file mode 100644 index 000000000..d8cc04262 --- /dev/null +++ b/ansible/install/roles/cleanup_sqlalchemy_collectd/vars/16.yml @@ -0,0 +1,19 @@ +mysql_svcs: + cinder: + path: "/var/lib/config-data/puppet-generated/cinder/etc/cinder/cinder.conf" + glance: + path: "/var/lib/config-data/puppet-generated/glance_api/etc/glance/glance-api.conf" + heat: + path: "/var/lib/config-data/puppet-generated/heat/etc/heat/heat.conf" + heat_api: + path: "/var/lib/config-data/puppet-generated/heat_api/etc/heat/heat.conf" + heat_api_cnf: + path: "/var/lib/config-data/puppet-generated/heat_api_cfn/etc/heat/heat.conf" + keystone: + path: "/var/lib/config-data/puppet-generated/keystone/etc/keystone/keystone.conf" + neutron: + path: "/var/lib/config-data/puppet-generated/neutron/etc/neutron/neutron.conf" + nova: + path: "/var/lib/config-data/puppet-generated/nova/etc/nova/nova.conf" + nova_metadata: + path: "/var/lib/config-data/puppet-generated/nova_metadata/etc/nova/nova.conf" diff --git a/ansible/install/roles/cleanup_sqlalchemy_collectd/vars/17.yml b/ansible/install/roles/cleanup_sqlalchemy_collectd/vars/17.yml new file mode 100644 index 000000000..d8cc04262 --- /dev/null +++ b/ansible/install/roles/cleanup_sqlalchemy_collectd/vars/17.yml @@ -0,0 +1,19 @@ +mysql_svcs: + cinder: + path: "/var/lib/config-data/puppet-generated/cinder/etc/cinder/cinder.conf" + glance: + path: "/var/lib/config-data/puppet-generated/glance_api/etc/glance/glance-api.conf" + heat: + path: "/var/lib/config-data/puppet-generated/heat/etc/heat/heat.conf" + heat_api: + path: "/var/lib/config-data/puppet-generated/heat_api/etc/heat/heat.conf" + heat_api_cnf: + path: "/var/lib/config-data/puppet-generated/heat_api_cfn/etc/heat/heat.conf" + keystone: + path: "/var/lib/config-data/puppet-generated/keystone/etc/keystone/keystone.conf" + neutron: + path: "/var/lib/config-data/puppet-generated/neutron/etc/neutron/neutron.conf" + nova: + path: "/var/lib/config-data/puppet-generated/nova/etc/nova/nova.conf" + nova_metadata: + path: "/var/lib/config-data/puppet-generated/nova_metadata/etc/nova/nova.conf" diff --git a/doc/source/usage.rst b/doc/source/usage.rst index 6bd2df081..818f0b67e 100644 --- a/doc/source/usage.rst +++ b/doc/source/usage.rst @@ -25,7 +25,7 @@ convenience they are being mentioned here as well. :: - $ ansible-playbook -i hosts install/shaker_build.yml + $ ansible-playbook -i hosts.yml install/shaker_build.yml .. note:: The playbook to setup networking is provided as an example only and might not work for you based on your underlay/overlay network setup. In such @@ -340,6 +340,17 @@ To cleanup : $ source ~/overcloudrc $ python browbeat/rally_cleanup.py +Cleanup sqlalchemy collectd configuration +------------------------------------------ +Browbeat adds configuration for sqlalchemy collectd on the configuration files of many Openstack API containers on controller hosts. This causes issues in the +next overcloud deployment. There is a playbook to clean up sqlalchemy collectd configuration installed by Browbeat from Openstack API containers. + +To cleanup : + +:: + $ cd ansible + $ ansible-playbook -i hosts.yml install/cleanup_sqlalchemy_collectd.yml + Generate CSV file/Google Sheets from Rally json file -------------------------------------------- Rally generates a json file with data about atomic actions duration from each iteration. These atomic actions often occur multiple times within one iteration.