I’ve come across this issue in previous versions of vRealize Operations Manager prior to the 6.5 release, where you delete an adapter for data collection like vSphere, NSX or VCD, and immediately try to re-create it. Whether it was a timing issue, or vROps just didn’t successfully complete the deletion process, I’d typically get an error that the new adapter instance could not be created because a previous one exists with the same name. Now there are two ways around this. You can connect the adapter to whatever instance (VCD, NSX, vSphere) you are trying to collect data from using the IP address, instead of the FQDN (or vice-versa), or you can cleanup the certificate that was left behind manually as I will outline the steps below.
To resolve the issue, delete the existing certificate from Cassandra DB and accept the new certificate re-creating adapter instance.
1. Take snapshots of the cluster
2. SSH to the master node. Access the Cassandra DB by running the following command:
$VMWARE_PYTHON_BIN $VCOPS_BASE/cassandra/apache-cassandra-2.1.8/bin/cqlsh --ssl --cqlshrc $VCOPS_BASE/user/conf/cassandra/cqlshrc
3. Access the database by running the following command:
4. We will need to look at the entries in the global persistence certificate store. To do this, first list all the entries in globalpersistence.certificate store by running the following command:
SELECT * from globalpersistence.certificate;
5. From the list, find the desired certificate. Now select that specific certificate with the following command:
SELECT * from globalpersistence.certificate where key = 'Certificate.<ThumbprintOfVCCert>' and classtype = 'certificate' ALLOW FILTERING;
SELECT * from globalpersistence.certificate where key = 'Certificate.e88b13c9e346633f94e46d2a74182d219a3c98b2' and classtype = 'certificate' ALLOW FILTERING;
6. The tables which contains the information:
namespace | classtype | key | blobvalue | strvalue | valuetype | version
7. Select the Key which matches the Thumbprint of the Certificate you wish to remove and run the following command:
DELETE FROM globalpersistence.certificate where key = 'Certificate.<ThumbprintOfVCCert>' and classtype = 'certificate' and namespace = 'certificate';
DELETE FROM globalpersistence.certificate where key = 'Certificate.e88b13c9e346633f94e46d2a74182d219a3c98b2' and classtype = 'certificate' and namespace = 'certificate';
8. Verify that the Certificate has been removed from the VMware vRealize Operations Manager UI by navigating to:
Administration > Certificates
9. Click the Gear icon on the vSphere Solution to Configure.
10. Click the + icon to create an new instance. Do not remove the existing instance unless the data can be lost. If the old instance has already been deleted prior to this operation, then this warning can be ignored.
11. Click Test Connection and the new certificate will be imported.
12. Upon clicking Save there will be an error stating the Resource Key already exists. Ignore this and click Close and the UI will show Discard Changes?. Click Yes.
13. Upon clicking Certificates Tab the Certificate is shown for an existing VC Instance. Now you should have a new adapter configured and collecting. If you kept the old adapter for the data, it can safely be removed after the data retention period has expired.