VMware Cloud Community
Pilu1978
Enthusiast
Enthusiast
Jump to solution

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

 

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Sure
unicast.png


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

View solution in original post

Reply
0 Kudos
15 Replies
LucD
Leadership
Leadership
Jump to solution

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


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

Reply
0 Kudos
Pilu1978
Enthusiast
Enthusiast
Jump to solution

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

Reply
0 Kudos
Pilu1978
Enthusiast
Enthusiast
Jump to solution

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.

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

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

Reply
0 Kudos
Pilu1978
Enthusiast
Enthusiast
Jump to solution

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

 

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

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

Reply
0 Kudos
Pilu1978
Enthusiast
Enthusiast
Jump to solution

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

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

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


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

Reply
0 Kudos
Pilu1978
Enthusiast
Enthusiast
Jump to solution

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

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

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


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

Reply
0 Kudos
Pilu1978
Enthusiast
Enthusiast
Jump to solution

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

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

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

Reply
0 Kudos
Pilu1978
Enthusiast
Enthusiast
Jump to solution

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

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Sure
unicast.png


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

Reply
0 Kudos
Pilu1978
Enthusiast
Enthusiast
Jump to solution

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.

Reply
0 Kudos