Kicking off SDRS Migrations One at a Time

Posted: December 24, 2017 in Scripts, Storage, VMware

Had to do a bunch of SDRS migrations recently. This was in a 5.5 environment, so I’m not sure if this has been fixed in 6.0+, but when you kick off a heap of SDRS migrations in a row, vCenter doesn’t seem to factor in the impact of the already queued migrations. You can quickly find yourself with way too many VMs on a datastore or even worse, a 100% full store. I use this script to run migrations one after the other, without having to baby sit it. It also ensure you don’t overload either the source or destination stores.

Be sure to replace TargetDSCluster with you destination cluster.

Also, this is set to force thin provisioning of all the disks as they move across, you may want to consider changing this so the VMs keep their original format.

The Start-Sleep command was there to allow the environment I was working in a little break, as it was highly over utilised. This can be removed if you just want to chain the migrations back to back.


$VMs = Get-Content C:\Temp\VMList.txt
$SDRS = Get-DatastoreCluster -Name TargetDSCluster
ForEach ( $VM in $VMs){
Move-VM -VM $VM -DiskStorageFormat Thin -Datastore $SDRS
Start-Sleep -Seconds (Get-Random(30..60))

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s