- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Any way to throttle asynchronous tasks?
For example,
foreach ($VM in $VMS) { Move-VM -VM $VM -Datastore $Datastore -RunAsync}
and make so that only X amount of SvMotions are running concurrently. Once one finishes, the next one would start. I assume I would use Get-Task to count how many jobs are running.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Note that vSphere itself already throttles the number of parallel vMotions.
If you want to divert from the number of parallelism from vSphere, you will have to indeed use the Get-Task cmdlet and monitor the number of "running" tasks of type vMotion.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference