VMware Cloud Community
wreedctd
Enthusiast
Enthusiast

Vcenter Events

Hello,

My Vcenter is set to keep events forever, however when I run a script to show VMs built within the last 30 days, I only see VMs built today.

Any ideas?  Running 5.5

0 Kudos
4 Replies
greco827
Expert
Expert

Can you display the contents of the script (which I assume is PowerCLI)?

Events only stay in the logs for a certain line count.  You can increase that line count, which may help, depending on how busy your environment, this may get you back 30 days (mine barely goes back 6 hours).  I'm not sure if this would affect a script or just the display in vCenter.

     In the VI Client go to Edit -->Client Settings --> Lists --> Change Page size, and increase the line count to number of lines desired .

     If necessary close and re open your VI Client.

Alternatively, if the data is no longer in the vmkernel.log, you can query the database to get older data.

Getting Previous vCenter Tasks | VMware Communities

If you find this or any other answer useful please mark the answer as correct or helpful https://communities.vmware.com/people/greco827/blog
0 Kudos
wreedctd
Enthusiast
Enthusiast

We have 5000 VMs in this Vcenter I am trying to query.

What is another way to get what I want? Directly from SQL?

Get-VIEvent -maxsamples 0 -Start (Get-Date).AddDays(-60) | where {$_.Gettype().Name-eq "

VmCreatedEvent" -or $_.Gettype().Name-eq "VmBeingClonedEvent" -or $_.Gettype().N

ame-eq "VmBeingDeployedEvent"} |Sort CreatedTime -Descending |fl

0 Kudos
praveenkv
Enthusiast
Enthusiast

0 Kudos
wreedctd
Enthusiast
Enthusiast

I believe I am going to have to query the DB directly. Are there any threads on that? Do you know which table the events are in? Has anyone written a statement to do this task?

0 Kudos