Use the configure-metrics command of the cell management tool to configure the set of metrics to collect.

vCloud Director can collect metrics that provide current and historic information about virtual machine performance and resource consumption. Use this subcommand to configure the metrics that vCloud Director collects. Use the cell-management-tool cassandra subcommand to configure an Apache Cassandra database for use as a vCloud Director metrics repository. See Configuring a Cassandra Metrics Database.

To configure the metrics that vCloud Director collects, use a command line with the following form:

cell-management-tool configure-metrics --metrics-config pathname

Table 1. Cell Management Tool Options and Arguments, configure-metrics Subcommand

Command

Argument

Description

--help (-h)

None

Provides a summary of available commands in this category.

--repository-host (Deprecated)

Host name or IP address of KairosDB host

Deprecated. Use the --cluster-nodes option of the cell-management-tool cassandra subcommand to configure an Apache Cassandra database for use as a vCloud Director metrics repository.

--repository-port (Deprecated)

KairosDB port to use.

Deprecated. Use the --port option of the cell-management-tool cassandra subcommand to configure an Apache Cassandra database for use as a vCloud Director metrics repository.

--metrics-confg

path name

Path to metrics configuration file

Configuring a Metrics Database Connection

This example configures the metrics collection as specified in the file /tmp/metrics.groovy.

[root@cell1 /opt/vmware/vcloud-director/bin]# ./cell-management-tool configure-metrics --metrics-config /tmp/metrics.groovy

The vCloud Director metrics collection service implements a subset of the metrics collected by the vSphere Performance Manager. See the vSphere Performance Manager documentation for more information about metric names and collection parameters. The metrics-config file cites one or more metric names and provides collection parameters for each cited metric. For example:

configuration {
    metric("cpu.usage.average")
    metric("cpu.usagemhz.average")
    metric("cpu.usage.maximum")
    metric("disk.used.latest") {
        currentInterval=300
        historicInterval=300
        entity="VM"
        instance=""
        minReportingInterval=1800
        aggregator="AVERAGE"
    }
}

The following metric names are supported.

Table 2. Metric Names

Metric Name

Description

cpu.usage.average

Host view of this virtual machine's average actively used CPU as a percentage of total available. Includes all cores in all sockets.

cpu.usagemhz.average

Host view of this virtual machine's average actively used CPU as a raw measurement . Includes all cores in all sockets.

cpu.usage.maximum

Host view of this virtual machine's maximum actively used CPU as a percentage of total available. Includes all cores in all sockets.

mem.usage.average

Memory used by this virtual machine as a percentage of total configured memory.

disk.provisioned.latest

Storage space allocated to this virtual hard disk in the containing organization virtual data center.

disk.used.latest

Storage used by all virtual hard disks.

disk.read.average

Average read rate for all virtual hard disks.

disk.write.average

Average write rate for all virtual hard disks.

Note:

When a virtual machine has multiple disks, metrics are reported as an aggregate for all disks. CPU metrics are an aggregate of all cores and sockets.

For each named metric, you can specify the following collection parameters.

Table 3. Metrics Collection Parameters

Parameter Name

Value

Description

currentInterval

Integer number of seconds.

The interval in seconds to use when querying for the latest available metric values (for current metrics queries) Defaults to 20 if not specified. Values greater than 20 are supported only for Level 1 metrics as defined by the vSphere Performance Manager.

historicInterval

Integer number of seconds.

The interval in seconds to use when querying for historic metric values. Defaults to 20 if not specified. Values greater than 20 are supported only for Level 1 metrics as defined by the vSphere Performance Manager.

entity

One of: HOST, VM

The type of VC object that the metric is available for Defaults to VM if not specified. Not all metrics are available for all entities.

instance

A vSphere Performance Manager PerfMetricId instance identifier.

Indicates whether to retrieve data for individual instances of a metric (individual CPU cores for example), an aggregate of all instances, or both. A value of "*" collects all metrics, instance and aggregate. An empty string, "" collects only the aggregate data. A specific string like "DISKFILE" collects data only for that instance. Defaults to "*" if not specified.

minReportingInterval

Integer number of seconds.

Specifies a default aggregation interval in seconds to use when reporting time series data. Provides further control over reporting granularity when the collection interval's granularity is not sufficient. Defaults to 0 (no dedicated reporting interval)

aggregator

One of: AVERAGE, MINIMUM, MAXIMUM, SUMMATION

The type of aggregation to perform during the minReportingInterval. Defaults to AVERAGE if not specified.