summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSwann Croiset <scroiset@mirantis.com>2017-02-01 15:57:34 +0100
committerSwann Croiset <scroiset@mirantis.com>2017-02-09 12:54:36 +0000
commita5c154d6ef7cd5cb54e4bb02b4635faeac2fea4a (patch)
tree198ed40f7f5c26abb48ce4f3f317310166cf32fa
parente805c9fe585d8c1f26892f406774768064e53d48 (diff)
Configure pagination for OpenStack collectd plugins
Notes
Notes (review): Code-Review-1: Olivier Bourdon <obourdon@mirantis.com> Code-Review+2: Simon Pasquier <spasquier@mirantis.com> Workflow+1: Swann Croiset <scroiset@mirantis.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Thu, 09 Feb 2017 12:55:18 +0000 Reviewed-on: https://review.openstack.org/427750 Project: openstack/fuel-plugin-lma-collector Branch: refs/heads/master
-rw-r--r--deployment_scripts/puppet/manifests/collectd.pp28
-rw-r--r--deployment_scripts/puppet/modules/lma_collector/README.md12
-rw-r--r--deployment_scripts/puppet/modules/lma_collector/manifests/collectd/openstack.pp23
3 files changed, 53 insertions, 10 deletions
diff --git a/deployment_scripts/puppet/manifests/collectd.pp b/deployment_scripts/puppet/manifests/collectd.pp
index 7e6ab37..2edd29f 100644
--- a/deployment_scripts/puppet/manifests/collectd.pp
+++ b/deployment_scripts/puppet/manifests/collectd.pp
@@ -162,16 +162,36 @@ if hiera('lma::collector::influxdb::server', false) {
162 require => Class['lma_collector::collectd::base'], 162 require => Class['lma_collector::collectd::base'],
163 } 163 }
164 $openstack_services = { 164 $openstack_services = {
165 'nova' => $openstack_service_config,
166 'nova_services' => $openstack_service_config, 165 'nova_services' => $openstack_service_config,
167 'cinder' => $openstack_service_config,
168 'cinder_services' => $openstack_service_config, 166 'cinder_services' => $openstack_service_config,
169 'glance' => $openstack_service_config,
170 'keystone' => $openstack_service_config, 167 'keystone' => $openstack_service_config,
171 'neutron' => $openstack_service_config,
172 'neutron_agents' => $openstack_service_config, 168 'neutron_agents' => $openstack_service_config,
173 } 169 }
170
171 $nova_polling = {
172 'polling_interval' => 60,
173 'pagination_limit' => 500,
174 }
175 $cinder_polling = {
176 'polling_interval' => 60,
177 'pagination_limit' => 500,
178 }
179 $glance_polling = {
180 'polling_interval' => 60,
181 'pagination_limit' => 25,
182 }
183 $neutron_polling = {
184 'polling_interval' => 60,
185 'pagination_limit' => 100,
186 }
187 $openstack_resources = {
188 'nova' => merge($openstack_service_config, $nova_polling),
189 'cinder' => merge($openstack_service_config, $cinder_polling),
190 'glance' => merge($openstack_service_config, $glance_polling),
191 'neutron' => merge($openstack_service_config, $neutron_polling),
192 }
174 create_resources(lma_collector::collectd::openstack, $openstack_services) 193 create_resources(lma_collector::collectd::openstack, $openstack_services)
194 create_resources(lma_collector::collectd::openstack, $openstack_resources)
175 195
176 # FIXME(elemoine) use the special attribute * when Fuel uses a Puppet version 196 # FIXME(elemoine) use the special attribute * when Fuel uses a Puppet version
177 # that supports it. 197 # that supports it.
diff --git a/deployment_scripts/puppet/modules/lma_collector/README.md b/deployment_scripts/puppet/modules/lma_collector/README.md
index 7d667d9..e7b12d4 100644
--- a/deployment_scripts/puppet/modules/lma_collector/README.md
+++ b/deployment_scripts/puppet/modules/lma_collector/README.md
@@ -176,10 +176,12 @@ the `lma_collector::collectd::openstack` define:
176 176
177```puppet 177```puppet
178lma_collector::collectd::openstack { 'nova': 178lma_collector::collectd::openstack { 'nova':
179 user => 'user', 179 user => 'user',
180 password => 'password', 180 password => 'password',
181 tenant => 'tenant', 181 tenant => 'tenant',
182 keystone_url => 'http://example.com/keystone', 182 keystone_url => 'http://example.com/keystone',
183 polling_interval => 60,
184 pagination_limit => 500,
183} 185}
184``` 186```
185 187
@@ -965,6 +967,8 @@ The resource title should be set to the service name (e.g. `'nova'`).
965 [`lma_collector::collectd::pacemaker`](#class-lma_collectorcollectdpacemaker) 967 [`lma_collector::collectd::pacemaker`](#class-lma_collectorcollectdpacemaker)
966 class should be declared, with its `master_resource` parameter set to the 968 class should be declared, with its `master_resource` parameter set to the
967 same value as this parameter. Valid options: a string. Default: `undef`. 969 same value as this parameter. Valid options: a string. Default: `undef`.
970* `polling_interval`: *Optional*. The interval used to poll the resources.
971* `pagination_limit`: *Optional*. The number of resource returned by request.
968 972
969#### Define `lma_collector::collectd::dbi_services` 973#### Define `lma_collector::collectd::dbi_services`
970 974
diff --git a/deployment_scripts/puppet/modules/lma_collector/manifests/collectd/openstack.pp b/deployment_scripts/puppet/modules/lma_collector/manifests/collectd/openstack.pp
index c14e1bf..3a5cf4a 100644
--- a/deployment_scripts/puppet/modules/lma_collector/manifests/collectd/openstack.pp
+++ b/deployment_scripts/puppet/modules/lma_collector/manifests/collectd/openstack.pp
@@ -21,6 +21,8 @@ define lma_collector::collectd::openstack (
21 $timeout = 20, 21 $timeout = 20,
22 $max_retries = 2, 22 $max_retries = 2,
23 $pacemaker_master_resource = undef, 23 $pacemaker_master_resource = undef,
24 $polling_interval = undef,
25 $pagination_limit = undef,
24) { 26) {
25 27
26 include lma_collector::params 28 include lma_collector::params
@@ -46,12 +48,29 @@ define lma_collector::collectd::openstack (
46 'Timeout' => "\"${timeout}\"", 48 'Timeout' => "\"${timeout}\"",
47 'MaxRetries' => "\"${max_retries}\"", 49 'MaxRetries' => "\"${max_retries}\"",
48 } 50 }
51 if $polling_interval {
52 validate_integer($polling_interval)
53 $polling_config = {
54 'PollingInterval' => "\"${polling_interval}\""
55 }
56 } else {
57 $polling_config = {}
58 }
59 if $pagination_limit {
60 validate_integer($pagination_limit)
61 $limit_config = {
62 'PaginationLimit' => "\"${pagination_limit}\""
63 }
64 } else {
65 $limit_config = {}
66 }
49 67
50 if $pacemaker_master_resource { 68 if $pacemaker_master_resource {
51 $real_config = merge($config, {'DependsOnResource' => "\"${pacemaker_master_resource}\""}) 69 $pacemaker_config = {'DependsOnResource' => "\"${pacemaker_master_resource}\""}
52 } else { 70 } else {
53 $real_config = $config 71 $pacemaker_config = {}
54 } 72 }
73 $real_config = merge($config, $pacemaker_config, $polling_config, $limit_config)
55 74
56 lma_collector::collectd::python { "openstack_${title}": 75 lma_collector::collectd::python { "openstack_${title}":
57 config => $real_config, 76 config => $real_config,