Highlighted
Contributor
Contributor

vSAN cluster configuration settings

Hi,

How to retrieve value of following settings (marked in RED) of a vSAN cluster using powercli:

 

Pilu1978_0-1605770824999.png

 

0 Kudos
14 Replies
Highlighted
User Moderator
User Moderator

Have you checked Jase's POWERCLI COOKBOOK FOR VMWARE VSAN?


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

0 Kudos
Highlighted
Contributor
Contributor

No I have not checked the CookBook. I will check it now. Thanks for sharing.

0 Kudos
Highlighted
Contributor
Contributor

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.

0 Kudos
Highlighted
User Moderator
User Moderator

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

0 Kudos
Highlighted
Contributor
Contributor

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

 

 

Pilu1978_0-1605783112634.png

 

0 Kudos
Highlighted
User Moderator
User Moderator

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

0 Kudos
Highlighted
Contributor
Contributor

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

0 Kudos
Highlighted
User Moderator
User Moderator

Is the error on the $esxcli.vsan.cluster.get.Invoke(@{SubClusterUUID=$clusterUuid}) part?


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

0 Kudos
Highlighted
Contributor
Contributor

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

0 Kudos
Highlighted
User Moderator
User Moderator

Can you check what $esxcli.vsan.cluster.get.CreateArgs() returns?


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

0 Kudos
Highlighted
Contributor
Contributor

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

0 Kudos
Highlighted
User Moderator
User Moderator

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

0 Kudos
Highlighted
Contributor
Contributor

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

0 Kudos
Highlighted
User Moderator
User Moderator

Sure
unicast.png


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

0 Kudos