Manually remove a Content Library from vCenter Server Appliance when the datastore it resided on is no longer accessible or the Content Library has been corrupted
book
Article ID: 326242
calendar_today
Updated On:
Products
VMware vCenter Server
Issue/Introduction
A Content Library cannot be deleted from the vSphere Web UI.
When attempting to delete the Content Library using the vSphere Web UI, the task fails.
Error: A general system error occurred: Cannot delete content from library 19b1fa06-####-####-####-23379ec0e9c7, reason: (vim.fault.InaccessibleDatastore) { faultCause = null, faultMessage = null, datastore = ManagedObjectReference: type = Datastore, value = datastore-####, serverGuid = 3c723c9d-####-####-####-b24fb5a070c0, name = <DS_Name>, detail = notAccessibleWithPrivilege }.
The backing datastore for the Content Library is no longer accessible after the datastore has been unmounted and/or removed from hosts.
The Content Library was corrupted from accidental deletion of the Content Library items from disk or due to a corrupted content library item uploaded to the library resulting in new items failing to deploy from the Content Library.
Environment
VMware vCenter Server
Cause
Part of the deletion process for a Content Library is cleaning up the Content Library files which reside on a VMFS datastore. If this part of the workflow fails, the deletion process can run into an error and the Content Library fails to delete completely. The CL may still show content with size and details, but the data does not exist on disk.
Resolution
Note: The steps below are irreversible. Before you make those changes, ensure that you have created a fresh backup or snapshot of the vCenter Server. If the vCenter Server is a member of an Enhanced Linked Mode (ELM) replication setup, keep in mind that you need to create backups or offline snapshots (in powered off state) for all ELM nodes. Similarly, when you need to restore the backup of this vCenter, or roll back to the snapshot, all of the other ELM nodes need to be restored/rolled back as well. For more information, see https://knowledge.broadcom.com/external/article/313886.
Stop the vpxd and content library services:
service-control --stop vmware-vpxd
service-control --stop vmware-content-library
To remove the Content Library from vCenter database:
Connect to the vCenter Database using to psql tool in the SSH: