Skip to content

Use device UUID in hostname for unique mDNS identification #33

Description

@mihai-chiorean

Description

Currently, the hostname is generated using device serial or MAC address. We should use the already-generated device UUID (from edgeos-identity) to create a unique, persistent hostname that's broadcasted via mDNS.

Current Behavior

  • Hostname: edgeos-${serial_last_8_chars}
  • UUID is generated separately in /etc/edgeos/device-uuid
  • Two separate identity systems

Desired Behavior

  • Generate hostname using the device UUID
  • Format: edgeos-${uuid_last_8_chars} or similar
  • Ensure mDNS broadcasts the correct hostname
  • Single source of truth for device identity

Implementation Requirements

  1. Modify hostname generation flow:

    • edgeos-identity service generates UUID first
    • Hostname derived from UUID (not serial/MAC)
    • Both happen before network services start
  2. Update generate-hostname.sh:

    # Read UUID from /etc/edgeos/device-uuid
    if [ -f /etc/edgeos/device-uuid ]; then
        UUID=$(cat /etc/edgeos/device-uuid)
        SHORT_ID=${UUID: -8}
        HOSTNAME="edgeos-${SHORT_ID}"
    fi
  3. Service ordering:

    • edgeos-identity.service (generates UUID)
    • edgeos-hostname.service (sets hostname from UUID)
    • avahi-daemon.service (broadcasts hostname)

Benefits

  • Single identity source (UUID)
  • Consistent device identification across all services
  • UUID already used in mDNS TXT records
  • Simpler troubleshooting with matching identifiers

Acceptance Criteria

  • Hostname generated from device UUID
  • UUID generation happens before hostname setting
  • mDNS broadcasts correct UUID-based hostname
  • Hostname persists across reboots
  • Both hostname and UUID use same identifier
  • Backward compatibility considered

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions