WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple
You are here: Home / Automation / Converting a vSphere Content Library from Subscriber to a Publisher?

Converting a vSphere Content Library from Subscriber to a Publisher?

04.03.2018 by William Lam // 5 Comments

This is a blog post on some old Content Library research which I had looked into several months back for a customer inquiry and realized I never got a chance to write about. When you create a Subscriber Content Library (CL) which synchronize content from a Published CL, the Subscriber CL is basically in read-only mode. Not only can you not edit or modify the content, but the CL itself is also locked as a Subscriber forever. Why might this be a concern or an issue?

Consider the following scenario, where you have a single master CL that contains all the images you wish to distribute amongst your remote sites as efficiently as possible and ideally leveraging CL's built-in replication mechanism. Lets say the master CL is in Palo Alto and you have several vCenter Servers that can be configured as Subscriber CLs in Cork, Ireland. Instead of having configuring each Subscriber to pull remotely from PA, why not replicate that to a single Subscriber located in Ireland and re-publish that content locally to the remainder CL? The ideal workflow would look something like the diagram below.

However, today you can not simply convert a Subscriber CL to also become a Publisher CL. The only option that I could think of without relying on something like externally replicating a CL is to create an additional Published CL from the Subscriber CL. The idea is you would clone from your Subscriber CL in the same vCenter Server to a new Publisher CL and then that CL can then be used by the other local Subscriber CL as depicted in the diagram below.

This functionality currently does not exist in the vSphere Web/Flex Client, however it can be automated using the Content Library REST APIs. I had created a Content Library PowerCLI Module a few months back and one of the functions that would be useful for this workflow is the Copy-ContentLibrary.

The function is pretty straight forward to use, it accepts the name of a source CL that has already been configured as a Subscriber CL and the name of a new Published CL that you have created but is empty.


After that, the contents of the source CL will be copied into the destination CL as shown in the screenshot below.


Depending on the size of your CL, this can take some time but once it has completed, you should that your Published CL is now populated with content from your source CL.

The PowerCLI function also does a few additional things such as checking if a file already exists and will skip the file and move on to help with the copy.


If your intention is to only replicate from your master CL and then create a local publisher CL, there is an additional flag that you can set to $true called -DeleteSourceFile which will delete the files from the Subscriber CL. This is useful if you only have a single Datastore in which both the Subscriber and Publisher CL is storing, which means after the CL copy, you would be consuming 2x the storage as everything has been duplicated. For this particular customer, they only required an initial sync to populate content in their EMEA office and after that, they would be managing it local and not require additional replications from their master CL.

More from my site

  • vSphere Content Library PowerCLI community module
  • Quick Tip - Retrieving vSAN File Share Network Permissions using vSAN API & PowerCLI
  • Quick Tip - Using PowerCLI to query VMware Tools Configuration at scale 
  • Managing vSAN internet connectivity configuration using the vSAN API
  • Quick Tip - Retrieving NSX segment information from vCenter Server

Categories // Automation, PowerCLI, vSphere Tags // content library, PowerCLI

Comments

  1. *protectedSwapnil says

    04/12/2019 at 5:52 am

    very useful information, thank you for info. I am also going to do something like this but i my scenario i want to convert subscribed CL to Publisher CL as Publisher CL will be decommission soon, i have not verified this but will check and let you if i face any issue. Great work.

    Reply
  2. *protectedSnake Eater says

    04/24/2019 at 11:21 am

    Hello,

    Pardon for the inexperience in powershell but get the below error when attempting to run the command after connecting to the VIServer and CisServer and running the script.

    Method invocation failed because [System.Management.Automation.PSCustomObject] does not contain a method named 'Create'.

    I've tried importing the vmware.powercli module without any success. Any help would be appreciated.

    Reply
    • *protectedSnake Eater says

      04/24/2019 at 12:23 pm

      Forgot to mentioned I'm only using the Copy-Content-Library function.

      Reply
  3. *protectedJoe says

    11/21/2019 at 9:21 pm

    What really needs to happen is that a "Subscribed" library should be able to subscribe to other subscribed libraries. Then you could have regional hubs. Right now I have a central library in the U.S. that is replicating worldwide... I'd rather have one library in each geo region subscribe to this master library, then have other subscribing libraries subscribe to that geo hub subscriber. Or, I guess VMware should create a third library type, the duel "Subscribed" / "Published" library, represented with a double-headed up/down arrow.

    Reply
    • *protectedJoe says

      11/21/2019 at 9:23 pm

      "dual"... it's late. 🙂

      Reply

Thanks for the comment!Cancel 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...