Get VM uptime/last reboot
Is your feature request related to a problem? Please describe.
It's not related to a problem, but I'm trying to retrieve more information regarding each VM.
Describe the solution you'd like
I'm retrieving a list of all of my VMs based on the vSphere client and the following queries:
sphere_client.vcenter.vm.guest.Identity.get(vm=vm) and vsphere_client.vcenter.VM.list(vm_filter)
I'd like to also add also information regarding uptime/last reboot time per VM, is it possible?
Thank you
Describe alternatives you've considered
No response
Additional context
No response
Same, I'm looking at all the available counters in the vStats api, and none of them have last boot time, or sys.uptime for VMs. Anyone at VMware know how to get this counter/metric? The REST api for v7.x is not well documented on the website. I spent considerable time in apiexplorer as well. I can list all VM info just fine except for this one metric (uptime).
There is bootTime property in VirtualMachineRuntimeInfo(vim.vm.RuntimeInfo) in SOAP API (via PyVmomi SDK). You can find more details in, https://developer.vmware.com/apis/1192/vsphere (Search for VirtualMachineRuntimeInfo)
VirtualMachineRuntimeInfo is not yet available in REST.
Thanks for this, I spent an untold number of hours scouring the REST api thinking "surely its in here somewhere, they wouldn't just leave the most basic useful metric out.".
I'll check out the SOAP SDK now.