Hi,
How to retrieve value of following settings (marked in RED) of a vSAN cluster using powercli:
Have you checked Jase's POWERCLI COOKBOOK FOR VMWARE VSAN?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
No I have not checked the CookBook. I will check it now. Thanks for sharing.
I have managed to get the details of the settings from the cookbook expect the below 2 settings:
Networking mode: Unicast
Internet Connectivity: Disabled
Any help would be appreciated.
I'm not using that older VSAN version anymore, so I'm navigating blind I'm afraid.
The Unicast can be retrieved with an esxcli command afaik.
Something like this for example
$clusterName = 'cluster'
$cluster = Get-Cluster -Name $clusterName
$esx = Get-VMHost -Location $cluster | Get-Random
$esxcli = Get-EsxCli -VMHost $esx -v2
$clusterUuid = $cluster.ExtensionData.ConfigurationEx.VsanConfigInfo.DefaultConfig.Uuid
$esxcli.vsan.cluster.get.Invoke(@{clusteruuid=$clusterUuid}) |
Select-Object -ExpandProperty UnicastModeEnabled
The Internet connectivity part is afaik a derived property.
One of the health checks includes this Internet Connectivity Check (see KB2149196).
But in the newer VSAN version that explicit check is apparently not there anymore.
I can't seem to find a similar health check for my VSAN version (and it is also not present in the Web Client anymore).
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks for the update.
However I am getting the following error:
Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
At line:1 char:1
+ $esxcli.vsan.cluster.get.Invoke(@{clusteruuid=$clusterUuid}) | Select ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [], FormatException
+ FullyQualifiedErrorId : System.FormatException
Works for me, but it could be the VSAN version (I'm using v7).
What do you have in $clusterUuid?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Yes I am getting a value which is matching with the value of SubClusterUUID when running the following command:
$esxcli.vsan.cluster.get.invoke()
But getting same error even if I replace clusteruuid with SubClusterUUID as shown below:
$esxcli.vsan.cluster.get.Invoke(@{SubClusterUUID=$clusterUuid}) | Select-Object -ExpandProperty UnicastModeEnabled
Is the error on the $esxcli.vsan.cluster.get.Invoke(@{SubClusterUUID=$clusterUuid}) part?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Yes.
PS C:\> $esxcli.vsan.cluster.get.Invoke(@{SubClusterUUID=$clusterUuid})
Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
At line:1 char:1
+ $esxcli.vsan.cluster.get.Invoke(@{SubClusterUUID=$clusterUuid})
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [], FormatException
+ FullyQualifiedErrorId : System.FormatException
Can you check what $esxcli.vsan.cluster.get.CreateArgs() returns?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
It is giving the following error:
PS C:\> $esxcli.vsan.cluster.get.CreateArgs()
Method invocation failed because [VMware.VimAutomation.ViCore.Cmdlets.Commands.EsxCli.EsxCliMethodElement] does not contain a method named 'CreateArgs'.
At line:1 char:1
+ $esxcli.vsan.cluster.get.CreateArgs()
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : MethodNotFound
That seems to indicate that the VSAN esxcli commands for your VSAN version are apparently different from my VSAN v7.
I don't have an older version at hand, so I'm afraid I can't help there.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Ok.
Could you please show what output you are getting when you are running the below command against your vSAN cluster:
$esxcli.vsan.cluster.get.Invoke(@{ClusterUUID=$clusterUuid}) | Select-Object -ExpandProperty UnicastModeEnabled
Sure
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks for your help and reply.
As discussed I am not getting the same output like you due to old version of vSAN. I will wait until the vSAN is getting upgraded in our environment.