How to reduce unwanted cassandra metrics in VMware Cloud Director
search cancel

How to reduce unwanted cassandra metrics in VMware Cloud Director

book

Article ID: 415920

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

  • Remove some of the cassandra metrics
  • All the default cassandra metrics are not required and only some metrics are required in VMware Cloud Director (VCD)

Environment

VMware Cloud Director 10.6

Resolution

Run below set of commands to clean cassandra settings from VCD Database and cassandra Database and then re-configure after validating required metrics in VCD DB.

Warning: The steps provided involve removing the Cassandra configuration from VCD and dropping the currently stored historic metrics from the Cassandra database. This will effectively mean that the historic metrics feature will be reset and no existing historic metric will be retained meaning that historic metric data will start again from the current date.

Note: Please take a fresh VCD Database Backup before proceeding with below: Backup and Restore of Your VMware Cloud Director Appliance

  1. SSH to one of the VCD Cells as root.
  2. Run the Cell Management Tool command to clean the configuration again to confirm data is deleted:

    /opt/vmware/vcloud-director/bin/cell-management-tool cassandra --clean

  3. Remove the keyspace on cassandra:

    # cqlsh <ip address> -u cassandra -p cassandra; // or other super account
    # drop keyspace vcloud_metrics;

  4. Confirm the vcloud_metrics keyspace has gone:

    describe keyspaces;

  5. Go to VCD and run:

    sudo -i -u postgres psql vcloud
    select * from metric_configuration;

    Now delete whatever metrics are not needed from this table and save the data: i.e.:
    Note: This delete is an example and will remove the 'cpu.usage.maximum', 'cpu.usage.average', 'disk.used.latest', 'disk.provisioned.latest' metrics.

    delete from metric_configuration where name in ('cpu.usage.maximum', 'cpu.usage.average', 'disk.used.latest', 'disk.provisioned.latest');
  6. Configuring a Cassandra Metrics Database in VMware Cloud Director

    /opt/vmware/vcloud-director/bin/cell-management-tool cassandra --configure --create-schema --cluster-nodes node1-ip,node2-ip --username vcloud --password '<password>' --ttl 15 --port 9042

  7. Verify that new keyspace does have only required metric columns:

    use vcloud_metrics;
    describe vm_metrics;

Additional Information

Please see following guide on how to add back metrics that have been removed using the cell-management-tool configure-metrics --metrics-config command with a metrics.groovy file as outlined in the documentation: Configure Metrics Collection and Publishing in VMware Cloud Director