I am looking for a way to find out VMs that are powered on in vSphere Infra but not doing anything. I can get list of Idle virtual machines from vRops, however that's not sufficient for me, so can someone please assist me in finding out which VMs are not used from past few days for example 30 or 60 days. May be if there is any script to find out last time when vmx or vmdk files of the machines were updated, this may give me an idea if machine is really getting used.
The last used timestamp on any of the VM's files is not reliable.
There could have been vMotions or svMotions.
If you have a watermark for determining a VM is not used, you look at the data returned by Get-Stat.
You could for example check if the CPU usage never goes above 5%.
But again, this not 100$ reliable either, due to low CPU usage apps and statistical data aggregation (especially if you go back further in time).
With vRops you can also check CPU and memory usage, provided you have configured vRops to retain those values, and for a sufficiently long time.
Many thanks. I have fetched the report of oversized VMs from vRops, however I want to know on what criteria vRops has selected those VMs, so that I can provide the evidence when we request for reclaim. Is there any way to get that ?
If VMDK timestamp is not reliable then could you please suggest any other reliable alternative way to check if VM is unused from last few days, like 30 or 60 days ?
I'm not a vRops specialist, but this post explains how vRops determines oversized VMs.
I really don't know of another method do determine if a VM is oversized for a period of 30-60 days.
Over such long periods, the statistical data will be aggregated.
This means that for 1 day, let's say 60 days ago, you only have 1 value.
Like the post, I pointed to, also mentions, this will not allow you to find a VM idle for 99% of the time, but a high CPU usage for 1% of the time.
Peaks will become invisible.