Overview
In this post we are going to install the vCloud Director Notification Package, subscribe to a RabbitMQ queue and then configure vCenter Orchestrator to monitor to the newly created queue.
Installing the vCloud Director Notification Package
The vCloud Director Notification Package has various workflows, actions, etc that will allow us to parse AMQP notification messages from vCloud Director and act on them. By avoiding this heavy lifting, we can focus on using the parsed values in our workflows. Go to https://communities.vmware.com/docs/DOC-20446 and select the download link for com.vmware.coe.vcd55.notifications.package.zip. Unzip the archive and you’re left with a file named com.vmware.coe.vcd55.notifications.package.
From the the vCO client:
- Select Administer from the drop-down menu
- Select the Packages tab
- Select Import package
- Select the file com.vmware.coe.vcd55.notifications.package
- Select Open
Select Import on the following screen:
I’ve already imported the package so there is nothing selected, but you should have a lot of items with green arrows that will be imported:
Once the import is finished, you’ll see a new package with various workflows, actions, etc:
Subscribing to a RabbitMQ queue
In the vCO client go to the workflow tab and then Library > AMQP > Configuration. Right-click the Subscribe to queues workflow and set select Start Workflow. Give the queue a name and select Next
Select your broker and click Next.
Select Not Set and enter the name of your test queue in the in the New value field. Once you’ve entered your queue name select Accept.
My Queue section looks like:
Press submit and it should complete successfully:
Creating a new policy
Here is where we will create a policy that will tell vCO to monitor a RabbitMQ queue for messages and to run a workflow when a new message is found.
- Select the Run menu
- Select the Policies tab
- Create the new policy
Edit the new policy:
- Select Add policy element
- Select AMQP:Subscription
- Press OK
Type the name of your queue, select it and press Select.
Select the AMQP:Subscription line and then select Add trigger event.
Select OnMessage and then Select Trigger.
It should now look like this (not sure what’s up with the blue background):
Select OnMessage and below you will notice that no workflow is set. Click on the magnifying glass to search for a workflow to run:
Select the highlighted workflow:
Once you select the workflow you’ll notice that you have two new parameters that are not set:
Click on not set for subscription and then select the highlighted entry below:
Now do the same for messageBody:
The result should look like:
Start the policy by right-clicking on your policy and selecting Start policy.
The policy should now have a green arrow on it:
In the next post we will configure the workflow that will run when a new message is found.