With the release of Dynatrace OneAgent version 1.223, you can choose between two different host ID modes, automatic or deterministic, to configure the host-identification process in complex scenarios such as large Managed deployments or environments where virtual machines are managed dynamically.
Following the installation of OneAgent on all hosts in an application environment, Dynatrace provides continuously updated metrics related to the performance of every monitored host. To achieve this, every host is assigned a unique identifier, a host ID, which is used for all Dynatrace API requests, reporting, and alerting. In most cases, this works fine out of the box, but there are cases where new advanced configuration settings might be necessary.
Host IDs in Dynatrace Managed environments
In large Dynatrace Managed environments (or in certain Hyper-V cloud configurations), scenarios can become complex. When OneAgent is installed on a host, Dynatrace assigns the host a randomly generated host identifier. This identifier is persisted on the monitored host file system. To prevent host-ID duplication, the OneAgent polls the host MAC address at each startup to detect potential virtual-machine cloning of the host.
A changed MAC address triggers host ID regeneration of a new, randomly generated identifier. However, such regeneration might not be desirable in more complex environments. In fact, a duplicate host ID can break the continuity of your existing reporting and alerting. Additionally, API calls that reference those hosts IDs will no longer work as a “new” host has been detected.
Custom solutions for unique environments
In environments where virtual machines are managed dynamically for performance or cost-saving reasons, you cannot always rely on MAC addresses to detect host cloning. If unexpected host ID changes are observed, there’s an obvious need for a customized solution to calculate the host ID. That’s why we now make it possible to configure the host-identification process. This ensures a perfect fit for every unique use case.
Starting with the release of OneAgent version 1.223, you can choose between two different host ID modes: automatic or deterministic.
In automatic mode, which is the default setting, Dynatrace uses predetermined heuristics to automatically set the host identifier. This is a unique, random, hexadecimal 64-bit number that is assigned to each newly discovered host. It’s automatically regenerated whenever cloning or an environment change is detected.
In cloud environments, automatic mode works differently for each major cloud vendor. For example, when OneAgent is deployed to the Amazon cloud, the Amazon
instanceId is used to generate the Dynatrace host ID. Similarly, in Microsoft Azure, the host ID is based on the unique Azure-VM ID to prevent ID changes during reboot.
In deterministic mode, calculation of the host ID is configurable. The external parameters on which the deterministic host ID can be based on are:
- MAC address
- IP address
- Fully Qualified Domain Name (FQDN)
When using deterministic mode, VMs can be moved to different clusters for testing and moved back to production without losing the host ID in the process. The host ID always reverts to the same value if the chosen external identifier remains the same, making it easier to monitor the various stages of product development and support dynamic environments where VMs are automatically managed for optimal resource utilization.
Using deterministic mode also allows for full control over the definition of what a host actually is, supporting complex modern virtualized use cases where traditional definitions of hosts are inadequate.
Note: When using deterministic mode, you must ensure that each generated host ID is unique across the entire monitored environment. Deterministic mode ensures that the ID will always be the same if the external parameter remains unchanged and does not check for uniqueness.
Configure OneAgent to use deterministic mode for host IDs
To enable deterministic mode at the time of OneAgent installation, it’s necessary to enter the commands on the Configure OneAgent settings installer screen. On live, existing hosts, simply enter the relevant commands on the host and restart OneAgent.
Parameters for the
set-host-id-source command are:
The correct command Linux/AIX using the IP address would be:
The same command for Windows:
And the parameters for the Configure OneAgent settings installer screen:
Differentiate between environments using the namespace parameter
In cases where, for example, staging and production environments are identical, it’s possible to include a namespace parameter. With a namespace parameter, you can ensure that generated host IDs are unique even when all other external parameters (IP address, FQDN, or MAC address) remain the same. For example, setting the namespace on Linux/AIX to “staging” would look like this:
For more information, please see OneAgent installer via CLI in Dynatrace Documentation.
Tell us what you think
We’re excited about these changes and hope you are, too. Let us know what you think in the Dynatrace Community, where you can share ideas for new enhancements and features, learn more about Dynatrace, or reach out to our product experts. We’d love to hear from you!
Looking for answers?
Start a new discussion or ask for help in our Q&A forum.Go to forum