遥测技术用于OpenStack云资源。它收集了与计费相关的数据。目前,该计量服务只可通过: 命令: ‘ ceilometer ‘ 客户端命令行
对于模型数据,Telemetry使用如下抽象概念
计量一种资源用量的特定指标,如运行中的实例数,或实时性能数据,如实例的CPU利用率。每种资源都有相应的计量。例如,每个实例都有其CPU利用率。一个计量项的生命周期与其关联的资源是相互独立的,资源销毁后其计量数据仍然存在。
计量器具有以下属性:
一组聚集在连续时间段的数据。(相比而言,一个样例代表一个单一的数据点。)遥测服务采用了以下聚合函数:
ok
, alarm
, 和 insufficient data
.对于传统的基于阈值的告警,状态变化是由一个静态的阈值和比较器来管理的。比较器将过去一定时间间隔内(可配置)的统计值与选定的计量项数值做比较。该例中使用了:command:`openstack`客户端创建一个自动伸缩栈,使用:command:`ceilometer`客户端计量资源。
Create an auto-scaling stack by running the following command.
The -f
option specifies the name of the stack template
file, and the -P
option specifies the KeyName
parameter as heat_key
:
$ openstack stack create --template cfn/F17/AutoScalingCeilometer.yaml \
--parameter "KeyName=heat_key" mystack
列出我们所创建的heat的资源
$ openstack stack resource list mystack
+---------------+--------------------------------------+------------------+-----------------+---------------------+
| resource_name | physical_resource_id | resource_type | resource_status | updated_time |
+---------------+--------------------------------------+------------------+-----------------+---------------------+
| server | 1b3a7c13-42be-4999-a2a1-8fbefd00062b | OS::Nova::Server | CREATE_COMPLETE | 2013-10-02T05:53:41Z |
| ... | ... | ... | ... | ... |
+---------------+--------------------------------------+------------------+-----------------+---------------------+
列出我们所设置的警报
$ ceilometer alarm-list
+--------------------------------------+------------------------------+-------------------+---------+------------+----------------------------------+
| Alarm ID | Name | State | Enabled | Continuous | Alarm condition |
+--------------------------------------+------------------------------+-------------------+---------+------------+----------------------------------+
| 4f896b40-0859-460b-9c6a-b0d329814496 | as-CPUAlarmLow-i6qqgkf2fubs | insufficient data | True | False | cpu_util < 15.0 during 1x 60s |
| 75d8ecf7-afc5-4bdc-95ff-19ed9ba22920 | as-CPUAlarmHigh-sf4muyfruy5m | insufficient data | True | False | cpu_util > 50.0 during 1x 60s |
+--------------------------------------+------------------------------+-------------------+---------+------------+----------------------------------+
列出设置的计量:
$ ceilometer meter-list
+-------------+------------+----------+--------------------------------------+----------------------------------+----------------------------------+
| Name | Type | Unit | Resource ID | User ID | Project ID |
+-------------+------------+----------+--------------------------------------+----------------------------------+----------------------------------+
| cpu | cumulative | ns | 3965b41b-81b0-4386-bea5-6ec37c8841c1 | d1a2996d3b1f4e0e8645ba9650308011 | bf03bf32e3884d489004ac995ff7a61c |
| cpu | cumulative | ns | 62520a83-73c7-4084-be54-275fe770ef2c | d1a2996d3b1f4e0e8645ba9650308011 | bf03bf32e3884d489004ac995ff7a61c |
| cpu_util | gauge | % | 3965b41b-81b0-4386-bea5-6ec37c8841c1 | d1a2996d3b1f4e0e8645ba9650308011 | bf03bf32e3884d489004ac995ff7a61c |
+-------------+------------+----------+--------------------------------------+----------------------------------+----------------------------------+
列出示例
$ ceilometer sample-list -m cpu_util
+--------------------------------------+----------+-------+---------------+------+---------------------+
| Resource ID | Name | Type | Volume | Unit | Timestamp |
+--------------------------------------+----------+-------+---------------+------+---------------------+
| 3965b41b-81b0-4386-bea5-6ec37c8841c1 | cpu_util | gauge | 3.98333333333 | % | 2013-10-02T10:50:12 |
+--------------------------------------+----------+-------+---------------+------+---------------------+
查看数据
$ ceilometer statistics -m cpu_util
+--------+---------------------+---------------------+-------+---------------+---------------+---------------+---------------+----------+---------------------+---------------------+
| Period | Period Start | Period End | Count | Min | Max | Sum | Avg | Duration | Duration Start | Duration End |
+--------+---------------------+---------------------+-------+---------------+---------------+---------------+---------------+----------+---------------------+---------------------+
| 0 | 2013-10-02T10:50:12 | 2013-10-02T10:50:12 | 1 | 3.98333333333 | 3.98333333333 | 3.98333333333 | 3.98333333333 | 0.0 | 2013-10-02T10:50:12 | 2013-10-02T10:50:12 |
+--------+---------------------+---------------------+-------+---------------+---------------+---------------+---------------+----------+---------------------+---------------------+
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.