following Willian Lam's series of articles about vCSA VAMI API (https://www.virtuallyghetto.com/2017/01/exploring-new-vcsa-vami-api-wpowercli-part-2.html) I tried to include the check for vCSA's software update availability into my standard health checks.
But I have a problem using /appliance/system/health/softwarepackages – while I get an answer, the answer actually is incorrect.
Everyday I am running a script to check the health status of our ESXi servers and ever since we moved to vCSA I also needed to include the appliance in these health checks.
Just recently I found out that even though the VAMI UI displays an update available – in this case build 184.108.40.20600 – the API call returns “green”:
C:\> $healthSoftwareUpdates = (Get-CisService -Name ‘com.vmware.appliance.health.softwarepackages’).get()
C:\> echo $healthSoftwareUpdates
As I could not find an API call to check online for updates prior to get the health status (this was the way I check for updates with the Windows vCenter server) I have scheduled automatic update check in the VAMI UI but this would not to the trick.
Can anyone confirm this behaviour? Is this a possible bug?
Unfortunately the call's description is incorrect.
The value's description provides the proper information regarding that call. That can be viewed in the SDK docs: vsphere-automation-sdk-rest/client.zip at master · vmware/vsphere-automation-sdk-rest · GitHub
Defines health levels Value is one of:
orange: The service health is degraded. The service might have serious problems
gray: No health data is available for this service.
green: Service is healthy.
red: The service is unavaiable and is not functioning properly or will stop functioning soon.
yellow: The service is healthy state, but experiencing some levels of problems.software updates available.
I've filed a request to get that information corrected and updated.
Things changed a bit with the new vCSA version (220.127.116.1100 Build Number 7515524) - now the automatic update setting does not work automatically anymore, meaning when I sign in to the VAMI portal page the available update status has not been checked anymore. Manually checking (against the repository) works though.
Additionally I started to get "gray" when I run the script above even after I have manually checked update availability against the repository, which tells me "Latest updates already installed on vCSA, nothing to stage/install" on the VAMI portal page.