Ever since the early days of vCAC, customers have needed the ability to provide a variety of additional control options to vRealize Automation’s self-service consumer. I’m specifically referring to inputs and selection options that are made available to the consumer during request time. Some of the most common examples include fields for plain text input, drop-down menus, checkboxes, value lists, and text descriptors. The input or selection can be basic information or used for downstream processing during machine provisioning.
There are hundreds (thousands?) of use cases and unique requirements that make it just about impossible for VMware to deliver every option as an out of the box. function. Instead, vRealize Automation (vRA) leverages Custom Properties to provide a quick-n-easy way to control many aspects of machine provisioning. Custom properties can be used across much of vRA’s configuration constructs, including Blueprints, Business Groups, Compute Resources, Reservations, and Endpoints (in that order of precedence). Custom properties are a core component of vRA’s massive extensibility engine and are often used in collaboration with the Property Dictionary, Property Groups, vRealize Orchestrator (via workflow stubs), and the new Event Broker. If you’re unfamiliar with custom properties and these concepts, be sure to read the documentation.
Custom properties can also be used to override default behavior by specifying and modifying Internal custom properties. This essentially overrides a default configuration parameter with the desired custom input. There are many ways this can be beneficial — for example, the internal custom property VirtualMachine.Network0.Name is used by vRA to assign the appropriate network path to a machine’s primary vnic during provisioning. By default, this is configured via Reservations and an associated Network Profile. Network profiles are then available to be dragged onto the Converged Blueprint designer canvas and bound to one or more component machines. That’s the default behavior, but default behavior isn’t always the desired behavior.
Use Case: A vRA administrator wants to allow developers the ability to select a preferred network at provisioning time, which will depend on the dev cycle of a given application. While the admin can create several blueprints — each bound to a unique network — and make them all available to the developers, this creates unnecessary overhead and will result in excessive blueprint sprawl.
To solve this, we can use the internal custom property VirtualMachine.Network0.Name to allow the developer override the network path at request time. But that alone won’t do us much good since what we really need a drop-down list of available/supported networks (or else expect the developer to memorize and manually enter the exact network path each time). This is where the Property Dictionary comes in.
The Property Dictionary can be used to define unique custom properties and/or further customize how a consumer interfaces with a custom property field at request time. For example, a drop-down list of network paths.
Solution: Create a Property Definition to dynamically set the custom property VirtualMachine.Network0.Name based on a consumer’s selection from a list of predefined available networks.
Let’s do this…
Network Selection Drop-Down
The first step is to determine which networks you want to make available in the drop-down list. This can include any of the network paths collected during endpoint inventory, including NSX-backed logical networks. These networks need to be configured for use in the Reservation.
Configure Network Paths
1. From the Infrastructure tab, navigate to Reservations -> Network
2. Select (check) all the network paths that will be available in the drop-down list
3. Select the appropriate Network Profile to be used with each network (note: a network profile is required to assign the correct IP information at provisioning time).
4. Click OK to accept the changes
Create a Property Definition
5. Navigate over to Property Definitions from the Administration tab
6. Click +New to add a new property definition
7. Enter the following configuration details:
a. Name: VirtualMachine.Network0.Name
b. Label: Select a Network
c. Description: <some useful description>
d. Order index: 1
e. Data type: String
f. Required: Yes
g. Display advice: Dropdown
h. Values: Predefined values
8. In Predefined values, click +New to enter a friendly network Name and the corresponding Value (network path) for each network that will be available in the drop-down list.
Note: the Value must be IDENTICAL to the network path…copy/paste this info from Reservations.
9. Click OK to create the Property Definition
Create a Property Group
Property Groups are used to combine one or custom properties into a single logical grouping. This is extremely helpful when adding multiple custom properties to an object — the property group can be added once vs. having to add each individual custom property.
NOTE: there’s an alternate purpose for using a Property Group in this case (considering we’re only using one custom property)…vRA7 reserves any network-related custom properties for use at the network adapter level of a component machine. Attempting to add our property definition on its own will return an error stating that fact…
As a work-around, we create the property group, add the desired custom property, and then apply the property group to the Blueprint.
10. Navigate to Property Groups in the Administration tab
11. Click + New to create a new Property Group and configure as follows:
a. Name: Network Selection
b. ID: keep the default entry
c. Visibility: This tenant
d. Description: enter a useful description
12. In the Properties section, click on + New
13. In the Name column, use the drop-down menu to select VirtualMachine.Network0.Name
14. Keep the Value field empty and check Show in Request
15. Click OK to accept the property configuration
16. Click OK again to create the Property Group
Add Property Group to Blueprint
Custom properties (including property groups and property definitions) can be applied at various locations in vRA, depending on the use case. In the final step of this exercise, we’ll apply the Property Group directly to the machine component of the target Blueprint.
17. Open the target Blueprint to edit it
18. Highlight the desired machine component to modify it’s settings
19. Click + Add in the Properties tab -> Property Groups
20. Select the desired property group (Network Selection) from pop-up window and click OK
21. Once applied, click Finish to close the designer
Check Your Work
At this point you should be able to request the modified blueprint and see the network drop-down in the request screen. Since the property was applied at the machine component in the blueprint designer, the custom list will be available at the machine level (vs. the parent object).
Specify a desired network from the drop-down list and submit your request.
Once it has been provisioned, verify the machine was deployed to the appropriate network by inspecting the Network tab of the machine (under Items) or in the vSphere client.
This is just one example of putting custom properties to good use. But as you can imagine, the possibilities are quite vast. Whether you are customizing machine behavior or invoking external workflows, custom properties will — or should — play a significant role in your vRA implementation.