VMware Cloud Community
andvm
Hot Shot
Hot Shot

SVMotion and changing disks storage policy

hi,

using powercli and Move-VM command I can read the VM name and datastore from csv file and migration works.

However all disks remain attached to vSAN default storage policy so I need to change this to Datastore default when I migrate.

How can I achieve this for these VMs? Some of them have multiple disks so need to make sure all disks gets moved to Default datastore policy

Thanks

0 Kudos
2 Replies
LucD
Leadership
Leadership

Did you try like this?

$vm = Get-VM -Name MyVM

$hd = Get-HardDisk -VM $vm


Get-SpbmEntityConfiguration -VM $vm | Set-SpbmEntityConfiguration -StoragePolicy "NewPolicy" -Confirm:$false

Get-SpbmEntityConfiguration -HardDisk $hd | Set-SpbmEntityConfiguration -StoragePolicy "NewPolicy" -Confirm:$false


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

0 Kudos
andvm
Hot Shot
Hot Shot

sorry did not try it as as these were eventually migrated manually, took note of it however for future use.

Thanks

0 Kudos