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)
S.P. says
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.
William Lam says
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
Jens Hofbauer says
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.
William Lam says
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
Philip says
You're the absolute BEST. Gosh, everything you produce is so helpful. We couldn't do this job without you!