Trying to deploy a VM from a content library throws a similar error related to a missing datastore:
The provided storage backing Datastore:datastore-XXXX:XXXXXXXX-XXXX-XXXX-XXXXXXXXXXXX for library ZZZZZZZZ-ZZZZ-ZZZZ-ZZZZZZZZZZZZ does not exist, the storage backing might be removed, disconnected, or no longer accessible via Datastore:datastore-XXXX:XXXXXXXX-XXXX-XXXX-XXXXXXXXXXXX.
Running the following poweshell command also shows no datastore listed
Get-ContentLibrary <Content_Library_Name>| Select *
AuthenticationEnabled : FalsePublished : FalsePublishUrl : <Content_Library_publish_URL> Example: https://<VCFQDN>/cls/vcsp/lib/<UUID>/lib.jsonPersistJson : FalseOptimizeRemotePublishing : FalseType : LocalCreateDate : 3/4/2035:11:41 PMUpdateDate : 3/4/2024 12:10:41 PMDescription :SyncDate :Version : 2Datastore :Id : <UUID>Name : Content_Library_NameUid : /VIServer=servername\username@VCFQDN:443/LocalContentLibrary=UUID
vCenter Server 7.x
vCenter Server 8.x
This is likely caused by a datastore that was improperly removed from the vCenter
Rebuilding the Content Library is the best option to fix this error