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
Hallo..
I run it but it gives me csv file with blank columns. Although I have done many vMotions. Can you kindly advise?
Mohamed
Hi Mohamed, Have you got the functions properly registered..?
I’ll try and take a look at it tomorrow, and get back to you
checked the code today on a 6.5 platform, be sure to dot source both the functions
worked fine for me
. ./Get-VIEventPlus.ps1
. ./Get-VMotionHistory
https://github.com/raoconnor/Get-VMotionHistory