Ask: A system has the same machine-id than the original one, need to differentiate it so that some applications can tell systems apart.
What is machine-id
– The /etc/machine-id file contains the unique machine ID of the local system that is set during installation. The machine ID is a single newline-terminated, hexadecimal, 32-character, lowercase machine ID string. When decoded from hexadecimal, this corresponds to a 16-byte/128-bit string.
– The “machine-id” parameter is added from RHEL 7.1 to identify the machine in the network. Therefore this parameter must be unique.
– But when user clone the virtual machine that is installed RHEL 7.1, the cloned virtual machine’s “machine-id” is not changed, and some virtual machine may have the same “machine-id”.
– User should change the “machine-id” of the cloned virtual machine for the server to be uniquely identifiable over network.
– The machine-id is written into the file /etc/machine-id.
There is a built-in tool in systemd called systemd-machine-id-setup that will allow the re-generation of the machine-id. This is the procedure on how to use it:
1. Add writing permission to the machine-id file:
# chmod 777 /etc/machine-id
2. Open /etc/machine-id with a text editor and delete all of its content.
# vi /etc/machine-id
3. Rename the file /etc/machine-id:
# mv /etc/machine-id /etc/machine-id.oldid
4. Run the command:
5. Restore the previous permissions of the file:
# chmod 444 /etc/machine-id
Now the system will have a different IDs.