VMware Cloud Community
buffalix
Contributor
Contributor

vsandatastore default storage policy and powercli

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

Frank

0 Kudos
3 Replies
TheBobkin
Champion
Champion

Hello Frank,

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.

Bob

0 Kudos
TheBobkin
Champion
Champion

Hello Frank,

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!).

Bob

0 Kudos
srodenburg
Expert
Expert

Somebody calling my name?  🙂

Have a look at this post for inspiration:  VS6.2 - Applying Storage-Policy via PowerCLI killed Performance Service

0 Kudos