PowerCLI script for setting up /VSAN/IgnoreClusterMemberListUpdates on all hosts, with minimum effort

 

As you probably know, vSAN does not need vCenter to work. You can actually create and manage vSAN without vCenter but it’s a bit more… well… you know… not easy 🙂

I’m currently managing a huge vSAN environment with 132 hosts in 10 clusters and I learned the hard way some vSAN hidden stuff that you probably never see in smaller environments.

Still, during normal operation, the vCenter state is regarded as the primary source of truth starting with vSAN 6.6. ESXi hosts are automatically updated with the latest host membership list coming from the vCenter Server. When a vCenter is replaced or recovered from backup however, vCenter host membership list may be out of date. It might also be out-of-date if changes to vSAN cluster membership were done using manual “esxcli” command on the vSAN hosts while vCenter was offline.

 

I ran into this is issue and the fix or better said, protection is just one command but it’s a bit cumbersome to set it up as you basically need to push it to all hosts.

After doing some Googling, I found a post with what I needed, on William Lam’s blog (a must-read for any Virtualization Engineer or just enthusiast!)

I adapted a bit that script so it can be a bit more flexible and user friendly so I can run it in PowerCLI and setup all hosts in all clusters and not have to ssh in all of them.

 

$ClusterName = Read-Host -Prompt 'Enter the Cluster name you want to setup VSAN.IgnoreClusterMemberListUpdates'
$Value = Read-Host -Prompt 'Enter the value you want to set (1 Enable / 0 Disable)'
Write-Host ""
Write-Host -ForegroundColor Red "Continue? (Y/N) "
$response = Read-Host
if ( $response -ne "Y" ) { exit }
Write-Host ""
Write-Host -ForeGroundColor Red "Setting VSAN.IgnoreClusterMemberListUpdates to" $Value "on Cluster" $ClusterName
Write-Host ""

Foreach ($vmhost in (Get-Cluster -Name $ClusterName | Get-VMHost)) {
$vmhost | Get-AdvancedSetting -Name "VSAN.IgnoreClusterMemberListUpdates" | Set-AdvancedSetting -Value $Value -Confirm:$false
}
Write-Host ""
Write-Host -ForeGroundColor Green "Successfully setup VSAN.IgnoreClusterMemberListUpdates to" $Value "on Cluster" $ClusterName
Write-Host ""

 

Enjoy it!

Advertisements
About

Victor an End User Computing Consultant. You find him most of the time on Twitter (@01004753) but also on LinkedIn evangelizing new technologies and processes that can change in good, the world we live in. Victor has expertise in Server & Client Virtualization, Client Management, GPU Virtualization, HyperConvergence and Enterprise Security

Posted in HowTo, PowerCLI, vCenter, VMware, vSAN

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Follow Victor Homocea on WordPress.com
My Gravatar

Trafictube.ro

cu camera pe bord

Thincomputing.net

by Michel Roth on the VDI, Desktop Virtualizaion, Application Virtualization, UEM aspects of End User Computing and Product Management

Ingmar Verheij

About Citrix, Remote Desktop, Performance, Workspace, Monitoring and more...

Carl Stalhood

Filling gaps in EUC vendor documentation

Archy.net

Don't Follow the Trend

Victor Homocea

blog.ogs.ro

Ray Heffer

Double VCDX #122 | Cloud Architect

Elvis Apostol

Calatorind prin lumi indepartate, pictez in cuvinte, lacrimi de culori.

%d bloggers like this: