I have devices already deployed to the field, and I’m using the default implementation of mac=xx:xx:xx:xx:xx:xx
as the output format for mender-device-identity
. Although this satisfies the constraints of uniqueness and is locked to hardware, it isn’t particularly human friendly. I’d like to add a unique serial_number
attribute to the identity set. In fact, I’m already sending this attribute as part of an inventory
script.
It is my understanding that device identity should remain constant for the device lifetime:
The device identity must remain unchanged throughout lifetime of the device. Thus, it is advised to use attributes that will not change or are unlikely to change in the future.
By adding a serial_number
attribute to the mender-device-identity
script in addition to the mac
attribute (whose implementation I’d leave unchanged), I’d be making the identity set a superset of the current identity. However, my understanding is that this would cause each device to be regarded as a new device, since the identity set is hashed together to form a unique ID from the server.
My use case is simply to add an alternate tag for identity that is easier to read. It appears this could be handled in at least two ways:
- Change
mender-device-identity
to output bothmac
andserial_number
attributes, which would allow changing the displayed identifier in the web UI frommac
toserial_number
. - Allow custom columns to be added to the device list table in the web UI. The columns could be chosen from either the identity or inventory attributes.
Although the web UI change would satisfy my use case, I’m wondering what the impact would be if I augmented the identity key set from [mac
] to [mac
, serial_number
]. Would it be as simple as the following steps, or am I missing something?
- Add
serial_number
output tomender-identity-script
. - Push a Mender update to all devices containing the change.
- Decommission every device.
- Reauthorize every device using the new identity set.