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

Microk8s CLI mayastor-pools command should use recommended way to refer to disks #268

Open
adamfowleruk opened this issue Mar 16, 2024 · 0 comments

Comments

@adamfowleruk
Copy link

Summary

The Mayastor documentation recommends using disk name references that persist between system reboots rather than references such as /dev/nvme1n1. Currently the Microk8s mayastor-pools add command only supports these names rather than the by-id names. This fails because specifying a full path such as --device /dev/disks/by-id/nvme-SomeDiscReference-54321 attempts to use the whole name as part of the pool name when it generates the DiskPool YAML, which is not a valid K8S name, and so fails.

What Should Happen Instead?

As a bare minimum, a sensible name in the YAML should be generated from the last part of the device path rather than full path.

Ideally this command should take a local name such as nvme1n1 and use linux syscalls to determine its by-id (E.g. via the udevadm command/API). It should then generate a sensible persistent name that is valid, and use the by-id name in the YAML's 'disks: ['NAME']' element.

Even better, modifying the mayastor-pools command to include something like add --thisnode --all-free-nvme or --all-free-sata, or even better a cluster wide version of this, would be much more user friendly. (One pool per disk)

Reproduction Steps

  1. Enable the Mayastor addon
  2. Attempt to run microk8s mayastor-pools add --node mynode --device /dev/disks/by-id/nvme-SOMEID
  3. Observe that this command fails

Introspection Report

Unable to share - airgapped customer system. Was on Ubuntu 23.10.1 and microk8s v1.29.2-strict and that version of the Mayastor addon.

Can you suggest a fix?

As above - several options.

Are you interested in contributing with a fix?

Not sure where to start on a reliable way via Linux system calls if I'm honest. My udevadm and mount approach I'm using with sed feels a bit hacky.

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

No branches or pull requests

1 participant