openstack-manuals/doc/user-guide/section_ceilometer_cli.xml
Diane Fleming ee146d0112 Updates to User Guide / Havana testing
Updates also clouddocs-maven-plugin to 1.11.1

Change-Id: Id5b325d5ad7d33f0b5e1bb1a63d9b48178aa45f4
author: diane fleming
2013-10-16 14:46:06 +02:00

81 lines
7.0 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<section xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:html="http://www.w3.org/1999/xhtml" version="5.0"
xml:id="ceilometer_cli_commands">
<title>Measure cloud resources</title>
<para>The Metering service measures cloud resources within
OpenStack.</para>
<para>It collects information about how much, who, what, and when
with regards to billing. For Havana, metering is available
through only the <command>ceilometer</command> command-line interface
(CLI).</para>
<para>The following example uses the <command>heat</command> client to create an
auto-scaling stack and the <command>ceilometer</command> client to measure
resources.</para>
<procedure>
<step>
<para>Create an auto-scaling stack:</para>
<screen><prompt>$</prompt> <userinput>heat stack-create -f cfn/F17/AutoScalingCeilometer.yaml -P "KeyName=heat_key"</userinput></screen>
</step>
<step>
<para>List the heat resources that were created:</para>
<screen><prompt>$</prompt> <userinput>heat resource-list</userinput>
<computeroutput>+--------------------------+-----------------------------------------+-----------------+----------------------+
| resource_name | resource_type |resource_status | updated_time |
+--------------------------+-----------------------------------------+-----------------+----------------------+
| CfnUser | AWS::IAM::User |CREATE_COMPLETE | 2013-10-02T05:53:41Z |
| WebServerKeys | AWS::IAM::AccessKey |CREATE_COMPLETE | 2013-10-02T05:53:42Z |
| LaunchConfig | AWS::AutoScaling::LaunchConfiguration |CREATE_COMPLETE | 2013-10-02T05:53:43Z |
| ElasticLoadBalancer | AWS::ElasticLoadBalancing::LoadBalancer |UPDATE_COMPLETE | 2013-10-02T05:55:58Z |
| WebServerGroup | AWS::AutoScaling::AutoScalingGroup |CREATE_COMPLETE | 2013-10-02T05:55:58Z |
| WebServerScaleDownPolicy | AWS::AutoScaling::ScalingPolicy |CREATE_COMPLETE | 2013-10-02T05:56:00Z |
| WebServerScaleUpPolicy | AWS::AutoScaling::ScalingPolicy |CREATE_COMPLETE | 2013-10-02T05:56:00Z |
| CPUAlarmHigh | OS::Ceilometer::Alarm |CREATE_COMPLETE | 2013-10-02T05:56:02Z |
| CPUAlarmLow | OS::Ceilometer::Alarm |CREATE_COMPLETE | 2013-10-02T05:56:02Z |
+--------------------------+-----------------------------------------+-----------------+----------------------+</computeroutput></screen>
</step>
<step>
<para>List the alarms that are set:</para>
<screen><prompt>$</prompt> <userinput>ceilometer alarm-list</userinput>
<computeroutput>+--------------------------------------+------------------------------+-------------------+---------+------------+-------------------------------+
| Alarm ID | Name | State | Enabled | Continuous | Alarm condition |
+--------------------------------------+------------------------------+-------------------+---------+------------+-------------------------------+
| 4f896b40-0859-460b-9c6a-b0d329814496 | as-CPUAlarmLow-i6qqgkf2fubs | insufficient data | True | False | cpu_util &lt; 15.0 during 1x 60s |
| 75d8ecf7-afc5-4bdc-95ff-19ed9ba22920 | as-CPUAlarmHigh-sf4muyfruy5m | insufficient data | True | False | cpu_util &gt; 50.0 during 1x 60s |
+--------------------------------------+------------------------------+-------------------+---------+------------+-----------------------------+</computeroutput></screen>
</step>
<step>
<para>List the meters that are set:</para>
<screen><prompt>$</prompt> <userinput>ceilometer meter-list</userinput>
<computeroutput>+--------------------------+------------+----------+-----------------------------------------------------------------------+------------------------------------+
| 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 |
+--------------------------+------------+----------+-----------------------------------------------------------------------+------------------------------------+</computeroutput></screen>
</step>
<step>
<para>List samples:</para>
<screen><prompt>$</prompt> <userinput>ceilometer sample-list -m cpu_util</userinput>
<computeroutput>+--------------------------------------+----------+-------+---------------+------+---------------------+
| Resource ID | Name | Type | Volume | Unit | Timestamp |
+--------------------------------------+----------+-------+---------------+------+---------------------+
| 3965b41b-81b0-4386-bea5-6ec37c8841c1 | cpu_util | gauge | 3.98333333333 | % | 2013-10-02T10:50:12 |
+--------------------------------------+----------+-------+---------------+------+---------------------+</computeroutput></screen>
</step>
<step>
<para>View statistics:</para>
<screen><prompt>$</prompt> <userinput>ceilometer statistics -m cpu_util</userinput>
<computeroutput>+--------+---------------------+---------------------+-------+---------------+---------------+---------------+---------------+----------+---------------------+---------------------+
| 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 |
+--------+---------------------+---------------------+-------+---------------+---------------+---------------+---------------+----------+---------------------+---------------------+</computeroutput></screen>
</step>
</procedure>
</section>