Error: Datastore '(name)' is not accessible. "No connected and accessible host is attached to this datastore."
Note: Please take a snapshot before deleting the datastore from the database.
1. Login into vCenter.
2. Go to Datastore TAB and verify the any VM's are connected to the affected datastore.
3. If not connected VMS to datastore. Just try to delete the datastore from vCenter if not work.
4. Let’s just delete the datastore from the inventory database.
5. Make sure SSH enabled in VCSA.
6. Take putty session by using root credentials.
7. Run the below command in the VCSA putty session.
" opt/vmware/vpostgres/current/bin/psql -d VCDB -U postgres"
8. We should now enter the psql tool
9. At the VCDB=# prompt you can type \d to list all tables
VCDB= \d
10. SELECT id FROM vpx_entity WHERE name = 'MyDatastore';
11. It gave me 1 result, just how we like it.
id
--------
164727
(1 row)
12. So now we knew the Id of the datastore.
13. VCDB=# SELECT * FROM vpx_ds_assignment WHERE ds_id=162667; (find out if it is being connected)
ds_id | entity_id | accessible | mount_path | mount_id | mount_mode | mounted
--------+-----------+------------+------------+----------+------------+---------
164727 | 165646 | | | | |
(1 rows)
14. When we can’t be removed using the GUI, you have to try removing the datastore from the tables:
DELETE FROM vpx_ds_assignment WHERE ds_id=162667;
DELETE FROM vpx_datastore WHERE id=162667;
DELETE FROM vpx_vm_ds_space WHERE ds_id=162667
No comments: