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

MTL-1748 Handle NVME partition naming #32

Merged
merged 3 commits into from
May 20, 2022
Merged

MTL-1748 Handle NVME partition naming #32

merged 3 commits into from
May 20, 2022

Conversation

rustydb
Copy link
Contributor

@rustydb rustydb commented May 19, 2022

Remove manual gcp-mode by replacing it with automatic NVME handling.

Summary and Scope

Issue Type
  • Bugfix Pull Request

This fixes the NVME handling of partitions.

  1. Each partition of an NVME is delimited with a letter "p" which is currently missing from the strings referring to the target disks when dracut runs.

  2. This change also effectively automates gcp-mode, making toggling of gcp-mode no longer necessary. Thus gcp-mode has been removed.

  3. Additionally this fixes a loophole from NVME partitions by adding the -d flag to the lsblk call. Without the -d flag, NVME partitions show up in the lsblk output with nvme as their TRANSPORT value. The disk resolver only chooses from disks that have a TRANSPORT value, but the disk resolver needs to ignore partitions. Since NVME partitions have TRANSPORT value the will appear to the disk resolver as eligible disks. The -d flag added to lsblk ensure no partitions ever show, removing the possibility of accidentally choosing an NVME partition:
    Before

ncn-w002:~ # lsblk -b -l -o SIZE,NAME,TYPE,TRAN
         SIZE NAME                 TYPE  TRAN
   6534922240 loop0                loop
   3435973632 loop1                loop
  34359738368 loop2                loop
 960197124096 sda                  disk  sas
    499122176 sda1                 part
  24499978240 sda2                 part
 149999845376 sda3                 part
 149999845376 sda4                 part
 960197124096 sdb                  disk  sas
    499122176 sdb1                 part
  24499978240 sdb2                 part
 149999845376 sdb3                 part
 149999845376 sdb4                 part
 299729158144 md124                raid0
 149864579072 md125                raid1
  24482152448 md126                raid1
    499056640 md127                raid1
  34359738368 live-overlay-pool    dm
 214748364800 metalvg0-CRAYS3CACHE lvm
1920383410176 nvme0n1              disk  nvme
  74999398400 nvme0n1p1            part  nvme
 693152776192 nvme0n1p2            part  nvme
 192038305792 nvme0n1p3            part  nvme

Now:

ncn-w002:~ # lsblk -b -l -o SIZE,NAME,TYPE,TRAN -d
         SIZE NAME    TYPE TRAN
   6534922240 loop0   loop
   3435973632 loop1   loop
  34359738368 loop2   loop
 960197124096 sda     disk sas
 960197124096 sdb     disk sas
1920383410176 nvme0n1 disk nvme
  1. A WARNING has been demoted to an INFO message, making it available to a default console:
# before
[   15.842126] dracut-initqueue[2162]: Warning: Found the following disks for the main RAID array (qty. [2]): [sda sdb]

# now
[   15.085175] dracut-initqueue[2128]: Found the following disks for the main RAID array (qty. [2]): [sda sdb]

Prerequisites

  • I have included documentation in my PR (or it is not required)
  • I tested this on internal system (x) (if yes, please include results or a description of the test)

Idempotency

Risks and Mitigations

What is less risky, or more risky now - or if your mod fails is there a new risk?

Remove manual gcp-mode by replacing it with automatic NVME handling.

Ensure already created NVME partitions do not show up as eligible disks.
NVME partitions report a transport value, unlike SAS and SATA which do
not. This reported transport value will be picked up by the disk
resolver, making NVME partitions eligible when they are already claimed.
This change ensures that NVME partitions never show up as eligible
devices.
jacobsalmela
jacobsalmela previously approved these changes May 19, 2022
This is not a warning, but it should always print. This removed the
"WARNING:" prefix in the log messages while ensuring the message prints
into a default console.
@rustydb rustydb merged commit 282056a into main May 20, 2022
@rustydb rustydb deleted the MTL-1748-handle-nvme branch May 20, 2022 15:20
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

Successfully merging this pull request may close these issues.

3 participants