VMware VSAN PowerCLi module

Cover

With the PowerCLi 6.5.1 release, the new Get-VsanView cmdlet is now available that exposes the complete VMware VSAN Management API.

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.

You can download it (and many other resources) from my GitHub PowerCLi repo.

Today I want to introduce you release that already contains nine functions to deal with VSAN Health Check aspects.

Get-Command –Module VSAN

01.VSAN_Get-Command

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

Get-Cluster | Get-VSANVersion
Get-Version -VCenter

02.VSAN_Get-VSANVersion

Disable-VSANHealthCheck /

Enable-VSANHealthCheckSkipped

The first function pair is:

Disable-VSANHealthCheck and Enable-VSANHealthCheckSkipped.

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)

03.VSAN_Disable-VSANHealthCheck

Get-Cluster | Get-VSANHealthCheckSkipped | Enable-VSANHealthCheckSkipped

04.VSAN_Enable-VSANHealthCheckSkipped

Get-VSANHealthCheckSupported /

Get-VSANHealthCheckSkipped

As you can see there are two helper functions:

Get-VSANHealthCheckSupported and Get-VSANHealthCheckSkipped. There is possible to pipeline their output to the Disable-VSANHealthCheck and Enable-VSANHealthCheckSkipped functions respectively.

The Get-VSANHealthCheckSupported function has not any mandatory parameters and may be executed with no one parameter.

Get-VSANHealthCheckSupported

05.VSAN_Get-VSANHealthCheckSupported

As well the PowerShell Intellisense autocomplete can be used.

Get-VSANHealthCheckSupported cloudhealth,hcl,perfsvc

06.VSAN_Get-VSANHealthCheckSupported

Get-VSANHealthCheckGroup

All Tests (supported Health Checks) are organized in groups. The Get-VSANHealthCheckGroup function will return all of them.

Get-VSANHealthCheckGroup

07.VSAN_Get-VSANHealthCheckGroup

Get-VSANHealthSummary

The 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

08.VSAN_Get-VSANHealthSummary

The Get-VSANHealthSummary supports one more parameter -SummaryLevel. The 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

09.VSAN_Get-VSANHealthSummary

Invoke-VSANHealthCheck

The Invoke-VSANHealthCheck function executes “Retest” button action (Hosts and Clusters view -> Monitor tab -> vSAN category -> Health menu -> Retest button)

10.VSAN_Invoke-VSANHealthCheck_Retest

Get-Cluster | Invoke-VSANHealthCheck
Get-Cluster | Invoke-VSANHealthCheck -HideGreen
Get-Cluster | Invoke-VSANHealthCheck –Level Test

11.VSAN_Invoke-VSANHealthCheck

With -HideGreen switch you can filter out Green and Skipped Health Checks.

The -Level parameter manages Health Checks view level.

The default is Group level.

12.VSAN_Invoke-VSANHealthCheck_GroupView

But there is option to drill down to each Health Checks group to view in Test level.

13.VSAN_Invoke-VSANHealthCheck_TestView

Get-VSANSmartData

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.

Summary

  • Most functions in the module are advanced functions and support -Confirm and -Verbose parameters.
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

You may also like:

VMware VAMI PowerCLi module

3 thoughts on “VMware VSAN PowerCLi module

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s