VMware Cloud Community
MacWrob
Contributor
Contributor
Jump to solution

creation configuration elements - duplicated paths

Hello,

I faced issues when creating Configuration Elements, hope you can help with solution.

Case is: under vRO workflow I would like to create three configuration elements under the same path. So at the end that should look like that:

Root Folder

  • Folder A
    • Subfolder A
      • Conf. Element A
      • Conf. Element B
      • Conf. Element C

Unfortunately what I get current is:

Root Folder

  • Folder A
    • Subfolder A
      • Conf. Element A
  • Folder A
    • Subfolder A
      • Conf. Element B
  • Folder A
    • Subfolder A
      • Conf. Element C

So something that you cannot do manually from vRO.

The investigation I did so far shows that number of elements under WF is not changing – the new created are not visible.

I was trying to do reload, reading configuration elements between creation, adding delay, creating configuration elements thru separate WF – unfortunately result is not changing.

Ideas ?

0 Kudos
1 Solution

Accepted Solutions
iiliev
VMware Employee
VMware Employee
Jump to solution

It worked in my environment only because I didn't have the root folder 'Test'.

It seems to be a problem with aggressive subfolder caching in vRO configuration element categories. To work around it, try to change the following 3 lines of your workflow:

var newItem = Server.createConfigurationElement(path, configItemName1);

var newItem1 = Server.createConfigurationElement(path, configItemName2);

var newItem2 = Server.createConfigurationElement(path, configItemName3);

to:

var newItem = Server.createConfigurationElement(path, configItemName1);

var newItem1 = Server.createConfigurationElement(newItem.configurationElementCategory, configItemName2);

var newItem2 = Server.createConfigurationElement(newItem.configurationElementCategory, configItemName3);

That is, the subforlder hierarchy will be created by the first call, and the remaining 2 calls will use already created subfolders instead of searching for them (and hitting the caching issue)

View solution in original post

0 Kudos
6 Replies
iiliev
VMware Employee
VMware Employee
Jump to solution

Hi,

Which vRO version do you use? Could you show the code you use to create these elements?

Something like the following should work:

Server.createConfigurationElement("Root Folder/Folder A/Subfolder A", "Conf Element A");

Server.createConfigurationElement("Root Folder/Folder A/Subfolder A", "Conf Element B");

Server.createConfigurationElement("Root Folder/Folder A/Subfolder A", "Conf Element C");

0 Kudos
MacWrob
Contributor
Contributor
Jump to solution

hi,

yvRo 7.2, I'm using custom action to create configuration element under provided path. The code is:

newConfigurationElement = Server.createConfigurationElement(path, configurationElementName);

path is like:  ABC/XYZ/QWE

configurationElementName is string like: QWE_Attributes

instead of having such structure:

pastedImage_9.png

I have this:

pastedImage_10.png

when I want to creates those three Configuration elements under single workflow.

0 Kudos
iiliev
VMware Employee
VMware Employee
Jump to solution

Tried it in my lab, in both vRO 7.2 and 7.4, with and without action calls - worked properly in all cases.

Could you create a package with your custom action/workflow, and attach it there so I can import it in my lab and run the exactly same code?

0 Kudos
MacWrob
Contributor
Contributor
Jump to solution

Interesting... attached is workflow with single task creating configuration elements.

0 Kudos
iiliev
VMware Employee
VMware Employee
Jump to solution

It worked in my environment only because I didn't have the root folder 'Test'.

It seems to be a problem with aggressive subfolder caching in vRO configuration element categories. To work around it, try to change the following 3 lines of your workflow:

var newItem = Server.createConfigurationElement(path, configItemName1);

var newItem1 = Server.createConfigurationElement(path, configItemName2);

var newItem2 = Server.createConfigurationElement(path, configItemName3);

to:

var newItem = Server.createConfigurationElement(path, configItemName1);

var newItem1 = Server.createConfigurationElement(newItem.configurationElementCategory, configItemName2);

var newItem2 = Server.createConfigurationElement(newItem.configurationElementCategory, configItemName3);

That is, the subforlder hierarchy will be created by the first call, and the remaining 2 calls will use already created subfolders instead of searching for them (and hitting the caching issue)

0 Kudos
MacWrob
Contributor
Contributor
Jump to solution

Thanks a lot !

That did the work.

regards Maciej.

0 Kudos