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

Query vm name in vCenter

$
0
0

Hi,

 

Does anybody know a faster way of querying the vCenter name of a vCloud vm than below?  This works, however takes aprox 5 seconds.   There must be a faster way.....

 

 

vms = new Array();
MoRefs = new Array();
var doc = new XML(VM.toXml());
default xml namespace = doc.namespace();var n8 = new Namespace("http://www.vmware.com/vcloud/extension/v1.5");
//System.log("Info for VM \n"+ VM.name)
//System.log(VM.toXml());
//System.log("VM MoRef: "+doc.VCloudExtension.*::VmVimInfo.*::VmVimObjectRef.*::MoRef.toString());
MoRefs.push(""+doc.VCloudExtension.*::VmVimInfo.*::VmVimObjectRef.*::MoRef.toString()+"");
var vimServerHostName = doc..*::VmVimInfo.*::VmVimObjectRef.*::VimServerRef.@name.toString();
//System.log("VM MoRef: "+vimServerHostName);
for (var k in MoRefs){
vms.push(Server.findForType("VC:VirtualMachine", vimServerHostName + "/" + MoRefs[k]));
}
vm_Name = vms[0].name

Viewing all articles
Browse latest Browse all 6251

Trending Articles



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