xref: /openbmc/docs/designs/unique-hostname.md (revision f4febd00)
12ef2b60dSasmithakarun# Setting a unique hostname to the BMC machine on first boot
22ef2b60dSasmithakarun
3*f4febd00SPatrick WilliamsAuthor: Asmitha KR
42ef2b60dSasmithakarun
5*f4febd00SPatrick WilliamsOther contributors: None
62ef2b60dSasmithakarun
7*f4febd00SPatrick WilliamsCreated: 2019-05-07
82ef2b60dSasmithakarun
92ef2b60dSasmithakarun## Problem Description
10*f4febd00SPatrick Williams
112ef2b60dSasmithakarunIn OpenBMC, the hostname discovery is done by the avahi Dbus service at the
122ef2b60dSasmithakarunstartup. In a network where there are multiple OpenBMC machines, avahi keeps
13*f4febd00SPatrick Williamsgetting the hostname conflict and the service name conflict. Hence, the problem
14*f4febd00SPatrick Williamsis to find a solution that resolves these conflicts.
152ef2b60dSasmithakarun
162ef2b60dSasmithakarun## Background and References
17*f4febd00SPatrick Williams
182ef2b60dSasmithakarunThe detailed issue regarding the hostname and service name conflicts is
192ef2b60dSasmithakarundescribed in the following links.
202ef2b60dSasmithakarun
212ef2b60dSasmithakarunhttps://github.com/openbmc/openbmc/issues/1741.
222ef2b60dSasmithakarunhttps://lists.freedesktop.org/archives/avahi/2018-January/002492.html
232ef2b60dSasmithakarunhttps://github.com/lathiat/avahi/issues/117
242ef2b60dSasmithakarun
252ef2b60dSasmithakarun## Requirements
26*f4febd00SPatrick Williams
272ef2b60dSasmithakarunNone.
282ef2b60dSasmithakarun
292ef2b60dSasmithakarun## Proposed Design
30*f4febd00SPatrick Williams
31*f4febd00SPatrick WilliamsTo solve this, we are proposing a service which assigns a unique hostname to the
32*f4febd00SPatrick WilliamsBMC and runs on the very first boot. one of the ways to generate the unique
332ef2b60dSasmithakarunhostname is to append the Serial Number retrieved from Inventory Manager to the
342ef2b60dSasmithakarunexisting default hostname.
352ef2b60dSasmithakarun
362ef2b60dSasmithakarun## Alternatives Considered
37*f4febd00SPatrick Williams
382ef2b60dSasmithakarunNone.
392ef2b60dSasmithakarun
402ef2b60dSasmithakarun## Impacts
41*f4febd00SPatrick Williams
422ef2b60dSasmithakarunNone.
432ef2b60dSasmithakarun
442ef2b60dSasmithakarun## Testing
45*f4febd00SPatrick Williams
462ef2b60dSasmithakarunNone.
47