vCAC 6 Property Dictionary Relationship


Note: If you are looking for how use Property Dictionary Relationship in vRA 7.0, then you want to look at my updated article at: vRealize Automation 7 Property Dictionary Relationship, though if you are looking for vRA 6.0, then please keep reading below.

Property Dictionary Relationship in vCAC 6 allow you to build a relationship between the different drop down menu boxes provided to your End User for input. This provide a more elegant and flexible solution when it come to user input in the vCAC request form. It will help you provide the user with only the valid choices rather than provide them with every choice in the list. Let’s take an example.

vCAC Property Dictionary Relationship

The above diagram demonstrate a vCAC request form with three drop down menus into it for Location, Storage, & Network. Let’s assume you have the following list of items for each list as below:

Location Storage Network
Toronto Toronto_T1 Toronto_Prod_PG01
Toronto_T2 Toronto_Prod_PG02
Toronto_T3 Toronto_DMZ_PG01
Boston Boston_T1 Boston_Prod_PG01
Boston_T2 Boston_Prod_PG02
Boston_T3 Boston_DMZ_PG01
Paris Paris_T1 Paris_Prod_PG01
Paris_T2 Paris_Prod_PG02
Paris_T3 Paris_DMZ_PG01

If you implement the above table values into a property dictionary drop down menus(Without building relationship), you will have 3 options to choose from for location, and 12 options to choose from for storage and network no matter what location you have chosen, although only 3 options for Network or storage is valid for any particular location. In this case, property dictionary relationship become a very handy feature. As you can filter the storage and network field based on the location field. You can set it up where if the user choose a particular location the storage and network locations present only that location network and storage options. Below is how the drop down menus will look in action after implementing vCAC Property Dictionary on them as we will do in this post.

vCAC Drop Down Menu after Property Dictionary Relationship

Let’s start the process of  building the property dictionary and property dictionary relationship for the above scenario.

1- Go to Infrastructure => Blueprints => Property Dictionary

2- Create the property definitions for VirtualMachine.Network0.Name, VirtualMachine.Storage.Name, Vrm.DataCenter.Location as in the below screenshot:

vCAC Property Dictionary Property Definitions

3- Let’s fix the property attributes for the Parent “Vrm.DataCenter.Location”, hit Edit under property attributes for Vrm.DataCenter.Location and configure it as per the below screenshot

vcac VrmDatacenterLocation Property Attributes

4- Let’s fix the property attributes for the first child in this relationship “VirtualMachine.Network0.Name” and configure it as per the below screenshot

vCAC Property Attributes VirtualMachineNetwork0Name

Make sure the value for the relationship attribute is the name of the parent in this relationship, which is “Vrm.DataCenter.Location” in our case

The ValueExpression field is an XML file that shows the relationship between the Child & Parent, that will need to be put in a single line. Below is a copy of the actual XML file used in this scenario:

<?xml version=”1.0″ encoding=”utf-8″ standalone=”yes”?><ArrayOfPropertyValue xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”><PropertyValue><FilterName>Vrm.DataCenter.Location</FilterName><FilterValue>Toronto</FilterValue><Value>Toronto_Prod_PG01</Value></PropertyValue><PropertyValue><FilterName>Vrm.DataCenter.Location</FilterName><FilterValue>Toronto</FilterValue><Value>Toronto_Prod_PG02</Value></PropertyValue><PropertyValue><FilterName>Vrm.DataCenter.Location</FilterName><FilterValue>Toronto</FilterValue><Value>Toronto_DMZ_PG01</Value></PropertyValue><PropertyValue><FilterName>Vrm.DataCenter.Location</FilterName><FilterValue>Boston</FilterValue><Value>Boston_Prod_PG01</Value></PropertyValue><PropertyValue><FilterName>Vrm.DataCenter.Location</FilterName><FilterValue>Boston</FilterValue><Value>Boston_Prod_PG02</Value></PropertyValue><PropertyValue><FilterName>Vrm.DataCenter.Location</FilterName><FilterValue>Boston</FilterValue><Value>Boston_DMZ_PG01</Value></PropertyValue><PropertyValue><FilterName>Vrm.DataCenter.Location</FilterName><FilterValue>Paris</FilterValue><Value>Paris_Prod_PG01</Value></PropertyValue><PropertyValue><FilterName>Vrm.DataCenter.Location</FilterName><FilterValue>Paris</FilterValue><Value>Paris_Prod_PG02</Value></PropertyValue><PropertyValue><FilterName>Vrm.DataCenter.Location</FilterName><FilterValue>Paris</FilterValue><Value>Paris_DMZ_PG01</Value></PropertyValue></ArrayOfPropertyValue>

Note: I know how annoying it’s to generate such an XML file manually for a large environment, for that I have create a vCAC Property Dictionary Relationship Builder that you can get here. 

5- Let’s fix the property attributes for the second child in this relationship “VirtualMachine.Storage.Name” and configure it as per the below screenshot

vCAC Property Attributes VirtualMachineStorageName

Make sure the value for the relationship attribute is the name of the parent in this relationship, which is “Vrm.DataCenter.Location” in our case

The ValueExpression field is an XML file that shows the relationship between the Child & Parent, that will need to be put in a single line. Below is a copy of the actual XML file used in this scenario:

<?xml version=”1.0″ encoding=”utf-8″ standalone=”yes”?><ArrayOfPropertyValue xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”><PropertyValue><FilterName>Vrm.DataCenter.Location</FilterName><FilterValue>Toronto</FilterValue><Value>Toronto_T1</Value></PropertyValue><PropertyValue><FilterName>Vrm.DataCenter.Location</FilterName><FilterValue>Toronto</FilterValue><Value>Toronto_T2</Value></PropertyValue><PropertyValue><FilterName>Vrm.DataCenter.Location</FilterName><FilterValue>Toronto</FilterValue><Value>Toronto_T3</Value></PropertyValue><PropertyValue><FilterName>Vrm.DataCenter.Location</FilterName><FilterValue>Boston</FilterValue><Value>Boston_T1</Value></PropertyValue><PropertyValue><FilterName>Vrm.DataCenter.Location</FilterName><FilterValue>Boston</FilterValue><Value>Boston_T2</Value></PropertyValue><PropertyValue><FilterName>Vrm.DataCenter.Location</FilterName><FilterValue>Boston</FilterValue><Value>Boston_T3</Value></PropertyValue><PropertyValue><FilterName>Vrm.DataCenter.Location</FilterName><FilterValue>Paris</FilterValue><Value>Paris_T1</Value></PropertyValue><PropertyValue><FilterName>Vrm.DataCenter.Location</FilterName><FilterValue>Paris</FilterValue><Value>Paris_T2</Value></PropertyValue><PropertyValue><FilterName>Vrm.DataCenter.Location</FilterName><FilterValue>Paris</FilterValue><Value>Paris_T3</Value></PropertyValue></ArrayOfPropertyValue>

6- To control the orders of how these drop down menu show up on the form presented to the user, we will need to create a Property Layouts, from Infrastructure => Blueprints => Property Dictionary , then hit New Property Layout, and create your new property layout as in the below screenshot

vcac property instancs layout

7- Create a Build Profile & let’s call it “VMPlacement” by going to Infrastructure => Blueprints => Build Profiles => New Build Profile. Then complete it as per the below screenshot

vCAC Create Build Profile

8- Add the “VMPlacement” build profile to your blueprint as per the below screenshot

vCAC Add VMPlacement Build Profile to blueprint

9- Test your Blueprint and you should now have the same result showed at the beginning of this post.

Extra Tips:

– Don’t waste your time generating these Property Dictionary Relationship files manually, check out this property dictionary relationship builder instead

– If you need to choose the cluster to deploy to through a property dictionary, then you can use the following hidden custom property: “__reservationPolicyID”, and to find out the actual IDs for the your reservation policies, you will need to run the following SQL Query against your IaaS SQL DB:

1
SELECT [id],[name] FROM [vCAC].[dbo].[HostReservationPolicy]

Hope you find this helpful, & enjoy the power of property dictionary!

,

17 responses to “vCAC 6 Property Dictionary Relationship”

  1. What version of vCAC are you doing this in? I’m using 6.1 and when i try to define a property definition for vrm.datacenter.location it throws the error “You cannot use a reserved property name.”

  2. Hi,
    Thanks for this amazing piece of information. Just found out something strange while I was implementing this in the environment. I run on vCAC 6.1. I have got the Networks as drop down. If I provision VM by selecting the network in drop down, it takes IP from the particular network which is absolutely correct. When I view the VM details under Items tab in vCAC, in the Network tab I don’t see the IP of that VM. But in the vSphere, I see that VM has taken a correct IP. When I check the Network Profiles in the vCAC, I don’t see that status of that IP as “Allocated”.
    If I provison a VM without dropdowns for selecting network (conventional method I meant), it works fine and I can see the IP in the Network Profiles and In the Machine Information as well.
    Hope you can help me out on this!!

  3. Hi Eiad –

    Per the following comment…

    “…Unfortunately the vrm.datacenter.location is no longer available in a fresh install of 6.1…”

    Is there any alternative? I am trying to figure out a way to deploy VM’s to two (2) separate physical DC locations and would have been great to use this method via dropdown selection

  4. Hi, Eiad.

    The sharing is great, especially the XML tool.

    I have a similar use case: A blueprint is shared between two Business Group named “Test” and “Production”. “Test” use Network1, Network2, and “Production” use Network3, Network4. End users in “Test” are only allowed to choose from Network1&2, end users in “Production” are only allowed to choose from Network3&4. So, it’s a little different from your example which permit end users to choose location first.
    Do you think it can work out? How can I retrieve the business group name and create different dropdown list according to it?

    Thanks a lot.
    Ryan

  5. Hi Ryan, While what you are asking for is achievable, its not with the out of the box property dictionary. We have a customization kit called CCC internally that we use on PSO engagement that will allow you to do just that, but the only way to put your hand on the kit as far as I know is to involve PSO. If interested, I would suggest you reach out to your VMware SE.

    Hope this help,
    Eiad

  6. Hey Ryan, here’s what i did for your scenario. Create two new property dictionary entries for test.network0 and production.network0. Set test.network0 as a custom property on the test business group and production.network0 as a custom property on the production business group. in vRO grab those custom properties from the VM using the vCACVmProperties.get(‘test.network0’) method and update the VirtualMachine.Network0.Name vCAC VM property during the building phase. This will put the deployed VM on the appropriate test or prod network. i have about 300 business groups using this method, it works ok.

  7. Hi Eiad, first of all great blog thanks very much. I have 2 questions I was hoping you may be able to assist with if you have time please?

    I was wondering what you would suggest if the relationship was just on a one to one basis. I have got this working, but I would like to know if there is something a little cleaner that could be achieved.

    So I have datastores for OS disks on either SSD or SATA, and then the datastores for Data disk on SSD or SATA.

    Datastore
    OS-SSD Storage Reservation Policy – OS-SSD
    Data-SSD Storage Reservation Policy – DATA-SSD
    OS-SATA Storage Reservation Policy – OS-SATA
    Data-SATA Storage Reservation Policy – DATA-SATA

    Basically if a user selects the OS disk to be on SSD then the Data disk should always be on SSD so its a 1 to 1 relationship. Is there a way I can just apply these properties and relationships and just have a single dropdown for the OS disk, and then without having the dropdown in the request the datadisk will just build to the create datastore? Seems messy to me to have a user select a dropdown for just a single available value.

    2nd question is even trickier

    If I have a property relationship is it possible to return a “null” value, so the VM doesn’t create the component?

    e.g.

    Management network 1 – when selected users gets a dropdown for production network 1, production network 2
    Management network 2 – when selected users get a dropdown for production network 3, production network 4
    Management network 3 – user doesn’t have any options for a production nic and when the VM is provisioned there is no secondary NIC created on the VM.

    Hope this is clear, again I know you are busy, thanks for the blog and any help is greatly appreciated.

  8. Hi Dean, sorry it took me a while to come back to you as I was on vacation. Unfortunately the answer to your first question, is that it’s not possible without doing some vCO work flows.
    As far as your second question, if I understand it correctly then it could be done with what we call CCC kit, but this is only available when using PSO Services from VMware to implement your vRA.

  9. If I only have a single network and single storage for a particular location. Is it possible to have those automatically populate with out clicking on the drop down menu.

    If there is only single choice in storage and network

  10. haha, just read your response to Dean. Never mind. Thank you providing such a detailed description on to set this up. I had 0 issue following your instructions. Love it, big fan

Leave a Reply

Your email address will not be published. Required fields are marked *