Skip to content

hwdb: add Oracle Cloud OCI IMDS data#4

Closed
rpigott wants to merge 18 commits intopoettering:imdsfrom
rpigott:oracle/imds
Closed

hwdb: add Oracle Cloud OCI IMDS data#4
rpigott wants to merge 18 commits intopoettering:imdsfrom
rpigott:oracle/imds

Conversation

@rpigott
Copy link
Copy Markdown

@rpigott rpigott commented Mar 16, 2026

Adds support for Oracle Cloud "OCI".

I don't think public IPv4 data is available via IMDS, but IPv6 GUA is available under the /vnics path. A host in OCI can have multiple vnics, I believe each potentially with multiple GUA, not sure how this should be handled in systemd-imds, so I've chosen to omit the IPv4/IPv6 public addr keys.

Oracle has multiple cloud services. This IMDS service matches what is available in OCI, in contrast with their other cloud services like PCA. As recorded in the comment, the documentation for the OCI IMDS keys is available here. This PR uses the IMDSv2 keys.

poettering and others added 18 commits March 13, 2026 11:04
Credentials are highly privileged things, but still, let's do some
validation, because we can.
For the IMDS case there's value in being able to set the static
hostname, instead of just the transient one. Let's introduce
firstboot.hostname, which only applies to first boot, and write the
static hostname. This is different from system.hostname which applies to
any boot, and writes the transient hostname.
This stuff needs assert() defined, but we don't really want to pull in
assert-fundamental.h into macro.h just for this, hence split this out.
This is very similar to write_string_file_atomic(), but is intentionally
kept separate (after long consideration). It focusses on arbitrary
struct iovec data, not just strings, and hence also doesn't do stdio at
all. It's hence a lot more low-level.

We might want to consider moving write_string_file*() on top of
write_data_file_atomic_at(), but for now don't.
…ter it

For various usecases it is useful to read relevant data from the DMI
udev device, but this means we need a way to wait for it for this to be
probed to be race-free. Hence tag it with "systemd", so that
sys-devices-virtual-dmi-id.device can be used as synchronization point.
This only parses a small subset of RR types for now, but we can add more
later.

Covered are the most important RR types: A, AAAA, PTR.
let's ensure the name is actually a valid DNS name.
When we are told to reload our configuration also flush out /etc/hosts
explicitly. This is particularly relevant since we suppress too frequent
reloads, and hence a synchronous way to force a reload is very useful.
This is an extension of the /etc/hosts concept, but can provide any kind
of RRs (well, actually, we only parse A/AAAA/PTR for now, but the
concept is open for more).

Fixes: systemd#17791
@poettering poettering force-pushed the imds branch 4 times, most recently from e7ccdfa to 9922f5e Compare March 19, 2026 16:01
@rpigott
Copy link
Copy Markdown
Author

rpigott commented Mar 19, 2026

This is now included in the main PR. Closing.

@rpigott rpigott closed this Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants