VCO Workflows from vCAC Workflows (Southbound)
I recently blogged about Powershell integration with vCAC and how easy scripts can be called from within the various machine states, see here for details. This post will provide an overview of VCAC/VCO Integration of a similar tract.
VCO is an awesome companion with vCAC, VCO has many out of the box plugins and workflows that can be simple to use & test all within the VCO design canvas. When a workflow has been created within VCO it can be easily integrated into the machine lifecycle.
This example will show you how to setup VCO Integration within VCAC, and then create & run a simple workflow in both VCO and vCAC. The following is the (very simple) functional overview of this sample:
1) Create a new Workflow in VCO which takes an input username as a workflow argument
2) A workflow output argument will be created and set with a user CostCenter being the result.
3) A vCAC State Workflow will run in the Building Machine State and call out to VCO and execute the workflow, wait and store the result as a local vCAC workflow variable.
4) The vCAC Workflow will then save the result to a machine custom property.
All workflows in this post can be downloaded
Setup VCO Integration with vCAC
![]() |
Create New Endpoint |
![]() |
Select New Endpoint, then vCO.
|
![]() |
Configure name add Address which is the location of the VCO API (Default port is 8281) |
![]() |
Create Credentials |
![]() |
Select New Credential |
![]() |
vCO endpoints must have a property to indicate the priority of each endpoint. Click New Property & create property with the name VMware.VCenterOrchestrator.Priority and a value that is greater than 0 |
![]() |
Click Ok to save endpop |
|
Create a new vCO Workflow
- Create a new workflow called GetCostCenteryUser
- Create input workflow argument:
- Name: User
- Type: string
- Create output workflow argument:
- Name: costcenter
- Type: string
- Within the schema you can add logic, this can be to interact with a 3rd party database, webservice etc. As a test we will just return “CC1” and store it in the costcenter workflow output argument:
- Create a new scripting task.
- Add this within the scripting tab of the new script task:
- CostCenter=”CC1″
Create a new vCAC Workflow
VCO Setup
If however you are using the CDK vCAC Workflow Designer there will be some initial steps required to set this up.
The details on creating the workflow are as follows:
- Create a Pre-BuildingMachine workflow, meaning the VCO workflow will run prior to the machine being created.
- Set this to run if a custom property called “User.CostCenter.Name”
- In order to get a machines owner details (we will get the whole machine including some extra properties, we can query the VirtualMachineExts table):
- Create a variable calle Machine of Type “VirtualMachineExts”
- Drag an Assign activity into the Custom Code area of the worklow:
- Assign variable name = “Machine”
- Assign variable value = “mgmtCtx.VirtualMachineExts.Where(Function (v) v.VirtualMachineId = VirtualMachineId).FirstOrDefault()”
- Add the VCO Activity “InvokeVCOWorkflow”:
- Choose our newly created workflow called “GetCostCenterByUser”
- A list of input workflow arguments will be presented, add the user value : “Machine.UserName”
- Output workflow parameters will also be displayed, these can be bound to local variables. Create a variable:
- Name = costCenter
- Type = string
- Assign the VCO Activity costcentre to vcac variable costCenter
- Using the Out of the Box vCAC Activities drag the SetMachineProperty activity into the workflow:
- Machine Id=VirtualMachineId
- Property Name=”User.CostCenter.Name”
- Property Value = costCenter
Configuration
- Deploy the workflow and any associated XML files as normal
- Update a blueprint with the custom property:
- “User.CostCenter.Name” and the value can be left blank.
March 13, 2013 at 4:58 pm
Hi Tom, nice article. In my case I had to add the value “Machine.VirtualMachineId” to the VirtualMachineId property of the InvokeVcoWorkflow activity to be able to run it successfully.
LikeLike
March 13, 2013 at 5:01 pm
Sure, all depends on where the VirtualMachine object came from, in the case of a State Transition workflow, VirtualMachineId is an incoming workflow argument.
LikeLike
April 5, 2013 at 6:35 pm
This comment has been removed by the author.
LikeLike
April 5, 2013 at 6:36 pm
Hi Tom, I get an exception when trying to select the vCO workflow in the InvokeVCOWorkflow activity within Visual Studio (2010 SP1): vCO endpoint priority is not configured correctly. The vCO server is using LDAP (tested logon), and the endpoint is configured with the VMware.VCenterOrchestrator.Priority set to 1 as in this article (in fact it doesn't let you save the endpoint without this property set). Any ideas?
LikeLike
April 12, 2013 at 12:28 pm
Did you follow the Visual Studio setup instructions: http://clearascloud.blogspot.co.uk/2013/03/setting-up-vco-integration-with-vcac.html
LikeLike
April 24, 2013 at 1:53 am
Hi Tom, I followed your setup instructions however I'm unable to browse vCO workflows. Visual Studio loads ok and I can see the appropriate DynamicOps reference DLLs (same as the screen shot). There was an existing appSettings key with a different value pair defined in devenv.exe.config, so I'm able to place the repositoryAddress setting in the right spot within the config file.
One note, per the instructions above the appSettings config refers to “Key” and “Value”, however the devenv.exe.config attribute names are case sensitive and these must be in lower case. If I enter them with the first character in upper case I get the error “Unrecognized attribute 'Key'” versus the endpoint priority error when attempting to select a workflow from the InvokeVcoWorkflow control.
The vCAC Designer is installed on the same machine and works fine using the InvokeVcoWorkflow (able to browse workflows). I've also verified the repository address using LINQPad.
LikeLike
June 17, 2013 at 6:38 pm
A reliable workflow software will indeed help businesses reduce costs, increase speed, and improve overall efficiency! That's why I have presented a Healthcare Workflow system to my healthcare staff to ensure that our patients get better quality of care. Could this software also help achieve this as well?
LikeLike