vCloud Director 5.1/5.5 blocking tasks and notification package using AMQP

vCloud Director 5.1/5.5 blocking tasks and notification package using AMQP

This package for the vCenter Orchestrator plug-in for vCloud Director 5.1 or 5.5 allows to trigger custom workflows on vCloud Director blocking tasks and notifications with including:

  • "Create  a vCD notification subscription" (including AMQP  host, exchange,  queue, binding) with getting AMQP configuration from the  vCloud  Director configuration. Select end user custom workflow to run  on  specific blocking task or notification.
  • "Start a subscription listener workflow" Start a looping workflow waiting for new messages   from the selected subscription created with the workflow "Create a vCloud Director notification subscription" and then run the workflow   runner which convert the message to vCD inputs and pass these to the end user selected workflow.
  • Workflows samples to be triggered by the blocking tasks and notifications:
    • Customize VMs name and IPs: Apply Custom naming convention to each VM in resulting vApp (See workflow description for full details)
    • Approve Add Move or Delete VM from vApp: This workflow is designed to respond to the "Add, Move or Delete Virtual Machines from vApp" blocking task.
    • Approve Modify VM Configuration: This workflow is designed to respond to the "Modify Virtual Machine Configuration" blocking task.
    • Approve Build vApp: This workflow is designed to respond to the "Instantiate vApp from Template" blocking task.
    • Connect vApp from particular vAppTemplate to particular network: See workflow description before using and for more details
    • Approve vApp (Simple) : Sent email notification with details to approver with link to web page to approve vApp.
    • Approve vApp (AD:Computer) : Same plus add computer to AD Organization matching vCloud Director Organization.
    • Customize VM names and IP : Upon deployment of new vApp set custom vApp VM names & IPs.
    • Log all : Log all the information passed by the workflow runner. Usefull to check what information can be obtained from a given event.


These are the instructions to have the sample workflows working

  • Pre-requisite : 
    • vCO installed and configured
    • AMQP plug-in installed
    • vCloud Director 5.1 vCO plug-in installed and configured using the System org
    • Microsoft AD vCO plug-in installed and configured
    • Perspective plug-in installed (Optional !)
    • Mail plug-in configured
    • AMQP server freshly installed (if you messed up with AMQP before chances are something will be set wrong)

  • vCloud Director: 
    • Configure blocking tasks settings with AMQP server info and Test the AMQP Connection
    • Check "Instantiate vApp from Template" blocking task
  • Import package in vCO:  
    • Start vCenter Orchestrator Client.
    • Import package com.vmware.coe.vcd.notifications55.package
  • Configure email notifications for sample workflows
    • Run the workflow "customization Config" (Approver group, email, parent OU to create new OU, timeouts)
  • Configure Perspectives (the web front-end - NOT REQUIRED - the workflow that is specified to be run here may be run from vCO Client)
    • Start the "Initialize vCD Notifications Perspective" workflowUse Perspectives to create a new notification subscription:
    • Upon successful execution of workflow, open browser to http://<vco server>:8280
    • Click “Web View List”
    • Click “Perspectives”
    • Login to Perspectives as your vCO Administrator
    • Load the “vCD Notification Admin” perspective by clicking the link
    • Run the “Create a vCloud Director notification subscription” workflow by clicking the link in the left pane and then the “Start task” button in   the right pane
      • Give a subscription name (i.e "On vAppTemplate Instantiation")
      • Set AMQP password
      • Create a broker: yes
      • Filter on blocking task operation type: yes
      • Select event type (this should display the one you enable in vCD)
      • Filter on entity type: no
      • Filter on notification age: no
      • Select a Workflow to start (i.e Approve vApp)
      • Next screen will show the calculated routing key. Do not change it ! Submit.
  • Create a notification policy OR Start the listener workflow:
    • Use ONE of the following methods to have vCO listen for tasks:
      • Run the "Create a vCloud Director notification policy" workflow, Choose the AMQP Subscription you created earlier and set autoStart and start to Yes
      • Run the “Start a subscription listener workflow”, choose the Subscription that was just created and click Submit
      • NOTE: The second option presented here may be helpful if your policy fails to consistently pick up AMQP messages
  • Test:
    • Go to vCD and attempt to Instantiate (deploy in vCD UI terms) a template from the catalog
    • Open the vCO client and check "Start a subscription listener workflow" has a new Workflow run
    • Check the Approve vApp workflow you selected ran as well. If successful check email of the approver.
    • Click on the approve link, login, approve.


The implementation of the workflows is documented in the vCAT 3.0 Workflow Examples Document

UPDATE Sep 9th, 2014: Updated package to include a couple  minor fixes, updated description text --> Added notes on additional workflows in package (see BOLD entries in bullet list above), updated instructions to reflect that notification policy should be used and opt for listener workflow if there is trouble with policy)

UPDATE March 11th, 2014: Updated "Create a vCloud Director Notification subscription" workflow to work with vCloud Director 5.5. The change IS backward compatible with vCloud Director 5.1.

Disclaimer: These samples workflows are provided AS IS and  are not considered production quality and are not officially Supported.  Use at your own risk. Feel free to modify and expand and share your  contributions.


"Click on the approve link, login, approve."

The approver link is to the vCloud API - this article doesn't mention setting that up does it?

There were some issues at the time of release for this package that prevented us from including a web based approval for this. One way to implement this is to use the code examples provided here: to have Weboperator provide an approval interface. The other option is to have a custom webview in vCO handle the approval - this is my preferred method and I have the approval webview already created, I just need to find the time to update the package to include this - I was on PTO for the last several days but will see if I can squeeze this in sometime in the near future.

That would be cool, I will keep an eye on this post.

Facing issue while extending Notification package by adding new workflow.

I am trying to extend Notification package by adding new workflow for handling Import OVF as vApp or vApp template in catalog, my new workflow takes following input parameters

            Input              Type

  1. vApp               vCloud:VApp
  2. vAppTemplate          vCloud:VAppTemplate
  3. user                vcloud:User
  4. blockingTask                        vCloud:BlockingTask

I created a notification subscription and associate newly developed workflow to it also started subscription listener by executing respective workflows, when I upload OVF for creating vApp from OVF or upload OVF to create vApp template in catalog from VCD. Respective blocking task "vApp Template - Upload vApp Template" initiated and my newly developed workflow get called. Everything seems working except input parameter user vCloud:User object not found, I compare my workflow with other notification workflows but I could not able to figure it out what is wrong or missing.

-- AVR

Version history
Revision #:
1 of 1
Last update:
‎09-13-2012 01:48 AM
Updated by: