The famous VMware guru William Lam demonstrated the great proof of concept for managing and silencing VSAN Health Checks.
After reading this article, I decided to create VSAN PowerCLi module.
Today I want to introduce you release that already contains nine functions to deal with VSAN Health Check aspects.
Get-Command –Module VSAN
The only requirement for all the functions is PowerCLi 6.5.1 and VSAN API 6.6. You can check these prerequisites by
Get-VSANVersion function, that included in the module and Get-Version from another my module.
Get-Cluster | Get-VSANVersion Get-Version -VCenter
The first function pair is:
These functions allow to disable or silence a currently active Health Check(s) or enable previously skipped Health Check(s).
Get-VSANHealthCheckSupported | Disable-VSANHealthCheck (Get-Cluster)
Get-Cluster | Get-VSANHealthCheckSkipped | Enable-VSANHealthCheckSkipped
As you can see there are two helper functions:
Get-VSANHealthCheckSkipped. There is possible to pipeline their output to the
Enable-VSANHealthCheckSkipped functions respectively.
Get-VSANHealthCheckSupported function has not any mandatory parameters and may be executed with no one parameter.
As well the PowerShell Intellisense autocomplete can be used.
All Tests (supported Health Checks) are organized in groups. The
Get-VSANHealthCheckGroup function will return all of them.
Get-VSANHealthSummary function can get overall VSAN Cluster health summary. It can retrieve the last test results from the cache (
-FetchFromCache switch parameter) or execute checks right now. The
Timestamp property will show you the test execution time.
Get-Cluster | Get-VSANHealthSummary -FetchFromCache
Get-VSANHealthSummary supports one more parameter
Strict level will show you additional warnings. You may quietly ignore them, but it would be nice to be notified about them.
Get-Cluster | Get-VSANHealthSummary -SummaryLevel Strict -Verbose
Invoke-VSANHealthCheck function executes “Retest” button action (Hosts and Clusters view -> Monitor tab -> vSAN category -> Health menu -> Retest button)
Get-Cluster | Invoke-VSANHealthCheck Get-Cluster | Invoke-VSANHealthCheck -HideGreen Get-Cluster | Invoke-VSANHealthCheck –Level Test
-HideGreen switch you can filter out Green and Skipped Health Checks.
-Level parameter manages Health Checks view level.
The default is Group level.
But there is option to drill down to each Health Checks group to view in Test level.
The idea for
Get-VSANSmartData function taken from VSANSmartsData.ps1 script written by William Lam.
Get-Cluster | Get-VSANSmartData
I could not test it, because I have not SMART capable drives in my LAB. If you will be able to check it, please write in the comments.
- Most functions in the module are advanced functions and support
Get-VSANHealthCheckSkipped -Cluster (Get-Cluster VSAN-Cluster) -Verbose Get-VSANHealthCheckSupported | Disable-VSANHealthCheck (Get-Cluster) -Confirm:$false –Verbose
- Wherever possible a pipeline is supported.
Get-Cluster | Get-VSANHealthCheckSkipped Get-VSANHealthCheckSupported | Disable-VSANHealthCheck (Get-Cluster) Get-Cluster VSAN-Cluster | Get-VSANHealthCheckSkipped | Enable-VSANHealthCheckSkipped
- For more details about each function, please take a look at the content based help and examples.
Get-Help Get-VSANHealthSummary -Examples Get-Help Disable-VSANHealthCheck –Full Get-Help Get-VSANHealthCheckSkipped –Parameter VsanCluster