Define a relationship so that the value of a parent property determines the child property values that are available in a drop-down list.

In this example, a new VirtualMachine.Network.Environment property filters available network options based on the machine environment. The VirtualMachine.Network.Environment property acts as a filter for the networks that a user can select when confirming a machine request. An associated child property, VirtualMachine.Network0.Name, is also created and a relationship is formed between the two properties. The user must first select the environment before selecting from the list of networks that are applicable to the selected environment.

Relationship Between VirtualMachine.Network.Environment Property and VirtualMachine.Network0.Name Property Menu Options

Values for the VirtualMachine.Network.Environment Property (parent)

Values for the VirtualMachine.Network0.Name Property (child)

Development

Development Network

Test

Test Network 1 Test Network 2

Production

Production Network Failover Network

You use the following workflow to create the relationship and add the properties to the blueprint.

1

Create the parent and child property definitions.

2

Add a Relationship attribute to the child property whose value is the name of the parent property.

3

Create a value expression that describes which values to display in the child drop-down list for each value of the parent property.

4

Add the value expression as an attribute of the child property.

5

Add both properties to a blueprint or build profile.

The following example is a logical progression from the following topics.

Add a Property Definition

Add a Relationship Attribute

Add a Value List Attribute

Add a Value Expression Attribute

Instead of specifying a ValueList attribute for the child property, you can use an XML string in a ValueExpression attribute to specify the mapping between the values of the parent property and the possible values of the child property.

This example uses the ValueList, ValueExpression, and Relationship property attributes with the DropDownList property definition control type.

1

Log in to vCloud Automation Center as a tenant administrator.

2

Select Infrastructure > Blueprints > Property Dictionary.

3

Create the parent property.

a

Click New Property Definition on the Property Dictionary page.

b

Type VirtualMachine.Network.Environment in the Name text box.

c

Type Environment in the Display Name text box.

d

Select DropDownList from the Control Type drop-down menu.

e

Select the Required check box to make the property required at request time.

f

Click Save.

4

Define the values for the parent property.

a

In the VirtualMachine.Network.Environment property name row, click Edit in the Property Attributes column.

b

Click New Property Attribute.

c

Select ValueList from the Type drop-down menu.

d

Type Values in the Name text box.

e

Type Development,Test,Production in the Value text box.

f

Click Save.

g

Click OK.

5

Create the child property.

a

Click New Property Definition on the Property Dictionary page.

b

Type VirtualMachine.Network0.Name in the Name text box.

c

Type Select Network in the Display Name text box.

d

Select DropDownList from the Control Type drop-down menu.

e

Click Save.

6

Define the relationship between the child and parent properties.

a

In the VirtualMachine.Network0.Name property name row, click Edit in the Property Attributes column.

b

Click New Property Attribute.

c

Select Relationship from the Type drop-down menu.

d

Type Parent in the Name text box.

e

Type VirtualMachine.Network.Environment in the Value text box.

f

Click Save and click OK.

7

In an XML editor, create the following value expression, which specifies the values of the child property based on the values of the parent property, and save it as an XML file:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<ArrayOfPropertyValue xmlns:xsi=
	"http://www.w3.org/2001/XMLSchema-instance">
<PropertyValue>
		<FilterName>VirtualMachine.Network.Environment</FilterName>
		<FilterValue>Development</FilterValue>
		  <Value>Development Network</Value>
	</PropertyValue>
	<PropertyValue>
		<FilterName>VirtualMachine.Network.Environment</FilterName>
		<FilterValue>Test</FilterValue>
		  <Value>Test Network 1</Value>
	</PropertyValue>
	<PropertyValue>
		<FilterName>VirtualMachine.Network.Environment</FilterName>
		<FilterValue>Test</FilterValue>
		  <Value>Test Network 2</Value>
	</PropertyValue>
	<PropertyValue>
		<FilterName>VirtualMachine.Network.Environment</FilterName>
		<FilterValue>Production</FilterValue>
		  <Value>Production Network</Value>
	</PropertyValue>
	<PropertyValue>
		<FilterName>VirtualMachine.Network.Environment</FilterName>
		<FilterValue>Production</FilterValue>
		  <Value>Failover Network</Value>
	</PropertyValue>
</ArrayOfPropertyValue>
8

Add the value expression, specifically the XML file content, that you just created to the child property.

a

In a text editor, format the value expression so that it is a single line string with no line breaks.

b

In the VirtualMachine.Network0.Name property name row, click Edit in the Property Attributes column.

c

Click New Property Attribute.

d

Select ValueExpression from the Type drop-down menu.

e

Type Expression in the Name text box.

f

Copy the value expression from the text editor and paste it into the Value text box.

g

Click Save and click OK.

9

Add both properties to a blueprint.

a

Create a new blueprint or edit an existing blueprint.

b

Click the Properties tab on the blueprint page.

c

Click New Property.

d

Type VirtualMachine.Network.Environment in the Name text box. This name must be an exact character match for the property name you created for the parent property in this example.

e

Leave the Value text box blank.

10

Select the Prompt User check box.

11

Click OK.

12

Click New Property.

13

Type VirtualMachine.Network0.Name in the Name text box.

14

Click OK.

When a user uses this blueprint to request a machine, the Environment and Select Network drop-down menus now appear on the Confirm Machine Request page and are initially empty. The user can select an environment, which then narrows the list of networks that they can select for the machine that they are requesting.