I have a 5000 VM Vcenter. PowerCLI does not display the expected results.
Has anyone written a SQL statement to produce a report of all VMs created in the last 30 days? If so could you share it with me?
Anyone ever done this?
Here is a statement that works we came up with in a hour. We will tweak tomorrow. For the curious minds.
WITH T as
ROW_NUMBER() OVER (PARTITION By VM_Name ORDER BY Create_Time ASC ) as Num,
INNER JOIN VPX_VM V on EN.ID = V.ID
INNER JOIN VPX_EVENT E on E.VM_Name = EN.Name
DateDiff(D, T.Create_Time, Getdate()) as DaysSince
INNER JOIN VPX_EVENT E on T.VM_Name = E.VM_Name and E.Create_Time = T.Create_Time
T.num = 1
and DateDiff(D, T.Create_Time, Getdate()) < 600