"Datastore conflicts with an existing datastore in the datacenter that has the same URL" error in vCenter Server
book
Article ID: 316577
calendar_today
Updated On:
Products
VMware vSphere ESXi
Issue/Introduction
Symptoms: When adding an ESXi host to a vCenter Server that was previously part of a datacenter or cluster from another vCenter Server, you experience these symptoms:
Adding the ESXi host fails.
You see the error similar to:
Datastore 'datastorename(XX)' conflicts with an existing datastore in the datacenter that has the same URL (ds://vmfs/volumes/UUID/), but is backed by different physical storage.
Multiple ESXi hosts in the same cluster may become unresponsive or go to a Disconnected or Not Responding state as a result of the attempt to add the ESXi host.
vCenter 6.5: Run the query select id,storage_url from vpx_datastore;
vCenter 6.7/7.x: select * from vpx_datastore;
Alternatively, you may also run:
select * from vpx_datastore where storage_url='<storage URL from the error message>';
Look for the affected datastore (DS) UUID and find the ID.
To confirm the correct ID as needed, run select * from vpx_entity where id=(ID found on previous step);
Delete the entry from vpx_ds_assignment, vpx_vm_ds_space, vpx_datastore and vpx_entity using query delete from vpx_ds_assignment where DS_id=XXXX;
Sample were the ID = 461:
delete from vpx_ds_assignment where ds_id=461; delete from vpx_vm_ds_space where ds_id=461; delete from vpx_datastore where id=461; delete from vpx_entity where id=461;
To quit from database use \q
Start the vmware-vpxd service in order for changes to be reflected:
service-control --start vmware-vpxd
Once the vmware-vpxd service is up again, proceed to add the ESXi host again back to the vCenter Server.
Additional Information
Impact/Risks: This process interacts directly with the vCenter Server Appliance (VCSA) Postgres Database, and it is recommended to have a snapshot of the VCSA prior to proceeding.