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

btrfs filesystems cannot be specifed with multiple devices #815

Open
nickbreen opened this issue May 28, 2019 · 5 comments
Open

btrfs filesystems cannot be specifed with multiple devices #815

nickbreen opened this issue May 28, 2019 · 5 comments
Labels
kind/enhancement spec change Requires changes to the spec

Comments

@nickbreen
Copy link

nickbreen commented May 28, 2019

Feature Request

Support multiple devices for btrfs filesystems in *.ign configuration.

Environment

Bare metal, PXE boot.

Desired Feature

Essentially to have this configuration supported:

storage:
  disks:
    - device: /dev/sda
      wipe_table: false
      partitions:
        - label: srva
          number: 1
          start: 0
          size: 0
    - device: /dev/sdb
      wipe_table: false
      partitions:
        - label: srvb
          number: 1
          start: 0
          size: 0

  filesystems:
    - name: srv
      mount:
        device: [ /dev/sda1, /dev/sdb1 ]
        format: btrfs
        wipe_filesystem: false
        label: SRV

Other Information

This works perfectly now, but with only single device support.

@lucab
Copy link
Contributor

lucab commented May 28, 2019

Self note: storage.filesystems[].mount.device is currently a simple string, not an array.

@ajeddeloh
Copy link
Contributor

Hadn't considered this before. btrfs is somewhat special since it's the only supported filesystem that supports multiple devices. Multi-device support also gets really hairy when you consider the filesystem reuse semantics and root-on-raid (though it doesn't look like you're doing root-on-raid here). There's some related discussion about how Ignition should handle mdadm raid that would also apply. This would also need to be in a new spec (either 2.4.0-experimental for CL and/or 3.1.0-experimental for FCOS) since it would change the type of device from string to []string (and we'd probably want to rename it devices).

As a stop gap, it looks like mkfs.btrfs is smart about parsing out-of-order arguments, so you should be able to just add the extra devices to the options section and have it just work. Just be aware that options are not considered when doing filesystem matching (as per the reuse semantics linked above), so you may have false positives for determining if the filesystem is already set up if you're PXE booting without a persistent root.

@nickbreen
Copy link
Author

I worked around this with a oneshot systemd service to add the other devices on startup, which seems to be robust enough.

@bgilbert bgilbert changed the title btrfs filesystems cannot be specifed with mutlple devices btrfs filesystems cannot be specifed with multiple devices Jul 24, 2021
@bgilbert
Copy link
Contributor

bgilbert commented Nov 8, 2022

As we found in #1176, converting a scalar device field to a devices array would cause some problems. A major one is that config merging doesn't allow child configs to replace list entries in the parent (#1130). It would also require us to deprecate the device field, breaking configs for a use case that won't affect most users.

As an alternative, device could specify one of the component devices, and then we'd add something like an additionalDevices array for the other devices. That's a little clunky but it has some benefits. It would avoid affecting the common case, while allowing Ignition to have special-case behavior for multiple disks, which wouldn't be possible if secondary devices were specified in the options field:

  • Config validation could ensure that a device isn't specified in multiple filesystems sections
  • Ignition could validate that a pre-existing filesystem has all of the specified secondary devices, and no others

In principle we could also add other fields, e.g. for data and metadata storage profiles. That would allow Ignition to check those against a pre-existing filesystem as well. But a minimal implementation might just use options for those.

Thoughts?

@travier travier added kind/enhancement spec change Requires changes to the spec labels Nov 22, 2022
@har7an
Copy link

har7an commented Jan 22, 2023

I think it's "fair" to add a new, explicit configuration option for filesystem RAIDs that extends the default. Sounds like a good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement spec change Requires changes to the spec
Projects
None yet
Development

No branches or pull requests

6 participants