Invoking vSAN Re-layout with PowerCLI

less than 1 minute read

Skyline Health was reporting “vSAN object format health” alerts after upgrading a bunch of clusters to 7.x. Each cluster requires a “re-layout” to clear the alert. Kicking off the process is fairly straight forward just requires a lot of clicks.


I figured I could do this with PowerCLI but struggled with finding an example anywhere. After a good amount of time of trial and error I have the below working code to perform the process.

#connect to vcenter
connect-viserver -server ""
#Get view #
#Run Get-VSANView to get full list
$vsanobj = Get-VSANView -Id "VsanObjectSystem-vsan-cluster-object-system"

#get clusters to perform layout
$clusters = get-cluster
foreach($cluster in $clusters)
    write-host $
    #invoke re-layout (async)

Leave a comment