Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 2. Capacity Metering using the Telemetry Service
The OpenStack Telemetry service provides usage metrics that can be leveraged for billing, charge-back, and show-back purposes. Such metrics data can also be used by third-party applications to plan for capacity on the cluster and can also be leveraged for auto-scaling virtual instances using OpenStack Heat. For more information, see Auto Scaling for Compute.
The combination of ceilometer and gnocchi can be used for monitoring and alarms. This is supported on small-size clusters and with known limitations. For real-time monitoring, Red Hat OpenStack Platform ships with agents that provide metrics data, and can be consumed by separate monitoring infrastructure and applications. For more information, see Monitoring Tools Configuration.
2.1. View Existing Alarms Link kopierenLink in die Zwischenablage kopiert!
To list the existing Telemetry alarms, use the aodh command. For example:
To list the meters assigned to a resource, specify the UUID of the resource (an instance, image, or volume, among others). For example:
gnocchi resource show 5e3fcbe2-7aab-475d-b42c-a440aa42e5ad
# gnocchi resource show 5e3fcbe2-7aab-475d-b42c-a440aa42e5ad
2.2. Create an Alarm Link kopierenLink in die Zwischenablage kopiert!
You can use aodh to create an alarm that activates when a threshold value is reached. In this example, the alarm activates and adds a log entry when the average CPU utilization for an individual instance exceeds 80%. A query is used to isolate the specific instance’s id (94619081-abf5-4f1f-81c7-9cedaa872403) for monitoring purposes:
To edit an existing threshold alarm, use the aodh alarm update command. For example, to increase the alarm threshold to 75%:
aodh alarm update --name cpu_usage_high --threshold 75
# aodh alarm update --name cpu_usage_high --threshold 75
2.3. Disable or Delete an Alarm Link kopierenLink in die Zwischenablage kopiert!
To disable an alarm:
aodh alarm update --name cpu_usage_high --enabled=false
# aodh alarm update --name cpu_usage_high --enabled=false
To delete an alarm:
aodh alarm delete --name cpu_usage_high
# aodh alarm delete --name cpu_usage_high
2.4. View Measures Link kopierenLink in die Zwischenablage kopiert!
To list all the measures for a particular resource:
gnocchi measures show --resource-id UUID METER_NAME
# gnocchi measures show --resource-id UUID METER_NAME
To list only measures for a particular resource, within a range of timestamps:
gnocchi measures show --aggregation mean --start START_TIME --end STOP_TIME --resource-id UUID METER_NAME
# gnocchi measures show --aggregation mean --start START_TIME --end STOP_TIME --resource-id UUID METER_NAME
Where START_TIME and END_TIME are in the form iso-dateThh:mm:ss.
2.5. Create New Measures Link kopierenLink in die Zwischenablage kopiert!
You can use measures to send data to the Telemetry service, and they do not need to correspond to a previously-defined meter. For example:
gnocchi measures add -m 2015-01-12T17:56:23@42 --resource-id UUID METER_NAME
# gnocchi measures add -m 2015-01-12T17:56:23@42 --resource-id UUID METER_NAME
2.6. View Cloud Usage Measures Link kopierenLink in die Zwischenablage kopiert!
This example shows the average memory usage of all instances for each project.
gnocchi measures aggregation --resource-type instance --groupby project_id -m memory
gnocchi measures aggregation --resource-type instance --groupby project_id -m memory
2.7. View L3 Cache Usage Link kopierenLink in die Zwischenablage kopiert!
If your Intel hardware and libvirt version supports Cache Monitoring Technology (CMT), you can use the cpu_l3_cache meter to monitor the amount of L3 cache used by an instance.
2.8. Monitor the disk activity of instances Link kopierenLink in die Zwischenablage kopiert!
The following example demonstrates how to use an aodh alarm to monitor the cumulative disk activity for all the instances contained within a particular project.
1. Review the existing projects, and select the appropriate UUID of the project you need to monitor. This example uses the admin tenant:
2. Use the project’s UUID to create an alarm that analyses the sum() of all read requests generated by the instances in the admin tenant (the query can be further restrained with the --query parameter).
2.9. Manage Resource Types Link kopierenLink in die Zwischenablage kopiert!
Telemetry resource types that were previously hardcoded can now be managed by the gnocchi client. You can use the gnocchi client to create, view, and delete resource types, and you can use the gnocchi API to update or delete attributes.
1. Create a new resource-type:
2. Review the configuration of the resource-type:
3. Delete the resource-type:
gnocchi resource-type delete testResource01
$ gnocchi resource-type delete testResource01
You cannot delete a resource type if a resource is using it.
2.10. Using the Time-Series-Database-as-a-Service Link kopierenLink in die Zwischenablage kopiert!
Time-Series-Database-as-a-Service (Gnocchi) is a multi-tenant, metrics, and resource database. It is designed to store metrics at a very large scale while providing access to metrics and resources information to operators and users.
Currently, the TSDaaS uses the Identity service for authentication, and Ceph object storage to store data.
TDSaaS provides the statsd deamon that is compatible with the statsd protocol and can listen to the metrics sent over the network, named gnocchi-statsd. To enable statsd support in TDSaaS, configure the [statsd] option in the configuration file. The resource ID parameter is the main generic resource where all the metrics are attached, a user and project ID that are associated with the resource and metrics, and an archive policy name that is used to create the metrics.
All the metrics will be created dynamically as the metrics are sent to gnocchi-statsd, and attached with the provided name to the resource ID you configured. For more information on installing and configuring TSDaaS, see the Install Time-Series-Database-as-a-Service chapter in the Manual Installation Procedures available at: https://access.redhat.com/documentation/en/red-hat-enterprise-linux-openstack-platform/
2.10.1. Running Time-Series-Database-as-a-Service Link kopierenLink in die Zwischenablage kopiert!
Run Time-Series-Database-as-a-Service (TSDaaS) by running the HTTP server and metric daemon:
gnocchi-api gnocchi-metricd
# gnocchi-api
# gnocchi-metricd
2.10.2. Running As A WSGI Application Link kopierenLink in die Zwischenablage kopiert!
You can run the TSDaaS through a WSGI service such as mod_wsgi or any other WSGI application. The file gnocchi/rest/app.wsgi provided with TSDaaS allows you to enable Gnocchi as a WSGI application.
The TSDaaS API tier runs using WSGI. This means it can be run using Apache httpd and mod_wsgi, or another HTTP daemon such as uwsgi. Configure the number of processes and threads according to the number of CPUs you have, which is usually around 1.5 × number of CPUs. If one server is not enough, you can spawn any number of new API servers to scale Gnocchi out, even on different machines.
2.10.3. metricd Workers Link kopierenLink in die Zwischenablage kopiert!
By default, the gnocchi-metricd daemon spans all of your CPU power to maximize CPU utilization when computing metric aggregation. Use the gnocchi status command to query the HTTP API and get the cluster status for metric processing. This command displays the number of metrics to process, known as the processing backlog for the gnocchi-metricd. As long as this backlog is not continuously increasing, that means that gnocchi-metricd is able to cope with the amount of metrics that are being sent. If the number of measures to process is continuously increasing, you might need to temporarily increase the number of gnocchi-metricd daemons. You can run any number of metricd daemons on any number of servers.
2.10.4. Monitoring the Time-Series-Database-as-a-Service Link kopierenLink in die Zwischenablage kopiert!
The /v1/status endpoint of the HTTP API returns information, such as the number of measures to process (measures backlog), which you can easily monitor. To verify good health of the overall system, ensure that the HTTP server and the gnocchi-metricd daemon are running and are not writing errors in their log files.
2.10.5. Backing up and Restoring Time-Series-Database-as-a-Service Link kopierenLink in die Zwischenablage kopiert!
To recover from an unfortunate event, you need to backup both the index and the storage. That means creating a database dump (PostgreSQL or MySQL) and doing snapshots or copies of your data storage (Ceph, Swift, or your file system). To restore Time-Series-Database-as-a-Service, complete the following tasks: . Restore your index and storage backups. . Reinstall TSDaaS if necessary. . Restart TSDaaS.
2.10.6. Batch deleting old resources from Gnocchi Link kopierenLink in die Zwischenablage kopiert!
To remove outdated measures, create the archive policy to suit your requirements. To batch delete resources, metrics and measures, use the CLI or REST API. For example, to delete resources and all their associated metrics that were terminated 30 days ago, run the following command:
openstack metric resource batch delete "ended_at < '-30days'"
openstack metric resource batch delete "ended_at < '-30days'"