VMware Cloud Community
lna_system_team
Contributor
Contributor
Jump to solution

How to change a vSan datastore default storage policy with powerCLI

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 ?

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Reply
0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

See page 51 of the POWERCLI COOKBOOK FOR VMWARE VSAN


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
lna_system_team
Contributor
Contributor
Jump to solution

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

 

Reply
0 Kudos