Avatar of carbonbase
carbonbaseFlag for United Kingdom of Great Britain and Northern Ireland

asked on 

how to list past events for a vmware virtual machine

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

Open in new window

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?

VirtualizationVMware

Avatar of undefined
Last Comment
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)
ASKER CERTIFIED SOLUTION
Avatar of Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)
Flag of United Kingdom of Great Britain and Northern Ireland image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of carbonbase
carbonbase
Flag of United Kingdom of Great Britain and Northern Ireland image

ASKER

On one vCenter server the only DRS migrations listed are a couple of dozen all between 6pm and 7pm on the 1st May, on my other vCenter server, I can only see one DRS migration on the 28th April.  My clusters aren't super busy so I wouldn't expect to see migrations happening all the time, so I guess that's correct.

My retention is set to 30 days.  I've checked a few different vm's and I've seen a couple with events going back to the 6th April so I guess that's right then.
If you want to view older tasks and events, set to > 30.
Avatar of carbonbase
carbonbase
Flag of United Kingdom of Great Britain and Northern Ireland image

ASKER

Thanks Andrew.  I think for the time being we are ok with only retaining 30 days worth of logging, but it's good to know where that setting is in case we need to change it.
VMware
VMware

VMware, a software company founded in 1998, was one of the first commercially successful companies to offer x86 virtualization. The storage company EMC purchased VMware in 1994. Dell Technologies acquired EMC in 2016. VMware’s parent company is now Dell Technologies. VMware has many software products that run on desktops, Microsoft Windows, Linux, and macOS, which allows the virtualizing of the x86 architecture. Its enterprise software hypervisor for servers, VMware vSphere Hypervisor (ESXi), is a bare-metal hypervisor that runs directly on the server hardware and does not require an additional underlying operating system.

39K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo