pyvmomi icon indicating copy to clipboard operation
pyvmomi copied to clipboard

PyVmomi API For Last Logon Time

Open venugopalsjce opened this issue 6 years ago • 8 comments

Hello,

I am using pyVmomi for automation purpose. My aim is to get all VMs along with their last logon time (by any user). I am interested in this last logon time, as I need to auto logout or shutdown all those machines which have logged in since more than x days.

Does the API has support for this feature of getting "last logon time" ? Please help.

Regards, Venu

venugopalsjce avatar Mar 26 '19 09:03 venugopalsjce

Hello, Could you please respond on this?

Many thanks. Venu.

venugopalsjce avatar Mar 28 '19 13:03 venugopalsjce

Hi Venu,

If below line of code helps you runtime_info = vmObj.runtime.bootTime print("last powered on : ", runtime_info)

shwetapurohit avatar Mar 29 '19 11:03 shwetapurohit

Hi Purohit,

The boot time and log on time are different. I am able to fetch the bootTime. I am interested in knowing the last log on time. The use case here is that, people boot the machine, and keep on using it, log in, log out, without powering off. I need to find such machines whose last log on time is > 60 days (The boot time could be much more than this), and take some action on these systems. Is there any such field which exposes the last logon time?

venugopalsjce avatar Mar 29 '19 11:03 venugopalsjce

Hello, Can you please update on this?

Regards, Venu

venugopalsjce avatar Apr 15 '19 06:04 venugopalsjce

Hi Venu,

There is no field in any of the apis to get the last logon time of VM.

Thanks, Shweta

shwetapurohit avatar Apr 15 '19 07:04 shwetapurohit

Any plan to include this feature? Or can you please take this as a new feature request? This is very much needed to solve our problem, as described in the issue.

Regards, Venu

venugopalsjce avatar Apr 16 '19 14:04 venugopalsjce

Hello, Can you please update on this ?

Regards, Venu

venugopalsjce avatar Apr 23 '19 11:04 venugopalsjce

This demand should be invalidated and close because you ask something that is linked to the OS execution, not to VMWare VSphere. It's just impossible to know when was the last logon time on a VM with VMWare VSphere.

nfourniol avatar Jul 26 '24 14:07 nfourniol