troubleshooting Question

how to list past events for a vmware virtual machine

Avatar of carbonbase
carbonbaseFlag for United Kingdom of Great Britain and Northern Ireland asked on
5 Comments1 Solution12 ViewsLast Modified:
Hi I'd like to see all migration events for a particular virtual machine, as we are trying to troubleshoot performance issues are being caused whenever DRS moves it between hosts.  

I have the following code which pulls off all the events for a specific virtual machine but it only returns the same number of events I can see in the vCenter html5 client, 41 events.

$fileName = $env:Temp + '\report.csv' 
$entity = Get-VM -Name my-vm 
$events = Get-VIEvent -Entity $entity -MaxSamples 1000 | Select CreatedTime,UserName,FullFormattedMessage | Export-Csv -Path $fileName -NoTypeInformation -UseCulture
The vm has been around for a while so I would have thought there were more events than that.  In the vSphere flash based web client you could export all events between specific dates, I know there isn't that feature in the html5 client but is it possible to do this in the vSphere power cli?

Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros