diff --git a/ansible/ansible.cfg b/ansible/ansible.cfg index 0440d4894..85481a152 100644 --- a/ansible/ansible.cfg +++ b/ansible/ansible.cfg @@ -1 +1,5 @@ [defaults] +gathering = smart +fact_caching_timeout = 86400 +fact_caching = jsonfile +fact_caching_connection = /tmp/browbeat_fact_cache diff --git a/ansible/install/connmon.yml b/ansible/install/connmon.yml index cfdb2fc76..7e9f38d6a 100644 --- a/ansible/install/connmon.yml +++ b/ansible/install/connmon.yml @@ -23,3 +23,4 @@ - nova - neutron - keystone + - cinder diff --git a/ansible/install/roles/cinder/handlers/main.yml b/ansible/install/roles/cinder/handlers/main.yml new file mode 100644 index 000000000..277125ae8 --- /dev/null +++ b/ansible/install/roles/cinder/handlers/main.yml @@ -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 diff --git a/ansible/install/roles/cinder/tasks/main.yml b/ansible/install/roles/cinder/tasks/main.yml new file mode 100644 index 000000000..300253943 --- /dev/null +++ b/ansible/install/roles/cinder/tasks/main.yml @@ -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 diff --git a/graphing/connmonplot.py b/graphing/connmonplot.py index 1f81465a1..8fe64948f 100755 --- a/graphing/connmonplot.py +++ b/graphing/connmonplot.py @@ -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 = {}