VMware Cloud Community
CloudAutoCraft
Enthusiast
Enthusiast

Common Components Catalog -- include new property

Hi all,

We are running vRA 6.1 with the Common Components Catalog handling Custom Hostname, IPAM, and Active Directory joins.  Everything is working well, but a new requirement has surfaced where we have to capture a new property in the vRA Catalog and feed that into the vCO workflow for IPAM.  The new property is intended to be added into the Comment field of the IPAM Record that gets created for the machine. 

We updated the vCO workflow and everything is working in that workflow.  When we run it in vCO, it prompts for the new property (along with all the pre-existing properties), and it works -- an IPAM record is created and the Comment field is updated properly.

We created a corresponding property in vRA (same name as the input parameter on the vCO workflow) and added it to the IPAM build profile.  However, when we submit a machine request, that property is not getting handed over from vRA to vCO.  Remarkably, the request does not fail, and the machine gets built, but the IPAM comment field does not reflect the new property is null. 

Hopefully that description paints the picture enough for one of you geniuses to comment on what we have missed?

Thanks in advance for the help / ideas...

8 Replies
SeanKohler
Expert
Expert


Not a genius, and sort of following you... maybe some of these questions will actually also lead you to your answer...

The machine blueprint is definitely using the "IPAM Build Profile"?

Property is a key and a value.  Are you saying the key is there but the value is blank?  Or the Key isn't present at all after provisioning?

Are you setting/taking the "value" for the property key in VCAC or trying to set it after in VCO?  Is it user prompt in VCAC?

Are you doing a Syslog of all the properties at the beginning of your Machine Build Master?  And is your property present... just with no value?

e.g.

if (vCACVmProperties != null) {

var log = "";

log += "vCAC VM properties :\n";

var array = new Array();

for each (var key in vCACVmProperties.keys) {

  array.push(key + " : " + vCACVmProperties.get(key));

}

array.sort();

for each (var line in array) {

  log += "\t" + line + "\n";

}

System.log(log);

}

http://www.rickyadams.com/joomla3/index.php/storage/2-uncategorised/15-vcac-vco-variables-exposure

SeanKohler
Expert
Expert


>>>When we run it in vCO, it prompts for the new property (along with all the pre-existing properties), and it works

Are you assigning the property key:value that gets handed over into the variable that you are using for this input prompt?  (which could be converted to an Attribute)

myPropertyInput = vCACVmProperties.get(key);

Reply
0 Kudos
CloudAutoCraft
Enthusiast
Enthusiast

SeanKohler

Thanks for the replies; your suggestions are helping us advance the ball.  However, due to the way that the CCC is wired in, we don't have all of the properties of the virtual machine that we're working with.  In fact, we only have the VMName (string) and NetworkName (string).  Currently, we are beating our heads on how to retrieve the property that we need from vRA. 

It seems that we first need to retrieve the VCACEntity for the VM, but we only have the VMName, not the ID.  It seems that all of the canned Actions in vCO are retrieving entities by ID, not name.

Got any tips on that?  Thanks again for the suggestions...

Reply
0 Kudos
SeanKohler
Expert
Expert

>>>It seems that we first need to retrieve the VCACEntity for the VM, but we only have the VMName, not the ID.  It seems that all of the canned Actions in vCO are retrieving entities by ID, not name.

Well... you can get it with the Name... and I can show you how to use the Entities Finder to get the Entity and then how to get the Properties, but I think that you are off course in general.

The Properties and the Entity are handed to you during all of the Stub runs if you followed the Extensibility setup.

Are you are calling out the machine stubs in VCO during provisioning?  http://www.vmtocloud.com/how-to-extend-vcac-with-vco-part-1-installation/

And you have taken the "workflow template" in the VCAC Extensibility folder, made yourself a copy called MyBuildMachine or something, and added the ID to your Blueprint as type ExternalWFStubs.BuildingMachine?

Let me see if I can turn my rudimentary knowledge into a walk through....

When you build a machine in vRA, it can call out vRO workflows (WFStubs found in the VCAC/Infrastructure Administration/Extensibility/Workflow stubs folder) that are setup to run OTHER custom workflows based on an ID of the workflow passed in as a Custom Property in the Blueprint.  Looking at the first one...

This gets run during every build and if the Custom Property is there with a workflow ID, it goes and runs that workflow...

Stubs1.jpg

... This workflow does some setup and then runs the Workflow runner... supplying the VCACVM...

Stub2.jpg

Stub3.jpg

And if we look at the template that it runs (well it would be a COPY of this template), one of the Inputs is the VirtualMachineProperties.  Also provided is the Enity and the VM object.

Stub4.jpg

So if you have a script at the beginning of this workflow (again a COPY of this workflow, because you want a copy for each Stub and some number of Blueprints if you want duplicates depending on the blueprint itself - we use one with logic), you can loop through and get all your properties and assign various ones into local variables you can use for whatever you need... including as INPUTS into another workflow that runs from within this workflow  (e.g. your IPAM updater)...

The script I noted above will list all of the properties using the vCACVmProperties variable in the workflow.

CloudAutoCraft
Enthusiast
Enthusiast

SeanKohler

Thank you again for the replies -- they did help us on the path to resolving this.  Admittedly, we're noobs at this and are lacking some knowledge.  In general, we like to follow the practice that you laid out in your last reply.  Unfortunately in this case, we can't do that due to how VMware PSO wired in these workflows.  The workflow is invoked by custom properties that are stamped onto the Build Profile.  Somehow, PSO configured our vRA to call the IPAM Provision vCO workflow in the "Provision Virtual Machine" state (more on this later) when the custom property "External.IPAM.Enabled" is set to True.  It also passes a limited number of properties into the vCO workflow (VMName, Network Name, IPAM Endpoint Name) -- the most basic properties that you need to register an IPAM record. 


In this example, vRA is not sending, nor is vCO receiving, the virtualMachineID or a vCAC:Entity.  Originally, we were trying to solve our problem by trying to figure out how to pass another property in, but we failed to find that.  We did, however, find an action in vCO that we could leverage to get a VM Entity by searching on Name, not ID.  That action allowed us to retrieve the property that we were trying to pass.  Problem Solved!

More about the Provision Virtual Machine state...  based on what I've read, this state is a "Master State" that includes Building Machine, Customize Machine, Customize OS, Customize Guest, and then Machine Provisioned.  I don't know how PSO has wired it into this Provision State.  Most of the workflows we wire in are in the Building Machine state.  I seem to recall hearing that Provision Machine is a "Private" state that only VMware can access.  I'm looking for a document that would confirm that.  So far, the best thing I've found is this blog post from sidsmith.  It would be nice to get a more comprehensive understanding of each of these states and how to access them. 


In any event, our problem is solved, and many thanks Sean for helping lead us down the path. 

Reply
0 Kudos
GrantOrchardVMw
Commander
Commander

Sounds like they may have used the CloudClient to achieve this. It exposes a few additional stubs that you don't see during the vRO registration process.

Grant

Grant http://grantorchard.com
Reply
0 Kudos
SeanKohler
Expert
Expert


Well... for what little help I actually provided, I am glad you got it figured out.

I would recommend that you review the earlier link I provided very thoroughly: http://www.vmtocloud.com/how-to-extend-vcac-with-vco-part-1-installation/

There are also other examples and information on the subject available through google search.

It sounds like PSO built out your environment using the older Design Center method?  I would highly recommend you move toward the vRO extensibility method if you can someday.  I think this method is the forward moving method and fits in better with where they are taking the product.  (but it wouldn't be the first time a company changed directions on us) If you have ASD, you will see what I mean... and I have seen some early previews for 7, and to me it has every appearance of moving closer to vRO.

But... In the end, I am just some dude out there doing my best to follow along.  So who knows...  Smiley Happy

Reply
0 Kudos
CloudAutoCraft
Enthusiast
Enthusiast

GrantOrchardVMware

Thanks for the reply Grant.  Do you have a document / link that you can share that discusses these additional stubs?  Or, can you provide some quick information on this?  I've toyed with the CloudClient and haven't seen anything like what you mentioned.  Thanks in advance!

Reply
0 Kudos