VMware Cloud Community
JakeP
Enthusiast
Enthusiast
Jump to solution

Default value when using relationships between properties?

I'm trying to figure out if when using relationships between custom properties in vCAC if there is a way to select a default value in the second property based on the selection in the first. For example, if I have a custom property called Environment with selectable values like Dev, Test, Stage and then create a relationship on another property like CustSpec ( to use a specific customization specification for that environment) can I have it add a default value to the CustSpec property without the user having to select it? I have created an XML file as described in the documentation and applied it as a ValueExpression on the CustSpec property; it works great if I manually select the available CustSpec value based of selection of my Environment property, but there isn't a default value and for something with a single option that the user doesn't care about, I'd like it to just apply that value to the property.

Here is a short example of the XML:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>

<ArrayOfPropertyValue xmlns:xsi=

"http://www.w3.org/2001/XMLSchema-instance">

<PropertyValue>

<FilterName>Environment</FilterName>

<FilterValue>Development</FilterValue>

<Value>CustSpecName</Value>

</PropertyValue>

</ArrayOfPropertyValue>

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
SkyCoop
VMware Employee
VMware Employee
Jump to solution

The relationships require you to select the child value, even if there is only one option. There was a time in 5.2 with the optional web portal you could install, that would select the child if there was one present, but that has gone away. What I would do is use a vRO workflow in the building machine state and have it set the CustSpec value based on the property that drives the value of the others and pass that back to vRA. It is a pretty easy operation and a good opportunity to play with vRA -> vRO if you haven't done anything with it before.

I wrote a blog post on how to update a property in vRO and pass it back to vRA, there is a follow-on post that has a more complex update that allows you to have a generic blueprint that updates the cloneFrom and cloneSpec properties based on what OS is selected.

http://www.realize.net/2014/10/vcac-6-1-update-custom-properties-vco/

View solution in original post

0 Kudos
5 Replies
SeanKohler
Expert
Expert
Jump to solution

I don't have an answer at the moment... but I am going to try to get this working also and will update here if I get it.

There isn't a lot of dynamic capability in the standard blueprint forms (that I have been able to work out). There is a lot better capability in ASD, but we also need the capability in the standard blueprints.

Hopefully somebody has an answer to help both of us along.


0 Kudos
JamesMW
Enthusiast
Enthusiast
Jump to solution

Ive wasted more time on this then i care to think about.

If someone finds a solution to this, I would love it.

0 Kudos
SkyCoop
VMware Employee
VMware Employee
Jump to solution

The relationships require you to select the child value, even if there is only one option. There was a time in 5.2 with the optional web portal you could install, that would select the child if there was one present, but that has gone away. What I would do is use a vRO workflow in the building machine state and have it set the CustSpec value based on the property that drives the value of the others and pass that back to vRA. It is a pretty easy operation and a good opportunity to play with vRA -> vRO if you haven't done anything with it before.

I wrote a blog post on how to update a property in vRO and pass it back to vRA, there is a follow-on post that has a more complex update that allows you to have a generic blueprint that updates the cloneFrom and cloneSpec properties based on what OS is selected.

http://www.realize.net/2014/10/vcac-6-1-update-custom-properties-vco/

0 Kudos
JakeP
Enthusiast
Enthusiast
Jump to solution

SkyCoop,


Thanks for the information, I'm glad to have a definitive answer. Using vRO was actually my first plan as I've done similar actions with custom host naming; but then figured I'd try to make use of the built-in relationships since it seemed like a logical fit in this scenario. I'll check out your blog, I'm always looking for tips and tricks.

Thanks again,

Jake

0 Kudos
SeanKohler
Expert
Expert
Jump to solution

Thanks Sky.

"I’ve tried doing this multiple ways within the context of the script but couldn’t get the type to match properly – (let me know if you know how to do this)."

isFalse = false;  //javascript boolean value

But binding it is a fine way to go... there really isn't a specific reason to set it in the script

Hope everything is going well! I have it on good authority that you are missed. Especially if you are buying lunch! Smiley Happy

0 Kudos