VMware {code} Community
ululu
Contributor
Contributor
Jump to solution

Last vm active time?

Hi,

Does someone know How can I get the last time vm shutdown or that last vm active time?

What I would like to do is using API to list up the vms that has been shutdown for more than three month to check

the importance of each vms, so that I can remove the unnessesary vms and reduce the disk space.

I checked VirtualMachineRuntimeInfo or VirtualMachineConfigInfo but there is no such information...

Thanks in advance.

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
lamw
Community Manager
Community Manager
Jump to solution

Is this querying against an individual ESX(i) host or vCenter? A tool that can definitely help with this is the new VMware CapacityIQ which has tons of reports and one of which is idle report as you'll need to trend some data to determine which VMs are truly idle, and again this can be done by looking at a VMs usage over time but you'll need to extract all that information.

Regarding the time "last shutdown", you could query this piece of information using VmEvent and specifically VmGuestShutdownEvent and correlate that information. Gathering usage over time will be a little more tricky and again CapIQ does all that for you along with other types of reports against your environment.

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

Twitter: @lamw

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Comuunity

If you find this information useful, please award points for "correct" or "helpful".

View solution in original post

0 Kudos
1 Reply
lamw
Community Manager
Community Manager
Jump to solution

Is this querying against an individual ESX(i) host or vCenter? A tool that can definitely help with this is the new VMware CapacityIQ which has tons of reports and one of which is idle report as you'll need to trend some data to determine which VMs are truly idle, and again this can be done by looking at a VMs usage over time but you'll need to extract all that information.

Regarding the time "last shutdown", you could query this piece of information using VmEvent and specifically VmGuestShutdownEvent and correlate that information. Gathering usage over time will be a little more tricky and again CapIQ does all that for you along with other types of reports against your environment.

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

Twitter: @lamw

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Comuunity

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos