You can create a local content library programmatically by using the vSphere Automation API. The API allows you to populate the content library with VM and vApp templates. You can use these templates to deploy virtual machines or vApps in your virtual environment.
Procedure
- Create a StorageBacking instance and define the storage location.
- Create a LibraryModel instance and set the properties of the new local library.
- Access the LocalLibrary object which is part of the vSphere Automation API service interfaces.
- Call the create function on the LocalLibrary object and pass the LibraryModel as a parameter.