Server hostname scheme

A consistent, meaningful and scalable server naming standard is critical when working with dynamically allocated cloud resources.

Design goals

Hostnames should be:

  • Meaningful.
  • Flexible for different workload types and server roles.
  • Automatically available without knowledge of the server workload.
  • Globally unique.

Default hostname scheme

By default, Turbot uses a 15 character scheme for server naming as follows:

Character Contents
1 Cluster ID
2
3
4 Account ID
5
6
7 Cloud Provider Code
8 Region code
9
10
11 3rd Octet of the private IP in two characters of Base 36 and then Decimal format.
12
13 4th Octet of private IP in Decimal format, padded to 3 characters.
14
15

Examples for a server in Virginia of Account ABC in Cluster CLU:

  • 10.1.2.3 - cluabcauva02003
    • clu = Cluster ID
    • abc = Account ID
    • a = Amazon Web Services
    • uva = Virginia, USA
    • 02 = 3rd octet, in Base36/Decimal format
    • 003 = 4th octet, in Decimal format
  • 10.1.99.123 - cluabcauva99123
    • 99 = 3rd octet, in Base36/Decimal format
    • 123 = 4th octet, in Decimal format
  • 10.1.134.134 - cluabcauvad4134
    • d4 = 3rd octet, in Base36/Decimal format (130 = d, 4 = 4)
    • 134 = 4th octet, in Decimal format
  • 10.1.255.255 - cluabcauvap5255
    • p5 = 3rd octet, in Base36/Decimal format (250 = p, 5 = 5)
    • 255 = 4th octet, in Decimal format

Customizing hostnames

The format for Server hostnames is defined by the option Network > Hostname Template. It may be customized to suit the preferred naming standard for your internal environment.

As an example, the default hostname template is:

{{account.clusterId}}{{account.id|lower}}{{host.Provider.code|lower}}{{host.Placement.AvailabilityZone|region3|lower}}{{host.PrivateIpAddress|ipOctet(3)|ipOctetBase36Dec}}{{host.PrivateIpAddress|ipOctet(4)|padLeft(3)}}

The template is in Nunjucks / Jinja2 format with these variables:

  • account
    • id
    • clusterId
    • title
  • host
    • As per EC2 Instance data type - but field names are capitalized.

and these filters:

  • built-in filters
  • region3
  • lower
  • hex
  • padLeft
  • ipOctet
  • ipOctetBase36Dec
Was this article helpful?
0 out of 0 found this helpful