oxidecomputer / oxidecomputer/omicron

Initialize `/etc/hosts` in zones

Open
#1,388 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

networking Sled Agent
Dominant language
Rust
Stars
572
Forks
97
Avg merge
2d 12h
Merged PRs (30d)
96

Description

The other day @jgallagher got the following messages on the console:

14Jul  9 03:10:00 oxz_nexus cron[1796]: [ID 574227 user.alert] Solaris_audit getaddrinfo(oxz_nexus) failed[node name or service name not known]: Error 0
Jul  9 03:10:00 oxz_nexus cron[1796]: [ID 574227 user.alert] Solaris_audit mapping oxz_nexus to fe80::8:20ff:fe97:6ad0: Error 0

These come from the auditing subsystem in illumos. In particular, the reason that these console logs are generated is due to the fact that we're trying to resolve the hosts primary node name to a DNS address, but failing to. While we could opt to wait until we have DNS set up, it might make sense to make a mapping of the node name as an entry in /etc/hosts. In fact, the default /etc/hosts that we have right now just has mappings for local host. So if we look at say the file in the nexus zone (oxc_nexus), we just see (stripping the comments out):

::1             localhost
127.0.0.1       localhost loghost

On other hosts you might actually see the system's name in /etc/hosts when it's not part of the DNS scheme. From here we have two options that we may want to consider:

  1. Have sled-agent append an entry for the IPv6 address as the node name as a line in /etc/hosts as part of all of its other static networking setup.
  2. Assume that DNS will always be functioning and allow that to work.

I have a minor, perhaps irrational preference, for (1). In particular, the main idea here is that if DNS isn't functioning or not to rely on the dns search path or related features, it may make sense to still have a fixed entry. In particular, because it mimics what we're trying to do and will help speed up the overall process when using getaddrinfo() for processing by the system. Note, that the DNS bits would still be needed regardless for the rest of the system to reach it and for the individual services which will be using a cueball like system that'll always use DNS and therefore bypass the name service switch and related.

@jclulow thoughts on this part of the network naming?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating sled-agent's static networking setup and the code that initializes /etc/hosts in zones. Review how the node name and IPv6 address are obtained, then resolve whether the chosen behavior is to append a node mapping or rely on DNS; done means the intended mapping is initialized consistently and the relevant networking tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
networking, operating-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.