Tuesday, January 17, 2012

SVmotion individual harddisks via PowerShell

I ran into an issue today where I wanted to SVmotion several large virtual disks to different datastores. I didnt want to use the VC because I would either have to 1) Kick off all migrations at the same time, or 2) wait and watch for each disk to finish before launching the next migration.

I knew I could move the whole VM using Powershell, and then I came across this link: http://mrpointy.wordpress.com/2011/07/05/storage-vmotion-only-one-harddisk-via-powershell/. This shows how to identify a single disk and move it to a separate datastore. Queue up these commands in notepad and then past them into PS and they will automatically launch one after the other. Below is an example command

get-harddisk -vm cvmedia51 | where {$_.Name -eq "Hard disk 3"} | % {set-harddisk -harddisk $_ -Datastore TKPD_T3_L070001_02 -Confirm:$false}

No comments: