VMware Cloud Director 10.6
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
root.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
Remove the keyspace on cassandra:
# cqlsh <ip address> -u cassandra -p cassandra; // or other super account# drop keyspace vcloud_metrics;
Confirm the vcloud_metrics keyspace has gone:
describe keyspaces;
Go to VCD and run:
sudo -i -u postgres psql vcloudselect * 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');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
Verify that new keyspace does have only required metric columns:
use vcloud_metrics;describe vm_metrics;
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