Hi all,
I have a task to clear one storage completely.
For this, I need to do storage vmotion of around 200 + vms from one datastore to another.
I can write script for this purpose to automate the activity.
If executed in async mode, so that multiple vms can get svmotion simultaneously, I believe there will be a large queue of svmotion to be executed.
To avoid this, i would like to introduce sleep if live storage vmotion on that vcenter is more than 4.
Is there a possibility to find the number of live storage vmotion in progress? If yes, how to do it.
Please help.
Thanks in advance.
You can find all the async running tasks with the Get-Task cmdlet.
You will have to do some filtering to find the actual svMotion tasks.
You can keep the Task IDs of all the svMotion async tasks in a hash table.
That way it might be easier to find the specific svMotion tasks your script submitted.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
You can find all the async running tasks with the Get-Task cmdlet.
You will have to do some filtering to find the actual svMotion tasks.
You can keep the Task IDs of all the svMotion async tasks in a hash table.
That way it might be easier to find the specific svMotion tasks your script submitted.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks LucD, for your guidance.
I did like this
((get-task | where {$_.Uid -like "*<my acc name>*" -and $_.State -eq "Running" }).count -ge 4