Grabbed this from another post. Added some logging as a test....but no tasks are returned.
var hosts = VcPlugin.allSdkConnections;
//var allClusters = VcPlugin.getAllClusterComputeResources();
System.log(hosts[0]);
var tm = hosts[0].taskManager;
System.log(tm);
var allTasks = tm.recentTask;
System.log(allTasks);
Tried this one as well:
var hosts = VcPlugin.vimHosts;
var tm = hosts[0].taskManager;
tasks = tm.recentTask;
System.log(tasks.length);
for (var i in tasks) {
System.log(tasks[i].info.name);
}
Add to boot tried the
getAllTasks method from the VcPlugin and VcSdkconnection.
Got nothing returned.
Upgrading to the latest 5.1 VCplugin Version 5.1.2-562 resolved the issue. Apparently the original plugin was not reloading task information and working with cached. This also appears to have corrected an issue with the vim3WaitTask action that relies on the VC task object information being updated to return a value.
Cheers
Can you check in Managed Object Browser if you can see the tasks there?
(To rule out that it's really a problem in vCO, rather than in vcenter)
I'm not able to verify via MOB, however if I call the Get-Task cmdlet in powerCli connected to that particular vCenter server, I do rec a list of the recent tasks.
Upgrading to the latest 5.1 VCplugin Version 5.1.2-562 resolved the issue. Apparently the original plugin was not reloading task information and working with cached. This also appears to have corrected an issue with the vim3WaitTask action that relies on the VC task object information being updated to return a value.
Cheers