I had a customer ask for a report of who built all VMs in a particular vCenter instance. Alan of Virtu-Al.net has a great article on how to tag VMs with creator information, here: https://www.virtu-al.net/2010/02/23/who-created-that-vm/
In my case however, I wanted a complete report of all VMs created in the environment, and I wanted it fast. I opted to go straight to the source… the database. This SQL query will do the trick:
Using Alan’s article, I compiled a list of interesting event types and added the “vim.event” prefix, as used in the database. Easy.
One final note: You may or may not have a complete history in the VPX_EVENT table. The vCenter with a Microsoft SQL database has a stored procedure “cleanup_events_tasks_proc,” and corresponding SQL Agent job. This will purge your event history based on two parameters. You can check the relevant parameters with this query:
WHERE NAME IN ('task.maxAgeEnabled','task.maxAge')
Here’s sample output. In this case purging VPX_EVENT based on event age is disabled: