Quantcast
Channel: VMware Communities : Discussion List - vRealize Orchestrator
Viewing all articles
Browse latest Browse all 6251

how to anchor the getallvmfolder to specific Datacenter

$
0
0

I run a workflow to retrieve a VMFolder resource to place new vm.

 

I used code from this post : https://communities.vmware.com/message/2110436 to put together a script that takes path string attribute to then traverse all of the VMFolders in order to get the last element in the path attribute (VMFolder).

 

I am running into little anomaly where in some cases the path is the same, only diff is that they exist in different Datacenters.

 

This is section of the code that retrieves all of the vm folders. I assumed since I was passing the cluster resource it would only retrieve folders that were in that Datacenter. Probably not right assumption.

 

How can  I modify the folders variable to only run the getallVMFolders on specific Datacenter

 

var sdkConnection_new = cluster.sdkConnection;  

System.log("Path has "+foldercount+" elements, last element "+VMFolderName);

var folders = sdkConnection_new.getAllVmFolders();

// result is an array of type VcFolder

//


Viewing all articles
Browse latest Browse all 6251

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>