Latest posts by Mohammed Raffic (see all)
- How to create a VMware content library - Mon, Oct 9 2017
- DRS affinity and anti-affinity rules in VMware vSphere - Fri, Sep 29 2017
- ESXi host maintenance mode in a vSAN cluster - Fri, Sep 8 2017
Maintaining centralized VM templates, vApp templates, and ISO images for consistent VM deployment across the virtualized infrastructure is a key task. Content libraries are container objects for VM and vApp templates and other file types like ISO files.
You can share the templates and ISO files across multiple vCenter Servers in the same or even in different datacenter locations. vSphere administrators can use the VM templates in the content library to deploy VMs into the vSphere inventory. There are two types of content libraries: local or subscribed.
A local library stores items in a single vCenter Server instance. You can publish the contents of the local library so that other vCenter Server system users can subscribe to the local library to deploy VMs. You can even configure password authentication when you publish the content library externally.
You can create a subscribed content library in the same vCenter Server where the published content library is, or in a different vCenter Server system in the same vSphere domain or in a different vSphere domain.
Create a local content library ^
Log in to vCenter Server using the vSphere Web Client. In the Web Client navigator, click Content Libraries.
Navigate to Content Libraries in the vSphere Web Client
To create a new content library, click on Create a new content library under the Objects tab.
Enter the name for the content library and specify the description for the library under Notes. If you have multiple vCenter Servers linked to a single Platform Services Controller (PSC), select the appropriate vCenter Server from the drop-down and click Next.
Select Local Content Library to create a local library only accessible to the vCenter Server instance where you create it.
To make the contents of local library available to other vCenter Servers, select the checkbox Publish externally. You can also enable password authentication to access this local library. To do this, select the checkbox Enable authentication and specify the password. Click Next.
You need to specify the location to store the library content. The storage location can be either a Server Message Block (SMB) share, a Network File System (NFS) path (NFS3 or NFS4), or a datastore connected to any of the ESXi hosts of the vCenter Server.
To use a datastore, click Select a datastore. Select any one of the datastores in the vSphere inventory and click Next.
Review the content library settings and click Finish to start creating the content library.
The local content library is now created, and you will be able to see it under Content Libraries.
Import library items into the content library ^
You can now import library items such as VM templates, vApp templates, Open Virtualization Format (OVF) files, and ISO images. You can also upload all the files associated with an OVF template (.ovf, .mf, and .vmdk). However, you will only see .ovf files under the templates in the vSphere Web Client.
To upload library items into the content library, click Import item on the Templates tab. Select the files to import into the library and click OK.
I have imported the Windows Server 2012 VM template called "Win2k12_template" into my local content library. Once the import is complete, you will be able to see the imported VM template under the Templates option in the content library. The Stored Content Locally option tells you if it is a local library.
Create a subscribed content library ^
The procedure to create a subscribed content library is similar to creating a local library. The only difference is that we need to select the option Subscribed Library and specify the URL and password of the published library.
Before creating a subscribed library, go to Published Content library (Local library) -> Configure and click Copy Link to copy the subscription URL of the local content library. Keep the password handy if password protected is set to "Yes."
Log in to the vCenter Server where you want to create the subscribed content library using the vSphere Web Client. In the Web Client navigator, click Content Libraries. Specify the name and description of the content library and click on Next.
Select Subscribed Content library and paste the subscription URL of the published local content library. If enabling password authentication, select the checkbox Enable authentication and enter the same password you used for creating the published local library.
You can now choose one of the following two options:
Download all library content immediately: This option will download the entire library contents of the published local library immediately after creating the content library.
Download library content only when needed: This option saves storage space by storing only the metadata for the library items from the published library.
Specify the datastore location to store the contents of the library and click Finish to create the subscribed content library. The subscribed content library is created, and you will be able to see the library details under Summary tab.
Since it is the subscribed content library, you will able to see the library items imported into the published content library (local library) under Templates. We can see the VM template "Win2k12_template" we have imported into the local library earlier.
Since we have chosen the option Download library items only when needed during the creation of the subscription content library, this set the Stored Content Locally option to "No."
Synchronize the content library items ^
Because we selected Download library content only when needed during the creation of the subscribed content library, this will download only metadata of the library items from the published library. To use the content library items, we need to synchronize either the individual library items or the entire library.
To synchronize an individual library item, select the library item under Templates and click on Synchronize Item to start the synchronization between the subscribed library and the published library.
Once the synchronization of the library item is complete, the Stored Content Locally option will switch to "Yes." You will also notice that the size of the VM template increased.
To synchronize the entire subscribed content, right-click the subscribed library and select Synchronize Library or click the Synchronize symbol marked below.