VMware Cloud Community
chrisheartland
Enthusiast
Enthusiast

Help with vCAC extensibility and vCO

I'm trying to create a vcac/vco tandem workflow to change the name of the machine during initial build.

To do so, I've set the wfstubbuildingmachine to run after a user submits a request. I have it tied into a vCO workflow called "Generate server name." The workflow is pretty simple. It consists of the following:

in: vcacvVM(vcac:entity)

out: serverName (string)

The code is:

var domainName (this is just a custom property I created in the blueprint) = vcacVM.getProperty("Custom.Domain");

System.debug("Found domain: " + domainName);

serverName = domainName;

When this runs the out put is "Found domain: null". I have tried multiple variations of the "getProperty" (i.e. .get,, .getProperties) and nothing works. Any ideas?

13 Replies
chrisheartland
Enthusiast
Enthusiast

I got around this by adding in: vCACVmProperties (Properties) and changing my code to vCACVmProperties.get("Custom.Domain");

That worked. Now the question I have is, what is the property name for changing machine name when I run the "create / update property on virtual machine identity"? So far I've tried VirtualMachineName and VirtualMachine.Admin.Name. Neither worked.

0 Kudos
qc4vmware
Virtuoso
Virtuoso

the property is just "hostname"

0 Kudos
chrisheartland
Enthusiast
Enthusiast

Ok thanks. I'm still getting an error that the object is null. Is it possible to change property "Hostname" with workflow 'create / update property on virtual machine identity"? I was reading that this WF updates custom properties. Is there another workflow I need to run to update system properties like machine name/hostname?

0 Kudos
qc4vmware
Virtuoso
Virtuoso

Have you tried just setting the attribute of the object to the name you are grabbing?  vCACVm.virtualMachineName = whateveryournewnameis ?  I am relatively new myself to the vCAC constructs but I think that might work.  You can also add a property to the property dictionary for hostname and present that on your form and make it a mandatory entry.

Paul

0 Kudos
stvkpln
Virtuoso
Virtuoso

Ok, so I just had to do this last week, so it's fresh in my mind! Keep in mind, you want to do this during the BuildingMachine state, or you're going to have all sorts of issues you don't want to deal with... but, this is what I did:

1) Make sure you have the vCAC Entity for the VM

2) Update the custom property hostname with whatever value you want using the action addUpdatePropertyFromVirtualMachineEntity (as Paul indicated above). Easy peasy, right?

3) Create a new scriptable task that has an input of value used for the hostname custom property, and an output value going to a property attribute (call it whatever you want).. (or you can make this into an action once you've tested). What needs to be in the property is this: <property attribute> = { "VirtualMachineName":<hostname value> }

4) Embed the workflow Update a vCAC model entity in after the scriptable task. The only attributes you need to bring in are the vCAC Entity and the Proprerty

That should be it. As long as you do this during the BuildingMachine, you won't have any funky weirdness between IaaS and CAFE.

-Steve
vSeanClark
Enthusiast
Enthusiast

Steve,

You mention "The only attributes you need to bring in are the vCAC Entity and the Proprerty."...   But when I embed the "Update a vCAC model entity", I have two inputs that I'm not sure how to address.  They are: "links" and "headers", both are properties.  And both end up with NULL value when called during the BuildingMachine workflow stub.  vCO is throwing an error that says "Properties for update cannot be null."

Any thoughts on how those input parameters should be bound for the Update a vCAC model entity workflow?

Thanks,

Sean

Sean Clark - http://twitter.com/vseanclark
0 Kudos
stvkpln
Virtuoso
Virtuoso

The only thing I map is the vCAC VM's entity and the property for the name to inputProperties... Leave links and headers mapped to null. Haven't had an issue correcting names.

-Steve
0 Kudos
chrisheartland
Enthusiast
Enthusiast

I just created a links and headers attribute and that'sit. That should work. You don't need to tie it to anything. It's a built in "input" but just needs you to give it a name.

http://http://i.imgur.com/U5yKo0d.jpg

0 Kudos
stvkpln
Virtuoso
Virtuoso

I looked at my inputs... I skipped both of them (i.e. set to null). Works fine on vCO 5.5.2.1 and the 6.1 plugin.

-Steve
0 Kudos
vSeanClark
Enthusiast
Enthusiast

Thanks, guys. That helped.  The workflow executed successfully.  But the provisioning failed after with "vCenter Orchestrator workflow WFStubBuildingMachine failed with error: Error executing vCenter Orchestrator workflow: Unable to serialize object of class : ch.dunes.vso.sdk.SDKTypeConvertor_server$1.."

So, being that is Friday.  I'm off to beer:30.  Thanks again. 

Sean Clark - http://twitter.com/vseanclark
0 Kudos
JaseMachado
Contributor
Contributor

Did anyone find a solution to this error:

vCenter Orchestrator workflow WFStubBuildingMachine failed with error: Error executing vCenter Orchestrator workflow: Unable to serialize object of class : ch.dunes.vso.sdk.SDKTypeConvertor_server$1..

I'm getting the same thing in vCAC logs. I provision a Windows VM and have the building machine stub set to create an AD computer object in a specific OU.

When I deploy the blueprint everything works fine, the vCO flow is run and the AD object is created. But because vCAC is not happy (with this error code), it moves the VM to disposing stub.

Anybody have any ideas on this vCAC<->vCO error?

0 Kudos
stvkpln
Virtuoso
Virtuoso

That error is being generated by vCO.... Have you confirmed that the stub workflow you're calling runs successfully and you have the requisite inputs being properly configured to achieve the desired outcome from the stub?

-Steve
0 Kudos
MichaelRoss
Contributor
Contributor

I have been working through this error in my lab.   I found in my case it had nothing to do with the way the workflow was setup.   It ended up being an incompatible version of the vCAC plugin for vCO.   I updated my vCO appliance to the latest version (6.0.2) and the plugin to 6.2.1 to match the version of vRA I have installed and voila!   The error went away and I was successfully able to process the workflow and get my custom names.   Hope this helps someone else who is searching for the solution to this error.

-Mike

0 Kudos