VMware Cloud Community
vrtualUser13
Contributor
Contributor

Set value of a property same as other property in property dictionary

Hi,

I need help in vRA property dictionary. Is there a way to set value of a property same as other property in  property dictionary?

Say from user we have input a value which is set in "VirtualMachine.Network0.Name" (via dropdown) while blueprint request.

Now i want value of "VirtualMachine.Network0.Name" to be set in say "VirtualMachine.Network0.Profile"

VirtualMachine.Network0.Name="VM network"

VirtualMachine.Network0.Profile=VirtualMachine.Network0.Name (something like this)


Thanks.

0 Kudos
3 Replies
zebduin
Enthusiast
Enthusiast

If I understand what you are trying to accomplish, you might be able to achieve your results with the following:

1. Set both VirtualMachine.Network0.Name (set to prompt user) & VirtualMachine.Network0.ProfileName (prompt user remains unchecked) in a build profile, enable build profile on the blueprint

2. in the property dictionary, add a property definition VirtualMachine.Network0.Name, control type = drop down list (sounds like you have done this)

     a. define a property attribute Value List (these will be your parent values.

3. in the property dictionary, add a property definition VirtualMachine.Network0.ProfileName, control type = DropDownList

     a. define a property attribute = Relationship - set the value to VirtualMachine.Network0.Name (parent value)

     b. define a property attribute = Value Expression - this is where you can set the value of VirtualMachine.Network0.ProfileName = VirtualMachine.Network0.Name


The XML expression will look something like this:

pastedImage_4.png

Which is basically saying that is the VM Network was selected from the VirtualMachine.Network0.Name drop down, then set the value of VirtualMachine.Network0.ProfileName also to VM Network.  And since you are not prompting the user for VirtualMachine.Network0.ProfileName, they will not see duplicate entries

vrtualUser13
Contributor
Contributor

Thanks for your input. I tried the same as you have suggested, but the value of "VirtualMachine.Network0.ProfileName" is always empty(with out user prompt).

If I set user prompt, then I can see the proper value in the drop down for "VirtualMachine.Network0.ProfileName".

Please let me know if I might have missed something.

Thanks

0 Kudos
zebduin
Enthusiast
Enthusiast

yeah...it was late when I posted that. The relationship attribute with XML Expression is used to build a "dynamic"drop-down list.  I assumed that if you had one value listed that it would default the value to the single option.

normally I used vRO to update custom property values during buildingMachine WFStub.  However there is a catch with the network profile, while vRO sets the value to the custom property correctly, for network profiles, those settings are applied prior to building machine.

you can prompt the user for the second value and limit choices based on the drop-down values provided by the XML expression, but it would be redundant. 

0 Kudos