Advanced Services in vRA: Custom Service

Great, so you've installed vCAC and you've been around the block provisioning IaaS. Easy as pie, right? So now, you're probably looking for a way to expose advanced services.

It's worth noting, at this point, that you WILL require at least Advanced edition of vCAC. Standard Edition (not sold separately, but can be purchased as part of the vCloud Suite at the time of this writing) does not expose the ability configure and author advanced services.

So, if your company is using Advanced or Enterprise, then we're cooking with gas, and you can easily follow this post to set up an advanced service or two.

See here if you don't see the Advanced Services tab and want to enable it.

Typically, companies tend to use the Advanced Services capabilities of vCAC to expose a service that automates a particular task which is unrelated to infrastructure per se.
Such a task might provision an Exchange Mailbox (for developers) or even provision a SIP Account for VoiP customers.

For the purposes of this example, I'm going to walk you through 2 Advanced Services.

The first (This part: Part One) involves the SQL Plugin, and deletes log entries in a table on a Dev Database. The second (Part Two) creates an Active Directory user, aimed at Developers who frequently require this type of option, providing a level of autonomy that allows a Dev to create a test user in AD at 2 AM, without requiring a System Admin to do this, but also not exposing the entire environment to the developer.

A little more about Advanced Services and XaaS

What is Xaas? It means "anything" or x as a Service.
What's significant about it? We have IaaS (Infrastructure as a Service), DaaS (Desktops as a Service), DBaaS (Databases as a Service) and VaaS (Voice as a Service) and so forth...

There's no reason we can't have almost "anything" as a service, and that's where vCAC comes in. vCAC allows one to expose vCO workflows as a service. Whatever those workflows do is what vCAC can expose to end users...

Take a look at this catalog, and see what I mean:

XaaS in the making - Not just IaaS (Infrastructure) but Networks as a Service, Storage, Developer Services etc...

Now onto the the meaty bits that allow us to create our first Advanced Service. This particular service (highlighted in the image above) allows a Sys Admin or Developer to delete log entries from a table before a specific date. This is just to showcase the use of the ASD and SQL Plugin, but such services might well be useful for Developers / DBAs etc.

In this example, I have created a Database on a SQL Server, and a simple table with test data in it. This is the table we will working with, and you can refer back to this image at the end to see which rows were deleted, after running the same query:

The table we'll be deleting from for this example

The first step to achieve anything worth while is to create our vCO (vCenter Orchestrator) workflow.  For this, I have created a test folder in vCO and created my first workflow called "Delete Log Entries".

First Dev Workflow "Delete Log Entries"

This simply makes use of the SQL Plugin "Execute a custom query", which requires configuring the database connection first within vCO. I feel that this is beyond the scope of this post, and there is a ton of information out there on how to do this, so I'll move on.

Workflow: Delete Application Logs

In the image above, the required inputs on the SQL Workflow are the query and the database against which to run this query. To facade the exposure of the Database to anyone requesting the service (and to ensure people only delete logs from this particular Database), I have set it already to my VirtualNebula Database on my SQL Server.

The "Set Script" task beforehand is a scripted task, which simply sets the Query as follows:

Setting the simple delete query against our Database...

Note the predefined variables "query" and "MaxDate". These are inputs and attributes on our workflow as follows:

Inputs for the workflow (MaxDate)

Attributes for the workflow - we will set the query internally based on the MaxDate as depicted above

After setting the query, the vCO simply executes it against the configured DB and voila.

Now, we our simple-as-ever workflow is complete, we can expose this as a service in vCAC as follows:

We need to create our new Advanced Service by navigating to the "Advanced Services" tab, then selecting "Service Blueprints", and adding a new one here.

Click the green "plus" icon to add a new service

Next, we simply browse through the vCO folder structure, and select the workflow we just created. vCAC automagically reads the inputs and outputs and displays them:

Add a new Service Blueprint by browsing through the vCO folder structure for your workflow

Next up, the basics:

Enter a name and Description

Next, we modify the form to be friendlier and replace "MaxDate" with "Delete all logs before date:". Note: this is the famous Advanced Services Designer in action. Here, we can actually drag on additional fields, including Date Controls and Text Areas etc. We're designing a web form on a web form ;-)

Create the form using the ASD

Once we're done with the Designer, it's simply a matter of publishing our new service.

Publish your newly created service before moving on

Next up, we need to navigate to our Services in our Catalog and assign this new Advanced Service to a parent, and manage entitlements, so that it's visible to the right people. This is the step where you would define groups that are allowed to access this service, such as Developers or Testers. So, let's go ahead and Configure our newly created service. Note that in the screen below, our new service has no parent Service assigned to it yet.

Assign a parent Service to our new Service

Assign the "Developer Services" Parent Service to our new Advanced Service

Next, we need to manage Entitlements as follows - Go to "Entitlements", select the Entitlement Group you created (or create one) and, under the "Items & Approvals" tab, add this Catalog Item:

Go to "Entitlements", select the Entitlement Group you created (or create one) and add this Catalog Item.

Next, your result should be something like this:

Our new Advanced Service

The first step when we consume this service is to: enter a Description and a Reason for the request

To prove the concept, we'll enter a date of 05 September, 2013. This means we want to delete all log entries prior to this date.

Note the date

Our request was successful

And, the result (look further up on this post for the "before" state)!

The result: All rows prior to the date we entered were deleted!

Hope you enjoyed this post and that it helps clarify the concepts.

Read Part 2 here...