I would like to get results of VcVirtualMachine.recentTask, but according the documentation it is not working anymore:
In releases after vSphere API 5.0, vSphere Servers might not generate property collector update notifications for this property. To obtain the latest value of the property, you can use PropertyCollector methods RetrievePropertiesEx or WaitForUpdatesEx.
I haven't found any example using it and the documentation didn't really helped me to understand how to use it.
Could somebody point me to the right direction?
maaca
This should work for you - Using a TaskHistoryCollector
Here you can find example Reading configured memory of resourcepool
Thank you for pointing on that.
Sadly, result of this query is empty:
entityType = 'VirtualMachine'; |
propertyPaths = ['recentTask'];
entityIds = ['vm-XXXXX']
[2015-07-10 11:04:25.534] [I] vm-XXXXX
[2015-07-10 11:04:25.535] [I] VirtualMachine
[2015-07-10 11:04:25.536] [I] recentTask
[2015-07-10 11:04:25.536] [I]
Am I using correct propertyPaths? It exist, but contains nothing. Is there some "property collector inventory browser"?
tasks are available only couple of minutes through this property after they complete. Can you create a task and right after that try to fetch it with the script
Ah I see.
Is there some way to get also older tasks?
This should work for you - Using a TaskHistoryCollector
Thank you. This is exactly what I need.