I'm trying to get a presentation working that selects out the datastores I want presented based on the VC:ClusterComputeResource that is selected earlier in the wizard. This is working perfectly in the vRO java client and displays correctly. My issue is when I try to run the work flow in the vsphere web client, the same field does not work falls back to the object browser. Here is what is looks like in the respective clients, note the options available are what are being returned from clusterDS
My presentation options like like so.
Here is the action that I wrote to built to return the Array/VC:Datastore objects. cluster.name comes from an in on the workflow that gets set on a prior step in the workflow wizard.
var clusterDS = new Array(); var allDs = VcPlugin.getAllDatastores(); var searchObj = { "clust1" : "clust1", "clust2" : "clust2", }; for (i in searchObj) { if (cluster.name == i){ var searchPat = searchObj[i]; for (i in allDs) { if (allDs[i].name.match(searchPat)){ clusterDS.push(allDs[i]); } } } } return clusterDS;
I can't for the life of me figure out what it won't work in the web client. I tested it against the getAllDatastoresMatchingRegexp workflow which is written very similar to my code and it works fine. That actions code is as follows.
// Get all datastores for all vCenter connections defined for this plugin var allDatastores = VcPlugin.getAllDatastores(); var datastores = new Array(); // Check if the datastore match the regexp for (var i in allDatastores) { if (allDatastores[i].name.match(regexp)) { datastores.push(allDatastores[i]); } } return datastores;
Any thoughts or ideas would be much appreciated