VMware Cloud Community
yatigammanabnd
Enthusiast
Enthusiast
Jump to solution

Is there a way to automatically associate many workflows to vSphere objects? (or run a script to do so)

I know how to associate a Workflow from vRO, to an object in vSphere (as described here); but what I'd really like to know is if there is a way to make this automagically happen?

e.g. Something along the lines of: I give vSphere a script/command/api-call that specifies the association mapping of vRO Workflows to vSphere objects.

Or is the only way to perform the task manually one by one for each new vSphere<-->vRO setup?

Reply
0 Kudos
1 Solution

Accepted Solutions
iiliev
VMware Employee
VMware Employee
Jump to solution

There is no API or script to do so, but you have a couple of other options:

1. Configure context mappings once, then export the created mappings as a file (there is a btoon to do so in the vSphere Web client UI), and then you should be able to import these mappings on all other setups.

2. Inside the vRO integration plug-in's ZIP file, there is a file named actions.xml containing the 'default' context mappings. You can extract this file out of the ZIP file, add/modify the context mappings, and then put the updated actions.xml file back into ZIP file at the same location. You can put the same updated XML file into vRO integration plug-in at all your setups. This requires more work than the first option, and will only work if in particular setup you haven't created custome contaext mappings yet (the first time you create custom context mapping, the plug-in will stop to use the default actions.xml and will switch to the custom mappings list).

View solution in original post

Reply
0 Kudos
5 Replies
yatigammanabnd
Enthusiast
Enthusiast
Jump to solution

Also, in case anyone was interested there is a manual procedure to export and import the association mapping.

  1. Define your Workflow to vSphere object association
  2. Export the association map as an XML file
  3. Import XML association map to another vSphere

What I'm looking for is if there is an API-endpoint that can be called to pass this association map (e.g. this XML) from vRO - to allow a more automated approach? Much like how vRO can associate itself "automatically" with vSphere via a workflow?

I ask as I'm imagining this user case:

User installs plugin for vRO via the vco-controlcenter. Which also provides the vRO package (Workflows & Actions) to use the plugin. Additionally, the user could then run a special "associate with vSphere" Workflow to associate these new Workflows from the plugin to a specified vSphere instance.

Is there a vSphere API-endpoint that might make that at all possible?

Reply
0 Kudos
iiliev
VMware Employee
VMware Employee
Jump to solution

There is no API or script to do so, but you have a couple of other options:

1. Configure context mappings once, then export the created mappings as a file (there is a btoon to do so in the vSphere Web client UI), and then you should be able to import these mappings on all other setups.

2. Inside the vRO integration plug-in's ZIP file, there is a file named actions.xml containing the 'default' context mappings. You can extract this file out of the ZIP file, add/modify the context mappings, and then put the updated actions.xml file back into ZIP file at the same location. You can put the same updated XML file into vRO integration plug-in at all your setups. This requires more work than the first option, and will only work if in particular setup you haven't created custome contaext mappings yet (the first time you create custom context mapping, the plug-in will stop to use the default actions.xml and will switch to the custom mappings list).

Reply
0 Kudos
yatigammanabnd
Enthusiast
Enthusiast
Jump to solution

I don't think I have all the terminology correct in my head yet!

Your option 2 intrigues me. When you say "vRO integration plug-in's ZIP file", I am not sure what you mean. I've looked in my plugin for vRO's .vmoapp file and cannot find it in there, so I presume you must be pointing me towards something else?

Reply
0 Kudos
iiliev
VMware Employee
VMware Employee
Jump to solution

This is a different kind of plug-in.

The plug-ins distributed as vmoapp files are vRO plug-ins; they are deployed on vRO server and run in vRO server context. Usually they are used to extend vRO functionality by exposing Javascript API to access 3rd party systems.

The vRO integration plug-in is a different kind of plug-in. It is stored on vRO server at /usr/lib/vco/downloads/vco-plugin.zip, but it is downloaded and deployed on vSphere Web client side, so it is a plug-in for Web client. The actions.xml is stored inside this plug-in's ZIP file.

Reply
0 Kudos
yatigammanabnd
Enthusiast
Enthusiast
Jump to solution

OK. So if I understand correctly, the vRO integration plug-in is part of that vRO's install.

Which implies that if we want to specify this association of the vRO plug-in's (the .vmoapp file) Workflows across many vRO instances, then altering the actions.xml of one vRO integration will not make any difference to what Workflows are associated with vSphere from another vRO integration.

Correct?

Then that means option #1 is the solution for me (to configure associations once and export as an XML that can be imported onto other setups)

Thank you for discussing this with me

Reply
0 Kudos