Skip to content

Commit a60e4bc

Browse files
Various os_capacity fixes
1 parent a679cd4 commit a60e4bc

File tree

10 files changed

+408
-74
lines changed

10 files changed

+408
-74
lines changed

.yamllint

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ ignore: |
2020
.github/
2121
.gitlab/
2222
.gitlab-ci.yml
23+
etc/kayobe/kolla/config/prometheus/prometheus.yml.d/70-oscapacity.yml

doc/source/configuration/monitoring.rst

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -140,33 +140,58 @@ enable the ceph mgr exporter.
140140
OpenStack Capacity
141141
==================
142142

143-
OpenStack Capacity allows you to see how much space you have avaliable
144-
in your cloud. StackHPC Kayobe Config includes this exporter by default
145-
and it's necessary that some variables are set to allow deployment.
143+
OpenStack Capacity allows you to see how much space you have available
144+
in your cloud. StackHPC Kayobe Config includes a playbook for manual
145+
deployment, and it's necessary that some variables are set before
146+
running this playbook.
146147

147148
To successfully deploy OpenStack Capacity, you are required to specify
148149
the OpenStack application credentials in ``kayobe/secrets.yml`` as:
149150

150151
.. code-block:: yaml
151152
152-
secrets_os_exporter_auth_url: <some_auth_url>
153-
secrets_os_exporter_credential_id: <some_credential_id>
154-
secrets_os_exporter_credential_secret: <some_credential_secret>
153+
secrets_os_capacity_credential_id: <some_credential_id>
154+
secrets_os_capacity_credential_secret: <some_credential_secret>
155155
156-
After defining your credentials, You may deploy OpenStack Capacity
156+
The Keystone authentication URL and OpenStack region can be changed
157+
from their defaults in ``stackhpc-monitoring.yml`` should you not
158+
want to use the public authentication URL or set the correct OpenStack
159+
region for your cloud:
160+
161+
.. code-block:: yaml
162+
163+
stackhpc_os_capacity_auth_url: <public_openrc_auth_url>
164+
stackhpc_os_capacity_openstack_region_name: <RegionOne>
165+
166+
Additionally, you are required to enable a conditional flag to allow
167+
HAProxy and Prometheus configuration to be templated during deployment.
168+
169+
.. code-block:: yaml
170+
171+
stackhpc_enable_os_capacity: true
172+
173+
If you are deploying in a cloud with internal TLS, you may be required
174+
to disable certificate verification for the OpenStack Capacity exporter
175+
if your certificate is not signed by a trusted CA.
176+
177+
.. code-block:: yaml
178+
179+
stackhpc_os_capacity_openstack_verify: false
180+
181+
After defining your credentials, you may deploy OpenStack Capacity
157182
using the ``ansible/deploy-os-capacity-exporter.yml`` Ansible playbook
158183
via Kayobe.
159184

160185
.. code-block:: console
161186
162-
kayobe playbook run ansible/deploy-os-capacity-exporter.yml
187+
kayobe playbook run $KAYOBE_CONFIG_PATH/ansible/deploy-os-capacity-exporter.yml
163188
164189
It is required that you re-configure the Prometheus, Grafana and HAProxy
165190
services following deployment, to do this run the following Kayobe command.
166191

167192
.. code-block:: console
168193
169-
kayobe overcloud service reconfigure -kt grafana,prometheus,haproxy
194+
kayobe overcloud service reconfigure -kt grafana,prometheus,loadbalancer
170195
171196
If you notice ``HaproxyServerDown`` or ``HaproxyBackendDown`` prometheus
172197
alerts after deployment it's likely the os_exporter secrets have not been

etc/kayobe/ansible/deploy-os-capacity-exporter.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
gather_facts: false
44

55
tasks:
6+
- name: Ensure legacy os_exporter.cfg config file is deleted
7+
ansible.builtin.file:
8+
path: /etc/kolla/haproxy/services.d/os_exporter.cfg
9+
state: absent
10+
delegate_to: network
11+
become: true
12+
613
- name: Create os-capacity directory
714
ansible.builtin.file:
815
path: /opt/kayobe/os-capacity/
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
clouds:
22
openstack:
33
auth:
4-
auth_url: "{{ secrets_os_exporter_auth_url }}"
5-
application_credential_id: "{{ secrets_os_exporter_credential_id }}"
6-
application_credential_secret: "{{ secrets_os_exporter_credential_secret }}"
7-
region_name: "RegionOne"
4+
auth_url: "{{ stackhpc_os_capacity_auth_url }}"
5+
application_credential_id: "{{ secrets_os_capacity_credential_id }}"
6+
application_credential_secret: "{{ secrets_os_capacity_credential_secret }}"
7+
region_name: "{{ stackhpc_os_capacity_openstack_region_name }}"
88
interface: "internal"
99
identity_api_version: 3
1010
auth_type: "v3applicationcredential"
11+
{% if not stackhpc_os_capacity_openstack_verify | bool %}
12+
verify: False
13+
{% endif %}

etc/kayobe/kolla/config/grafana/dashboards/openstack/grafana_cloud_dashboard.json

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"editable": true,
2626
"fiscalYearStartMonth": 0,
2727
"graphTooltip": 0,
28-
"id": 2084495,
2928
"links": [],
3029
"liveNow": false,
3130
"panels": [
@@ -66,7 +65,7 @@
6665
},
6766
"gridPos": {
6867
"h": 4,
69-
"w": 2.4,
68+
"w": 4.8,
7069
"x": 0,
7170
"y": 1
7271
},
@@ -86,7 +85,7 @@
8685
},
8786
"textMode": "auto"
8887
},
89-
"pluginVersion": "9.4.7",
88+
"pluginVersion": "10.1.5",
9089
"repeat": "flavors",
9190
"repeatDirection": "h",
9291
"targets": [
@@ -96,7 +95,7 @@
9695
"uid": "${DS_PROMETHEUS}"
9796
},
9897
"editorMode": "code",
99-
"expr": "openstack_free_capacity_by_flavor_total{flavor_name=~\"$flavors\"}",
98+
"expr": "round(avg_over_time(openstack_free_capacity_by_flavor_total{flavor_name=~\"$flavors\"}[30m]), 1)",
10099
"legendFormat": "__auto",
101100
"range": true,
102101
"refId": "A"
@@ -424,6 +423,7 @@
424423
"tooltip": false,
425424
"viz": false
426425
},
426+
"insertNulls": false,
427427
"lineInterpolation": "linear",
428428
"lineWidth": 1,
429429
"pointSize": 5,
@@ -465,6 +465,7 @@
465465
"y": 17
466466
},
467467
"id": 5,
468+
"interval": "10m",
468469
"options": {
469470
"legend": {
470471
"calcs": [
@@ -489,7 +490,7 @@
489490
"uid": "${DS_PROMETHEUS}"
490491
},
491492
"editorMode": "code",
492-
"expr": "openstack_project_usage{placement_resource=\"MEMORY_MB\"}",
493+
"expr": "avg_over_time(openstack_project_usage{placement_resource=\"MEMORY_MB\"}[30m])",
493494
"legendFormat": "{{project_name}}",
494495
"range": true,
495496
"refId": "A"
@@ -522,6 +523,7 @@
522523
"tooltip": false,
523524
"viz": false
524525
},
526+
"insertNulls": false,
525527
"lineInterpolation": "linear",
526528
"lineWidth": 1,
527529
"pointSize": 5,
@@ -552,7 +554,7 @@
552554
}
553555
]
554556
},
555-
"unit": "decmbytes"
557+
"unit": "none"
556558
},
557559
"overrides": []
558560
},
@@ -563,6 +565,7 @@
563565
"y": 17
564566
},
565567
"id": 16,
568+
"interval": "10m",
566569
"options": {
567570
"legend": {
568571
"calcs": [
@@ -587,7 +590,7 @@
587590
"uid": "${DS_PROMETHEUS}"
588591
},
589592
"editorMode": "code",
590-
"expr": "openstack_project_usage{placement_resource=\"VCPU\"}",
593+
"expr": "avg_over_time(openstack_project_usage{placement_resource=\"VCPU\"}[30m])",
591594
"legendFormat": "VCPU {{project_name}}",
592595
"range": true,
593596
"refId": "A"
@@ -598,7 +601,7 @@
598601
"uid": "${DS_PROMETHEUS}"
599602
},
600603
"editorMode": "code",
601-
"expr": "openstack_project_usage{placement_resource=\"PCPU\"}",
604+
"expr": "avg_over_time(openstack_project_usage{placement_resource=\"PCPU\"}[30m])",
602605
"hide": false,
603606
"legendFormat": "PCPU {{project_name}}",
604607
"range": true,
@@ -646,6 +649,7 @@
646649
"tooltip": false,
647650
"viz": false
648651
},
652+
"insertNulls": false,
649653
"lineInterpolation": "smooth",
650654
"lineStyle": {
651655
"fill": "solid"
@@ -689,6 +693,7 @@
689693
"y": 26
690694
},
691695
"id": 6,
696+
"interval": "10m",
692697
"options": {
693698
"legend": {
694699
"calcs": [
@@ -715,15 +720,15 @@
715720
},
716721
"editorMode": "code",
717722
"exemplar": false,
718-
"expr": "openstack_free_capacity_hypervisor_by_flavor{flavor_name=~\"$flavors\"}",
723+
"expr": "avg_over_time(openstack_free_capacity_hypervisor_by_flavor{flavor_name=~\"$flavors\"}[30m])",
719724
"format": "time_series",
720725
"instant": false,
721726
"legendFormat": "{{flavor_name}} on {{hypervisor}}",
722727
"range": true,
723-
"refId": "Avaliable Capacity on Hypervisors"
728+
"refId": "Available Capacity on Hypervisors"
724729
}
725730
],
726-
"title": "Avaliable Capacity for $flavors",
731+
"title": "Available Capacity for $flavors",
727732
"type": "timeseries"
728733
},
729734
{
@@ -750,6 +755,7 @@
750755
"tooltip": false,
751756
"viz": false
752757
},
758+
"insertNulls": false,
753759
"lineInterpolation": "linear",
754760
"lineWidth": 1,
755761
"pointSize": 5,
@@ -791,6 +797,7 @@
791797
"y": 26
792798
},
793799
"id": 4,
800+
"interval": "10m",
794801
"options": {
795802
"legend": {
796803
"calcs": [
@@ -814,8 +821,8 @@
814821
"type": "prometheus",
815822
"uid": "${DS_PROMETHEUS}"
816823
},
817-
"editorMode": "builder",
818-
"expr": "openstack_hypervisor_placement_allocatable_capacity{resource=\"MEMORY_MB\"} - on(hypervisor) openstack_hypervisor_placement_allocated{resource=\"MEMORY_MB\"}",
824+
"editorMode": "code",
825+
"expr": "avg_over_time(openstack_hypervisor_placement_allocatable_capacity{resource=\"MEMORY_MB\"}[30m]) - on(hypervisor) avg_over_time(openstack_hypervisor_placement_allocated{resource=\"MEMORY_MB\"}[30m])",
819826
"legendFormat": "{{hypervisor}}",
820827
"range": true,
821828
"refId": "A"
@@ -885,7 +892,7 @@
885892
]
886893
},
887894
"time": {
888-
"from": "now-24h",
895+
"from": "now-2d",
889896
"to": "now"
890897
},
891898
"timepicker": {},
@@ -895,4 +902,4 @@
895902
"version": 1,
896903
"weekStart": ""
897904
}
898-
{% endraw %}
905+
{% endraw %}

0 commit comments

Comments
 (0)