Deleting the datastore where a content library is hosted is probably not the best idea
Deleting the datastore where a content library is hosted is probably not the best idea but … yes stupid error and now what. If you are not faint of heart (and now how to take a snapshot), you can rectify this. You should contact GSS as there is not documented solution and this might break.
Take a snapshot and verify if the vCenter backups are in a healthy status. Yes? Ok go ahead.
Log on to the vCenter and create a new Content Library and name it ‘i-made-an-error’. Use the new datastore you want to use and keep the rest of the settings default as these don’t really matter.
Open an SSH session to the vCenter and connect to the Postgress DB ‘VCDB’
1 |
psql -d VCDB -U postgres |
To show which tables are present within the database:
1 |
\d |
Show an overview of the Content Libraries added ( make sure to add the trailing ;):
1 |
SELECT id,name FROM cl_library; |
Now that we have an overview of the Content Libraries, with the one that is throwing an error highlighted.
In the following overview we find the library id from the new Content Library we just added and also the corresponding storage id.
1 |
SELECT * FROM cl_library_storage; |
I will update the storage id from the faulty one we found on the previous screenshot with the one we found for the new Content Library.
1 2 3 |
UPDATE cl_library_storage SET storage_id = 'ae80d942-d7e2-4ab8-b0c1-93405ff4db38' WHERE library_id = '6c7851ed-6166-44b9-b439-5bcd2f9742eb'; |
There are a couple of places that helped me in solving this:
https://tinkertry.com/how-to-remove-vmware-vsphere-zombie-datastore
https://vmninja.wordpress.com/2019/04/05/remove-inaccessible-datastore-from-inventory/