Hi,
I have been trying to get the task status from ApplyStorageDrsRecommendation_Task today and not had any luck. I just get "queued" even when the task has completed. To test this out some more I have writen some code in c# to power on the vm, wait and then check the status. Can anyone correct where I'm going wrong using TaskInfo with the provided managed object ref.
Thanks,
David
The problem is the following code:
TaskInfo TaskInfoObj = new TaskInfo();
TaskInfo is the type of a property defined with the Task managed object. With the ManagedObjectReference of a Task, you should use PropertyCollector to get its property. The TaskInfo is not meant to be "new"ed. If you use open source VI Java API, you will have Task object, and simple call:
TaskInfo ti = task.getInfo();
To clarify the concept, check out: http://www.doublecloud.org/2011/06/managedobjectreference-vs-managedobject/
Can anyone help with this? I'm still struggling to make this work.
Thanks,
David
Is it PowerCLI Views? Perhaps this will help?
Anyway, state of TaskInfo will not change by itself, additional data querying from the server is needed. By creating filter and view for Task itself, or something like this.
The problem is the following code:
TaskInfo TaskInfoObj = new TaskInfo();
TaskInfo is the type of a property defined with the Task managed object. With the ManagedObjectReference of a Task, you should use PropertyCollector to get its property. The TaskInfo is not meant to be "new"ed. If you use open source VI Java API, you will have Task object, and simple call:
TaskInfo ti = task.getInfo();
To clarify the concept, check out: http://www.doublecloud.org/2011/06/managedobjectreference-vs-managedobject/