-
Notifications
You must be signed in to change notification settings - Fork 23
Add docs for configuring CloudKitty #1036
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
8101668
Add docs for configuring CloudKitty
MoteHue c707389
Update doc/source/operations/cloudkitty.rst
MoteHue fa04ccb
Update doc/source/operations/cloudkitty.rst
MoteHue 73a7fbd
Update doc/source/operations/cloudkitty.rst
MoteHue 75d0b2d
Apply suggestions from code review
MoteHue 552caf8
Update doc/source/operations/cloudkitty.rst
MoteHue 3fdc75b
Further changes from review
MoteHue 1a4d6c4
Merge branch 'document-cloudkitty' of https://github.com/stackhpc/sta…
MoteHue 0ec6d22
Split config
MoteHue 68052b2
Update collection period explanation
MoteHue 51a2b84
Change woridng to clarify OpenSearch support
MoteHue 367d2a1
Note on ex-Monasca systems
MoteHue f5c9e41
Correct indentation
MoteHue 12721b7
Add kolla docs, update cafile handling
MoteHue a94ebf6
Drop yaml highlighting on raw tags
MoteHue File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,125 @@ | ||
| ========== | ||
| CloudKitty | ||
| ========== | ||
|
|
||
| Configuring in kayobe-config | ||
| ============================ | ||
|
|
||
| By default, CloudKitty uses Gnocci and Ceilometer as the collector and fetcher | ||
| backends. Unless the system has a specific reason not to, we recommend instead | ||
| using Prometheus as the backend for both. The following instructions explain | ||
| how to do this | ||
MoteHue marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Enable CloudKitty and disable InfluxDB, as we are using OpenSearch as the | ||
| storage backend. Set the following in ``kolla.yml``: | ||
|
|
||
| .. code-block:: console | ||
MoteHue marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| kolla_enable_cloudkitty: true | ||
| # Explicitly disable influxdb as we are using OpenSearch as the CloudKitty backend | ||
MoteHue marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| kolla_enable_influxdb: false | ||
MoteHue marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Use Prometheus as the collector and fetcher backends, and Elasticsearch as the | ||
MoteHue marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| storage backend. Note that this is patched in our fork of CloudKitty to also | ||
MoteHue marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| work with OpenSearch. Proper support is still pending in Kolla-Ansible `here | ||
| <https://review.opendev.org/c/openstack/kolla-ansible/+/898555>`__. If you have | ||
| TLS enabled, you will also need to allow insecure connections for Prometheus | ||
MoteHue marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| and Elasticsearch. Set the following in ``kolla/globals.yml``: | ||
|
|
||
| .. code-block:: console | ||
MoteHue marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| cloudkitty_collector_backend: prometheus | ||
| cloudkitty_fetcher_backend: prometheus | ||
| cloudkitty_storage_backend: elasticsearch | ||
| cloudkitty_elasticsearch_insecure_connections: true | ||
| cloudkitty_prometheus_insecure_connections: true | ||
|
|
||
| The default collection period is one hour, which is likely too long for your | ||
| system. CloudKitty will charge for the entire period if any usage is seen | ||
| within this timeframe. This means that even just one minute will be counted as | ||
| an hour's usage. It is recommended to change this to a lower number, such as | ||
| ten minutes. When using Prometheus as the collector, you need to change the | ||
| scope_key to match the metrics provided by the Prometheus OpenStack Exporter. | ||
| Set the following in ``cloudkitty.conf``: | ||
MoteHue marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
MoteHue marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| .. code-block:: console | ||
|
|
||
| [collect] | ||
| scope_key = tenant_id | ||
| period = 600 | ||
|
|
||
| You will need to configure which metrics CloudKitty should track. This example | ||
| will track for flavors and volumes, set in | ||
| ``kolla/config/cloudkitty/metrics.yml``: | ||
MoteHue marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| .. code-block:: console | ||
MoteHue marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| metrics: | ||
MoteHue marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| openstack_nova_server_status: | ||
| alt_name: instance | ||
| groupby: | ||
| - uuid | ||
| - user_id | ||
| - tenant_id | ||
| metadata: | ||
| - flavor_id | ||
| - name | ||
| mutate: MAP | ||
| mutate_map: | ||
| 0.0: 1.0 # ACTIVE | ||
| 11.0: 1.0 # SHUTOFF | ||
| 12.0: 1.0 # SUSPENDED | ||
| 16.0: 1.0 # PAUSED | ||
| unit: instance | ||
| openstack_cinder_limits_volume_used_gb: | ||
| alt_name: storage | ||
| unit: GiB | ||
| groupby: | ||
| - tenant_id | ||
|
|
||
| TODO: Should we explain how to handle OpenStack exporter metrics relabelling, | ||
| for the case where a system may have had Monasca deployed in the past? | ||
|
|
||
| Post-configuration with openstack-config | ||
| ======================================== | ||
|
|
||
| This is an example `openstack-config | ||
| <https://github.com/stackhpc/openstack-config>`__ setup to create mappings for | ||
| the metrics configured above. Note that the costs are scaled for the ten-minute | ||
MoteHue marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| collection period, e.g. a flavor with 1 VCPU will cost 1 unit per hour. | ||
|
|
||
| .. code-block:: yaml | ||
|
|
||
| # Map flavors based on VCPUs | ||
| openstack_ratings_hashmap_field_mappings: | ||
| - service: instance | ||
| name: flavor_id | ||
| mappings: | ||
| - value: '1' # tiny compute flavor (1 vcpu) with an OpenStack flavor ID of 1 | ||
| cost: 0.1666666666666666 | ||
MoteHue marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| type: flat | ||
| - value: '2' # small compute flavor (2 vcpus) with an OpenStack flavor ID of 2 | ||
| cost: 0.3333333333333333 | ||
| type: flat | ||
| - value: '3' # medium compute flavor (3 vcpus) with an OpenStack flavor ID of 3 | ||
| cost: 0.5 | ||
| type: flat | ||
| - value: '4' # large compute flavor (4 vcpus) with an OpenStack flavor ID of 4 | ||
| cost: 0.6666666666666666 | ||
| type: flat | ||
| - value: '5' # xlarge compute flavor (8 vcpus) with an OpenStack flavor ID of 5 | ||
| cost: 1.3333333333333333 | ||
| type: flat | ||
| - value: '6' # tiny 2 compute flavor (2 vcpus) with an OpenStack flavor ID of 6 | ||
| cost: 0.3333333333333333 | ||
| type: flat | ||
|
|
||
| # Map volumes based on GB | ||
| openstack_ratings_hashmap_service_mappings: | ||
| - service: storage | ||
| cost: 0.16666666666666666 | ||
| type: flat | ||
|
|
||
| See the `OpenStack CloudKitty Ratings role | ||
| <https://github.com/stackhpc/ansible-collection-openstack/tree/main/roles/os_ratings>`__ | ||
| for more details. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.