I found sometimes vsandatastore default storage policy changes back from our customized one to the "virtual san default storage policy" which comes with teh software. I suspect it happens when we apply patches. Anyone has the same experience?
The understand is the datastore have a default storage policy and every VMs created/moved to this datastore will use this default storage policy if not specified otherwise.
Now I plan to write a powercli script to monitor this but I have hard time to find a powercli commands to retrieve default storage policy for a datastore. Any help? Thanks
Are you using host profiles/VUM for updating? If so, then there could be something misconfigured there.
If you are using only one Storage Policy (SP) that you want as default then you could avoid what you described being an issue at all by just editing the Default vSAN SP and changing it to the rules you want.
You can check the policy defaults of a host for different types of Objects via CLI using:
# esxcli vsan policy getdefault
I will have a look and see if there is a PowerCLI equivalent of this, there almost certainly is.
This shows a field for StoragePolicy:
> Get-VsanClusterConfiguration <Cluster> | Format-list
But the value appears blank and does not change when I change the vsanDatastore Default SP via Web Client so I am not sure if this a reference to the cluster Default SP or not (Cluster SP = vsanDatastore SP in my mind as can only have one vsanDatastore per cluster)
I cannot seem to figure out if set-VsanClusterConfiguration is the proper way to set this and/or in conjunction with spbm cmdlets and there does not appear to be any SP-related settings when querying the vsanDatastore itself.
Maybe srodenburg can weigh in here as from previous contributions on this forum he seems to be fairly into the PowerCli side of vSAN administration.
Otherwise, as I said above - if you only require one specific SP to be applied then you can always change the Default SP rules and this way you never have to check whether something has switched or not after updates and change anything reactively (though I am still curious as to why/how this would occur!).