VRA CustomHostnaming

From Bitbull Wiki
Jump to navigation Jump to search

1 General

I created this as an exercise, hopefully this is useful for others too. This workflow got developed and tested with vRealize Automation 7.1.

VRO custom hostname wf.png

File: defineHostname.js

1.1 Concept

  • Select DropDown "hostname set" as a property in vRA
  • Store Hostname Numbers for every pattern as configuration element in vRO
  • Store hostname number length as configuration element in vRO
  • If configuration elements do not exist (eg. new pattern) create them automatically
  • Make it easy to work with property group in vRA to add prefix collection to blueprint component

2 Configuration

2.1 Workflows

You can import my package from github:
https://github.com/joe-speedboat/vRealizeOrchestrator/blob/master/ch.bitbull.hostname.package

2.2 vRA Event Broker

Create new Subscription.
Add the following conditions:

  • Data > Lifecycle state name Equals VMPSMasterWorkflow32.BuildingMachine
  • Data > Lifecycle state phase Equals PRE
  • Data > Machine > Machine type Equals Virtual Machine
Vra custom hostname 1.png


Vra custom hostname 2.png


Vra custom hostname 3.png


Vra custom hostname 4.png


Do not forget to hand over the properties from EB to vRO, by setting this custom property to Blueprint Component:

Extensibility.Lifecycle.Properties.VMPSMasterWorkflow32.BuildingMachine = *

2.3 Create Properties / Property Group

Create vRA properties like:
Note: PRD is a placeholder for a set of hostname prefixes

Extensibility.Lifecycle.Properties.VMPSMasterWorkflow32.BuildingMachine -> *
Custom.Hostname.Prefix.Group -> empty (set in property group)
Custom.Hostname.Prefix.PRD -> drop down list with needed prefixes
Custom.Hostname.Prefix.PRD.UpperCase -> [true|false] (as you need)

Below you can find an example:

Vra custom hostname 5.png


Vra custom hostname 6.png


Add all the needed patterns to the dropdown list


Vra custom hostname 8.png


2.4 Final note

Now you can add the property group to a blueprint component and get the desired dropdown.

3 Links