Add connmon support for cinder.

This will enable connmon install to also enable Cinder
to report database transactions.

Change-Id: I7100b5cd27c57bb795b6ec6a258e58cd8177ef35
This commit is contained in:
Joe Talerico 2016-01-06 14:39:09 -05:00
parent 514f76e693
commit 9a4cb2b05b
5 changed files with 62 additions and 1 deletions

View File

@ -1 +1,5 @@
[defaults]
gathering = smart
fact_caching_timeout = 86400
fact_caching = jsonfile
fact_caching_connection = /tmp/browbeat_fact_cache

View File

@ -23,3 +23,4 @@
- nova
- neutron
- keystone
- cinder

View File

@ -0,0 +1,35 @@
---
#
# Cinder handlers for browbeat install connmon
#
- name: unmanage cinder services
command: pcs resource unmanage {{ item }}
with_items:
- openstack-cinder-api
- openstack-cinder-scheduler
- openstack-cinder-volume
ignore_errors: true
- name: restart cinder services
service: name={{ item }} state=restarted
with_items:
- openstack-cinder-api
- openstack-cinder-scheduler
- openstack-cinder-volume
- name: manage cinder services
command: pcs resource manage {{ item }}
with_items:
- openstack-cinder-api
- openstack-cinder-scheduler
- openstack-cinder-volume
ignore_errors: true
- name: cleanup cinder services
command: pcs resource cleanup {{ item }}
with_items:
- openstack-cinder-api
- openstack-cinder-scheduler
- openstack-cinder-volume
ignore_errors: true

View File

@ -0,0 +1,19 @@
---
#
# Cinder connmon tasks
#
- name: Check for connmon in cinder.conf
shell: grep -Eq 'connection\s?=\s?mysql:' /etc/cinder/cinder.conf
register: cinder_mysql
ignore_errors: true
changed_when: false
- name: Enable Connmon in cinder.conf
shell: sed -i 's/mysql:/mysql+connmon:/g' /etc/cinder/cinder.conf
when: cinder_mysql.rc == 0
notify:
- unmanage cinder services
- restart cinder services
- manage cinder services
- cleanup cinder services

View File

@ -11,7 +11,9 @@ import matplotlib.cbook as cbook
from pylab import rcParams
rcParams['figure.figsize'] = 18, 10
services=['/usr/bin/nova-scheduler','/usr/bin/keystone-all','/usr/bin/nova-api','/usr/bin/nova-conductor','/usr/bin/neutron-server']
services=['/usr/bin/nova-scheduler','/usr/bin/keystone-all','/usr/bin/nova-api',
'/usr/bin/nova-conductor','/usr/bin/neutron-server','/usr/bin/cinder-api',
'/usr/bin/cinder-volume','/usr/bin/cinder-scheduler']
color_wheel=['r','g','b','y']
data = {}