diff --git a/ansible/install/collectd-openstack.yml b/ansible/install/collectd-openstack.yml index 491ab2ec2..4de0d4bfc 100644 --- a/ansible/install/collectd-openstack.yml +++ b/ansible/install/collectd-openstack.yml @@ -38,6 +38,7 @@ roles: - { role: common, when: collectd_controller } - { role: epel, when: collectd_controller } + - { role: repo, when: keystone_overcloud_collectd_plugin } - { role: collectd-openstack, when: collectd_controller } tasks: - name: Collectd off if not collectd_controller diff --git a/ansible/install/grafana-dashboards.yml b/ansible/install/grafana-dashboards.yml index 1277c57bf..e56f8dd04 100644 --- a/ansible/install/grafana-dashboards.yml +++ b/ansible/install/grafana-dashboards.yml @@ -16,6 +16,7 @@ static_dashboards: - cloud_gnocchi_status - cloud_instance_count + - cloud_keystone_token_count - cloud_rabbitmq_monitoring - cloud_system_performance_comparsion - three_node_performance_food_groups diff --git a/ansible/install/group_vars/all.yml b/ansible/install/group_vars/all.yml index 9e4ea6ed8..f9412450a 100644 --- a/ansible/install/group_vars/all.yml +++ b/ansible/install/group_vars/all.yml @@ -57,12 +57,19 @@ disable_ssh_dns: false # epel7 rpm for collectd packages epel7_rpm: https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm +# Extra Repos to add during collectd install +repos: + rhel-7-server-beta: + baseurl: http://walkabout.foobar.com/released/RHEL-7/7.3-Beta/Server/x86_64/os/ + # Host where connmond will be running connmon_host: 192.0.2.1 ######################################## # Collectd Configuration ######################################## +# Install collectd from EPEL +collectd_from_epel: true # Interval in seconds collectd_interval: 10 # Run collectd on specific openstack nodes: @@ -94,6 +101,12 @@ apache_controller_mod_status_port: 5001 gnocchi_status_python_plugin: false gnocchi_status_interval: 30 +######################## +# Keystone token count via dbi plugin +######################## +keystone_undercloud_collectd_plugin: false +keystone_overcloud_collectd_plugin: false + ######################## # Rabbitmq plugin ######################## diff --git a/ansible/install/roles/collectd-openstack/tasks/main.yml b/ansible/install/roles/collectd-openstack/tasks/main.yml index 75da41ff1..12ec83312 100644 --- a/ansible/install/roles/collectd-openstack/tasks/main.yml +++ b/ansible/install/roles/collectd-openstack/tasks/main.yml @@ -3,6 +3,18 @@ # Install/run collectd for Browbeat # +- name: Remove Non-EPEL collectd install + yum: + name: libcollectdclient + state: absent + become: true + when: collectd_from_epel + +- name: Clean Non-EPEL collectd configuration + shell: "rm -rf /etc/collectd.d/*.conf" + become: true + when: collectd_from_epel + # # (akrzos) yum module works at this point due to the fact the EPEL repo now exists. EPEL rpm is # installed at this point in time. @@ -16,6 +28,16 @@ - collectd-mysql - collectd-turbostat +- name: (Keystone Token Count) Install libdbi mysql driver + yum: + name: "{{item}}" + state: present + become: true + when: "(('controller' in group_names and {{keystone_overcloud_collectd_plugin}} == true and '{{inventory_hostname}}' == groups['controller'][0]) or ('undercloud' in group_names and {{keystone_undercloud_collectd_plugin}} == true))" + with_items: + - libdbi-dbd-mysql + - collectd-dbi + # Get mysql's root password - name: (Controllers Only) Get mysql root password command: hiera mysql::server::root_password diff --git a/ansible/install/roles/collectd-openstack/templates/controller.collectd.conf.j2 b/ansible/install/roles/collectd-openstack/templates/controller.collectd.conf.j2 index 46a92f04f..138acbcb8 100644 --- a/ansible/install/roles/collectd-openstack/templates/controller.collectd.conf.j2 +++ b/ansible/install/roles/collectd-openstack/templates/controller.collectd.conf.j2 @@ -21,6 +21,9 @@ LoadPlugin apache {% endif %} LoadPlugin cpu LoadPlugin conntrack +{% if keystone_overcloud_collectd_plugin %} +LoadPlugin dbi +{% endif %} LoadPlugin df LoadPlugin disk LoadPlugin exec @@ -83,14 +86,41 @@ PreCacheChain "PreCache" EscapeCharacter "_" - {% if apache_controller_collectd_plugin %} + URL "http://127.0.0.1:{{apache_controller_mod_status_port}}/mod_status?auto" {% endif %} +{% if keystone_overcloud_collectd_plugin %} +{%if inventory_hostname == groups['controller'][0] %} + + + + Statement "select count(*) as count from token" + + Type gauge + InstancePrefix "token" + ValuesFrom "count" + + + + Driver "mysql" + DriverOption "host" "localhost" + DriverOption "dbname" "keystone" + DriverOption "username" "root" + DriverOption "password" "{{mysql_root_password.stdout}}" + DriverOption "mysql_unix_socket" "/var/lib/mysql/mysql.sock" + Query token_count + + +{% else %} +# Token Count plugin installed and enabled on {{groups['controller'][0]}} +{% endif %} +{% endif %} + ValuesPercentage true diff --git a/ansible/install/roles/collectd-openstack/templates/undercloud.collectd.conf.j2 b/ansible/install/roles/collectd-openstack/templates/undercloud.collectd.conf.j2 index 51f8ee810..9f9650030 100644 --- a/ansible/install/roles/collectd-openstack/templates/undercloud.collectd.conf.j2 +++ b/ansible/install/roles/collectd-openstack/templates/undercloud.collectd.conf.j2 @@ -21,6 +21,9 @@ LoadPlugin apache {% endif %} LoadPlugin cpu LoadPlugin conntrack +{% if keystone_undercloud_collectd_plugin %} +LoadPlugin dbi +{% endif %} LoadPlugin df LoadPlugin disk LoadPlugin exec @@ -83,14 +86,35 @@ PreCacheChain "PreCache" EscapeCharacter "_" - {% if apache_undercloud_collectd_plugin %} + URL "http://127.0.0.1:{{apache_undercloud_mod_status_port}}/mod_status?auto" {% endif %} +{% if keystone_undercloud_collectd_plugin %} + + + + Statement "select count(*) as count from token" + + Type gauge + InstancePrefix "token" + ValuesFrom "count" + + + + Driver "mysql" + DriverOption "host" "localhost" + DriverOption "dbname" "keystone" + DriverOption "mysql_unix_socket" "/var/lib/mysql/mysql.sock" + Query token_count + + +{% endif %} + ValuesPercentage true diff --git a/ansible/install/roles/grafana-dashboards/files/cloud_gnocchi_status.json b/ansible/install/roles/grafana-dashboards/files/cloud_gnocchi_status.json index 2ab9fbf60..e8b80c9e0 100644 --- a/ansible/install/roles/grafana-dashboards/files/cloud_gnocchi_status.json +++ b/ansible/install/roles/grafana-dashboards/files/cloud_gnocchi_status.json @@ -54,7 +54,7 @@ "steppedLine": false, "targets": [ { - "refId": "B", + "refId": "A", "target": "aliasByMetric(aliasSub($Cloud.$Node.gnocchi_status.*, 'gauge-', ''))", "textEditor": false } diff --git a/ansible/install/roles/grafana-dashboards/files/cloud_instance_count.json b/ansible/install/roles/grafana-dashboards/files/cloud_instance_count.json index 520efbcff..fd91a7ac3 100644 --- a/ansible/install/roles/grafana-dashboards/files/cloud_instance_count.json +++ b/ansible/install/roles/grafana-dashboards/files/cloud_instance_count.json @@ -54,7 +54,7 @@ "steppedLine": false, "targets": [ { - "refId": "B", + "refId": "A", "target": "alias(sumSeries($Cloud.overcloud-*compute-*.processes-qemu-kvm.ps_count.processes), 'Sum qemu-kvm processes')", "textEditor": false } diff --git a/ansible/install/roles/grafana-dashboards/files/cloud_keystone_token_count.json b/ansible/install/roles/grafana-dashboards/files/cloud_keystone_token_count.json new file mode 100644 index 000000000..0b9777789 --- /dev/null +++ b/ansible/install/roles/grafana-dashboards/files/cloud_keystone_token_count.json @@ -0,0 +1,187 @@ +{ + "dashboard": { + "annotations": { + "list": [] + }, + "editable": true, + "gnetId": null, + "hideControls": false, + "id": null, + "links": [], + "rows": [ + { + "collapse": false, + "editable": true, + "height": "250px", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "datasource": null, + "editable": true, + "error": false, + "fill": 0, + "grid": { + "threshold1": null, + "threshold1Color": "rgba(216, 200, 27, 0.27)", + "threshold2": null, + "threshold2Color": "rgba(234, 112, 112, 0.22)" + }, + "id": 1, + "isNew": true, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": true, + "min": true, + "rightSide": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 12, + "stack": false, + "steppedLine": false, + "targets": [ + { + "refId": "A", + "target": "alias($Cloud.$Node.dbi-keystone.gauge-token, 'Tokens')", + "textEditor": false + } + ], + "timeFrom": null, + "timeShift": null, + "title": "$Node Keystone Token Count", + "tooltip": { + "msResolution": false, + "shared": true, + "sort": 0, + "value_type": "cumulative" + }, + "type": "graph", + "xaxis": { + "show": true + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + } + ], + "showTitle": true, + "title": "Token Count" + } + ], + "schemaVersion": 12, + "sharedCrosshair": false, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "allFormat": "glob", + "current": { + "text": "", + "value": "" + }, + "datasource": null, + "hide": 0, + "includeAll": false, + "multi": false, + "multiFormat": "glob", + "name": "Cloud", + "options": [], + "query": "*", + "refresh": 1, + "regex": "/^(?!stats[d]*[_counts]*$).*$/", + "type": "query" + }, + { + "current": { + "tags": [], + "text": "undercloud", + "value": "undercloud" + }, + "datasource": null, + "hide": 0, + "includeAll": false, + "multi": false, + "name": "Node", + "options": [ + { + "selected": false, + "text": "overcloud-controller-0", + "value": "overcloud-controller-0" + }, + { + "selected": true, + "text": "undercloud", + "value": "undercloud" + } + ], + "query": "$Cloud.*", + "refresh": 0, + "regex": "/.*[cu][on][dn].*/", + "type": "query" + } + ] + }, + "time": { + "from": "now-24h", + "to": "now" + }, + "timepicker": { + "now": true, + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "utc", + "title": "Cloud Keystone Token Count", + "version": 2 + } +} diff --git a/ansible/install/roles/grafana-dashboards/files/cloud_rabbitmq_monitoring.json b/ansible/install/roles/grafana-dashboards/files/cloud_rabbitmq_monitoring.json index e5bede291..9f2d83f5c 100644 --- a/ansible/install/roles/grafana-dashboards/files/cloud_rabbitmq_monitoring.json +++ b/ansible/install/roles/grafana-dashboards/files/cloud_rabbitmq_monitoring.json @@ -49,11 +49,11 @@ "steppedLine": false, "targets": [ { - "refId": "M", + "refId": "A", "target": "alias($Cloud.$Node.processes-rabbitmq.ps_count.processes, 'rabbitmq Processes')" }, { - "refId": "N", + "refId": "B", "target": "alias($Cloud.$Node.processes-rabbitmq.ps_count.threads, 'rabbitmq Threads')" } ], @@ -125,11 +125,11 @@ "steppedLine": false, "targets": [ { - "refId": "M", + "refId": "A", "target": "alias(scale($Cloud.$Node.processes-rabbitmq.ps_cputime.syst, 0.0001), 'rabbitmq System')" }, { - "refId": "N", + "refId": "B", "target": "alias(scale($Cloud.$Node.processes-rabbitmq.ps_cputime.user, 0.0001), 'rabbitmq User')" } ], @@ -201,11 +201,11 @@ "steppedLine": false, "targets": [ { - "refId": "M", + "refId": "A", "target": "alias($Cloud.$Node.processes-rabbitmq.ps_rss, 'rabbitmq RSS')" }, { - "refId": "N", + "refId": "B", "target": "alias($Cloud.$Node.processes-rabbitmq.ps_vm, 'rabbitmq Virtual')" } ], @@ -277,11 +277,11 @@ "steppedLine": false, "targets": [ { - "refId": "M", + "refId": "A", "target": "alias($Cloud.$Node.processes-rabbitmq.ps_pagefaults.majflt, 'rabbitmq Majflt')" }, { - "refId": "N", + "refId": "B", "target": "alias($Cloud.$Node.processes-rabbitmq.ps_pagefaults.minflt, 'rabbitmq Minflt')" } ], @@ -353,11 +353,11 @@ "steppedLine": false, "targets": [ { - "refId": "M", + "refId": "A", "target": "alias($Cloud.$Node.processes-rabbitmq.ps_disk_ops.read, 'rabbitmq Read')" }, { - "refId": "N", + "refId": "B", "target": "alias($Cloud.$Node.processes-rabbitmq.ps_disk_ops.write, 'rabbitmq Write')" } ], @@ -429,11 +429,11 @@ "steppedLine": false, "targets": [ { - "refId": "M", + "refId": "A", "target": "alias($Cloud.$Node.processes-rabbitmq.ps_disk_octets.read, 'rabbitmq Read')" }, { - "refId": "N", + "refId": "B", "target": "alias($Cloud.$Node.processes-rabbitmq.ps_disk_octets.write, 'rabbitmq Write')" } ], diff --git a/ansible/install/roles/repo/tasks/main.yml b/ansible/install/roles/repo/tasks/main.yml new file mode 100644 index 000000000..10306e022 --- /dev/null +++ b/ansible/install/roles/repo/tasks/main.yml @@ -0,0 +1,10 @@ +--- +# +# Task to deploy a repo file +# + +- name: Add custom repos + template: + src: "templates/browbeat.repo.j2" + dest: /etc/yum.repos.d/browbeat.repo + become: true diff --git a/ansible/install/roles/repo/templates/browbeat.repo.j2 b/ansible/install/roles/repo/templates/browbeat.repo.j2 new file mode 100644 index 000000000..653642574 --- /dev/null +++ b/ansible/install/roles/repo/templates/browbeat.repo.j2 @@ -0,0 +1,9 @@ +# Deployed by Browbeat + +{% for key in repos %} +[{{key}}] +name={{key}} +baseurl={{repos[key].baseurl}} +gpgcheck=0 +enabled=1 +{% endfor %}