WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple
You are here: Home / vSphere 6.0 / Creating your own 3rd Party Content Library for vSphere 6.0 & vCloud Director 5.x

Creating your own 3rd Party Content Library for vSphere 6.0 & vCloud Director 5.x

06.02.2015 by William Lam // 21 Comments

If you recall a few weeks back, I had shared a custom vGhetto Content Library that I had created that contains a collection of my Nested ESXi and VSAN OVF Templates that anyone with a vSphere 6.0 or vCloud Director 5.x environment could subscribed to. This custom Content Library is also known as a 3rd Party Content Library and is one of the capabilities that I am most excited about with the new Content Library feature in vSphere 6.0. The reason I think this is such a cool capability is that I believe it opens up a wide range of use cases not only for our customers but also for our partner eco-systems enabling ease of content management and content distribution for VMware customers.

Just imagine, a vendor who might be providing Virtual Appliances (OVF/OVA), ISOs, VIBs, patches, workflows, blueprints, scripts, etc. can host a 3rd Party Content Library and as a customer you can easily subscribe to a particular repository. Once subscribed, you can either have the content automatically downloaded or synchronized on-demand. In fact, customers can also create their own 3rd party Content Library and distribute their own content within their own organization (local and remote sites) and even be able to share it with others in the VMware community.

Before I jump into the process of creating your own 3rd Party Content Library, I wanted to quickly go over the different options for publishing and subscribing to a Content Library. Below is a diagram to help you visualize the different options you have for publisher and subscriber sources.

vsphere-6.0-class-content-library-as-a-service
Here is the same information as shown in the diagram but in a table format:

Publisher Subscriber
vCenter Server vCenter Server
vCloud Director vCenter Server
3rd Party vCenter Server
3rd Party vCloud Director

Note1: Although the diagram technically shows a 5th scenario where a vCenter Server is the publisher and vCloud Director is the Subscriber, this particular flow is not entirely functional at the moment. Though it will work, it will only allow you to sync non-VM Templates and a different version of the script would be needed. This is a known issue and hopefully it will be resolved in a future update within vCloud Director.

Note2: For 2nd scenario where vCloud Director is a Publisher and vCenter Server is a Subscriber, On-Demand synchronization and overriding an existing OVF Library is currently not supported.

Here is the high level workflow for creating your own 3rd Party Content Library:

  1. Create directory structure layout for your content
  2. Create the JSON metadata index
  3. Publish the 3rd Party Content Library using HTTP(s)
  4. (Optional) Periodically update the JSON metadata index on new or updated content

Step 1 - Here is an example of what your directory structure layout should look like:

creating-third-party-content-library-0
Step 2 - To assist with the JSON metadata indexing, Eric Cao, one of the Content Library Engineers was kind enough to provide the following Python script called make_vcsp_2018.py which you will need to download onto a system which has the Python interpreter running

UPDATE (07/26/18) - You can also create 3rd party content library directly on Amazon S3 or Microsoft Azure Blob using the updated versions of the script make_vcsap_2018.py and  make_vcsap_2022.py respectively

UPDATE (05/29/17) - Thanks to Eric, the script now supports both Python2/3 as well as a new 4th optional command-line argument for performing md5check (Default: true)

Step 3 - The make_vcsp_2018.py script accepts two arguments: the first is the display name of the Content Library and the second argument is the path to the root directory of your Content Library. Here is an example:

python make_vcsp_2018.py vghetto-content-library /Users/lamw/desktop/vghetto-content-library

Once the script has finished building the metadata index, we can now take a look at our content and you will notice some additional files that have been added to your Content Library directory as seen in the screenshot below:

creating-third-party-content-library-1
You will notice two new files at the root directory of your 3rd Party Content Library. The first is the items.json which provides reference to all the files within the library and you will see that each subsequent directory will also contain an individual item.json file describing the content within the local directories. The lib.json is the 3rd Party Content Library endpoint and is what you will be specify when subscribing to a 3rd Party Content Catalog and by providing the absolute URL to this file when setting up a new Content Library.

Step 4 - To publish the 3rd Party Content Library, you just need to host the content somewhere that supports HTTP(s), this can be as simple as using a regular Web Server to something like an Object Store such as Amazon S3.

Note: If you plan to use a non-traditional Web Server for hosting your 3rd Party Content, ensure that the root URL is the same for accessing all files and can not change. For example, you will not be able to host a 3rd Party Content Library using Dropbox as the root URL changes for each and every file.

Step 5 (Optional)- Periodically you will most likely want to add new content and files to your 3rd Party Content Library and as part of that process you will also need to update the metadata index. You can easily do so by re-running the make_vcsp_2018.py script against your existing 3rd Party Content Library. The script will only generate new metadata index for files that have been newly added and for any changes to existing files, the appropriate metadata files will only updated.

As you can see the process in creating and publishing a 3rd Party Content Library is pretty straight forward and simple. I hope to see more of our partners start to publish their own 3rd Party Content Libraries, I think it would be extremely beneficial for VMware customers and I look forward to hearing about them :). If you have created your own 3rd Party Content Library and would like to share the details, feel free to leave a comment and I will be aggregating a list below so that you can easily find them all in one place.

Published 3rd Party Content Libraries

Author Library Content Link
William Lam Nested ESXi & VSAN OVF Templates Subscribe to vGhetto Nested ESXi Template Content Library in vSphere 6.0
Alan Renouf Some sample OVF/OVAs Subscribe to Alan's Content Library in vSphere 6.0

More from my site

  • How to deploy vSphere 6.0 (VCSA & ESXi) on vCloud Director and vCloud Air?
  • Deployment models for vSphere Content Library
  • Quick Tip - Using ovftool to connect to vCloud Director behind a 2-Factor Authentication portal
  • Subscribe to vGhetto Nested ESXi Template Content Library in vSphere 6.0
  • Configuring a "Whitelist" for VM advanced settings in vCloud Director

Categories // vSphere 6.0 Tags // content library, vcd, vcloud director, vSphere 6.0

Comments

  1. *protectedterafirma says

    06/03/2015 at 12:02 am

    Hi William,

    Any idea if there is a way for multiple users on the same vCenter to share a content library so i don't have to store all the templates and iso files multiple times as each user creates their own Content Library? Even better would be the ability to share a Content Library with all vCetners in a site and only storing the files once.

    Reply
    • William Lam says

      06/03/2015 at 12:55 am

      Yes, you can setup permissions so that a group of users can all share/contribute to a common Content Library. In terms of your second question, the boundary for Content Library is at the VC level, this means that you would need to setup the other VC's as subscribers to your main VC if you want to share the content and it would be replicated.

      Reply
      • *protectedterafirma says

        06/03/2015 at 1:08 am

        thanks for that, any idea where the permissions are I cannot find where they are set?

        Reply
        • William Lam says

          06/03/2015 at 1:15 am

          They're under Roles in the vSphere Web/C# Client just like all the other permissions. There's a new "Content Library Administrator" sample role which you can see all the different privileges that can be assigned. You can then add/remove privileges either using an existing role or creating a new one.

          Reply
          • *protectedterafirma says

            06/03/2015 at 1:28 am

            The problem I have is that I create a library as *protected email* then login with my domain user account that has full admin privileges on the whole vCenter and when I go to Content Libraries it says there are none. I then log back in as SSO admin and the library I created is there and works fine.

          • William Lam says

            06/03/2015 at 5:03 am

            This should work as long as your AD Domain account has full Administrator privileges. Can you check to see if the AD Domain User/Group is also part of the SSO Administrator group? You can check by going to Administration->Users and Groups and under "Group" there should be one called Administrator. If not, can you try adding the AD User/Group and see if that helps?

          • *protectedterafirma says

            06/04/2015 at 5:04 am

            Yes if I apply the permission at the Global level to all users for the role defined for Content Library access then it works.

  2. *protectedterafirma says

    06/04/2015 at 5:09 am

    Sorry to make that clear: in the web client I go to: Administration -> Global Permissions -> Add then select the AD group for my users then select the Role customized for Content Library access or the sample one and apply it all those users then get those permissions.

    I couldn't find any other way to get permissions to apply to the Content Library. This is ok if you don't need to apply global permissions to the same group for any other reason unless you create a custom role specifically for use in the Global permissions.

    Reply
  3. *protectedGrumpy Gremlin says

    11/14/2016 at 12:37 pm

    I'm not entire clear on the "publish" step. Could you flesh out some details on how exactly you publish the content library from a web host? Specifically if I was using Amazon S3 ?

    Reply
  4. *protectedyezdi says

    03/15/2017 at 7:57 am

    Hi William, Thanks for the article and script. Can we use the script for creating catalog for VCD 8.20 too?

    Reply
  5. *protectedBrian Graf says

    04/08/2017 at 4:50 pm

    Note* This script does not work with Python 3+. Stick with 2.7x if you don't want encoding errors 🙂

    Reply
  6. *protectedBenjamin Saiz says

    11/29/2017 at 5:51 am

    Hi,

    Trying to run my own content library with your script but didn't find how to deploy vm from it ?
    Got my ovf correctly published but cannot use it for "new vm from Content Library" operation.

    Reply
  7. *protectedBenjamin Saiz says

    11/29/2017 at 6:11 am

    nevermind ... just found out that the manual synchronization of the item is required.

    Reply
  8. *protectedBenjamin Saiz says

    11/29/2017 at 8:11 am

    In fact got inconsistent result where vm template type stay Unknown and cannot be used.
    Any idea why ?

    Reply
    • William Lam says

      12/01/2017 at 6:55 am

      Are you sync'ing OVF or OVA? Only the former is a "deployable" type today in CL. This is the same workflow if you were to use the CL UI to upload an OVF, if you upload OVA it'll be treated as a regular file

      Reply
  9. *protectedBenjamin Saiz says

    12/01/2017 at 7:00 am

    I'm using ovf but when i sync an item im can't use it.
    i have to delete it and resync

    Reply
  10. *protectedDamir says

    08/28/2018 at 7:19 am

    Hey, So I have more of a flat structure of my files and script does generate item.json and there I have everything like this:
    {
    "files": [
    {
    "hrefs": [
    "vm.vmdk"
    ],
    "etag": "907d7fd341c17a78205844683de051e9",
    "name": "item.vmdk",
    "size": xxx
    },

    "hrefs": [
    "vm.vmdk"
    ],
    "etag": "907d7fd341c17a78205844683de051e9",
    "name": "item.ovf",
    "size": xxx
    },

    ...

    When I create a lib out of this I get some general system errors, with NULL pointers reported by vCenter that I am using.

    My question is ... Is this suppose to work, or I need to have separated folders in the root folder for each vmdk, ovf ... file?

    Thx!

    Reply
    • *protectedDamir Dedic says

      08/29/2018 at 1:28 am

      I managed to fix this, but now once I import all items are marked as UNKNOWN, anyone had something similar?

      Reply
      • *protectedRavi says

        04/23/2024 at 10:19 am

        How did you fix null pointer error?
        I setup third party content library on a windows server and used IIS for web server but getting null pointer error while trying to sync it.

        Reply
  11. *protectedАнтон Анатольевич Бородин says

    11/13/2023 at 10:14 pm

    Hello William!
    How to host a VMTX template in a third party content library? What files from the template will be needed there?

    Reply
    • William Lam says

      11/14/2023 at 4:02 am

      VMTX can’t be hosted as it’s vCenter specific feature and is associated with VC

      Reply

Leave a Reply to Damir DedicCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search

Thank Author

Author

William is Distinguished Platform Engineering Architect in the VMware Cloud Foundation (VCF) Division at Broadcom. His primary focus is helping customers and partners build, run and operate a modern Private Cloud using the VMware Cloud Foundation (VCF) platform.

Connect

  • Bluesky
  • Email
  • GitHub
  • LinkedIn
  • Mastodon
  • Reddit
  • RSS
  • Twitter
  • Vimeo

Recent

  • Programmatically accessing the Broadcom Compatibility Guide (BCG) 05/06/2025
  • Quick Tip - Validating Broadcom Download Token  05/01/2025
  • Supported chipsets for the USB Network Native Driver for ESXi Fling 04/23/2025
  • vCenter Identity Federation with Authelia 04/16/2025
  • vCenter Server Identity Federation with Kanidm 04/10/2025

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2025

 

Loading Comments...