Provide UUID for system id

Description

Background
Folow up ticket from https://opennms.atlassian.net/browse/NMS-14684#icft=NMS-14684

OpenNMS has a system id, stored in the table monitoringSystems.
It is accessed via DistPollerDaoHibernate.whoami() and exposed via OIA: RuntimeInfo.getSystemId()

Historically the id was always 00000000-0000-0000-0000-000000000000. With https://github.com/OpenNMS/opennms/pull/5216 we allowed to use any UUID. It can now manually be set via:

Update monitoringsystems set id=gen_random_uuid () where id = '00000000-0000-0000-0000-000000000000' AND type='OpenNMS' AND location='Default'

Goal

  • Going forward we want any new install of OpenNMS to have a unique system id.

  • Nice to have: a manual? migration path (e.g. description?) for existing systems that want to change their current system id to a UUID.

Business Reason
Within TSAAS we use the system id for logging. It will be easier for customers to interpret the logs.

Acceptance / Success Criteria

None

Confluence content

mentioned on

Lucidchart Diagrams

Activity

Show:

Zoë Knox October 28, 2022 at 6:13 PM
Edited

Have we followed up on the other system ID location? I think we should make both the same value unless there is a good reason to have separate ones. Or can we remove the second location and use a single source?

 

 

Alex May October 25, 2022 at 7:17 PM

Merged into release-30.x

Alex May October 19, 2022 at 7:51 PM

There seems to be a completely separate system id that is maintained in org.opennms.features.datachoices.internal.StateManager, which is also included in the usage statistics report payload. Worth following up on once this is merged in.

Alex May October 18, 2022 at 8:02 PM

Alex May October 6, 2022 at 4:43 PM
Edited

From my testing, the command listed above won't work on its own since the alarms table has a foreign key restraint on that id. It's straightforward to modify that constraint to cascade the updates, see the additions here:

https://github.com/OpenNMS/opennms/pull/5225/commits/fb046a5f08ad4b93172a50065577c410bc8b907a

Fixed

Details

Assignee

Reporter

Sprint

Fix versions

Priority

PagerDuty

Created October 5, 2022 at 5:41 PM
Updated March 20, 2023 at 4:52 PM
Resolved October 25, 2022 at 7:17 PM

Flag notifications