Preventing Duplicate machine-id When Cloning RHEL Virtual Machines
Overview
When cloning Red Hat Enterprise Linux virtual machines on VMware, the system file /etc/machine-id is sometimes cloned along with the OS. This results in multiple hosts sharing the same machine identity, which is unsupported and can cause issues with system services, security tooling, and Kubernetes.
This article explains why this happens and how to correctly remediate and prevent it.
What is machine-id
/etc/machine-id is a unique identifier generated by systemd for each operating system instance.
It is used by:
β’ systemd and journald
β’ Networking and D-Bus services
β’ Endpoint security agents such as Trellix
β’ Inventory, monitoring, and licensing systems
β’ Kubernetes node identity and stability
Each RHEL VM must have a unique machine-id.
Why duplicate machine-id is a problem
If multiple VMs share the same machine-id, the following issues may occur:
β’ Security agents may overwrite or conflict with each other in management consoles such as Trellix ePO
β’ Kubernetes nodes may behave unpredictably or fail to register correctly
β’ Logs may collide or be misattributed
β’ Host identity in monitoring and inventory systems may be incorrect
β’ Systemd based services may malfunction
This configuration is unsupported and should be corrected immediately.
How to fix an already cloned VM
Perform the following steps on each cloned VM.
- Remove the existing machine-id files
- Regenerate a new machine-id
- Reboot the system
- Verify uniqueness
Ensure each VM reports a different value.
Important note for Kubernetes or Trellix managed systems
If the system is already:
β’ Registered in Trellix ePO
β’ Joined to a Kubernetes cluster It is recommended to:
β’ Remove or drain the node from Kubernetes
β’ Regenerate the machine-id
β’ Reboot
β’ Rejoin the Kubernetes cluster
β’ Re register the Trellix agent
This prevents identity conflicts across platforms.
Preventing the issue in future clones
When creating golden images or VM templates:
β’ Remove /etc/machine-id before converting the VM to a template
β’ Do not clone powered on VMs
β’ Allow systemd to generate a new machine-id on first boot
β’ Use cloud init or first boot scripts when available
This ensures each VM receives a unique identity automatically.
Summary
Cloning RHEL VMs with an existing machine-id causes duplicate host identities and can lead to operational and security issues.
Regenerating the machine-id after cloning and following proper template hygiene prevents these problems and is required for stable Kubernetes and endpoint security operation.