vRealize Orchestrator 7 VAPI vSphere tags workflow

I created a workflow using the VAPI plugin to assign vSphere tags to a VC:VirtualMachine object.

You will need to import the package, then configure VAPI with your vCenter endpoints by following these instructions:

1 – Run the Import VAPI metamodel workflow

2 – Run the Add VAPI endpoint workflow

Both workflows take the same inputs, but you must run the workflows in that order. Screen shot of inputs as follows:

Screen Shot 2016-07-19 at 22.56.04


Once you have configured your VAPI endpoints, download the following package from github


Import the package and then the following workflows and actions.

Screen Shot 2016-07-19 at 23.02.25

Screen Shot 2016-07-19 at 23.03.11

Run the Add tag to VC vm workflow (highlighted in the package screen shot above), and as long as you have configured VAPI endpoints, you can add vSphere Tags and vSphere Categories to a VC:VirtualMachine object.


  • The vCenter Virtual Machine is the VC:VirtualMachine object
  • The VAPI Endpoint drop down list should contain all your VAPI endpoints
  • The Create new Tag Category allows you to create a new Category
  • The Tag Category displays existing tag categories configured on your VAPI Endpoint
  • The Tag Name is the name of the tag you wish to create
  • The Tag description is the description and is optional

Code is more of an example, as I found the OOTB VAPI plugins for tags pretty limited. You can move the input parameters to attributes as desired and pass in values for the tag name using maybe an API call to a SNOW or CMDB to get values for your tag name.

Any issues, send in a comment.



  1. Thanks, great article. It helped me create a set of tools to tag any object types with whatever I needed and if the categories or tags didn’t exist – create them on the fly.

    What I’m trying to figure out is how to make the leap from the VAPI REST API Documentation to javascript VAPI objects, methods, properties. I’m trying to move now to the multisite content library API to list libraries and once I have my “new com_vmware_content_library(client);” created, I can’t figure out the next step because I can’t figure out how to work with it.

    Does the vapi metamodel document itself somewhere in the system in a way I can look it up? I feel like I’m shooting blind.

    I’ve been unable to finding much documentation on how to make good use of the new orchestrator VAPI functionality outside of your article.

  2. Hi Oliver,

    It is very strange issue randomly for assign vSphere tag via vRO workflow. If try again to assign the same vSphere tag, it will be ok. The tag exists at Web Client so i don’t know why to happen this issue? Could you give me any ideas or suggestion?

    [2017-11-10 11:13:40.515] [I] Settings vCenter Tags
    [2017-11-10 11:13:40.516] [I] Tags: P-VL408
    [2017-11-10 11:14:58.220] [I] Found Tag: P-VL408
    [2017-11-10 11:14:58.746] [E] (com.vmware.vapi.tags/findTagByName) Error in (Dynamic Script Module name : findTagByName#7) ReferenceError: “com_vmware_cis_tagging_tag” is not defined.
    [2017-11-10 11:14:58.762] [E] Workflow execution stack:
    item: ‘EBS-setVcTags-Production/item1’, state: ‘failed’, business state: ‘null’, exception: ‘ReferenceError: “com_vmware_cis_tagging_tag” is not defined. (Dynamic Script Module name : findTagByName#7)’

    1. Hi Sean, I use to have this problem before the VAPI plugin was available in vRO 6.x. In fact, I had to try catch multiple times before the tag was created, however I never experienced this using the VAPI in vRA 7.x. Whilst there is no harm in do a try catch to make sure that the tag is created whilst using the VAPI plugin, its usually down to caching in VAPI, or a stale connection, or DNS resolution. Difficult to say, but in a dev env, if you hit the problem, does a service vco-server restart fix the problem? If so, then it might point to a caching issue.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s