Created
December 24, 2021 06:19
-
-
Save YagmurOzden/1acee12f1ecb696599da4dc60e77e42f to your computer and use it in GitHub Desktop.
get the datastore connected to the relevant cluster (VMware vRO action, vSphere, resourcepool)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// VMware vRealize Orchestrator action sample | |
// vRA 8.4 | |
//action input type: cluster (string) | |
//action return type: VC:ResourcePool (array) | |
// this code below gets all clusters | |
var clusters =VcPlugin.getAllClusterComputeResources(); | |
var rPool=Array(); | |
System.log("get cluster's resource pool action started") | |
//this loop is to check all clusters | |
for (var i in clusters){ | |
System.log(i+"- "+clusters[i].name+" = "+cluster); | |
//this condision helps us select cluster | |
if (cluster==clusters[i].name.toString()){ | |
//and this is for datastores | |
rPool.push (clusters[i].resourcePool) | |
System.log("resource pool appointed: "+clusters[i].resourcePool) | |
} | |
} | |
System.log("get cluster's resource pool action over") | |
return rPool; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment