Recently customer had a issue where they have changes the vCenter IP address and after making the old vCenter endpoint as inactive is Usage Meter .Once the Changes have done we tried to add the vCenter and it adds successfully as per the collector logs but we were unable to see the vCenter with the new IP address.
We later found that the old vCenter has the same instance UUID of the New vCenter IP address cache in the Usage Meter DB causing the issue.
In order to resolve the issue we had to replace the FQDN or IP address on the Usage Meter database table with the new vCenter IP address .
vCenter with old IP address is highlighted in the screenshot below after making its as inactive
catalina logs
[ERROR] [04/23/2020 15:49:46.151] [default-akka.actor.default-dispatcher-19] [akka://default/user/vcenterSaver] Exception while executing statement : ERROR:
duplicate key value violates unique constraint "VcServer_instanceUuid"
Detail: Key ("instanceUuid")=(DFD348D4-93A6-47E5-B681-E1B39DB2D3D3) already exists.errorCode: 0, sqlState: 23505
Resolution:
sql -- > command to access the DB
psql.bin (9.5.7 (VMware Postgres 9.5.7.0-5604358 release))
Type "help" for help.
usgmtr=> select * from "VcServer";
usgmtr=> Select host, id FROM "VcServer";
host | id
---------------+----
10.200.51.225 | 2
10.200.18.250 | 4
10.210.0.105 | 3
10.200.102.5 | 5
10.200.51.240 | 1
(5 rows)
usgmtr=> UPDATE "VcServer" SET host = '10.200.101.5' WHERE id = 5;
UPDATE 1
usgmtr=> Select host, id FROM "VcServer";
host | id
---------------+----
10.200.51.225 | 2
10.200.18.250 | 4
10.210.0.105 | 3
10.200.51.240 | 1
10.200.101.5 | 5
(5 rows)
usgmtr=> \q
usgmtr# service tomcat restart
usgmtr# service vpostgres restart
We later found that the old vCenter has the same instance UUID of the New vCenter IP address cache in the Usage Meter DB causing the issue.
In order to resolve the issue we had to replace the FQDN or IP address on the Usage Meter database table with the new vCenter IP address .
vCenter with old IP address is highlighted in the screenshot below after making its as inactive
catalina logs
[ERROR] [04/23/2020 15:49:46.151] [default-akka.actor.default-dispatcher-19] [akka://default/user/vcenterSaver] Exception while executing statement : ERROR:
duplicate key value violates unique constraint "VcServer_instanceUuid"
Detail: Key ("instanceUuid")=(DFD348D4-93A6-47E5-B681-E1B39DB2D3D3) already exists.errorCode: 0, sqlState: 23505
Resolution:
sql -- > command to access the DB
psql.bin (9.5.7 (VMware Postgres 9.5.7.0-5604358 release))
Type "help" for help.
usgmtr=> select * from "VcServer";
usgmtr=> Select host, id FROM "VcServer";
host | id
---------------+----
10.200.51.225 | 2
10.200.18.250 | 4
10.210.0.105 | 3
10.200.102.5 | 5
10.200.51.240 | 1
(5 rows)
usgmtr=> UPDATE "VcServer" SET host = '10.200.101.5' WHERE id = 5;
UPDATE 1
usgmtr=> Select host, id FROM "VcServer";
host | id
---------------+----
10.200.51.225 | 2
10.200.18.250 | 4
10.210.0.105 | 3
10.200.51.240 | 1
10.200.101.5 | 5
(5 rows)
usgmtr=> \q
usgmtr# service tomcat restart
usgmtr# service vpostgres restart
Cool! Really useful. Thanks
ReplyDelete