Hi there, I need to change the storage policy on a cluster worth of VMs. I've been following vSphere PowerCLI 5.8 SPBM Walkthrough (Part 1): Introduction | VMware vSphere Blog - VMware Blogs, specifically running this:
Get-Cluster "MyCluster" | Get-VM "myvm.local" | Set-SpbmEntityConfiguration -StoragePolicy "VSAN-FTT=1"
This applies the new Storage Profile policy to the "home" folder of the VM, but ignores the vmdks, hence the VM fails to comply with the policy. How can I make it so that it changes the home and all vmdks on the VM to the policy I'm specifying.
Thanks in advance,
You will have to set the storage policy on the hard disks as well in an extra command, for example:
$vm = Get-Cluster "MyCluster" | Get-VM "myvm.local"
$hd = Get-HardDisk -VM $vm
$vm | Set-SpbmEntityConfiguration -StoragePolicy "VSAN-FTT=1"
$hd | Set-SpbmEntityConfiguration -StoragePolicy "VSAN-FTT=1"
You will have to set the storage policy on the hard disks as well in an extra command, for example:
$vm = Get-Cluster "MyCluster" | Get-VM "myvm.local"
$hd = Get-HardDisk -VM $vm
$vm | Set-SpbmEntityConfiguration -StoragePolicy "VSAN-FTT=1"
$hd | Set-SpbmEntityConfiguration -StoragePolicy "VSAN-FTT=1"
Awesome, that works great. Thanks.
I need to dig that post out.
How to set with powercli this toogle switch from GUI "Configure per disk" - since setting both (for VM Home, and Disks) is ok, but newly added disk will not have this policy.