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

Create /dev/disk/* symlink to boot disk, for use by Ignition config #759

Closed
bgilbert opened this issue Mar 6, 2021 · 9 comments
Closed
Labels
jira for syncing to jira kind/enhancement

Comments

@bgilbert
Copy link
Contributor

bgilbert commented Mar 6, 2021

(apologies for writing a JIRA card; actually I copypasted this)

As a user configuring disk partitions via FCC,
I want a stable device path for the boot disk,
so I can write a storage.disks section without hardcoding /dev/sda, /dev/vda, or /dev/nvme0n1.

Acceptance criteria:

  • Create /dev/disk/... symlink for disk containing root filesystem when there's exactly one such disk, and create no such symlink in other cases (e.g. rootfs RAID)
  • Confirm symlink doesn't propagate to the real root
  • Possibly add an FCCT validation to check for symlink being used outside storage.disks.device context (to prevent adding a mount unit pointing to the symlink)
  • FCOS and RHCOS docs updated to explicitly resize root partition when rootfs LUKS configured without RAID
  • FCOS and RHCOS docs updated to use stable symlink when configuring /var partition on boot disk
  • kola test for stable symlink added
@bgilbert
Copy link
Contributor Author

bgilbert commented Mar 6, 2021

I don't think udev rules natively have a way to take action based on the properties of a child device. In principle we could shell out to a script, though. However: if we do this with udev, race conditions could be a concern. At some point during ignition-disks, the boot device will no longer have a recognizable rootfs on it, and udev will remove the symlink. Ignition device aliases should handle this, if the symlink is only used to partition the disk. But if the config tries to reuse the symlink e.g. to put a filesystem on the whole-disk device for the original boot disk, it may fail.

We might want to create the symlink programmatically from a systemd service, instead. That would avoid any possible races. Plus, we're used to sequencing systemd units in the initrd, and less used to debugging udev interactions.

@cgwalters
Copy link
Member

This is also related to...some tracker issue where we discussed discovering the boot disk and how for us that boils down to our GRUB config hardcoding LABEL=boot. If this is about before the root partition might be moved by Ignition, then we can create this in early boot exactly once, right?

Because this refers to the root label which is FCOS specific it'd live in f-c-c git?

Agree that systemd unit makes the most sense; we can just explicitly sequence it where we want.

@bgilbert
Copy link
Contributor Author

bgilbert commented Mar 9, 2021

If this is about before the root partition might be moved by Ignition, then we can create this in early boot exactly once, right?

Right.

Because this refers to the root label which is FCOS specific it'd live in f-c-c git?

Yep.

@sohankunkerkar sohankunkerkar pinned this issue Aug 24, 2021
@sohankunkerkar sohankunkerkar unpinned this issue Aug 24, 2021
@jlebon jlebon added the jira for syncing to jira label Oct 18, 2021
nikita-dubrovskii added a commit to nikita-dubrovskii/fedora-coreos-config that referenced this issue Oct 25, 2021
Issue: coreos/fedora-coreos-tracker#759

Signed-off-by: Nikita Dubrovskii <nikita@linux.ibm.com>
nikita-dubrovskii added a commit to nikita-dubrovskii/coreos-assembler that referenced this issue Oct 26, 2021
Issue: coreos/fedora-coreos-tracker#759

Signed-off-by: Nikita Dubrovskii <nikita@linux.ibm.com>
nikita-dubrovskii added a commit to nikita-dubrovskii/fedora-coreos-config that referenced this issue Oct 26, 2021
Issue: coreos/fedora-coreos-tracker#759

Signed-off-by: Nikita Dubrovskii <nikita@linux.ibm.com>
nikita-dubrovskii added a commit to nikita-dubrovskii/fedora-coreos-config that referenced this issue Nov 4, 2021
Issue: coreos/fedora-coreos-tracker#759

Signed-off-by: Nikita Dubrovskii <nikita@linux.ibm.com>
nikita-dubrovskii added a commit to nikita-dubrovskii/fedora-coreos-config that referenced this issue Nov 4, 2021
Issue: coreos/fedora-coreos-tracker#759

Signed-off-by: Nikita Dubrovskii <nikita@linux.ibm.com>
nikita-dubrovskii added a commit to nikita-dubrovskii/fedora-coreos-config that referenced this issue Nov 5, 2021
Issue: coreos/fedora-coreos-tracker#759

Signed-off-by: Nikita Dubrovskii <nikita@linux.ibm.com>
nikita-dubrovskii added a commit to nikita-dubrovskii/ignition that referenced this issue Nov 5, 2021
Issue: coreos/fedora-coreos-tracker#759

As long as `cores-root-disk` symlink isn't managed by `udev-rules` or `device-mapper`,
we should use target device for `systemd` `.device' units

Signed-off-by: Nikita Dubrovskii <nikita@linux.ibm.com>
nikita-dubrovskii added a commit to nikita-dubrovskii/fedora-coreos-config that referenced this issue Nov 10, 2021
Issue: coreos/fedora-coreos-tracker#759

Signed-off-by: Nikita Dubrovskii <nikita@linux.ibm.com>
nikita-dubrovskii added a commit to nikita-dubrovskii/fedora-coreos-config that referenced this issue Nov 10, 2021
Issue: coreos/fedora-coreos-tracker#759

Signed-off-by: Nikita Dubrovskii <nikita@linux.ibm.com>
nikita-dubrovskii added a commit to nikita-dubrovskii/fedora-coreos-config that referenced this issue Nov 10, 2021
Issue: coreos/fedora-coreos-tracker#759

Signed-off-by: Nikita Dubrovskii <nikita@linux.ibm.com>
nikita-dubrovskii added a commit to nikita-dubrovskii/fedora-coreos-config that referenced this issue Nov 10, 2021
Issue: coreos/fedora-coreos-tracker#759

Signed-off-by: Nikita Dubrovskii <nikita@linux.ibm.com>
nikita-dubrovskii added a commit to nikita-dubrovskii/fedora-coreos-config that referenced this issue Nov 11, 2021
Issue: coreos/fedora-coreos-tracker#759

Signed-off-by: Nikita Dubrovskii <nikita@linux.ibm.com>
nikita-dubrovskii added a commit to nikita-dubrovskii/fedora-coreos-config that referenced this issue Nov 26, 2021
Issue: coreos/fedora-coreos-tracker#759

Signed-off-by: Nikita Dubrovskii <nikita@linux.ibm.com>
nikita-dubrovskii added a commit to nikita-dubrovskii/fedora-coreos-config that referenced this issue Nov 29, 2021
Issue: coreos/fedora-coreos-tracker#759

Signed-off-by: Nikita Dubrovskii <nikita@linux.ibm.com>
nikita-dubrovskii added a commit to nikita-dubrovskii/fedora-coreos-config that referenced this issue Jan 26, 2022
nikita-dubrovskii added a commit to nikita-dubrovskii/fedora-coreos-config that referenced this issue Jan 26, 2022
nikita-dubrovskii added a commit to nikita-dubrovskii/fedora-coreos-config that referenced this issue Jan 31, 2022
…oot disk

Issue: coreos/fedora-coreos-tracker#759

Signed-off-by: Nikita Dubrovskii <nikita@linux.ibm.com>
nikita-dubrovskii added a commit to nikita-dubrovskii/fedora-coreos-config that referenced this issue Jan 31, 2022
Creates '/dev/disk/coreos-root-disk' symlink to boot disk for
use by Ignition config, therefore 'storage.disks' section
could be defined without hardcoding /dev/sda, /dev/vda, etc.

Issue: coreos/fedora-coreos-tracker#759

Signed-off-by: Nikita Dubrovskii <nikita@linux.ibm.com>
nikita-dubrovskii added a commit to nikita-dubrovskii/fedora-coreos-config that referenced this issue Feb 2, 2022
Creates '/dev/disk/coreos-boot-disk' symlink to boot disk for
use by Ignition config, therefore 'storage.disks' section
could be defined without hardcoding /dev/sda, /dev/vda, etc.

Issue: coreos/fedora-coreos-tracker#759

Signed-off-by: Nikita Dubrovskii <nikita@linux.ibm.com>
jlebon pushed a commit to coreos/fedora-coreos-config that referenced this issue Feb 2, 2022
Creates '/dev/disk/coreos-boot-disk' symlink to boot disk for
use by Ignition config, therefore 'storage.disks' section
could be defined without hardcoding /dev/sda, /dev/vda, etc.

Issue: coreos/fedora-coreos-tracker#759

Signed-off-by: Nikita Dubrovskii <nikita@linux.ibm.com>
@jlebon
Copy link
Member

jlebon commented Feb 2, 2022

Fixed in coreos/fedora-coreos-config#1308.

@jlebon jlebon closed this as completed Feb 2, 2022
@dustymabe
Copy link
Member

Would be cool to add some docs for this.

@jlebon
Copy link
Member

jlebon commented Feb 4, 2022

Would be cool to add some docs for this.

Opened coreos/fedora-coreos-docs#353 so we don't lose that.

@dustymabe
Copy link
Member

The fix for this went into testing stream release 35.20220213.2.0. Please try out the new release and report issues.

@dustymabe dustymabe added status/pending-stable-release Fixed upstream and in testing. Waiting on stable release. and removed status/pending-testing-release Fixed upstream. Waiting on a testing release. labels Feb 16, 2022
@travier
Copy link
Member

travier commented Mar 16, 2022

I think this one went into stable 35.20220213.3.0. @dustymabe?

@dustymabe
Copy link
Member

The fix for this went into stable stream release 35.20220213.3.0.

@dustymabe dustymabe removed the status/pending-stable-release Fixed upstream and in testing. Waiting on stable release. label Mar 16, 2022
HuijingHei pushed a commit to HuijingHei/fedora-coreos-config that referenced this issue Oct 10, 2023
Creates '/dev/disk/coreos-boot-disk' symlink to boot disk for
use by Ignition config, therefore 'storage.disks' section
could be defined without hardcoding /dev/sda, /dev/vda, etc.

Issue: coreos/fedora-coreos-tracker#759

Signed-off-by: Nikita Dubrovskii <nikita@linux.ibm.com>
HuijingHei pushed a commit to HuijingHei/fedora-coreos-config that referenced this issue Oct 10, 2023
Creates '/dev/disk/coreos-boot-disk' symlink to boot disk for
use by Ignition config, therefore 'storage.disks' section
could be defined without hardcoding /dev/sda, /dev/vda, etc.

Issue: coreos/fedora-coreos-tracker#759

Signed-off-by: Nikita Dubrovskii <nikita@linux.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira for syncing to jira kind/enhancement
Projects
None yet
Development

No branches or pull requests

5 participants