Skip to content

Instantly share code, notes, and snippets.

@YagmurOzden
Created January 6, 2022 07:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YagmurOzden/9d703140cc490aae0f0658d40ca30a0b to your computer and use it in GitHub Desktop.
Save YagmurOzden/9d703140cc490aae0f0658d40ca30a0b to your computer and use it in GitHub Desktop.
VMware vRO action, vSphere, Virtual Machine, get virtual machine's cluster
// VMware vRealize Orchestrator action sample
// vRA 8.4
//action input type: vm (VC:VirtualMachine)
//action return type: VC:ClusterComputeResource
var parent = vm.runtime.host;
while (parent !== null && ! (parent instanceof VcClusterComputeResource)) {
parent = parent.parent;
}
System.log("VC:VirtualMachine Name: " + vm.name);
System.log("VcClusterComputeResource of VM: " + parent.name);
return parent;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment