Remediate vSAN Policy ‘Out of Date’

Every object in vSAN (OSA) has an assigned storage policy. If no custom policies have been defined, objects are assigned the factory-installed vSAN default policy. Compliance of the selected policy with the current state is checked regularly. If the object is compliant with the assignes policy, the compliance status is set to ‘Compliant’.

However, it can happen that several objects in the cluster show the compliance status ‘Out of Date’. This will be shown in Skyline Health as an informative note. In the example below, several VMs with their vDisks were out of date.

Remediation in vSphere-Client

If there is only one or very few objects, the affected VM can be highlighted in Skyline Health. By doing so, we switch to the context of this VM and we can see details about namespace-object (VM Home) or the vDisks under Configuration > Policies. In the dialog (image below) we can select the object and click on ‘Reapply VM Storage Policy’. Usually this is enough to bring all objects of the VM back to the ‘Compliant’ state.


If the cluster is large, with many hundreds or even thousands of VMs, then the method using the vSphere Client is very tedious. It is much easier with our powerful tool PowerCLI.

The commands shown here are all so-called one-liners, i.e. instructions that are passed in direct mode via a single command line. Of course, you can package this more elegantly in a script. That’s a matter of personal taste.

We’ll utilize two different PowerCLI commands:

Query Status

Using Get-SpbmEntityConfiguration we get the status of all VM namespace objects and vDisks. To get a more structured view, we sort the output by ID.

Get-SpbmEntityConfiguration | sort -Property id

Get-SpbmEntityConfiguration command returns the status of all objects. That can be quite a lot and we are only interested in the ones that have the status ‘Out of Date’.

Get-SpbmEntityConfiguration | Where-Object {$_.ComplianceStatus -eq 'outOfDate'}

In smaller environments with only one cluster, the above command is usually sufficient. In larger environments, you should narrow down the selection a bit. Suppose we have several vSAN clusters and we want to get policy status of objects in cluster01.

Get-Cluster -Name Cluster01 | Get-VM | Get-SpbmEntityConfiguration | Where-Object {$_.ComplianceStatus -eq 'outOfDate'}

This query returns all VM namespace objects with policy status ‘OutofDate’, but not the vDisk objects. This requires some extension of the command.

Get-Cluster -Name Cluster01 | Get-VM | Get-Harddisk | Get-SpbmEntityConfiguration | Where-Object {$_.ComplianceStatus -eq 'outOfDate'}


We can directly use these results to reassign the configured policy. Each of these objects has a defined VM storage policy, but for whatever reason it is not compliant and out of date. We need to query and reassign the defined policy again. To do so, we pipe the result to the Set-SpbmEntityConfiguration command. We pass the previously read policy as a parameter.


You should issue the following commands with the Poweshell parameter ‘-WhatIf‘ at first. This way no real changes are made and the command is only simulated.


Get-Cluster -Name Cluster01 | Get-VM | Get-SpbmEntityConfiguration | Where-Object {$_.ComplianceStatus -eq 'outOfDate'} | Set-SpbmEntityConfiguration -StoragePolicy $_.StoragePolicy


Get-Cluster -Name Cluster01 | Get-VM | Get-HardDisk | Get-SpbmEntityConfiguration | Where-Object {$_.ComplianceStatus -eq 'outOfDate'} | Set-SpbmEntityConfiguration -StoragePolicy $_.StoragePolicy

Leave a Reply

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