Fixing stale content libraries in vCenter Appliance
Fixing stale content libraries in vCenter Appliance - http://subnet192.com/?p=794
February 3, 2018 – 3:11 pm
Last year we had to rebuild our vCenter (I commented about that in a previous post) using a backup/restore procedure provided by VMware. After the restore, the Update Manager was broken (it’s now fixed) and the Content Libraries were also lost. I didn’t have time to fix it until today. I opened a case with VMware and was provided with the procedure to manually clear out the stale entries for the database.
Unable to delete the stale entry of the content library from the web client. The issue is seen upon restoring the VCDB database post re-deploy. The ‘dcli’ commands are also failing to remove the content library since the same is unable to list the stale entry.
- Snapshot the vCenter appliance
- SSH to the VCSA appliance, and enter the shell.
- Open the Postgres console:
Display the Content Library tables content
Note: As per the snippets above, we see the id for the library is “3b4280d3-b878-4428-85d0-867cb8252e66”.
The storage id for the same library is “1325cd29-0b3e-4be4-8445-625da0dce452”.
When we check the location, we see that the library is saved in the datastore with id “11” (Datastore:datastore-11:f271f3f1-a924-4519-a3f5-e9a75d962888)
We can get the datastore name from the datastore table, which is “DS1” here.
To remove stale entry follow below order.
The output for each of the above command would return “DELETE 1”,Once deleted, we can log in to the web client.
Note: Don’t forget the “;” at the end of each line. If your prompt is VCDB-#, that means it’s waiting for an end-of-line character (the “;”).