Hi Guy's,
I have a load of storage v-motions to complete over the next weekend. Rather than use scheduled tasks and guessimate a schedule does anybody know if its possible to schedule maybe 3 storage v-motions at once and have the next system in line migrate but only after the previous storage v-motion has completed.
I hope this all makes sense.
Regards
Mr G
No, my mistake. Use this instead
Get-VM -Datastore someDatastore | Get-HardDisk | `
where {$_.Name -eq "Hard disk 1"} | `
Set-HardDisk -Datastore anotherDatastore
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Orchastrator is the way to go but I bet you could do it with PS as well because PS will execute them as listed in the script and should not start the next Storage vMotion until the previous one finishes.
Hello,
You can do them in series (one at a time) with something like:
Get-VM -Datastore someDatastore | Move-VM -Datastore anotherDatastore -Confirm:$false
Or, could also initiate the sVMotions asynchronously using the -RunAsync parameter and let vCenter handle the queuing of the tasks, like:
Get-VM -Datastore someDatastore | Move-VM -Datastore anotherDatastore -Confirm:$false -RunAsync
How do those do?
Is there anyway to select a specific disk for migration only?
You can use the Set-HardDisk cmdlet to move a specific disk to another datastore. E.g.:
Set-HardDisk -HardDisk $harddisk -Datastore $datastore
Yes you can.
Suppose you want to only svMotion "Hard disk 1" for all the VMs to another datastore, then you can do
Get-VM -Datastore someDatastore | Get-HardDisk -Name "Hard disk 1" | `
Set-HardDisk -Datastore anotherDatastore
Unfortunately, the Set-Harddisk cmdlet has no RunAsync parameter. So each svMotion will be executed in sequence.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Mr G Grant wrote:
Hi Guy's,
I have a load of storage v-motions to complete over the next weekend. Rather than use scheduled tasks and guessimate a schedule does anybody know if its possible to schedule maybe 3 storage v-motions at once and have the next system in line migrate but only after the previous storage v-motion has completed.
I hope this all makes sense.
Regards
Mr G
Vcenter will only let you migrate 2 per server, and 2 per storage at a time. So if you kick them ALL off, only 2 will be done, the next will queue.. I am pretty sure vCenter will wait forever until the vMotion completes. I know when I do like 4 at once they wait until the others are done.. and sometimes it takes a few hours...
When i use the Get-HardDisk cmdlet there does not appear to be a -Name paramater. I use Powercli to write scripts so am i missing something here?
No, my mistake. Use this instead
Get-VM -Datastore someDatastore | Get-HardDisk | `
where {$_.Name -eq "Hard disk 1"} | `
Set-HardDisk -Datastore anotherDatastore
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference