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

get vCenter VM from vCAC VM

$
0
0

I couldn't find an action for this and it doesn't seem to be  a property of the vCAC vm.  It sure would be nice if it were.  I snagged this code from one of the workflows in the vCAC plugin that does what I would like so I figured I would repost here.  I also attached an action.  Takes a vCAC:VirtualMachine input and returns a VC:VirtualMachine out.

 

var sdkConnections = VcPlugin.allSdkConnections;

System.log(sdkConnections.length + " sdk Connections found...");

for each (var sdkConnection in sdkConnections) {

  try {

  vCenterVm = sdkConnection.searchIndex.findByUuid(null, vCACVm.vmUniqueID, true, false);

  } catch(e) {System.log("Error for SDK connection " + sdkConnection.name + " : " + e);}

  if (vCenterVm != null) {

  System.log("Resolved vCenter VM " + vCenterVm.name);

  return vCenterVm;

  break;

  }

}


Viewing all articles
Browse latest Browse all 6251

Trending Articles



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