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.
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.
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.
Note: The steps below are irreversible. Before you make those changes, please 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, please 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, please see https://knowledge.broadcom.com/external/article/313886.
To remove the Content Library from vCenter, connect to the vCenter Database using to psql tool in the VCSA:
# /opt/vmware/vpostgres/current/bin/psql -d VCDB -U postgres
Then:
# select id,name from cl_library where name = '<cl_name>';
# select * from cl_library_storage where library_id = '<ID from step 1>';
# delete from cl_library_storage where library_id = '<ID from step 1>';
# delete from cl_storage where id = '<storage_id from step 2>';
# delete from cl_library where name = '<cl_name>';
# service-control --stop --all && service-control --start --all