Pilu1978
Enthusiast
Enthusiast

vSAN cluster configuration settings

Jump to solution

Hi,

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

 

Pilu1978_0-1605770824999.png

 

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership

Sure
unicast.png


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

View solution in original post

0 Kudos
15 Replies
LucD
Leadership
Leadership

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


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

0 Kudos
Pilu1978
Enthusiast
Enthusiast

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

0 Kudos
Pilu1978
Enthusiast
Enthusiast

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
LucD
Leadership
Leadership

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
Pilu1978
Enthusiast
Enthusiast

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
LucD
Leadership
Leadership

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
Pilu1978
Enthusiast
Enthusiast

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
LucD
Leadership
Leadership

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


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

0 Kudos
Pilu1978
Enthusiast
Enthusiast

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
LucD
Leadership
Leadership

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


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

0 Kudos
Pilu1978
Enthusiast
Enthusiast

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
LucD
Leadership
Leadership

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
Pilu1978
Enthusiast
Enthusiast

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
LucD
Leadership
Leadership

Sure
unicast.png


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

View solution in original post

0 Kudos
Pilu1978
Enthusiast
Enthusiast

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.

0 Kudos