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

Consider specializing mount units on first boot, after partitioning #1732

Open
travier opened this issue May 15, 2024 · 4 comments
Open

Consider specializing mount units on first boot, after partitioning #1732

travier opened this issue May 15, 2024 · 4 comments

Comments

@travier
Copy link
Member

travier commented May 15, 2024

Describe the enhancement

We should consider adding some logic somewhere (Ignition or elsewhere) that specialize the /dev/sda entries in system units that Ignition writes to make sure that they stay stable across major OS upgrades.

This would add an override snippet that "fixes" the path to the partition to a well-defined, more stable ID than the default one.

Alternative, but only works for new installations

Another option would be to add new "selecting" options to Ignition to have to figure out "dynamically" which disk to use instead of hard coding names or IDs that may vary per node. For example, I could say: I want this to be on the smallest disk, this on the boot disk, this on the largest one.

Ideally we would ship all udev rules for all clouds, but that does not help us with Bare Metal systems.

System details

Bare Metal and some clouds:

Additional information

This could help with:

@travier travier added kind/enhancement meeting topics for meetings labels May 15, 2024
@jlebon
Copy link
Member

jlebon commented May 16, 2024

The main problem related to block device naming is feeding stable names to the partitioning or filesystem parts of the Ignition schema. Once you have that though, one should definitely set e.g. a partition or filesystem label that then gets used in the mount unit. That's stable across updates.

I think the issue is that our documentation may not follow that flow everywhere. (And in fact, https://github.com/openshift/os/blob/master/docs/faq.md#q-how-do-i-configure-a-secondary-block-device-via-ignitionmc-if-the-name-varies-on-each-node should be updated so that the mkfs.xfs step sets a label to avoid that whole $VAR_LIB_FOOBAR_DEV dance altogether.)

Edit: openshift/os#1509

jlebon added a commit to jlebon/os that referenced this issue May 16, 2024
We don't need to use an overcomplicated env unit dropin here. We can
just label the filesystem with a stable name and use that to refer to
the device in the mount unit.

Also clean up the script after we ran it and use it as the stamp file to
know if to run or not.

Related: coreos/fedora-coreos-tracker#1732
jlebon added a commit to jlebon/os that referenced this issue May 16, 2024
We don't need to use an overcomplicated env unit dropin here. We can
just label the filesystem with a stable name and use that to refer to
the device in the mount unit.

Related: coreos/fedora-coreos-tracker#1732
@travier
Copy link
Member Author

travier commented May 21, 2024

feeding stable names to the partitioning or filesystem parts of the Ignition schema.

Unfortunately this means that Ignition configs have to be specialized for each node. It's also a problem that you don't know that you will have until an update happens and triggers it and updating the Ignition config at that time will not help.


For selectors, I was thinking of something like:

storage:
	disks:
		- device_selector: 
			size: smallest|largest|<500GB|>500GB
			kind: spinning|!spinning|...
			vendor: "regexp?"
			...

which gets converted down on successful match to exact device IDs to keep things stable.

@jlebon
Copy link
Member

jlebon commented May 21, 2024

feeding stable names to the partitioning or filesystem parts of the Ignition schema.

Unfortunately this means that Ignition configs have to be specialized for each node.

Right yeah, that's indeed the main problem and why https://github.com/openshift/os/blob/master/docs/faq.md#q-how-do-i-configure-a-secondary-block-device-via-ignitionmc-if-the-name-varies-on-each-node exists.

It's also a problem that you don't know that you will have until an update happens and triggers it and updating the Ignition config at that time will not help.

This is the part I'm trying to expand on: the recommendation should be to define a partition or filesystem label and use by-partlabel/ or by-label/ in your mount unit.

@jlebon
Copy link
Member

jlebon commented May 22, 2024

We discussed this in today's community meeting:

We also mentioned we could emit an MOTD to detect this case on upgrading nodes and give users instructions on how to fix their mount units.

We also mentioned that it might be worth exploring adding more symlinks to make device selection easier in storage.disks and storage.filesystems.

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

No branches or pull requests

2 participants