WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple
You are here: Home / Automation / Managing vSAN internet connectivity configuration using the vSAN API

Managing vSAN internet connectivity configuration using the vSAN API

07.12.2024 by William Lam // 5 Comments

I recently received an inquiry from a vSAN customer who was looking to disable the vSAN internet connectivity, which is used pull down the latest vSAN HCL catalog updates and is also used as part of enabling the vSAN File Services.


Rather than using the vSphere UI to disable this configuration, the customer was interested in automating this and was wondering if there was an API that can be used?

While I have explored a large part of the vSAN Management API, this is one area that I had not played with before, which also meant a good learning opportunity!

After a few minutes of digging around the vSAN API documentation and performing a few operations, I found the vSAN internet connectivity setting was part of the VsanVcClusterHealthSystem and can be viewed by using the queryVsanClusterHealthConfig API, which returns a number of configurations that are stored as an array of key/value pairs. Luckily, for internet connectivity, the string was pretty easy to identify which is called enableinternetaccess and below is a quick PowerCLI snippet demonstrating the use of this vSAN API in retrieving its current value, which by enabled by default as you can see from the screenshot below:

$vsanClusterName = "Supermicro-Cluster"
$vchs = Get-VSANView -id "VsanVcClusterHealthSystem-vsan-cluster-health-system"
$results = $vchs.VsanHealthQueryVsanClusterHealthConfig((Get-Cluster $vsanClusterName).ExtensionData.MoRef)
$results.Configs | where {$_.key -eq "enableinternetaccess"}


Now that we know where to find the internet connectivity configuration, we can now modify the setting by using the setVsanClusterTelemetryConfig API and providing a list of keys and values that we wish to modify.

Here is PowerCLI snippet demonstrating the use of this vSAN API and once the update has been made, you can use the previous vSAN API to retrieve and confirm the setting has been updated as well as confirm using the vSphere UI.

$keyPairSpec = New-Object VMware.Vsan.Views.VsanClusterHealthResultKeyValuePair
$keyPairSpec.Key = "enableinternetaccess"
$keyPairSpec.Value = $true
$configHealthspec = New-Object VMware.Vsan.Views.VsanClusterHealthConfigs
$configHealthspec.Configs = @($keyPairSpec)

$vchs.VsanHealthSetVsanClusterTelemetryConfig((Get-Cluster $vsanClusterName).ExtensionData.MoRef,$configHealthspec)

More from my site

  • Quick Tip - Retrieving vSAN File Share Network Permissions using vSAN API & PowerCLI
  • Quick Tip - Retrieving the vSAN Rekey Interval using PowerCLI
  • Retrieving detailed per-VM space utilization on VSAN
  • Translating vSAN VM Object IDs (UUID to VM and VM to UUID)
  • Reporting vSAN Object distribution across vSAN Disk Groups using PowerCLI

Categories // Automation, PowerCLI, VSAN, vSphere 8.0 Tags // PowerCLI, VSAN

Comments

  1. sebastian+*protectedS.P. says

    07/13/2024 at 11:17 am

    Is it possible to change the URL where vcenter looks for the HCL and release catalogue? Use case would be for offline environments that have downloaded the json file and keep it on an internal web server.

    Reply
    • William Lam says

      07/13/2024 at 7:39 pm

      No, but for offline/airgapped environments, you can download the HCL/release catalog and then upload

      https://williamlam.com/2020/06/updating-the-vsan-hcl-release-catalog-db-using-vsan-api.html

      Reply
      • *protectedJens Hofbauer says

        07/15/2024 at 2:42 am

        I'm missing the possibility to manually upload the vSAN HCL file in the most recent vCenter 8u2 and 8u3 versions.
        The GUI for Skyline Health has changed and the link to upload the file is missing.

        Reply
        • William Lam says

          07/16/2024 at 9:13 am

          The location on where to update both HCL database/catalog has NOT changed since its introduction 🙂 Please see screenshot https://williamlam.com/2020/06/updating-the-vsan-hcl-release-catalog-db-using-vsan-api.html for where its located which is also same place in both U2/U3

          Reply
  2. *protectedPhilip says

    09/16/2024 at 10:17 am

    You're the absolute BEST. Gosh, everything you produce is so helpful. We couldn't do this job without you!

    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

  • VMware Flings is now available in Free Downloads of Broadcom Support Portal (BSP) 05/19/2025
  • VMUG Connect 2025 - Minimal VMware Cloud Foundation (VCF) 5.x in a Box  05/15/2025
  • 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

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...