Automation

 View Only
  • 1.  Get-VSANVersion -Cluster VSAN-Cluster

    Posted Feb 15, 2022 09:24 PM

    Need help please

    Get-VSANVersion -Cluster VSAN-Cluster   I need to run this so I can retrieve the vSAN versions on all my vSAN clusters



  • 2.  RE: Get-VSANVersion -Cluster VSAN-Cluster
    Best Answer

    Posted Feb 15, 2022 09:53 PM

    I assume that this Get-VsanVersion is coming from here?
    That code hasn't been updated with the latest information from KB2150753
    Also, that KB hasn't been updated either to reflect the latest versions.

    You could do something like this, but that will not return the VSAN version is shown in that KB.

    $vsan = Get-VsanView -Id "VsanVcClusterHealthSystem-vsan-cluster-health-system"
    
    Get-Cluster -PipelineVariable cluster |
    ForEach-Object -Process {
      [PSCustomObject]@{
        Cluster = $cluster.Name
        VSANVersion = $vsan.VsanVcClusterQueryVerifyHealthSystemVersions($cluster.ExtensionData.MoRef).VcVersion
      }
    }


    Another option is to look at the VSAN vib present on an ESXi in the cluster.

    Get-Cluster -PipelineVariable cluster |
    ForEach-Object -Process {
      $esx = Get-VMHost -Location $cluster | Select-Object -First 1
      $esxcli = Get-EsxCli -VMHost $esx -V2
      [PSCustomObject]@{
        Cluster = $cluster.Name
        VSANVersion = ($esxcli.software.vib.get.Invoke(@{vibname = 'vsan' })).Version
      }
    }





  • 3.  RE: Get-VSANVersion -Cluster VSAN-Cluster

    Posted Feb 15, 2022 10:29 PM

    wow, worked beautifully