- Ensure that the datastore is not referenced by any virtual machine or template or any ISO mounted to any VM from that old datastore .
- If that is not the case then you can delete the Datastore related entries from vCenter Database .
Run the below query to identify the datastore ID in the vCenter Server database:
select ID from VPX_ENTITY where name ='datastore_name';
Where datastore_name is the datastore to be removed. The query returns the ID of the datastore.
To remove the datastore from the vCenter Server database:
Run the below queries to delete the datastore. Where ID is the output from the first step above.
delete from VPX_DS_ASSIGNMENT where DS_ID=ID;
delete from VPX_VM_DS_SPACE where DS_ID=ID;
delete from VPX_DATASTORE where ID=ID;
delete from VPX_ENTITY where ID=ID;