VMware Cloud Community
daneben
Contributor
Contributor

Slow looping through vCenter objects since upgrade from vRO 7.2 to 7.4

Since I upgraded our vRO standalone installation from vRO 7.2 to 7.4 we have performance issues while executing code which looping though a large number of vCenter objects (like vm oder vmFolder objects).

I`m using following code:

var ret = VcPlugin.getAllVirtualMachines();

var time = new Date();

var start = time.getTime();

var i = 0;

var allVmNames = [];

for each(var vm in ret) {

      allVmNames.push(vm.name);

      if ((++i % 1000) == 0){

           System.log ("inserts: " + i);

      }

}

var time = new Date();

var end = time.getTime();

               System.log ("Start:     " + start);

               System.log ("End:      " + end);

System.log ("Difference: " + (end - start));

    

Result vRO 7.2:

2018-05-04 07:18:54.980] [I] Ergebnis: 5557

[2018-05-04 07:19:35.745] [I] inserts: 1000

[2018-05-04 07:20:37.296] [I] inserts: 2000

[2018-05-04 07:21:36.996] [I] inserts: 3000

[2018-05-04 07:22:36.400] [I] inserts: 4000

[2018-05-04 07:23:37.950] [I] inserts: 5000

[2018-05-04 07:24:11.751] [I] Start:     1525411134982

[2018-05-04 07:24:11.757] [I] Ende:      1525411451749

[2018-05-04 07:24:11.760] [I] Differenz: 316767

Result vRO 7.4:

[2018-05-04 07:18:13.604] [I] Ergebnis: 5557

[2018-05-04 07:18:13.644] [I] inserts: 1000

[2018-05-04 07:18:13.682] [I] inserts: 2000

[2018-05-04 07:18:13.705] [I] inserts: 3000

[2018-05-04 07:18:13.729] [I] inserts: 4000

[2018-05-04 07:18:13.747] [I] inserts: 5000

[2018-05-04 07:18:13.758] [I] Start:     1525411093614

[2018-05-04 07:18:13.760] [I] Ende:      1525411093756

[2018-05-04 07:18:13.762] [I] Differenz: 142

As you can see the execution time is in vRO 7.4 is much longer than in 7.2.

Does anyone see the same behavier after the updrage?

5 Replies
robrtb12
Enthusiast
Enthusiast

Hi daneben,
Can you clarify what you're trying to accomplish ?  I understand your code below, showing the time it takes, etc.   However, I don't understand what you mean by "(like vm oder vmFolder objects)"

Reply
0 Kudos
iiliev
VMware Employee
VMware Employee

Actually, the second set of results is much better than the first one. I guess the second set represents vRO 7.2 and the first vRO 7.4, the opposite of what is shown in the first post, is that correct?

The main difference between 7.2 and 7.4 that could be related is the different vCenter plug-in implementation. There is not much happened inside the for loop, so the performance degradation could be either in:

1) the retrieval of vCenter object properties, like vm.name

2) insertion of element in an array (not very likely, as 7.2 and 7.4 use identical version of Rhino Javascript engine)

3) arithmetic operations (also not very likely)

If you are willing to test it further, could you try to eliminate the operations listed above (one after another) and rerun the tests to see if there will be major difference? For example, to eliminate vCenter object property retrieval, you can replace allVmNames.push(vm.name); with allVmNames.push("fixedstring");

BTW, the new vCenter plug-in bundled in 7.4 uses a more aggressive caching that could also affect the performance when retrieving the initial object value. Could you check if there is major difference in the execution time if you run the code on 7.4 two times? I'd expect the first run to be slower (when objects are retrieved and put in cache), and the second run to be somewhat faster (the objects should be already available in the cache).

Reply
0 Kudos
robrtb12
Enthusiast
Enthusiast

Hi Ilian,
Is there a separate call that takes place for "retrieval of vCenter object properties, like vm.name" ?  I'm would like to better understand the redesigned vRealize Orchestrator vCenter Server plug-in.  (My SR 18696471601 related to object properties and cache)

Reply
0 Kudos
iiliev
VMware Employee
VMware Employee

Actually, I'm not very familiar with the implementation code of vCenter plug-in, but as you already have an open SR, I suppose it would be better to request detailed technical information about the design/implementation of the new plug-in there, and the people who worked on the plug-in can provide accurate information about what was changed/redesigned/improved.

Reply
0 Kudos
daneben
Contributor
Contributor

Hi Ilian,

thank you for your reply.

I did some further testing with the retrieval of vCenter object properties and I found a solution which solved my problem.

Instead querying all virtual machines with all properties

     var ret = VcPlugin.getAllVirtualMachines();

I use the additionalPropertyFilters method (e.g. "name") which runs very quick.

     var ret = VcPlugin.getAllVirtualMachines(["name"], null);

with PropertyFilter:

inserts: 1000

inserts: 2000

inserts: 3000

inserts: 4000

inserts: 5000

Start:     25-5-2018 14:17:22

Ende:    25-5-2018 14:17:24

without PropertyFilter

inserts: 1000

inserts: 2000

inserts: 3000

inserts: 4000

inserts: 5000

Start:     25-5-2018 14:19:14

Ende:     25-5-2018 14:22:02

Best regards