Hi all,
I'm trying to perform a simple task which doesn't seem to work as expected.
vRO, i would like to input a datastore and output a list of hosts connected to that datastore:
action element:
in param = datastore
type VC:datastore
return type: ARRAY/VC:HostSystem
script:
return datastore.host;
error:
Unable to convert object, no sdk type defined for class : com.vmware.vim.vi4.DatastoreHostMount@
Many thanks for your help.
Regards,
Pod
I am going to assume that you are creating this as an action and if so, did you define the output of the action as a HostSystem?
Give this a shot
script:
var hosts = new Array();
var dsMounts = datastore.host;
for each (var i in dsMounts) {
host.push(i.key);
}
return hosts;
I am going to assume that you are creating this as an action and if so, did you define the output of the action as a HostSystem?
Give this a shot
script:
var hosts = new Array();
var dsMounts = datastore.host;
for each (var i in dsMounts) {
host.push(i.key);
}
return hosts;
This looks correct as the array that datastore.host does not return an array of hostsystems as thought by the author.