implement a collectd composable service
authorLars Kellogg-Stedman <lars@redhat.com>
Wed, 21 Dec 2016 18:14:01 +0000 (13:14 -0500)
committerEmilien Macchi <emilien@redhat.com>
Tue, 7 Feb 2017 11:54:14 +0000 (11:54 +0000)
The collectd composable service permits an operator to configure
collectd metrics collection as part of the overcloud install.

Depends-on: I03cfbd96778a76125d18e2ca2f48d96e292608de
Change-Id: I143565329f5128f15cc39c9b62a6b242666383ab

ci/environments/scenario001-multinode.yaml
environments/collectd-environment.yaml [new file with mode: 0644]
overcloud-resource-registry-puppet.j2.yaml
puppet/services/memcached.yaml
puppet/services/metrics/collectd.yaml [new file with mode: 0644]
puppet/services/nova-compute.yaml
roles_data.yaml

index f75c0fd..69bf7c9 100644 (file)
@@ -5,6 +5,7 @@ resource_registry:
   OS::TripleO::Services::CephOSD: /usr/share/openstack-tripleo-heat-templates/puppet/services/ceph-osd.yaml
   OS::TripleO::Services::CephClient: /usr/share/openstack-tripleo-heat-templates/puppet/services/ceph-client.yaml
   OS::TripleO::Services::PankoApi: /usr/share/openstack-tripleo-heat-templates/puppet/services/panko-api.yaml
+  OS::TripleO::Services::Collectd: /usr/share/openstack-tripleo-heat-templates/puppet/services/metrics/collectd.yaml
 
 parameter_defaults:
   ControllerServices:
@@ -60,6 +61,7 @@ parameter_defaults:
     - OS::TripleO::Services::CinderBackup
     - OS::TripleO::Services::CinderScheduler
     - OS::TripleO::Services::CinderVolume
+    - OS::TripleO::Services::Collectd
   ControllerExtraConfig:
     nova::compute::libvirt::services::libvirt_virt_type: qemu
     nova::compute::libvirt::libvirt_virt_type: qemu
@@ -91,3 +93,5 @@ parameter_defaults:
     * evidence of criminal activity, system personnel may provide    *
     * the evidence from such monitoring to law enforcement officials.*
     ******************************************************************
+  CollectdExtraPlugins:
+    - rrdtool
diff --git a/environments/collectd-environment.yaml b/environments/collectd-environment.yaml
new file mode 100644 (file)
index 0000000..7780530
--- /dev/null
@@ -0,0 +1,23 @@
+resource_registry:
+  OS::TripleO::Services::Collectd: ../puppet/services/metrics/collectd.yaml
+
+# parameter_defaults:
+#
+## You can specify additional plugins to load using the
+## CollectdExtraPlugins key:
+#
+#   CollectdExtraPlugins:
+#     - disk
+#     - df
+#
+## You can use ExtraConfig (or one of the related *ExtraConfig keys)
+## to configure collectd.  See the documentation for puppet-collectd at
+## https://github.com/voxpupuli/puppet-collectd for details.
+#
+#   ExtraConfig:
+#     collectd::plugin::disk::disks:
+#       - "/^[vhs]d[a-f][0-9]?$/"
+#     collectd::plugin::df::mountpoints:
+#       - "/"
+#     collectd::plugin::df::ignoreselected: false
+#     collectd::plugin::cpu::valuespercentage: true
index 471a0ff..62b1cc4 100644 (file)
@@ -202,6 +202,7 @@ resource_registry:
   OS::TripleO::Services::GnocchiStatsd: puppet/services/gnocchi-statsd.yaml
   # Services that are disabled by default (use relevant environment files):
   OS::TripleO::Services::FluentdClient: OS::Heat::None
+  OS::TripleO::Services::Collectd: OS::Heat::None
   OS::TripleO::LoggingConfiguration: puppet/services/logging/fluentd-config.yaml
   OS::TripleO::Services::ManilaApi: OS::Heat::None
   OS::TripleO::Services::ManilaScheduler: OS::Heat::None
index ffa969e..eba8a58 100644 (file)
@@ -40,3 +40,11 @@ outputs:
             dport: 11211
       step_config: |
         include ::tripleo::profile::base::memcached
+      service_config_settings:
+        collectd:
+            tripleo.collectd.plugins.memcached:
+              - memcached
+            collectd::plugin::memcached::instances:
+              local:
+                host: "%{hiera('memcached::listen_ip')}"
+                port: 11211
diff --git a/puppet/services/metrics/collectd.yaml b/puppet/services/metrics/collectd.yaml
new file mode 100644 (file)
index 0000000..e4e7dac
--- /dev/null
@@ -0,0 +1,111 @@
+heat_template_version: ocata
+
+description: Collectd client service
+
+parameters:
+  ServiceNetMap:
+    default: {}
+    description: Mapping of service_name -> network name. Typically set
+                 via parameter_defaults in the resource registry.  This
+                 mapping overrides those in ServiceNetMapDefaults.
+    type: json
+  EndpointMap:
+    default: {}
+    description: Mapping of service endpoint -> protocol. Typically set
+                 via parameter_defaults in the resource registry.
+    type: json
+  DefaultPasswords:
+    default: {}
+    type: json
+  CollectdDefaultPlugins:
+    default:
+      - disk
+      - interface
+      - load
+      - memory
+      - processes
+      - tcpconns
+    type: comma_delimited_list
+    description: >
+      List of collectd plugins to activate on all overcloud hosts.  See
+      the documentation for the puppet-collectd module for a list plugins
+      supported by the module (https://github.com/voxpupuli/puppet-collectd).
+      Set this key to override the default list of plugins.  Use
+      CollectdExtraPlugins if you want to load additional plugins without
+      overriding the defaults.
+  CollectdExtraPlugins:
+    default: []
+    type: comma_delimited_list
+    description: >
+      List of collectd plugins to activate on all overcloud hosts.  See
+      the documentation for the puppet-collectd module for a list plugins
+      supported by the module (https://github.com/voxpupuli/puppet-collectd).
+      Set this key to load plugins in addition to those in
+      CollectdDefaultPlugins.
+  CollectdServer:
+    type: string
+    description: >
+      Address of remote collectd server to which we will send
+      metrics.
+    default: ''
+  CollectdServerPort:
+    type: number
+    default: 25826
+    description: >
+      Port on remote collectd server to which we will send
+      metrics.
+  CollectdUsername:
+    type: string
+    description: >
+      Username for authenticating to the remote collectd server. The default
+      is to not configure any authentication.
+    default: ''
+  CollectdPassword:
+    type: string
+    hidden: true
+    description: >
+      Password for authenticating to the remote collectd server. The
+      default is to not configure any authentication.
+    default: ''
+  CollectdSecurityLevel:
+    type: string
+    description: >
+      Security level setting for remote collectd connection.
+    default: 'None'
+    constraints:
+      - allowed_values:
+          - None
+          - Sign
+          - Encrypt
+
+outputs:
+  role_data:
+    description: Role data for the Collectd client role.
+    value:
+      service_name: collectd
+      config_settings:
+        collectd::manage_repo: false
+        collectd::purge: true
+        collectd::recurse: true
+        collectd::purge_config: true
+        collectd::minimum_version: "5.7"
+        tripleo::profile::base::metrics::collectd::collectd_server:
+          get_param: CollectdServer
+        tripleo::profile::base::metrics::collectd::collectd_port:
+          get_param: CollectdServerPort
+        tripleo::profile::base::metrics::collectd::collectd_username:
+          get_param: CollectdUsername
+        tripleo::profile::base::metrics::collectd::collectd_password:
+          get_param: CollectdPassword
+        tripleo::profile::base::metrics::collectd::collectd_securitylevel:
+          get_param: CollectdSecurityLevel
+        tripleo.collectd.plugins.collectd:
+          yaql:
+            data:
+              default_plugins: {get_param: CollectdDefaultPlugins}
+              extra_plugins: {get_param: CollectdExtraPlugins}
+            expression: >
+              ($.data.default_plugins + $.data.extra_plugins)
+              .flatten().distinct()
+      step_config: |
+        include ::tripleo::profile::base::metrics::collectd
index 2312b63..f7484da 100644 (file)
@@ -141,3 +141,8 @@ outputs:
         # We'll probably treat it like we do with Neutron plugins.
         # Until then, just include it in the default nova-compute role.
         include tripleo::profile::base::nova::compute::libvirt
+      service_config_settings:
+        collectd:
+          tripleo.collectd.plugins.nova_compute:
+            - virt
+          collectd::plugins::virt::connection: "qemu:///system"
index b429146..cfbe7e7 100644 (file)
     - OS::TripleO::Services::OpenDaylightOvs
     - OS::TripleO::Services::SensuClient
     - OS::TripleO::Services::FluentdClient
+    - OS::TripleO::Services::Collectd
     - OS::TripleO::Services::BarbicanApi
     - OS::TripleO::Services::PankoApi
     - OS::TripleO::Services::Zaqar
     - OS::TripleO::Services::SensuClient
     - OS::TripleO::Services::FluentdClient
     - OS::TripleO::Services::AuditD
+    - OS::TripleO::Services::Collectd
 
 - name: BlockStorage
   ServicesDefault:
     - OS::TripleO::Services::SensuClient
     - OS::TripleO::Services::FluentdClient
     - OS::TripleO::Services::AuditD
+    - OS::TripleO::Services::Collectd
 
 - name: ObjectStorage
   disable_upgrade_deployment: True
     - OS::TripleO::Services::SensuClient
     - OS::TripleO::Services::FluentdClient
     - OS::TripleO::Services::AuditD
+    - OS::TripleO::Services::Collectd
 
 - name: CephStorage
   disable_upgrade_deployment: True
     - OS::TripleO::Services::SensuClient
     - OS::TripleO::Services::FluentdClient
     - OS::TripleO::Services::AuditD
+    - OS::TripleO::Services::Collectd