To resolve the issue:
- Take a snapshot of the vCenter server.
- Navigate to C:\Program Files\VMware\vCenter Server\vPostgres\bin .
- Connect to the database running the command:
psql -d VCDB -U vc
- Search for the name of the duplicate running the command:
For example: Consider the VM causing the issue is identified with the name VM-2280.
select id, file_name from VPX_VM group by id, file_name having count(id)
> 1;
id | vm-2280
You will receive output similar to:
id | file_name
------+-------------------------------------------------------------------------
---------------------------------------
2280 | ds:///vmfs/volumes/Volume Name/VM name/(2)_replica/VM name.vmx
2247 | ds:///vmfs/volumes/Volume Name/VM name/VM_name.vmx
(2 rows)
- Once you have the ID matching the error message, you delete the matching ID with the command:
For example: delete from VPX_VM where ctid=(select ctid from VPX_VM where ID=2247 LIMIT 1);
After the entry has been deleted, stop all the vCenter Services and try to start them again, it may fail with another ID number, so you need to delete all the entries that causes conflicts