DRS history will only show the most recent VMotion events, to get a more complete picture LudD has created a couple of fantastic functions. What they do is allow you to create a csv report of all the VMotion/SVMotions events of a period of time, for example 24, 48, or 72 hours –

This is Luc’s work, if you think its good, go buy his VMware vSphere PowerCLI Reference book, even if you don’t read it cover to cover, it’s one way of acknowledging his and others excellent contribution to the community..

The code is now on GitHub
https://github.com/raoconnor/Get-VMotionHistory

Get-Cluster -Name Cluster1 | Get-MotionHistory -Hours 24 -Recurse:$true
Get-Cluster -Name Cluster1 | Get-MotionHistory -Hours 24 -Recurse:$true | Export-Csv C:\PowerCLI\Output\vmotion-report1.csv -NoTypeINformation -UseCulture

Be sure to dot source the both functions so they can be used
ie: period then a space and then the full or relative path to the function
. ./Get-VIEventPlus.ps1
. ./Get-VMotionHistory.ps1

Join the Conversation

3 Comments

  1. Hallo..
    I run it but it gives me csv file with blank columns. Although I have done many vMotions. Can you kindly advise?

    Mohamed

    1. Hi Mohamed, Have you got the functions properly registered..?
      I’ll try and take a look at it tomorrow, and get back to you

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.