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

Version 9

    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.

     

    Documentation

    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.

     

    Implementation

    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.