Using vCenter Orchestrator with RabbitMQ and vCloud Director – Part 4

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:

  1. Select Administer from the drop-down menu
  2. Select the Packages tab
  3. Select Import package
  4. Select the file com.vmware.coe.vcd55.notifications.package
  5. Select Open

2014-10-21_17-32-17

Select Import on the following screen:

2014-10-21_17-32-48

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:

2014-10-21_17-32-58

Once the import is finished, you’ll see a new package with various workflows, actions, etc:

2014-10-21_17-34-14

 

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

2014-10-21_18-00-05

2014-10-21_18-00-39

Select your broker and click Next.

2014-10-21_18-02-21

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.

2014-10-21_18-02-48

My Queue section looks like:

2014-10-21_18-03-02

Press submit and it should complete successfully:

2014-10-21_18-03-34

 

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.

  1. Select the Run menu
  2. Select the Policies tab
  3. Create the new policy

2014-10-21_18-16-49

Edit the new policy:

2014-10-21_18-17-16

  1. Select Add policy element
  2. Select AMQP:Subscription
  3. Press OK

Type the name of your queue, select it and press Select.

2014-10-21_18-18-57

Select the AMQP:Subscription line and then select Add trigger event.

2014-10-21_18-33-22

Select OnMessage and then Select Trigger.

2014-10-21_18-20-17

It should now look like this (not sure what’s up with the blue background):

2014-10-21_18-36-56

Select OnMessage and below you will notice that no workflow is set.  Click on the magnifying glass to search for a workflow to run:

2014-10-21_19-08-29

Select the highlighted workflow:

2014-10-21_19-10-09

Once you select the workflow you’ll notice that you have two new parameters that are not set:

2014-10-21_19-11-38

Click on not set for subscription and then select the highlighted entry below:

2014-10-21_19-12-03

Now do the same for messageBody:

2014-10-21_19-12-15

The result should look like:

2014-10-21_19-12-20

Start the policy by right-clicking on your policy and selecting Start policy. 

2014-10-21_19-15-27

The policy should now have a green arrow on it:

2014-10-21_19-16-36

In the next post we will configure the workflow that will run when a new message is found.

Advertisements


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 )

Google+ photo

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

Connecting to %s