lna_system_team
Contributor
Contributor

How to change a vSan datastore default storage policy with powerCLI

Jump to solution

I'm looking for powerCLI commands to get / set default storage policy for a vSan Datastore, as we can do it in the web UI, through the Configure tab on a datastore object ?

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
0 Kudos
2 Replies
LucD
Leadership
Leadership
0 Kudos
lna_system_team
Contributor
Contributor

Thanks LucD, I've upgraded my version of PowerCLI, the commands now accept datastore parameter :

# get default policy of datastore $Datastore
Get-SpbmEntityConfiguration $Datastore

# get new policy by Name
$RAID5Policy = Get-SpbmStoragePolicy -Name “RAID5”

# set as new default policy for datastore $Datastore
Get-SpbmEntityConfiguration $Datastore | Set-SpbmEntityConfiguration -StoragePolicy $RAID5Policy

 

0 Kudos