VMware Cloud Community
lurims
Enthusiast
Enthusiast
Jump to solution

Best way to convert a bunch of VMs (string values) to vRAVM objects

I have seen several examples to convert the VM names (string values) to vRAVM/VCACVM objects, but not sure which is the best one to use in the event of searching thousands in the range of more than 10,000 objects.  Could anyone suggests with an example?

1 Solution

Accepted Solutions
qc4vmware
Virtuoso
Virtuoso
Jump to solution

We have around 20K vm's managed in our vRA instance and I use this to retrieve a vCAC:VirtualMachine by name:

var vCACVms = Server.findAllForType("vCAC:VirtualMachine", "VirtualMachineName eq '" + vCACVmName + "'");

Gives me an array of any matches.

To find the catalog resource by name I use:

vCACCAFEEntitiesFinder.findCatalogResources(host, name);

Both of these return near immediate results.

Paul

View solution in original post

Reply
0 Kudos
2 Replies
qc4vmware
Virtuoso
Virtuoso
Jump to solution

We have around 20K vm's managed in our vRA instance and I use this to retrieve a vCAC:VirtualMachine by name:

var vCACVms = Server.findAllForType("vCAC:VirtualMachine", "VirtualMachineName eq '" + vCACVmName + "'");

Gives me an array of any matches.

To find the catalog resource by name I use:

vCACCAFEEntitiesFinder.findCatalogResources(host, name);

Both of these return near immediate results.

Paul

Reply
0 Kudos
lurims
Enthusiast
Enthusiast
Jump to solution

Thanks, that helps.