Server discovery naming rules

The server discovery naming rules enable you to customize the display name given to a server when it first boots into maintenance. The rules can be customized so that servers are named in a way that is meaningful to your organization.

How it works

Each line of the server discovery naming rules represents a separate rule. Each rule contains a match criteria and a naming template (see below). When a server boots into maintenance for the very first time, the rules are examined one at a time in order. If the match criteria for the rule matches any of the characteristics of the server being discovered, then the display name of the server is formed using the naming template specified in that rule. If the match criteria does not match, the next rule is processed until a match is found or the bottom of the list is reached. Once a match is found, the display name is set and processing stops.

A server discovery naming rule takes the following form:

Match criteria::=server naming template

Where the ::= is the separator between the match criteria and the template; and is required.

Match criteria

The match criteria is a regular expression that is compared against a single long string made up of all of the discovered server’s properties concatenated together. For a sample of the server properties character string, see Sample server characteristics string. Because all of the properties are on a single line, your regular expression should always begin and end with a .* to account for data on either side of the string you are trying to match.

The following are some examples of match criteria.

Match Criteria Description
.* Match all servers (useful as a default – use this to match any servers not matched in previous rules).
.*ProLiant BL.* Matches ProLiant Bladeservers, because the model name always includes the string ProLiant BL.
.*VMware.* Match all VMware virtual machines.
.*10\.20\..* Match all servers with IP addresses in the 10.20 subnet (note that the period was escaped with a backslash).
.*Linux.* Match servers running a Linux service OS

When specifying match criteria, keep in mind that you are comparing against all of the various server properties, so try and use strings that will be unique to the data type you are looking for. For example, the match string .*10.* would be a poor choice, as 10 could appear in any number of server characteristics and result in a false match.

Server naming template

The server naming template specifies how the display name for the server is created. The template is a combination of literal characters and server characteristics put together in whatever manner is meaningful to your organization. The server characteristics are always enclosed in curly braces {}.

For example:

myserver-{dvc_model}-{serial_num}

This example sets the server name to “myserver-“ followed by the server’s model name, a hyphen, and the server’s serial number, which might look like as follows:

myserver-ProLiant BL460c Gen8-AB12345678

A list of useful server characteristics for server naming is shown in the following table.

Server Characteristic Name Description
{serial_num} Serial number
{system_name} hostname
{uuid} UUID
{server_location[rack]} Rack name (Bladeservers only)
{server_location[enclosure]} Enclosure name (Bladeservers only)
{server_location[bay]} Bay number (Bladeservers only)
{dvc_id} Server Automation ID of the server
{dvc_mfg} Manufacturer
{dvc_model} Model

Less commonly used server characteristics for server naming are shown in the following table.

Server Characteristic Name Description
{chassis_id} Chassis ID (Usually the MAC address of the deployment NIC)
{os_version} The full OS Name and version running on the server
{Interfaces[X][hw_addr]} The MAC address of network interface X, where X is an integer starting from 0 that represents the interfaces in the order the SA agent reported them in.
{Interfaces[X][ip_address]} The IP address of network interface X

Sample server naming rules

The following sample matches any ProLiant Bladeserver and sets the name to the rack-enclosure-bay location of the server. This is one of the Hewlett Packard Enterprise provided default rules.

.*ProLiant BL.*::={server_location[rack]}-{server_location[enclosure]}-{server_location[bay]}

The following sample matches any ProLiant server and sets the name to the server’s serial number.

.*ProLiant*::={serial_num}

The following sample matches all VMware virtual machines and sets their name to the system hostname-MAC address of the first reported NIC.

.*VMware.*::={system_name}-{interfaces[0][hw_addr]}

The following sample matches any server and sets the name to the server’s hostname.

.*::={system_name}

Default server naming rules

If you select the Hewlett Packard Enterprise provided default server naming rules, the following rules are applied.

.*ProLiant BL.*::={server_location[rack]}-{server_location[enclosure]}-{server_location[bay]}
.*::={serial_num}

This means that ProLiant Bladeservers will be named with their server location information, and all other servers will be named using their serial number.

If no rules are provided or if none of the specified rules generate a match, the following naming template is applied:

{system_name}-{dvc_mfg}-{dvc_model}-{dvc_id}

Sample server characteristics string

The following is actual data that was collected when a ProLiant server was discovered. This gives you an example of the string you are comparing to when you specify your match criteria. The data is shown on multiple lines for readability but internal to the appliance, it is all on one line.

desc_fields={'server_location': {'bay': '1', 'rack': 'Rack-BD9', 'enclosure': 'Encl5'}, 
'interfaces': [{'hw_addr': '80:C1:6E:7A:A4:64', 'slot': 'eth1', 'enabled_flg': '', 
'address_family': '', 'address_index': 0, 'interface_type': 'ETHERNET', 'configured_duplex': '', 
'netmask': '', 'configured_speed': '', 'interface_duplex': '', 'ip_address': '', 'interface_speed': ''}, 
{'hw_addr': '80:C1:6E:7A:A4:60', 'slot': 'eth0', 'enabled_flg': '1', 'address_family': 'INET', 
'address_index': 0, 'interface_type': 'ETHERNET', 'configured_duplex': '', 'local_hostname': '', 
'netmask': '255.255.255.0', 'configured_speed': '', 'use_dhcp': '0', 'interface_duplex': 'FULL', 
'ip_address': '192.168.59.11', 'interface_speed': '10000'}], 
'default_gw': '192.168.59.1', 'device_dns_servers': ['192.168.162.139'], 'device_dns_search_domains': [], 
'storage_components': [{'storage_model': 'HP P220i', 'storage_type': 'SCSI', 'storage_media': 'scsi disk', 'storage_capacity': '1024', 'storage_drive': 'sda'}], 
'os_spversion': None, 'system_name': 'ezsetupsystem80c16e7aa460', 
'memory_components': [{'quantity': '16427156', 'memory_location': 0, 'memory_type': 'ram'}, {'quantity': '0', 'memory_location': 0, 'memory_type': 'swap'}], 
'uuid': '36343130-3136-5553-5555-333545444b4a', 
'cpu_components': [{'cpu_physical_cores': 8, 'cpu_stepping': '7', 'cpu_l1cache_kb': 256, 'cpu_slot': 0, 'cpu_logical_cores': 16, 'cpu_speed': 2099, 'cpu_status': 'ON-LINE', 'cpu_model': 'Intel(R) Xeon(R) CPU E5-2658 0 @ 2.10GHz', 'cpu_l3cache_kb': 20480, 'cpu_family': 'x64', 'cpu_flags': 'fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov', 'cpu_vendor': 'GenuineIntel', 'cpu_l2cache_kb': 2048}], 
'is_hypervisor': 0, 'mid': '1160001', 'chassis_id': '80:C1:6E:7A:A4:60', 'serial_num': 'USE232BDKJ', 'virtualization_type_id': None, 'os_version': 'SLES-11-X86_64', 'agent_python_version': '2.7.3', ...., 'os_flavor': None, 'dvc_mfg': 'HP', 'dvc_model': 'ProLiant BL460c Gen8 ', 'agent_version': '55.0.46673.0'}