VMware Cloud Community
mdangel1
Enthusiast
Enthusiast
Jump to solution

Get-VSANVersion -Cluster VSAN-Cluster

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

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

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




Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

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




Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
mdangel1
Enthusiast
Enthusiast
Jump to solution

wow, worked beautifully

0 Kudos