pages

Monday, July 1, 2013

vCAC - What if you need vCO on every blueprint?

Based on my blog posts you know already how to interact with vCenter Orchestrator from a vCloud Automation Center blueprint. When you use this interaction there will be the day when you ask yourself: "How can  i use different workflows with the same stub?".

To be honest, it looked to me as there is only one external call possible at the "ExternalWFStubs.MachineProvisioned" stub, but what if i can create another stub based on this provisioning state? Something like "ExternalWFStubs.MyMachineStateEqualMachineProvisioned"? Heureka!

Here is how:

First you have to install the CDK plug-in for Visual Studio. This enables the vCAC workflow generator and allows you to generate a "StateChange" workflow with your own stub name.













I named my workflow: "MyShinyWorkflow" and this is shown as naming in the solution explorer.











Now you can build everything you want in Visual Studio... or you can upload the empty workflow in your vCAC like described in the .txt file (just open the solution in a windows explorer and copy the files).


Cloudutil Workflow-Install -f MyShinyWorkflow.xaml -n MyShinyWorkflow














Don´t forget to copy the .xml file to the /xmldb folder in your vCAC file location. After that you are able to "design" your workflow in the vCAC Design Center.

















With this new workflow you can set a custom property for example (keep in mind that this is only a simple one)














Now you can upload the workflow it will set a new custom property when the workflow is called.














Just add your stub (mine is named: ExternalWFStubs.MyMachineStateEqualMachineProvisioned) to the blueprint you want to enhance.












After the machine is requested the custom property is set once the "MachineProvisioned" stated is reached.











Now you have the power!