4 Replies Latest reply on Apr 4, 2019 4:20 AM by Grzesiekk

    vSAN health checks

    Grzesiekk Expert

      Hello,

      has anyone tried to get some reports on vsan health using powerci ? Couldn't find anythng in google. I am just looking for a hint on how to hook into this monitor->Vsan tab using powercli. I would like to get that report that sits inside, for example that all disks are happy, that data section is green etc.

        • 1. Re: vSAN health checks
          LucD Guru
          vExpertCommunity WarriorsUser Moderators

          You can get that information through esxcli (if you use VSAN 6.6 or higher that is).

          For example

           

          $clusterName = 'cluster'

          $esx = Get-Cluster -Name $clusterName | Get-VMHost | Get-Random

          $esxcli = Get-EsxCli -VMHost $esx -v2

          $esxcli.vsan.health.cluster.get.Invoke(@{test='vSAN object health'})

           

          If you want to everything that is available, you could do

           

          $esxcli.vsan.health.cluster.list.Invoke() |

          ForEach-Object -Process {

             $esxcli.vsan.health.cluster.get.Invoke(@{test=$_.HealthTestName})

          }

          Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
          • 2. Re: vSAN health checks
            Grzesiekk Expert

            Hey Luc,

              that will do ! Thanks a lot , that's exactly what i was looking for.

             

            I googled more today, and i came across this:

            "

            VsanQueryVcClusterHealthSummary(queryClusterHealthSummary)

             

            Perform a cluster wide health check across all types of health checks. It's the primary API for fetching vSAN health status. This API runs a wide variety of health checks in many different categories against the cluster and returns both API-friendly and UI-friendly data. The 'fields' parameter should be used to return what the client is really interested in to limit the big result size for performance consideration. The API can either perform a health check against the up-to-date state of the hosts in the cluster and takes several seconds to return or it can retrieve the latest cached result to return in second. It's encouraged to fetch the cached data to get the quick response unless an update is required. Note: when this API is called directly from an ESXi host, following test groups are not supported: groupId = com.vmware.vsan.health.test.hcl

            "

             

            Any idea if this is the same ?

            • 3. Re: vSAN health checks
              LucD Guru
              Community WarriorsUser ModeratorsvExpert

              Looks like it.
              With Get-VsanView you can get to these API.

              Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
              • 4. Re: vSAN health checks
                Grzesiekk Expert

                got everything working:

                $vsanViewClusterHealthSystem = Get-VSANView -Id "VsanVcClusterHealthSystem-vsan-cluster-health-system"

                 

                $vsanViewClusterHealthSystem.VsanQueryVcClusterHealthSummary((get-cluster -Name 'cluster001').id,$null,$null,$false,$null, $true,[vmware.vsan.views.vsanhealthperspective]::defaultView)

                 

                Perfect ! thanks again