Find when Virtual Machine was created using SQL query

SQL Query

Yesterday I was asked by my colleague if it is possible to find when virtual machine was created and by who.

I found great post on Grzegorz blog. I tested it and it works from ESX 4.1 U3 up to ESXi 5.1

However it is possible to retrieve this information as well from vCenter database.

In order to find when Virtual Machine was created you can create simple SQL query in vCenter database and I will show you how to Find when Virtual Machine was created using SQL query.

In my case it is Windows SQL Server so I logged into SQL Management Studio and I executed following query.

select CREATE_TIME, USERNAME, VM_NAME, HOST_NAME, DATACENTER_NAME
          from VPX_EVENT
          Where VM_NAME = 'VIRTUAL MACHINE NAME'
order by CREATE_TIME;

After that I received information when it was created and who did it. Don’t forget to switch to vCenter Database at the beginning because you will execute query against Master Database 😉