Skip to content

Commit 97f6f05

Browse files
committed
Updated and tidied config for Cloudkitty configuration role.
1 parent f95b0f8 commit 97f6f05

File tree

3 files changed

+97
-212
lines changed

3 files changed

+97
-212
lines changed

etc/openstack-config/openstack-config.yml

Lines changed: 22 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,19 @@
9999
###############################################################################
100100
# Configuration variables for a Cloudkitty ratings service deployment.
101101

102-
#
103-
#
104-
#
102+
# # ### ####### ##### IN ORDER TO SUCCESSFULLY DEPLOY CLOUDKITTY
103+
# # # # # # # 'cloudkitty.conf' & 'metrics.yml' MUST BE
104+
# # # # # # ### PROVIDED ALONGSIDE THE FOLLOWING CONFIG.
105+
# # # # # # # MORE INFO CAN BE FOUND IN THE README.md
106+
# # ### # ##### 'stackhpc-kayobe-config' DOCS.
105107

106108
# File path or URL containing Python upper constraints.
107-
#
108-
# ratings_upper_constraints_file: /path/to/upper_constraints_file
109+
####### THIS IS NOT NECCESSARY TO CONFIGURE ###########
110+
#ratings_upper_constraints_file: /path/to/upper_constraints_file
109111

110112
# Environment variables for the OpenStack CLI. By default this is left empty.
111-
#
112-
# ratings_environment:
113+
################### THIS IS NOT NECCESSARY TO CONFIGURE #####################
114+
#ratings_environment:
113115
# - name: ENV_VAR_NAME
114116
# value: ENV_VAR_VALUE
115117

@@ -118,44 +120,23 @@
118120
# Example of the mappings and their fields can be found below,
119121
# however for more information please refer to the README.md file.
120122
#
121-
ratings_hashmap_field_mappings:
122-
- service: instance
123-
name: flavor_id
124-
mappings:
125-
- value: '1' #tiny
126-
cost: 1.0
127-
group: instance_uptime_flavor_id
128-
type: flat
129-
- value: '2' #small
130-
cost: 2.0
131-
group: instance_uptime_flavor_id
132-
type: flat
133-
- value: '3' #medium
134-
cost: 3.0
135-
group: instance_uptime_flavor_id
136-
type: flat
137-
- value: '4' #large
138-
cost: 4.0
139-
group: instance_uptime_flavor_id
140-
type: flat
141-
- value: '5' #xlarge
142-
cost: 5.0
143-
group: instance_uptime_flavor_id
144-
type: flat
145-
- value: '6' #tiny 2
146-
cost: 2.0
147-
group: instance_uptime_flavor_id
148-
type: flat
149-
123+
#ratings_hashmap_field_mappings:
124+
# - service: SERVICE_NAME
125+
# name: FIELD_NAME
126+
# mappings:
127+
# - value: MAPPING_VALUE
128+
# cost: MAPPING_COST
129+
# group: MAPPING_GROUP
130+
# type: MAPPING_TYPE
150131

151132
# Much like the field mappings above, the service mappings are a list of
152133
# dictionaries, however these are not associated with a field.
153134
#
154-
# ratings_hashmap_service_mappings:
155-
# - service: image.size
156-
# cost: 0.1
157-
# group: image_size
158-
# type: flat
135+
#ratings_hashmap_service_mappings:
136+
# - service: SERVICE_NAME
137+
# cost: MAPPING_COST
138+
# group: MAPPING_GROUP
139+
# type: MAPPING_TYPE
159140

160141
###############################################################################
161142
# Dummy variable to allow Ansible to accept this file.

etc/openstack-config/openstack-config_template.yml

Lines changed: 0 additions & 143 deletions
This file was deleted.

examples/ratings.yml

Lines changed: 75 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,81 @@
22
###############################################################################
33
# Configuration of cloudkitty for openstack.
44

5-
# Example playbook for configuring and registering Cloudkitty fields.
6-
# Included is registration for two different Nova flavor mappings and
5+
# Example configuration for registering Cloudkitty fields.
6+
# Included is mapping for various different compute flavors &
77
# a service mapping based on the stored image size in Glance.
88

9-
- name: Ensure Cloudkitty ratings are registered
10-
hosts: localhost
11-
tasks:
12-
- import_role:
13-
name: stackhpc.openstack.os_ratings
14-
vars:
15-
os_ratings_venv: "{{ openstack_venv }}"
16-
os_ratings_environment:
17-
OS_AUTH_URL: "{{ lookup('env', 'OS_AUTH_URL') }}"
18-
os_ratings_hashmap_field_mappings:
19-
- service: instance
20-
name: flavor_id
21-
mappings:
22-
- value: small
23-
cost: 1.0
24-
group: instance_uptime_flavor_id
25-
type: flat
26-
- value: large
27-
cost: 2.0
28-
group: instance_uptime_flavor_id
29-
type: flat
30-
os_ratings_hashmap_service_mappings:
31-
- service: image.size
32-
cost: 0.1
33-
group: volume_ceph
34-
type: flat
9+
ratings_hashmap_field_mappings:
10+
- service: instance
11+
name: flavor_id
12+
mappings:
13+
- value: '1' #tiny
14+
cost: 1.0
15+
group: instance_uptime_flavor_id
16+
type: flat
17+
- value: '2' #small
18+
cost: 2.0
19+
group: instance_uptime_flavor_id
20+
type: flat
21+
- value: '3' #medium
22+
cost: 3.0
23+
group: instance_uptime_flavor_id
24+
type: flat
25+
- value: '4' #large
26+
cost: 4.0
27+
group: instance_uptime_flavor_id
28+
type: flat
29+
- value: '5' #xlarge
30+
cost: 5.0
31+
group: instance_uptime_flavor_id
32+
type: flat
33+
- value: '6' #tiny 2
34+
cost: 2.0
35+
group: instance_uptime_flavor_id
36+
type: flat
3537

38+
ratings_hashmap_service_mappings:
39+
- service: image.size
40+
cost: 0.1
41+
group: image_size
42+
type: flat
43+
44+
# # ### ####### ##### THIS CONFIGURATION FILE ONLY WORKS IF
45+
# # # # # # # 'cloudkitty.conf' & 'metrics.yml' ARE
46+
# # # # # # ### CONFIGURED AS SHOWN BELOW. MORE INFO CAN
47+
# # # # # # # BE FOUND IN THE 'stackhpc-kayobe-config'
48+
# # ### # ##### DOCS.
49+
50+
51+
# CORRESPONDING cloudkitty.conf
52+
#
53+
# [collect]
54+
# period = 120
55+
# scope_key = tenant_id
56+
57+
# CORRESPONDING metrics.yml
58+
#
59+
# metrics:
60+
# openstack_nova_server_status:
61+
# alt_name: instance
62+
# unit: instance
63+
# mutate: MAP
64+
# mutate_map:
65+
# 0.0: 1.0 # ACTIVE
66+
# 11.0: 1.0 # SHUTOFF
67+
# 12.0: 1.0 # SUSPENDED
68+
# 16.0: 1.0 # PAUSED
69+
# groupby:
70+
# - user_id
71+
# - tenant_id
72+
# - uuid
73+
# metadata:
74+
# - flavor_id
75+
# - name
76+
# openstack_glance_image_bytes:
77+
# alt_name: image.size
78+
# factor: 1/1073741824 # image.size measurements are in B
79+
# unit: GiB
80+
# groupby:
81+
# - resource_id
82+
# - project_id

0 commit comments

Comments
 (0)