VMware {code} Community
Sunflower-1
Contributor
Contributor

Get VM uptime Python SDK

Hi,

 

I'm retrieving a list of all of my VMs based on the vsphere client, I'd like to also add more information, such as uptime/last reboot time per VM, does anyone knows if it's possible and how? 

 

I'm using the VMware vSphere Automation SDK for Python:  https://github.com/vmware/vsphere-automation-sdk-python/blob/master/README.md

 

Thanks,

0 Kudos
2 Replies
doskiran
Enthusiast
Enthusiast

From my understanding, not all vSphere REST APIs for the VM get/post operations are available in the current releases. We may expect all REST APIs in the next vSphere major release.
But for your requirement use vSphere management SDK(SOAP-based APIs) to query VM info.

Data Object - VirtualMachineRuntimeInfo(vim.vm.RuntimeInfo)  - bootTime
Data Object - VirtualMachineQuickStats(vim.vm.Summary.QuickStats)  - uptimeSeconds
Data Object - VirtualMachineConfigInfo(vim.vm.ConfigInfo)  - createDate , modified

 

Sunflower-1
Contributor
Contributor

Got it. Do you know if it should be released for the Python SDK as well?

Do you have an idea regarding the ETA?

Thank you 🙂 

0 Kudos