This article intends to provide resolution for deploying template from subscribed content library with the following symptoms,
Duplicate entries for the content library items in vCenter's Database.
Before applying the steps below, please take a backup or an offline-snapshot (in powered-off state) of the vCenter Server Appliance . If the vCenter is part of a Linked Mode replication setup, please backup/offline snapshots of all the replicating nodes as well.
We strongly recommend contacting Broadcom technical support, as deleting incorrect entries may corrupt the database and make vCenter inaccessible.
service-control --stop vmware-content-library
service-control --stop vpxd
/opt/vmware/vpostgres/current/bin/psql -d VCDB -U postgres
SELECT * FROM cl_libraryitem_certificate_verification certInfo WHERE certInfo.itemId = 'xxxxxxxxxxxxxxxxxxxxxxxx';
Sample Output : We can see multiple duplicate entries for same Item ID
5. Once you confirms that there are duplicate entries, Kindly run the below command to delete them, (NOTE: Kindly do not delete the library items directly from tables. Item info is not stored alone in the cl_libraryitem_certificate_verification there are other tables as well like cl_libraryitemversion, cl_libraryitem etc. Deleting items this way will leave the entries in inconsistent state.
DELETE FROM cl_libraryitem_certificate_verification cert_ver_old USING (SELECT MIN(ctid) as ctid, itemId FROM cl_libraryitem_certificate_verification GROUP BY itemId HAVING COUNT(*) > 1) cert_ver_new WHERE cert_ver_new.itemId = cert_ver_old.itemId AND cert_ver_new.ctid <> cert_ver_old.ctid;
Sample output : We should DELETE 1 after deleting the duplicate entry
6. Verify whether duplicate entry is deleted or not.
7.Quit the VCDB using \q
8. Start the vpxd and content library service using,
service-control --start --all
9. Re-sync the OVF template within the content library.
10. Once the sync is finished, re-attempt the OVF deployment.