What can I do (e.g. after hostname change) if the iotedge service of a device onboarded to netFIELD Cloud indicates "identityd hostname" problem during a check?

Q

What can I do (e.g. after hostname change) if the iotedge service of a device onboarded to netFIELD Cloud indicates "identityd hostname" problem during a check?

A

Changing the hostname of a device that is onboarded to a netFIELD Cloud instance may indicate a red status "offline"

after changing its hostname to a different name than the one at the time it was onboarded.

Using the command

sudo iotedge check


will output a hint like the following

× identityd config toml file specifies a valid hostname - Error
    identityd config has hostname XXXXXXX but device reports hostname YYYYYYYYYY.
    Hostname in identityd config must either be identical to the device hostname or be a fully-qualified domain name that has the device hostname as the first component.

In this case, the current certificates need to be invalidated and renewed by calling the command sequence

sudo rm -rf /etc/ssl/private/iotedge-ca/ 
sudo sed -i -e '/\[edge_ca\]/,+2d' /etc/aziot/config.toml 
sudo iotedge system restart

Calling a subsequent

sudo iotedge check

will indiacte afterwards that everything is well now

Configuration checks (aziot-identity-service)
---------------------------------------------
√ keyd configuration is well-formed - OK
√ certd configuration is well-formed - OK
√ tpmd configuration is well-formed - OK
√ identityd configuration is well-formed - OK
√ daemon configurations up-to-date with config.toml - OK
√ identityd config toml file specifies a valid hostname - OK

Also the device should get the green status in the netFIELD Cloud instance