Using vCenter Orchestrator with RabbitMQ and vCloud Director – Part 5

Overview

In this post we will create the workflow that will run when vCD sends a message to the AMQP server.  At the end we will see the data that vCloud passes to the workflow.  We will simply print out some of this data, but this info can be used in many ways.  For example, it could be used for a provisioning process that performs various tasks such as creating a computer object in AD, creating an IP/DNS entry, registering the VM in a configuration management tool, etc.  This is what we do in our private cloud.  Users log into vCloud Director, select their VM and from there vCO talks to all the necessary components to get the VM ready for the user.

Configuring the Workflow Runner Workflow

From anywhere within the vCO client, right-click a folder and select New workflow:

2014-10-21_19-37-02

Provide the workflow a name:

2014-10-21_19-40-39

After you press OK, you’ll be on the Inputs page.

  1. Select the new parameter icon (right-arrow with plus sign)
  2. Select arg_in_0
  3. Enter organization
  4. Press OK

2014-10-21_19-38-03

Now we need to set the object type of our organization attribute.

  1. Select string
  2. Enter organization
  3. Select vCloud:Organization
  4. Press Accept

2014-10-21_19-43-47

Repeat for the vapp, user and blockingTask attributes.  It should look like this:

2014-10-21_21-00-15

Select the Schema tab and drag a Scriptable task object from the Generic group onto the blue line between the Start and End elements:

2014-10-21_20-32-25

Select the IN tab and select organization, vapp, blockingTask and user:

2014-10-21_21-00-37

Click on the Scripting tab and enter the following in the scripting field:

2014-10-21_21-04-33

You should be able to press Save and close and not receive any errors.

Now we can configure the Workflow runner workflow to call the workflow we just created.  You can easily find the workflow by:

  1. Entering Workflow runner in the search box in the upper-right corner of the vCO client.
  2. Select the highlighted workflow
  3. Select Go to selection
  4. Select Close

2014-10-21_20-37-53

Edit the workflow and on the General tab under attributes we want to set vcdHost and wf.  Here we can see that they are both not set:

2014-10-21_20-48-41

Select Not set for the vcdHost attribute then

  1. Double-click vCloud Director to expand it.
  2. Select your vCloud Director host.  Mine is vcd55.vmware.local
  3. Press Select

2014-10-21_20-50-39

Select Not set for the wf attribute then

  1. Enter the name of our test workflow.
  2. Select it
  3. Press Select

2014-10-21_20-52-31

It should look like this:

2014-10-21_20-43-22

We need to make a quick change to make sure the vcdHost and wf attributes get passed correctly.  I’m not sure why this needs to be done.

  1. Click the Schema tab.
  2. Select the Retrieve message object.
  3. Select the Out tab.
  4. Select both the vcdHost and wf parameters and delete them.

It should look like this:

2014-10-21_20-55-24

 

You can now save and close.

Back to vCloud Director

If we’ve done everything correctly up to this point and we start a vApp in vCloud Director, the Workflow runner workflow should run and then start our vcd Test workflow.  Here we can see see that the Workflow runner workflow ran successfully.  You can also see some data is was able to parse from the blocking task:

2014-10-21_21-08-12

We can see the same thing with the vcd Test worflow that we ran.   We simply display a few attributes and resume the blocking task, which tells vCloud Director that it can continue with starting the vApp:

2014-10-21_21-09-39

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