Adjust vSAN CLOM Repair Delay Time via PowerCLI

I found that after doing a few maintenances, they’d sometimes go beyond the default repair time of 60 minutes which was not ideal in a vSAN Cluster.

It was also noticed by Duncan Epping via Yellow-Bricks.com article “Changed advanced setting VSAN.ClomRepairDelay and upgrading to 6.7 u1? Read this…“, when changing the Repair Time, this can default back to 60 minutes during an upgrade to 6.7 U1.

So how do I adjust this via PowerCLI to save time?

Pre-requisite: PowerCLI may need to be updated to use the vSAN Cmdlets.

# Author: Shane Marsh

$vc = Read-Host "vCenter Name/IP"

Write-Host -Fore Yellow "Credentials`n"
$user = Read-Host "Username"
$pass = Read-Host -AsSecureString "Password for $($user)"
$creds = Get-Credential -Credential (New-Object PSCredential $user, $pass)
$RepairTime = Read-Host "Repair Time (Minutes)"

Connect-VIServer -Server $vc -Credential $creds

$clusters = Get-Cluster

foreach ($cluster in $clusters) {

    $clusterconfig = Get-VsanClusterConfiguration -Cluster $cluster
    $clusterconfig.ObjectRepairTimerMinutes

    Set-VsanClusterConfiguration -Configuration $clusterconfig -ObjectRepairTimerMinutes $RepairTime

    $clusterconfig = Get-VsanClusterConfiguration -Cluster $cluster
    $clusterconfig.ObjectRepairTimerMinutes

}

Disconnect-VIServer -Server $vc -Confirm:$false

Download Script Here

As always, if you have any concerns/questions, feel free to leave a comment below and I’ll get back to you ASAP.

Leave a Reply

Your email address will not be published. Required fields are marked *