openstack-manuals/doc/common/section_nova_cli_usage_statistics.xml
Diane Fleming 64b6c9261e Folder rename, file rename, flattening of directories
Current folder name	New folder name	        Book title
----------------------------------------------------------
basic-install 	        DELETE
cli-guide	        DELETE
common	                common
NEW	                admin-guide-cloud	Cloud Administrators Guide
docbkx-example	        DELETE
openstack-block-storage-admin 	DELETE
openstack-compute-admin 	DELETE
openstack-config 	config-reference	OpenStack Configuration Reference
openstack-ha 	        high-availability-guide	OpenStack High Availabilty Guide
openstack-image	        image-guide	OpenStack Virtual Machine Image Guide
openstack-install 	install-guide	OpenStack Installation Guide
openstack-network-connectivity-admin 	admin-guide-network 	OpenStack Networking Administration Guide
openstack-object-storage-admin 	DELETE
openstack-security 	security-guide	OpenStack Security Guide
openstack-training 	training-guide	OpenStack Training Guide
openstack-user 	        user-guide	OpenStack End User Guide
openstack-user-admin 	user-guide-admin	OpenStack Admin User Guide
glossary	        NEW        	OpenStack Glossary

bug: #1220407

Change-Id: Id5ffc774b966ba7b9a591743a877aa10ab3094c7
author: diane fleming
2013-09-08 15:15:50 -07:00

97 lines
6.5 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<section xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" xml:id="usage_statistics">
<title>Show usage statistics for hosts and instances</title><para xlink:href="http://graphite.wikidot.com">You can show basic
statistics on resource usage for hosts and instances.</para>
<note> <para xlink:href="http://graphite.wikidot.com">For more sophisticated
monitoring, see the <link
xlink:href="https://launchpad.net/ceilometer"
>Ceilometer</link> project, which is under
development. You can also use tools, such as <link
xlink:href="http://ganglia.info/">Ganglia</link> or
<link xlink:href="http://graphite.wikidot.com/"
>Graphite</link>, to gather more detailed data.</para></note>
<procedure xml:id="host_usage_statistics">
<title>To show host usage statistics</title>
<step><para>List the hosts and the nova-related services that run on
them:</para><screen><prompt>$</prompt> <userinput>nova host-list</userinput></screen>
<screen><computeroutput>+------------------+-------------+----------+
| host_name | service | zone |
+------------------+-------------+----------+
| devstack-grizzly | conductor | internal |
| devstack-grizzly | compute | nova |
| devstack-grizzly | cert | internal |
| devstack-grizzly | network | internal |
| devstack-grizzly | scheduler | internal |
| devstack-grizzly | consoleauth | internal |
+------------------+-------------+----------+</computeroutput></screen></step>
<step><para>Get a summary of resource usage of all of the instances running
on the host.</para><screen><prompt>$</prompt> <userinput>nova host-describe <replaceable>devstack-grizzly</replaceable></userinput></screen>
<screen><computeroutput>+------------------+----------------------------------+-----+-----------+---------+
| HOST | PROJECT | cpu | memory_mb | disk_gb |
+------------------+----------------------------------+-----+-----------+---------+
| devstack-grizzly | (total) | 2 | 4003 | 157 |
| devstack-grizzly | (used_now) | 3 | 5120 | 40 |
| devstack-grizzly | (used_max) | 3 | 4608 | 40 |
| devstack-grizzly | b70d90d65e464582b6b2161cf3603ced | 1 | 512 | 0 |
| devstack-grizzly | 66265572db174a7aa66eba661f58eb9e | 2 | 4096 | 40 |
+------------------+----------------------------------+-----+-----------+---------+</computeroutput></screen>
<para>The <literal>cpu</literal> column shows the sum of
the virtual CPUs for instances running on the host.</para>
<para>The <literal>memory_mb</literal> column shows the
sum of the memory (in MB) allocated to the instances
that run on the hosts.</para>
<para>The <literal>disk_gb</literal> column shows the sum
of the root and ephemeral disk sizes (in GB) of the
instances that run on the hosts.</para>
<note> <para>These values are computed by using only information
about the flavors of the instances that run on the
hosts. This command does not query the CPU usage,
memory usage, or hard disk usage of the physical
host.</para> </note> </step> </procedure>
<procedure xml:id="instance_usage_statistics">
<title>To show instance usage statistics</title>
<step>
<para>Get CPU, memory, I/O, and network statistics for an
instance.</para>
<para>First, list instances:</para>
<screen><prompt>$</prompt> <userinput>nova list</userinput></screen>
<screen><computeroutput>+--------------------------------------+----------------------+--------+------------+-------------+------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+----------------------+--------+------------+-------------+------------------+
| 84c6e57d-a6b1-44b6-81eb-fcb36afd31b5 | myCirrosServer | ACTIVE | None | Running | private=10.0.0.3 |
| 8a99547e-7385-4ad1-ae50-4ecfaaad5f42 | myInstanceFromVolume | ACTIVE | None | Running | private=10.0.0.4 |
+--------------------------------------+----------------------+--------+------------+-------------+------------------+</computeroutput></screen>
<para>Then, get diagnostic statistics:</para>
<screen><prompt>$</prompt> <userinput>nova diagnostics myCirrosServer</userinput></screen>
<screen><computeroutput>+------------------+----------------+
| Property | Value |
+------------------+----------------+
| vnet1_rx | 1210744 |
| cpu0_time | 19624610000000 |
| vda_read | 0 |
| vda_write | 0 |
| vda_write_req | 0 |
| vnet1_tx | 863734 |
| vnet1_tx_errors | 0 |
| vnet1_rx_drop | 0 |
| vnet1_tx_packets | 3855 |
| vnet1_tx_drop | 0 |
| vnet1_rx_errors | 0 |
| memory | 2097152 |
| vnet1_rx_packets | 5485 |
| vda_read_req | 0 |
| vda_errors | -1 |
+------------------+----------------+</computeroutput></screen>
</step>
<step> <para>Get summary statistics for each tenant:</para><screen><prompt>$</prompt> <userinput>nova usage-list</userinput></screen>
<screen><computeroutput>Usage from 2013-06-25 to 2013-07-24:
+----------------------------------+-----------+--------------+-----------+---------------+
| Tenant ID | Instances | RAM MB-Hours | CPU Hours | Disk GB-Hours |
+----------------------------------+-----------+--------------+-----------+---------------+
| b70d90d65e464582b6b2161cf3603ced | 1 | 344064.44 | 672.00 | 0.00 |
| 66265572db174a7aa66eba661f58eb9e | 3 | 671626.76 | 327.94 | 6558.86 |
+----------------------------------+-----------+--------------+-----------+---------------+</computeroutput></screen>
</step> </procedure>
</section>