VMware Cloud Community
thiag2011
Enthusiast
Enthusiast
Jump to solution

How to find number of live storage vmotion in progress.

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.

1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

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

View solution in original post

2 Replies
LucD
Leadership
Leadership
Jump to solution

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

thiag2011
Enthusiast
Enthusiast
Jump to solution

Thanks LucD, for your guidance.

I did like this

((get-task | where {$_.Uid -like "*<my acc name>*" -and $_.State -eq "Running" }).count -ge 4

Reply
0 Kudos