Setup

Add Naming Sequence

  1. Login to vRA tenant
  2. Click on the Catalog tab
  3. Request the Add Naming Sequence vRA Catalog Item
  4. Fill out the form accordingly (see below) and Submit
Add Naming Sequence
Add Naming Sequence

One or more Naming Sequences can be used in a Naming Standard

FieldValue
Configuration label

No spaces, periods or special characters except underscore (_) and dash (-)

Unique label

DO NOT prepend with your tenant name and an underscore, e.g. mytenant_

Sequence type

Choose a sequence type: - Decimal (Base 10): 0-9 for each digit - Hexadecimal (Base 16): 0-F for each digit - Octal (Base 8): 0-7 for each digit - Pattern (Mixed bases and static text ): a flexible pattern that allows for unique naming sequences

Reuse sequence values?

Check the checkbox to reuse a previous sequence number if it is available.

For example, host001, host002, and host003 exist. host001 is deleted. For the next provision, host001 will be chosen.

In general, it's better to leave this turned off unless you have a specific need, or if you're configuring an environment that does not include a CMDB.

Max sequence length

Shown when 'Sequence type' is: Decimal, Hexadecimal or Octal

Maximum number of characters this sequence will contain. For example, if the first server should have 001 as the sequence number, set this field to 3 for a three digit sequence length.

Initial value

Do NOT pad this initial value number. Just type 1 if you want to start with 01 or 001 for example.

Initial number for the sequence (normally 1 but you can start with any value)

Sequence padding

Shown when 'Sequence type' is: Decimal, Hexadecimal or Octal

The module will pad the sequence with this character or number if the required sequence length is not met. Defaults to 0

Pattern type format

Shown when 'Sequence type' is: Pattern

Unique key

Optional but recommended

The Unique Key defines the elements of the name that should be evaluated to determine when the sequence number should start over.


For example, if your naming standard combines vRA properties for Environment, Location and serverType, you could create a Unique key of

{{Environment}}{{Location}}{{serverType}}

This would cause each unique combination of those 3 items to generate a new sequence starting at the beginning, e.g. start over at 001



Example 1:

If the values for the input properties on run #1 are:

Environment: prod
Location: nor
serverType: db

Resulting Hostname: prodnordb001

The sequence number is 001 (Assumes Sequence Type of decimal, with a max sequence length of 3, Sequence Padding as 0, and an Initial Value of 1)


As new unique keys are encountered, they are stored in the Data section of the SovLabs Custom Naming Sequence profile in vRA.
These unique keys are stored as key/value pairs with the next value to be assigned as the value.


In this case, a key named prodnordb is created and stored in the Sequence item in vRA, and the value is set to 2 (next value to use for that key)

The next time the key prodnordb is encountered, its stored "next" value will be used.


If the values for run #2 are:

Environment: dev
Location: den
serverType: web

Resulting Hostname: devdenweb001

The sequence number is again 001 because devdenweb is a new unique key.


Now let's say the values for run #3 are the same as the first run:

Environment: prod
Location: nor
serverType: db

Resulting Hostname: prodnordb002

The sequence number is 002 because prodnordb is an existing key from run #1, and the its next value was stored as 2.


Example 2:

Now let's say that you only want to store unique sequence groupings for your Environment. You could create a unique key consisting of only that property.

Unique Key: {{Environment}}

If the values for run #1 are:

Environment: prod
Location: nor
serverType: db

Resulting Hostname: prodnordb001

The sequence number is 001 (Again, assumes Sequence Type of decimal, with a max sequence length of 3, Sequence Padding as 0, and an Initial Value of 1)


If the values for run #2 are:

Environment: dev
Location: nor
serverType: db

Resulting Hostname: devnordb001

The sequence number is 001 because dev is a new Unique key.


If the values for run #3 are:

Environment: dev
Location: den
serverType: web

Resulting Hostname: devdenweb002

The sequence number is 002 because dev is an existing key and the last number used was 1.


If the values for run #4 are:

Environment: dev
Location: tex
serverType: app

Resulting Hostname: devtexapp003.

The sequence number is 003 because dev is an existing key and the last number used was 2.


The key values can be edited using the Update action on the SovLabs Custom Naming Sequence item to start at a higher or lower number if needed

In the Naming Sequence Unique Key, DO NOT include the references to {{ sequence.SEQUENCENAME }} from your Naming Standard Template field.

This field is templatable. Click the link below to view documentation on the SovLabs Template Engine

SovLabs Template Engine page

Add Naming Standard

  1. Login to vRA tenant
  2. Click on the Catalog tab
  3. Request the Add Naming Standard vRA Catalog Item
  4. Fill out the form accordingly (see below) and Submit
Add Naming Standard
Add Naming Standard

A Naming Standard contains the template that defines the "name" part of the host name and combines it with one or more Naming Sequence definitions to create the hostname and assign it to the Hostname property on the VM

FieldValue
Configuration label

No spaces, periods or special characters except underscore (_) and dash (-)

Unique label

DO NOT prepend with your tenant name and an underscore, e.g. mytenant_

Select sequence(s)

Select the checkbox(es) for the sequence(s) that will be used as a part of this naming standard (can be more than one)

Template

Define the naming standard template that will generate the hostname

The Naming template will include the elements that make up the non-sequence part of the name, and the placeholder(s) for the sequence(s): {{ sequence.SEQUENCENAME }}


The Naming template can contain any combination of references to templated vRA properties, literal characters and the reference to the sequence(s) as described above.


The items with the double curly braces, e.g. {{ Environment }} , are references to vRA properties. The SovLabs Template engine transforms the vRA properties referred to inside the double curly braces and replaces the entire object with the resulting value. See the information at the bottom of this page for more on the SovLabs Template Engine.


Example 1:

If the item name for the Naming Sequence is threedigit, refer to it in the Naming template as {{ sequence.threedigit }}. If you check more than one Sequence in the Select sequence(s) field, you'll need one reference to a {{ sequence.SEQUENCENAME }} per sequence in the Naming Template.

If your hostname should be

{{Environment}}{{Location}}{{serverType}}

and you want to put the threedigit sequence definition at the end, the Naming template would look like this:

{{Environment}}{{Location}}{{serverType}}{{ sequence.threedigit }}

Resulting Hostname: prodnordb001


Example 2: Literal characters

If your hostname should be prefixed by a literal prefix such as v:

Naming Template: v{{Environment}}{{Location}}{{serverType}}{{ sequence.threedigit }}

v{{Environment}}{{Location}}{{serverType}}{{ sequence.threedigit }}

Resulting Hostname: vprodnordb001



Example 3: Using a Filter to transform the returned value

If you want your hostname to be in uppercase letters, you could use the upcase filter on your templated properties:

Naming Template: V{{Environment| upcase }}{{Location| upcase }}{{serverType| upcase }}{{ sequence.threedigit }}

V{{Environment| upcase }}{{Location| upcase }}{{serverType| upcase }}{{ sequence.threedigit }}

Resulting Hostname: VPRODNORDB001


Example 4: Using multiple chained Filters to transform the returned value

If you want the uppercase hostname, and also want to use only the first character of the Environment property, add the substring filter to the Environment templated property:

Naming Template: V{{Environment| upcase|substring:0,1 }}{{Location| upcase }}{{serverType| upcase }}{{ sequence.threedigit }}

V{{Environment| upcase|substring:0,1 }}{{Location| upcase }}{{serverType| upcase }}{{ sequence.threedigit }}

Resulting Hostname: VPNORDB001


Example 5: Using an if tag in the Naming Template to dynamically change the hostname based on a property

If you want a 'dr' to appear at the beginning of the hostname only if a vRA property called disaster_recovery is set to true:

Naming Template: {% if disaster_recovery == true %}DR{% endif %}{{Environment| upcase|substring:0,1 }}{{Location| upcase }}{{serverType| upcase }}{{ sequence.threedigit }}

{% if disaster_recovery == true %}DR{% endif %}{{Environment| upcase|substring:0,1 }}{{Location| upcase }}{{serverType| upcase }}{{ sequence.threedigit }}
Assuming the disaster_recovery property is set to true:
Resulting Hostname: DRPNORDB001

Assuming disaster_recovery property is false, or is not set:
Resulting Hostname: PNORDB001

Example 6: Put the sequence number in a different part of the hostname other than at the end

This is very simple. If you want to put the threedigit Naming Sequence definition in the middle of the name after the Location:

Naming Template: {{Environment}}{{Location}}{{ sequence.threedigit }}{{serverType}}

{{Environment}}{{Location}}{{ sequence.threedigit }}{{serverType}}
Resulting Hostname: prodnor001db


You MUST include at least one {{ sequence.SEQUENCENAME }} in the Naming Template definition.


In most cases, you want the Unique Key in the Naming Sequence to match the Naming Template in the Naming Standard.
Simply copy the Template from the Template field in the Naming Standard, remove the references to the {{ sequence.SEQUENCENAME }} and paste that into your Unique Key field in the Naming Sequence.


SovLabs Template Engine

The SovLabs Template Engine allows injection of values for VM Properties into the SovLabs profiles, not just for Custom Naming, but for all SovLabs integrations. This is an extremly powerful feature. When you see a reference to a property enclosed in double curly brackets, e.g. {{ my_propertyname }}, that implies use of the SovLabs Template engine to transform that property and use its resulting value in that place. In SovLabs Endpoints and profile configurations in general, many fields are "templatable", which means you can substitute a valid Template Engine template in place of a hard-coded value.

If substitution of vRA properties into the SovLabs profiles sounds powerful, this next bit is a game changer!
The Template engine syntax contains filters such as substring, upcase, join, replace and Tags for logic operations such as if/else, case statements, for loops and many more to transform properties for use in SovLabs modules.


This field is templatable. Click the link below to view documentation on the SovLabs Template Engine

SovLabs Template Engine page