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 !!!!!

Tuesday, November 12, 2013

Enabling notification on vCloud Director


Today we will cover the easier step on this whole solution
Enabling notifications on  VMware vCloud Director.

When this configuration is enabled, vCloud will send notification of every task executed on it’s environment; creation of Orgs, VMs, vApps, Networks, customization of VMs....
 you got it, right ?!?! it will send notification about EVERYTHING.

On the last post we already configured RabbitMQ to intercept the notifications about VMs creation, therefore it’s just a matter of enabling vCloud to start sending them.

Log on vCloud Portal
Click on Administration

Click on Extensibility

Click on Enable Notifications
Fill the information about AMQP Hostname, Exchange, user and password


Click Test AMQP Connection to make sure it’s all right.

That’s all you need, from now on vCloud will send notification to the AMQP queue.

Since it’s a piece of cake, I will give you guys a bonus !!!!

But remember, It’s not related to the solution I’ve been discussing here.

It’s not unusual that some kind of approvals be required in cloud solutions.
With this in mind let’s see how a request can be paused until some administration approve or reject it.

The process is the same; configure RabbitMQ queues and enable vCloud notification plus the configuration of vCloud’s Blocking Tasks.

Blocking Tasks are notifications about specific actions which are suspended until a system administrator or an automated system  (you need to create it) acts on them, lets take an example of VM’s creation, it can be automatically approved and provisioned unless someone request a 8 vCPUs VM, in this case an approval will be send to the system administrator to approve or reject it.

Once the Notifications has been set up, click on Blocking Tasks


Browse to the list of actions and enable the action you want to block when performed by your users.
It's done.

How easier could it be ?!?!?

Who am I

My photo
I’m and IT specialist with over 15 years of experience, working from IT infraestructure to management products, troubleshooting and project management skills from medium to large environments. Nowadays I'm working for VMware as a Senior Consultant, helping customers to embrace the Cloud Era and make them succefully on this journay. Despite the fact I'm a VMware employee these postings reflect my own opnion and do not represents VMware's position, strategies or opinios.

Most Viewed Posts

Blog Archive