Skip to main content

VMWare - Delete inaccessible datastore

Rename the store

Use the web client to rename each store and a DEL in front of the name

Access the shell of the appliance server and then the database

VMware vCenter Server 8.0.2.00300

Type: vCenter Server with an embedded Platform Services Controller

Connected to service
* List APIs: "help api list"
* List Plugins: "help pi list"
* Launch BASH: "shell"

Command> shell
Shell access is granted to root
root@vcenter80 [ ~ ]#
/opt/vmware/vpostgres/current/bin/psql -d VCDB -U postgres

View the stores

SELECT * FROM vpx_entity; 

Delete the store

This is the delete for cleaning up the inaccessible datastore

DELETE FROM vpx_ds_assignment WHERE ds_id=1015;
DELETE FROM vpx_datastore WHERE id=1015;
DELETE FROM vpx_vm_ds_space WHERE ds_id=1015;
DELETE from vpx_entity where id=1015;
DELETE FROM vpx_ds_assignment WHERE ds_id=5015;DELETE FROM vpx_datastore WHERE id=5015;DELETE FROM vpx_vm_ds_space WHERE ds_id=5015;DELETE from vpx_entity where id=5015;

Restart the services

quit;service-control --stop --all && service-control --start --all