This Blog is to share our knowledge and expertise on Linux System Administration and VMware Administration

Tuesday, October 17, 2017

How to check the vMotion Count by using PowerCLI

Below script can help you to get the count of all vMotion events that has happened in the past 24 hrs.

If you want to calculate the count for longer period then change the number AddDays.

Get-VIEvent -Entity (Get-VM -Location $_) -MaxSamples ([int]::MaxValue) -Start (Get-Date).AddDays(-1) |Where { $_.GetType().Name -eq “TaskEvent” -and $_.Info.DescriptionId -eq “VirtualMachine.migrate”} | Measure-Object | Select-Object -ExpandProperty Count

No comments:

Post a Comment