I had a requirement from a customer where they needed to give users the option to select which vLAN (port group) a secondary NIC would be placed on. To add a little bit of extra complexity, the options for the secondary NICs should change depending on where the primary NIC was placed……..are you with me still? Anyway looking around I found some great help out there mainly from Jad El-Zein’s fantastic blog post here and then this fantastic tool from Eiad Al-Aqqad blog and tool here Note: In vRA7 this method is no longer used, I have now uploaded a post on how to achieve this in vRA7. OK, for this example here are my requirements:
Management vLAN (Primary NIC) | Production vLAN (Secondary NIC) |
vLANMAN_001 | vLANPROD_001vLANPROD_002 |
vLANMAN_002 | vLANPROD_003vLANPROD_004 |
vLANMAN_003 | vLANPROD_005vLANPROD_006 |
OK so first we need to create a parent value, in this case it will be the
VirtualMachine.Network0.Name property:
Edit the property attributes:
Now we need create the child values, for this example of the secondary NIC it will be the VirtualMachine.Network1.Name property:
Edit the property attributes: Create a relationship with the parent property:
Now we need to create a value expression, the relationship generator is invaluable here, it’s a great tool:
For the purists out there who like to write some code now and then the value expressions looks like this:
<PropertyValue><FilterName>VirtualMachine.Network0.Name</FilterName><FilterValue>vlanman_001</<br/>FilterValue><Value>vlanprod_001</Value>
</PropertyValue><PropertyValue><FilterName>VirtualMachine.Network0.Name</<br/>FilterName><FilterValue>vlanman_001</FilterValue>
<Value>vlanprod_002</Value></PropertyValue><PropertyValue><FilterName>VirtualMac<br/>hine.Network0.Name</FilterName>
<FilterValue>vlanman_002</FilterValue><Value>vlanprod_003</Value></<br/>PropertyValue><PropertyValue>
<FilterName>VirtualMachine.Network0.Name</FilterName><FilterValue>vlanman_002</<br/>FilterValue><Value>vlanprod_004</Value></PropertyValue>
<PropertyValue><FilterName>VirtualMachine.Network0.Name</<br/>FilterName><FilterValue>vlanman_003</FilterValue><Value>vlanprod_005</Value></PropertyValue>
<PropertyValue><FilterName>VirtualMachine.<br/>Network0.Name</FilterName><FilterValue>vlanman_003</FilterValue>
<Value>vlanprod_006</Value></PropertyValue></ArrayOfPropertyValue>
Here is what your property should look like:
Next step is to create a Property Layout to make sure the properties display in the correct order on the request form NetworkSelection is the layout for this example:
The property instances should be as below:
Now we need to assign the custom property definitions and the property layout to the desired blueprint:
Now when we request a Catalog Item you should see the options on the request form:
Hope this is of some help to someone, if I need to achieve something similar with vRA7 I will post up the solution.
by
One comment