Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: persist /etc/nvme #984

Merged
merged 1 commit into from
Feb 18, 2025
Merged

fix: persist /etc/nvme #984

merged 1 commit into from
Feb 18, 2025

Conversation

tserong
Copy link
Contributor

@tserong tserong commented Feb 18, 2025

Problem:
Our OS image includes /etc/machine-id, /etc/iscsi/initiatorname.iscsi, /etc/nvme/hostid and /etc/nvme/hostnqn. This means that those files will be identical on every single Harvester node installed from a given ISO image. This is wrong.

/etc/machine-id is meant to be unique per host, see e.g.:

https://manpages.opensuse.org/Tumbleweed/systemd/machine-id.5.en.html

Likewise, the iSCSI initiator name and NVMe hostid/hostnqn need to be unique when accessing external storage via iSCSI or NVMe over fabrics.

Solution:
harvester/os2#190 ensures that those files are not included in our OS image, and will be instead generated on first boot. This harvester-installer PR is also required to ensure /etc/nvme persists correctly.

Related Issue:
harvester/harvester#6911

Test plan:

  • With this and fix: ensure machine-id, initiatorname.iscsi and host{id,nqn} are unique os2#190 applied, install harvester on at least two nodes.
  • Check the contents of /etc/machine-id, /etc/iscsi/initiatorname.iscsi, /etc/nvme/hostid and /etc/nvme/hostnq on each node (tail -n1 /etc/machine-id /etc/iscsi/initiatorname.iscsi /etc/nvme/host* works well for this). The contents of the files should be different on each node. This verifies that those files are being uniquely generated on each node on first boot.
  • Reboot each node. Check the contents of those files again. Verify on each node that the contents are the same as they were before the reboot. This verifies that the files are correctly persisted and are not being re-generated on subsequent boots.

Without this, the contents of `/etc/nvme` won't be persistent, as
our config here overrides that in os2.  This is needed in support
of harvester/os2#190

Related issue: harvester/harvester#6911

Signed-off-by: Tim Serong <[email protected]>
@tserong tserong merged commit 8214c46 into harvester:master Feb 18, 2025
7 checks passed
@tserong tserong deleted the wip-fix-6911 branch February 18, 2025 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants