Last week I released a post on configuring Cassandra for vCloud Director 9.0 metrics. As a refresher, one of the cool features released in vCloud Director SP 5.6.x was the ability to expose VM metrics that service providers could expose to their clients via a set of API calls. With the release of vCloud Director 9.0, the metrics can now be viewed from the new HTML5 tenant UI, meaning that all service providers should be able to offer this to their customers.
With the Cassandra configuration out of the way, the next step is to use the Cell Management Tool to tell the vCD cells to push the VM Metric data. Before this, if you log into the HTML5 UI you will notice no menu for Monitoring…this only gets enabled once the metrics have have been enabled by the tool.
The command has changed from previous versions in line with removing the dependancy on the KairosDB and we are now calling a cassandra argument that has the following options:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
usage: cell-management-tool cassandra [options] --clean Remove cassandra settings from database --cluster-nodes <NODE-LIST> Comma-separated list of Cassandra cluster nodes (ip or hostname) to attempt connecting to --configure Configure vCD for use with an existingCassandra cluster --create-schema Creates the VM Monitoring keyspace and schema in the cluster --dump Dump the current connection configuration -h,--help Print this message --keyspace <arg> Specify cassandra keyspace --offline Offline configuration, connection to cluster will not be tested --password <PASSWORD> The password vCD must use to connect to Cassandra --port <PORT> Port to connect to, default 9042 --ttl <TTL> Time to live, data retention in numbers of days, 0 for indefinitely --update-schema Updates cassandra schema based on metrics configuration --username <USERNAME> The username vCD must use to connect to Cassandra |
Those familiar with the previous command to configure the metrics will see a lot more options that specify the Cassandra nodes, the original command to configure the schema, the username and password to connect to the Cassandra database with and the ttl for the data, meaning that if you wanted you could keep more than two weeks of data.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
[root@VCD01 bin]# ./cell-management-tool cassandra --configure --create-schema --cluster-nodes 10.0.30.7 --username cassandra --password cassandra --ttl 15 --port 9042 Verifying Cassandra settings... Cassandra setting valid for node: 10.0.30.7 Cassandra configuration settings verified successfully vcloud_metrics keyspace created... vm_metrics table created... adding configured metrics to the schema... adding counter: cpu.usage.average adding counter: cpu.usage.maximum adding counter: cpu.usagemhz.average adding counter: disk.provisioned.latest adding counter: disk.read.average adding counter: disk.used.latest adding counter: disk.write.average adding counter: mem.usage.average Persisting Cassandra settings... Success. The monitoring service is now configured to persist data into cassandra nodes(10.0.30.7), vCD cell(s) must be restarted if they are already running. |
If you tail the Cassandra system.log while the process is happening you will see a bunch of tables being created and populated with the initial data.
1 2 3 |
root@TPM03-CASSANDRA:~# tail -f /var/log/cassandra/system.log INFO [SharedPool-Worker-2] 2017-10-02 02:18:40,410 MigrationManager.java:365 - Update table 'vcloud_metrics/vm_metrics' From org.apache.cassandra.config.CFMetaData@dd054f8[cfId=8767c9f0-a739-11e7-9b44-cd04c5bf0dd5,ksName=vcloud_metrics,cfName=vm_metrics,cfType=Standard,comparator=org.apache.cassandra.db.marshal.CompositeType(org.apache.cassandra.db.marshal.TimestampType,org.apache.cassandra.db.marshal.UTF8Type),comment=,readRepairChance=0.0,dcLocalReadRepairChance=0.1,gcGraceSeconds=864000,defaultValidator=org.apache.cassandra.db.marshal.BytesType,keyValidator=org.apache.cassandra.db.marshal.UTF8Type,minCompactionThreshold=4,maxCompactionThreshold=32,columnMetadata=[ColumnDefinition{name=disk.read.average.instance, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=vdc_id, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=disk.used.latest.instance, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=cpu.usage.maximum.instance, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=disk.used.latest, type=org.apache.cassandra.db.marshal.LongType, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=disk.provisioned.latest.unit, type=org.apache.cassandra.db.marshal.Int32Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=disk.write.average.unit, type=org.apache.cassandra.db.marshal.Int32Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=cpu.usagemhz.average, type=org.apache.cassandra.db.marshal.LongType, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=disk.write.average.instance, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=disk.read.average.unit, type=org.apache.cassandra.db.marshal.Int32Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=disk.provisioned.latest.instance, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=cpu.usage.average.unit, type=org.apache.cassandra.db.marshal.Int32Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=org_id, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=disk.read.average, type=org.apache.cassandra.db.marshal.LongType, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=sample_time, type=org.apache.cassandra.db.marshal.TimestampType, kind=CLUSTERING_COLUMN, componentIndex=0, indexName=null, indexType=null}, ColumnDefinition{name=disk.provisioned.latest, type=org.apache.cassandra.db.marshal.LongType, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=cpu.usage.average, type=org.apache.cassandra.db.marshal.LongType, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=cpu.usage.average.instance, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=vapp_id, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=mem.usage.average, type=org.apache.cassandra.db.marshal.LongType, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=vm_id, type=org.apache.cassandra.db.marshal.UTF8Type, kind=PARTITION_KEY, componentIndex=null, indexName=null, indexType=null}, ColumnDefinition{name=disk.write.average, type=org.apache.cassandra.db.marshal.LongType, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=disk.used.latest.unit, type=org.apache.cassandra.db.marshal.Int32Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=cpu.usagemhz.average.unit, type=org.apache.cassandra.db.marshal.Int32Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=cpu.usage.maximum.unit, type=org.apache.cassandra.db.marshal.Int32Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=cpu.usage.maximum, type=org.apache.cassandra.db.marshal.LongType, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=cpu.usagemhz.average.instance, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}],compactionStrategyClass=class org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy,compactionStrategyOptions={},compressionParameters={sstable_compression=org.apache.cassandra.io.compress.LZ4Compressor},bloomFilterFpChance=0.01,memtableFlushPeriod=0,caching={"keys":"ALL", "rows_per_partition":"NONE"},defaultTimeToLive=0,minIndexInterval=128,maxIndexInterval=2048,speculativeRetry=99.0PERCENTILE,droppedColumns={},triggers=[],isDense=false] To org.apache.cassandra.config.CFMetaData@5de0759d[cfId=8767c9f0-a739-11e7-9b44-cd04c5bf0dd5,ksName=vcloud_metrics,cfName=vm_metrics,cfType=Standard,comparator=org.apache.cassandra.db.marshal.CompositeType(org.apache.cassandra.db.marshal.TimestampType,org.apache.cassandra.db.marshal.UTF8Type),comment=,readRepairChance=0.0,dcLocalReadRepairChance=0.1,gcGraceSeconds=864000,defaultValidator=org.apache.cassandra.db.marshal.BytesType,keyValidator=org.apache.cassandra.db.marshal.UTF8Type,minCompactionThreshold=4,maxCompactionThreshold=32,columnMetadata=[ColumnDefinition{name=disk.read.average.instance, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=vdc_id, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=disk.used.latest.instance, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=cpu.usage.maximum.instance, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=disk.used.latest, type=org.apache.cassandra.db.marshal.LongType, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=disk.provisioned.latest.unit, type=org.apache.cassandra.db.marshal.Int32Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=disk.write.average.unit, type=org.apache.cassandra.db.marshal.Int32Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=cpu.usagemhz.average, type=org.apache.cassandra.db.marshal.LongType, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=disk.write.average.instance, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=disk.read.average.unit, type=org.apache.cassandra.db.marshal.Int32Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=disk.provisioned.latest.instance, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=cpu.usage.average.unit, type=org.apache.cassandra.db.marshal.Int32Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=org_id, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=disk.read.average, type=org.apache.cassandra.db.marshal.LongType, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=sample_time, type=org.apache.cassandra.db.marshal.TimestampType, kind=CLUSTERING_COLUMN, componentIndex=0, indexName=null, indexType=null}, ColumnDefinition{name=disk.provisioned.latest, type=org.apache.cassandra.db.marshal.LongType, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=cpu.usage.average, type=org.apache.cassandra.db.marshal.LongType, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=mem.usage.average.instance, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=cpu.usage.average.instance, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=vapp_id, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=mem.usage.average, type=org.apache.cassandra.db.marshal.LongType, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=vm_id, type=org.apache.cassandra.db.marshal.UTF8Type, kind=PARTITION_KEY, componentIndex=null, indexName=null, indexType=null}, ColumnDefinition{name=disk.write.average, type=org.apache.cassandra.db.marshal.LongType, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=disk.used.latest.unit, type=org.apache.cassandra.db.marshal.Int32Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=cpu.usagemhz.average.unit, type=org.apache.cassandra.db.marshal.Int32Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=cpu.usage.maximum.unit, type=org.apache.cassandra.db.marshal.Int32Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=cpu.usage.maximum, type=org.apache.cassandra.db.marshal.LongType, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=cpu.usagemhz.average.instance, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}],compactionStrategyClass=class org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy,compactionStrategyOptions={},compressionParameters={sstable_compression=org.apache.cassandra.io.compress.LZ4Compressor},bloomFilterFpChance=0.01,memtableFlushPeriod=0,caching={"keys":"ALL", "rows_per_partition":"NONE"},defaultTimeToLive=0,minIndexInterval=128,maxIndexInterval=2048,speculativeRetry=99.0PERCENTILE,droppedColumns={},triggers=[],isDense=false] INFO [SharedPool-Worker-1] 2017-10-02 02:18:40,510 MigrationManager.java:365 - Update table 'vcloud_metrics/vm_metrics' From org.apache.cassandra.config.CFMetaData@dd054f8[cfId=8767c9f0-a739-11e7-9b44-cd04c5bf0dd5,ksName=vcloud_metrics,cfName=vm_metrics,cfType=Standard,comparator=org.apache.cassandra.db.marshal.CompositeType(org.apache.cassandra.db.marshal.TimestampType,org.apache.cassandra.db.marshal.UTF8Type),comment=,readRepairChance=0.0,dcLocalReadRepairChance=0.1,gcGraceSeconds=864000,defaultValidator=org.apache.cassandra.db.marshal.BytesType,keyValidator=org.apache.cassandra.db.marshal.UTF8Type,minCompactionThreshold=4,maxCompactionThreshold=32,columnMetadata=[ColumnDefinition{name=disk.read.average.instance, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=vdc_id, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=disk.used.latest.instance, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=cpu.usage.maximum.instance, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=disk.used.latest, type=org.apache.cassandra.db.marshal.LongType, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=disk.provisioned.latest.unit, type=org.apache.cassandra.db.marshal.Int32Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=disk.write.average.unit, type=org.apache.cassandra.db.marshal.Int32Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=cpu.usagemhz.average, type=org.apache.cassandra.db.marshal.LongType, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=disk.write.average.instance, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=disk.read.average.unit, type=org.apache.cassandra.db.marshal.Int32Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=disk.provisioned.latest.instance, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=cpu.usage.average.unit, type=org.apache.cassandra.db.marshal.Int32Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=org_id, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=disk.read.average, type=org.apache.cassandra.db.marshal.LongType, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=sample_time, type=org.apache.cassandra.db.marshal.TimestampType, kind=CLUSTERING_COLUMN, componentIndex=0, indexName=null, indexType=null}, ColumnDefinition{name=disk.provisioned.latest, type=org.apache.cassandra.db.marshal.LongType, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=cpu.usage.average, type=org.apache.cassandra.db.marshal.LongType, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=mem.usage.average.instance, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=cpu.usage.average.instance, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=vapp_id, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=mem.usage.average, type=org.apache.cassandra.db.marshal.LongType, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=vm_id, type=org.apache.cassandra.db.marshal.UTF8Type, kind=PARTITION_KEY, componentIndex=null, indexName=null, indexType=null}, ColumnDefinition{name=disk.write.average, type=org.apache.cassandra.db.marshal.LongType, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=disk.used.latest.unit, type=org.apache.cassandra.db.marshal.Int32Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=cpu.usagemhz.average.unit, type=org.apache.cassandra.db.marshal.Int32Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=cpu.usage.maximum.unit, type=org.apache.cassandra.db.marshal.Int32Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=cpu.usage.maximum, type=org.apache.cassandra.db.marshal.LongType, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=cpu.usagemhz.average.instance, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}],compactionStrategyClass=class org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy,compactionStrategyOptions={},compressionParameters={sstable_compression=org.apache.cassandra.io.compress.LZ4Compressor},bloomFilterFpChance=0.01,memtableFlushPeriod=0,caching={"keys":"ALL", "rows_per_partition":"NONE"},defaultTimeToLive=0,minIndexInterval=128,maxIndexInterval=2048,speculativeRetry=99.0PERCENTILE,droppedColumns={},triggers=[],isDense=false] To org.apache.cassandra.config.CFMetaData@64aea717[cfId=8767c9f0-a739-11e7-9b44-cd04c5bf0dd5,ksName=vcloud_metrics,cfName=vm_metrics,cfType=Standard,comparator=org.apache.cassandra.db.marshal.CompositeType(org.apache.cassandra.db.marshal.TimestampType,org.apache.cassandra.db.marshal.UTF8Type),comment=,readRepairChance=0.0,dcLocalReadRepairChance=0.1,gcGraceSeconds=864000,defaultValidator=org.apache.cassandra.db.marshal.BytesType,keyValidator=org.apache.cassandra.db.marshal.UTF8Type,minCompactionThreshold=4,maxCompactionThreshold=32,columnMetadata=[ColumnDefinition{name=disk.read.average.instance, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=vdc_id, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=disk.used.latest.instance, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=cpu.usage.maximum.instance, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=disk.used.latest, type=org.apache.cassandra.db.marshal.LongType, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=disk.provisioned.latest.unit, type=org.apache.cassandra.db.marshal.Int32Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=disk.write.average.unit, type=org.apache.cassandra.db.marshal.Int32Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=cpu.usagemhz.average, type=org.apache.cassandra.db.marshal.LongType, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=disk.write.average.instance, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=mem.usage.average.unit, type=org.apache.cassandra.db.marshal.Int32Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=disk.read.average.unit, type=org.apache.cassandra.db.marshal.Int32Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=disk.provisioned.latest.instance, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=cpu.usage.average.unit, type=org.apache.cassandra.db.marshal.Int32Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=org_id, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=disk.read.average, type=org.apache.cassandra.db.marshal.LongType, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=sample_time, type=org.apache.cassandra.db.marshal.TimestampType, kind=CLUSTERING_COLUMN, componentIndex=0, indexName=null, indexType=null}, ColumnDefinition{name=disk.provisioned.latest, type=org.apache.cassandra.db.marshal.LongType, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=cpu.usage.average, type=org.apache.cassandra.db.marshal.LongType, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=mem.usage.average.instance, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=cpu.usage.average.instance, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=vapp_id, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=mem.usage.average, type=org.apache.cassandra.db.marshal.LongType, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=vm_id, type=org.apache.cassandra.db.marshal.UTF8Type, kind=PARTITION_KEY, componentIndex=null, indexName=null, indexType=null}, ColumnDefinition{name=disk.write.average, type=org.apache.cassandra.db.marshal.LongType, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=disk.used.latest.unit, type=org.apache.cassandra.db.marshal.Int32Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=cpu.usagemhz.average.unit, type=org.apache.cassandra.db.marshal.Int32Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=cpu.usage.maximum.unit, type=org.apache.cassandra.db.marshal.Int32Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=cpu.usage.maximum, type=org.apache.cassandra.db.marshal.LongType, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}, ColumnDefinition{name=cpu.usagemhz.average.instance, type=org.apache.cassandra.db.marshal.UTF8Type, kind=REGULAR, componentIndex=1, indexName=null, indexType=null}],compactionStrategyClass=class org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy,compactionStrategyOptions={},compressionParameters={sstable_compression=org.apache.cassandra.io.compress.LZ4Compressor},bloomFilterFpChance=0.01,memtableFlushPeriod=0,caching={"keys":"ALL", "rows_per_partition":"NONE"},defaultTimeToLive=0,minIndexInterval=128,maxIndexInterval=2048,speculativeRetry=99.0PERCENTILE,droppedColumns={},triggers=[],isDense=false] |
With the done, if you go into the new HTML5 Tenant UI and go to the Virtual Machine view you should now see a Monitoring Chart drop down in the menu in the main window. From here you can choose any of the available metrics across a half hour, hour, day and week timescale.
API Calls to Retrieve Current and Historical Metrics:
If you still want to go old school the following API Calls are used to gather current and historical VM metrics for vCD VMs. The Machine ID required used the VM GUID as seen in vCenter. The ID can be sourced from the VM Name. The vCD Machine ID shown below in the brackets is what you are after.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# GETTING CURRENT VM METRICS # API CALL: https://VCD-CELL-IP/api/vApp/vm-GUID/metrics/current # METHOD: GET # HEADER: x-vcloud-authorization xxxxxxxxxxxxxxxx # HEADER: Accept: application/*+xml;version=27.0 https://10.0.30.5/api/vApp/vm-c279b551-8ad8-4e04-a894-72dd9bdcd7c7/metrics/current #EXAMPLE RESPONSE <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <CurrentUsage xmlns="http://www.vmware.com/vcloud/v1.5" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" xmlns:vssd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData" xmlns:common="http://schemas.dmtf.org/wbem/wscim/1/common" xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData" xmlns:vmw="http://www.vmware.com/schema/ovf" xmlns:ovfenv="http://schemas.dmtf.org/ovf/environment/1" xmlns:vmext="http://www.vmware.com/vcloud/extension/v1.5" xmlns:ns9="http://www.vmware.com/vcloud/networkservice/common/1.0" xmlns:ns10="http://www.vmware.com/vcloud/networkservice/1.0" xmlns:ns11="http://www.vmware.com/vcloud/networkservice/ipam/1.0" xmlns:ns12="http://www.vmware.com/vcloud/versions"> <Link rel="up" href="https://10.0.30.5/api/vApp/vm-c279b551-8ad8-4e04-a894-72dd9bdcd7c7" type="application/vnd.vmware.vcloud.vm+xml"/> <Metric name="cpu.usage.average" unit="PERCENT" value="0.5"/> <Metric name="cpu.usage.maximum" unit="PERCENT" value="0.5"/> <Metric name="cpu.usagemhz.average" unit="MEGAHERTZ" value="11.0"/> <Metric name="mem.usage.average" unit="PERCENT" value="10.99"/> <Metric name="disk.used.latest.0" unit="KILOBYTE" value="5566278.0"/> <Metric name="disk.used.latest.1" unit="KILOBYTE" value="5566278.0"/> <Metric name="disk.used.latest.2" unit="KILOBYTE" value="5566278.0"/> <Metric name="disk.provisioned.latest.0" unit="KILOBYTE" value="21348166"/> <Metric name="disk.provisioned.latest.1" unit="KILOBYTE" value="21348166"/> <Metric name="disk.provisioned.latest.2" unit="KILOBYTE" value="21348166"/> </CurrentUsage> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# GETTING HISTORIC VM METRICS # API CALL: https://VCD-CELL-IP/api/vApp/vm-GUID/metrics/historic # METHOD: GET # HEADER: x-vcloud-authorization xxxxxxxxxxxxxxxx # HEADER: Accept: application/*+xml;version=27.0 https://10.0.30.5/api/vApp/vm-c279b551-8ad8-4e04-a894-72dd9bdcd7c7/metrics/historic #EXAMPLE RESPONSE <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <HistoricUsage xmlns="http://www.vmware.com/vcloud/v1.5" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" xmlns:vssd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData" xmlns:common="http://schemas.dmtf.org/wbem/wscim/1/common" xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData" xmlns:vmw="http://www.vmware.com/schema/ovf" xmlns:ovfenv="http://schemas.dmtf.org/ovf/environment/1" xmlns:vmext="http://www.vmware.com/vcloud/extension/v1.5" xmlns:ns9="http://www.vmware.com/vcloud/networkservice/common/1.0" xmlns:ns10="http://www.vmware.com/vcloud/networkservice/1.0" xmlns:ns11="http://www.vmware.com/vcloud/networkservice/ipam/1.0" xmlns:ns12="http://www.vmware.com/vcloud/versions"> <Link rel="up" href="https://10.0.30.5/api/vApp/vm-c279b551-8ad8-4e04-a894-72dd9bdcd7c7" type="application/vnd.vmware.vcloud.vm+xml"/> <MetricSeries expectedInterval="300" name="disk.write.average" unit="NONE"/> <MetricSeries expectedInterval="300" name="cpu.usage.average" unit="PERCENT"> <Sample timestamp="2017-10-08T13:50:00.000Z" value="0.0"/> <Sample timestamp="2017-10-08T13:50:40.000Z" value="1.0"/> </MetricSeries> <MetricSeries expectedInterval="300" name="cpu.usage.maximum" unit="PERCENT"> <Sample timestamp="2017-10-08T13:50:00.000Z" value="0.0"/> <Sample timestamp="2017-10-08T13:50:40.000Z" value="1.0"/> </MetricSeries> <MetricSeries expectedInterval="1800" name="disk.used.latest" unit="KILOBYTE"> <Sample timestamp="2017-10-08T14:05:00.000Z" value="5566228.0"/> <Sample timestamp="2017-10-08T14:35:00.000Z" value="5566228.0"/> </MetricSeries> <MetricSeries expectedInterval="1800" name="disk.provisioned.latest" unit="KILOBYTE"> <Sample timestamp="2017-10-08T14:05:00.000Z" value="21348116"/> <Sample timestamp="2017-10-08T14:35:00.000Z" value="21348116"/> </MetricSeries> <MetricSeries expectedInterval="300" name="mem.usage.average" unit="PERCENT"> <Sample timestamp="2017-10-08T13:50:00.000Z" value="10.0"/> <Sample timestamp="2017-10-08T13:50:40.000Z" value="10.0"/> </MetricSeries> <MetricSeries expectedInterval="300" name="disk.read.average" unit="NONE"/> <MetricSeries expectedInterval="300" name="cpu.usagemhz.average" unit="MEGAHERTZ"> <Sample timestamp="2017-10-08T13:50:00.000Z" value="13.0"/> <Sample timestamp="2017-10-08T13:50:40.000Z" value="28.0"/> </MetricSeries> </HistoricUsage> |