Tuesday, November 26, 2013

Consuming Messages from RabbitMQ with vCenter Orchestrator


Finally we came to the end of this vCloud on top of vSphere MetroCluster solution.

Let’s review what we have done so far.

Now, let’s see how vCenter Orchestrator can integrate with the messages RabbitMQ receives from vCloud Director in order to automatize the DRS Affinity Groups management.

- Open vCO Client
Make sure the following plug-ins are available and configured

First thing you need to do is to add the RabbitMQ server to vCO.

- Open vCO Client 
- Login against your vCO server
- On Design View
- Expand: Library / AMQP / Configuration
- Run the Workflow Add a broker



- Provide a name to identify the AMQP Server and click Next

 
- Fill the details with the information about your AMQP Server and click Submit


 Your AMQP server is added to the vCO environment, now we need to configure the queue where the messages will be published by vCloud. It’s done with Subscribes.

- Run the Workflow Subscribe to queues


- Type a name for the Subscription and click Next
 - Click on Not Set to select the broker (AMQP Server) we created on the previous step

 - Click on Not Set to Add a queue

 
- Type the Queue name you add on RabbitMQ and click Insert Value
- Make sure the name is on the list and click Accept 


 
- Click Submit


Once you configure the AMQP server and Subscribed to the queue, we need a way to consume these messages on a regular basis. That's accomplished through the use of Policies.

Let’s create a Policy Template instead, that way you can reapply the Policies as much as you can.

- Go to Administer View click on policy templates tab and click add policy template



- Give it a name and click OK




- Click on add policy element



- Select the AMQP Subscription you just created, click OK



- Give it a name



- Click on ad trigger event



- Select OnMessage and click Select trigger



 - Search for the workflow you want to be executed  when a message arrives



- Select the desired Workflow and click Select
Obs: you can use the filter field to help your search



- On the Source parameter select not set



- Select Self and click Select



- Click Save and Close



Now that our Policy Template is created we just need to apply it.

- Right Click your new Policy Template and select Apply Policy



Under AMQP:Subscription, click on Not Set and browse for the subscription you just created.
Then click Submit



- You will be redirect to the Policies Tab, right click your new Policy and select Edit



- Change the field Startup to: On Server Startup, start the policy



- Save and close.

- Start your policy



Congratulations, it’s done !!!!
This policy will be listening to the AMQP queue and once a message arrives there, it will be consumed and the workflow you just set up on your policy will be executed.

Once every project/environment is unique and has it's own requirements, does not make sense to post here my workflow details, nevertheless I will post a screen of mine just in case you are curious about how it would looks like.




It’s up to you now !!!!!

No comments:

Post a Comment

Who am I

My photo
I’m an IT specialist with over 15 years of experience, working from IT infrastructure to management products, troubleshooting and project management skills from medium to large environments. Nowadays I'm working for VMware as a Consulting Architect, helping customers to embrace the Cloud Era and make them successfully on their journey. Despite the fact I'm a VMware employee these postings reflect my own opinion and do not represents VMware's position, strategies or opinions. Reach me at @dumeirell

Most Viewed Posts

Blog Archive