Quantcast
Channel: VMware Communities : All Content - vRealize Automation Tools
Viewing all articles
Browse latest Browse all 9859

Most Efficient, Quickest Way to Type Convert VC:VirtualMachine to VCAC:VirtualMachine

$
0
0


So this is one way we have been doing it... and I think it might be the equivalent of painting ourselves into a corner.  More machines means a much longer process to find a matching VCAC:VirtualMachine.

 

Have you guys come up with a quicker, better, smarter mechanism?

 

Action

 

VCAC:VirtualMachine getvcacvm (VC:VirtualMachine vcvm)

{

     var vcacvms = Server.findAllForType("VCAC:VirtualMachine");

     for each (var vcacvm in vcacvms){
          if (vcvm.name == vcacvm.virtualMachineName){
               return vcacvm;
          }
     }

}


Viewing all articles
Browse latest Browse all 9859

Trending Articles



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