nsomani
Contributor
Contributor

How do we automate the Updates section under vsan tab for cluster via powercli?

How do we automate the Updates section under vsan tab for cluster via powercli?

0 Kudos
25 Replies
LucD
Leadership
Leadership

Did you already try the Update-VsanHclDatabase cmdlet?

Or do you mean something else?


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

0 Kudos
peetz
Leadership
Leadership

What version of vSphere are you referring to?

Do you look at the HTML5 or the legacy flash Web Client?

Twitter: @VFrontDe, @ESXiPatches | https://esxi-patches.v-front.de | https://vibsdepot.v-front.de
0 Kudos
nsomani
Contributor
Contributor

Vsphere version 6.5.0

I am looking at the legacy flash Web Client.

0 Kudos
nsomani
Contributor
Contributor

Hi LucD. If you scroll to the configurations tab for cluster, there is a tab called vsan, under which there are actions like "Updates and Configuration Assist".

I am looking forward to automated these two actions via powercli.

0 Kudos
LucD
Leadership
Leadership

The database can be updated with the cmdlet I referred to earlier.

You can use a local file or connect over the Internet.
Did you try that?


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

0 Kudos
peetz
Leadership
Leadership

For the health checks in the "Configuration Assist" pane (as well as in the "Monitor / vSAN / Health" tab) you can use the

  Test-VsanClusterHealth

cmlet.

Twitter: @VFrontDe, @ESXiPatches | https://esxi-patches.v-front.de | https://vibsdepot.v-front.de
0 Kudos
nsomani
Contributor
Contributor

Yes, I tried using it. However I am getting the below error while using teh command Update-VsanHclDatabase

Update-VsanHclDatabase : 12/10/2018 15:09:14 Update-VsanHclDatabase Object reference not set to an instance of an object.

0 Kudos
LucD
Leadership
Leadership

Just to make sure, you did do a Connect-VIServer before?

To the vCenter that contains the VSAN cluster.

And which PowerCLI version are you using?
Do a

Get-Module -Name VMware* -ListAvailable | Select Name,Version


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

0 Kudos
nsomani
Contributor
Contributor

I tried using this command, however it takes forever to execute and ultimately throws the below error:

Test-VsanClusterHealth : 12/10/2018 15:16:26 Test-VsanClusterHealth The request channel timed out attempting to send after 00:05:00. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this operation may have been a portion of a longer timeout.

0 Kudos
peetz
Leadership
Leadership

The command should not take longer than 5 minutes to complete, but you can try increasing the timeout with

   Set-PowerCLIConfiguration -WebOperationTimeoutSeconds 900

(sets it to 900s = 15min).

Twitter: @VFrontDe, @ESXiPatches | https://esxi-patches.v-front.de | https://vibsdepot.v-front.de
0 Kudos
nsomani
Contributor
Contributor

VMware.PowerCLI                     11.0.0.10380590

Yes I am already connected to the vcenter via Connect-VIserver command.

0 Kudos
LucD
Leadership
Leadership

Do you get anything returned when you do

Get-VsanClusterConfiguration


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

0 Kudos
nsomani
Contributor
Contributor

Increased the timeout as instructed.

Got the same error while running the command after a considerable amount of time:

Test-VsanClusterHealth : 12/10/2018 15:32:38 Test-VsanClusterHealth The request channel timed out attempting to send after 00:05:00. Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this operation may have been a portion of a longer timeout.

0 Kudos
nsomani
Contributor
Contributor

Cluster              VsanEnabled  IsStretchedCluster   Last HCL Updated

-------              -----------  ------------------   ----------------

Cluster              True         False                12/22/2017 11:52:00

0 Kudos
LucD
Leadership
Leadership

That looks ok.
Can you check all PowerCLI modules with

Get-Module -Name VMware* -ListAvailable |

Select Name,Version,ModuleBase

And perhaps try the update cmdlet with the Verbose switch

Update-VsanHclDatabase -Verbose

On another note, you could also try to download the update file from https://partnerweb.vmware.com/service/vsan/all.json

and then try the cmdlet with

Update-VsanHclDatabase -FilePath .\all.json


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

0 Kudos
nsomani
Contributor
Contributor

Output of

Get-Module -Name VMware* -ListAvailable | Select Name,Version,ModuleBase:

Name                                Version         ModuleBase

----                                -------         ----------

VMware.DeployAutomation             6.7.0.8250345   /Users/Nitin/.local/share/powershell/Modules/VMware.DeployAutomation/6.7.0.8250345

VMware.ImageBuilder                 6.7.0.8250345   /Users/Nitin/.local/share/powershell/Modules/VMware.ImageBuilder/6.7.0.8250345

VMware.PowerCLI                     11.0.0.10380590 /Users/Nitin/.local/share/powershell/Modules/VMware.PowerCLI/11.0.0.10380590

VMware.Vim                          6.7.0.10334489  /Users/Nitin/.local/share/powershell/Modules/VMware.Vim/6.7.0.10334489

VMware.VimAutomation.Cis.Core       11.0.0.10335701 /Users/Nitin/.local/share/powershell/Modules/VMware.VimAutomation.Cis.Core/11.0.0.10335701

VMware.VimAutomation.Cloud          11.0.0.10379994 /Users/Nitin/.local/share/powershell/Modules/VMware.VimAutomation.Cloud/11.0.0.10379994

VMware.VimAutomation.Common         11.0.0.10334497 /Users/Nitin/.local/share/powershell/Modules/VMware.VimAutomation.Common/11.0.0.10334497

VMware.VimAutomation.Core           11.0.0.10336080 /Users/Nitin/.local/share/powershell/Modules/VMware.VimAutomation.Core/11.0.0.10336080

VMware.VimAutomation.HorizonView    7.6.0.10230451  /Users/Nitin/.local/share/powershell/Modules/VMware.VimAutomation.HorizonView/7.6.0.10230451

VMware.VimAutomation.License        10.0.0.7893904  /Users/Nitin/.local/share/powershell/Modules/VMware.VimAutomation.License/10.0.0.7893904

VMware.VimAutomation.Nsxt           11.0.0.10364044 /Users/Nitin/.local/share/powershell/Modules/VMware.VimAutomation.Nsxt/11.0.0.10364044

VMware.VimAutomation.Sdk            11.0.0.10334495 /Users/Nitin/.local/share/powershell/Modules/VMware.VimAutomation.Sdk/11.0.0.10334495

VMware.VimAutomation.Security       11.0.0.10380515 /Users/Nitin/.local/share/powershell/Modules/VMware.VimAutomation.Security/11.0.0.10380515

VMware.VimAutomation.Srm            10.0.0.7893900  /Users/Nitin/.local/share/powershell/Modules/VMware.VimAutomation.Srm/10.0.0.7893900

VMware.VimAutomation.Storage        11.0.0.10380343 /Users/Nitin/.local/share/powershell/Modules/VMware.VimAutomation.Storage/11.0.0.10380343

VMware.VimAutomation.StorageUtility 1.3.0.0         /Users/Nitin/.local/share/powershell/Modules/VMware.VimAutomation.StorageUtility/1.3.0.0

VMware.VimAutomation.Vds            11.0.0.10336077 /Users/Nitin/.local/share/powershell/Modules/VMware.VimAutomation.Vds/11.0.0.10336077

VMware.VimAutomation.Vmc            11.0.0.10336076 /Users/Nitin/.local/share/powershell/Modules/VMware.VimAutomation.Vmc/11.0.0.10336076

VMware.VimAutomation.vROps          10.0.0.7893921  /Users/Nitin/.local/share/powershell/Modules/VMware.VimAutomation.vROps/10.0.0.7893921

VMware.VumAutomation                6.5.1.7862888   /Users/Nitin/.local/share/powershell/Modules/VMware.VumAutomation/6.5.1.7862888

Output of Update-VsanHclDatabase -Verbose :

VERBOSE: Performing the operation "Update VSAN HCL database in server 'VMware.VimAutomation.ViCore.Impl.V1.VimClient'" on target "VMware.VimAutomation.ViCore.Impl.V1.VimClient".

Update-VsanHclDatabase : 12/10/2018 16:06:39 Update-VsanHclDatabase Object reference not set to an instance of an object.

At line:1 char:1

+ Update-VsanHclDatabase -Verbose

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo          : NotSpecified: (:) [Update-VsanHclDatabase], VimException

+ FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.Storage.Commands.Cmdlets.Vsan.UpdateVsanHclDatabase

VERBOSE: 12/10/2018 16:06:39 Update-VsanHclDatabase Finished execution

Output of Update-VsanHclDatabase -FilePath all.json:

Update-VsanHclDatabase : 12/10/2018 16:11:33 Update-VsanHclDatabase Object reference not set to an instance of an object.

At line:1 char:1

+ Update-VsanHclDatabase -FilePath all.json

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo          : NotSpecified: (:) [Update-VsanHclDatabase], VimException

+ FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.Storage.Commands.Cmdlets.Vsan.UpdateVsanHclDatabase

0 Kudos
LucD
Leadership
Leadership

The module versions all look ok.


Did you already stop/start your PowerShell/PowerCLI session?


From which environment are you running the commands?

Inside the ISE, from the prompt...?


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

0 Kudos
nsomani
Contributor
Contributor

Yes I tried stopping and restarting the session.

I am using command prompt (using pwsh).

0 Kudos
LucD
Leadership
Leadership

But wait, you are using PowerShelll Core?

Can you show what $PSVersionTable says?

Can you eventually try the cmdlet from a PowerShell 5.1 installation?
I think you might have hit a PowerShell Core issue.


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

0 Kudos