Both the VSAN Hardware Compatibility List (HCL) and the VSAN Release Catalog database which provides VSAN build recommendations should be updated periodically to ensure that you have the latest VSAN recommendations from VMware. In addition to using the vSphere UI to perform these update, customers can also automate either of these tasks using the VSAN Management API which can be consumed using any of the supported VSAN Management SDKs including PowerCLI.
I recently had a question about which VSAN API to use to update VSAN Release Catalog.
Updating VSAN HCL
The VsanVcClusterHealthSystem provides two methods for updating the VSAN HCL. The first is VsanVcUpdateHclDbFromWeb() which updates the HCL from VMware and the second VsanVcUploadHclDb updates from offline file.
- Offline VSAN HCL JSON: https://partnerweb.vmware.com/service/vsan/all.json
Once you have downloaded the offline HCL file from the link above, below is an example using this VSAN Management API using PowerCLI:
# Read HCL DB JSON File $HclDBRaw = Get-Content $HclDBFile # Convert content into Byte array $HclDBBytes = [System.Text.Encoding]::UTF8.GetBytes($HclDBRaw) # Gzip compress # Credit to https://gist.github.com/marcgeld/bfacfd8d70b34fdf1db0022508b02aca [System.IO.MemoryStream] $output = New-Object System.IO.MemoryStream $gzipStream = New-Object System.IO.Compression.GzipStream $output, ([IO.Compression.CompressionMode]::Compress) $gzipStream.Write( $HclDBBytes, 0, $HclDBBytes.Length ) $gzipStream.Close() $output.Close() # Base64 Encode $HclDBBytesString = $output.ToArray() $EncodedText =[Convert]::ToBase64String($HclDBBytesString) $vcchs = Get-VsanView -id VsanVcClusterHealthSystem-vsan-cluster-health-system $vcchs.VsanVcUploadHclDb($EncodedText)
Note: If you are using PowerCLI, you can simply use the Update-VsanHclDatabase cmdlet which just accepts the HCL file.
Updating VSAN Release Catalog
The VsanVumSystem provides the VsanVcUploadReleaseDb() method for updating the VSAN Release Catalog.
- Offline VSAN Release DB: https://vcsa.vmware.com/ph/api/v1/results?deploymentId=2d02e861-7e93-4954-9a73-b08692a330d1&collectorId=VsanCloudHealth.6_5&objectId=0c3e9009-ba5d-4e5f6-bae8-f25ec506d219&type=vsan-updates-json
Once you have downloaded the offline release catalog file from the link above, below is an example using this VSAN Management API using PowerCLI:
$vsanReleaseJson = Get-Content -Raw $ReleaseDBFile $vvs = Get-VsanView -id VsanVumSystem-vsan-vum-system $vvs.VsanVcUploadReleaseDb($vsanReleaseJson)
Joschua says
Thank you very much for describing the automated update process for the release catalog. The first step (update the HCL) can be done a little bit easier with following commandlet Update-VsanHclDatabase.
William Lam says
Yes, see the "Note" section which I describe exactly this 🙂
A. Mikkelsen says
Thanks for all your content.
Tried updating the vSAN Release Catalog via API (as above) but get an Exception error:
$vsanReleaseJson = Get-Content -Raw -Path $strvSANReleaseCatalogPath | ConvertFrom-Json
>> $vvs = Get-VsanView -id VsanVumSystem-vsan-vum-system
>> $vvs.VsanVcUploadReleaseDb($vsanReleaseJson)
MethodInvocationException:
Line |
3 | $vvs.VsanVcUploadReleaseDb($vsanReleaseJson)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Exception calling "VsanVcUploadReleaseDb" with "1" argument(s): ""
Tried to manually update the Release Catalog via GUI, and that worked...
Hope you know whats wrong