Merge ~techreed/curtin:storage_eud into curtin:master

Proposed by Reed Slaby
Status: Superseded
Proposed branch: ~techreed/curtin:storage_eud
Merge into: curtin:master
Diff against target: 24 lines (+2/-1)
2 files modified
curtin/block/schemas.py (+1/-0)
curtin/storage_config.py (+1/-1)
Reviewer Review Type Date Requested Status
Ryan Harper (community) Needs Fixing
Review via email: mp+371429@code.launchpad.net

This proposal has been superseded by a proposal from 2019-08-18.

Commit message

Allow EUI-64 formatted WWNs for disks and accept NVMe partition naming

Added WWNs matching the EUI-64 format (e.g. eui.0011223344556677) to the list of valid WWNs in the DISK schema definition.

Altered storage parser to allow partitions named like /dev/nvmeXnXpX. These were previously discarded since the naming scheme does not match traditional HDD/SSD drives.

Description of the change

This branch is the result of installer issues that were encountered while attempting to install Ubuntu Server 18.04.3 LTS on a Samsung 960 EVO M.2 NVMe drive.

The initial issue was that the EUI-64 identifier for the disk was not accepted by curtin as a valid WWN format. After adding this format to the DISK schema and restarting subiquity, curtin recognized the disk and I was able to complete the installation successfully.

While going back to verify that the commit to schemas.py was still working following the initial installation, I encountered a separate issue with curtin's partition parsing.

Since NVMe drives are named like '/dev/nvme0n1' and their partitions are named like '/dev/nvme0n1p1', using lstrip() to get the partition number results in 'p1' instead of '1'. This failed the naming check, the partitions were skipped, and the installer failed because asdict "Couldn't find partition entry in table".

To post a comment you must log in.
~techreed/curtin:storage_eud updated
3af744f... by Reed Slaby <email address hidden>

Restore detection of partition numbers greater than 9

Revision history for this message
Ryan Harper (raharper) wrote :

Hi Reed,

Thanks for the fix! To contribute to curtin, you must sign the Canonical Contributor License Agreement (CLA) [1].

If you have already signed it as an individual, your Launchpad user will be listed in the contributor-agreement-canonical launchpad group [2]. Unfortunately there is no easy way to check if an organization or company you are doing work for has signed. If you are unsure or have questions, email <email address hidden> or ping powersj in #curtin channel via freenode.

For information on how to sign, please see the HACKING document [3]. This links to the cloud-init information but the process is the same for the curtin project.

Thanks again, and please feel free to reach out with any questions.


[1] http://www.canonical.com/contributors
[2] https://launchpad.net/~contributor-agreement-canonical/+members
[3] http://cloudinit.readthedocs.io/en/latest/topics/hacking.html

Revision history for this message
Ryan Harper (raharper) :
review: Needs Fixing
Revision history for this message
Reed Slaby (techreed) wrote :

Hi Ryan,

Thanks for taking a look, and for your patience.

Looks like I made a bit of a mess out of this with the resubmit, sorry. I've implemented your suggestions in my branch, but they're showing up in the second proposal.

Revision history for this message
Ryan Harper (raharper) wrote :

No problem. You don't need to resubmit, only update the git branch and push to your launchpad remote.

Unmerged commits

3af744f... by Reed Slaby <email address hidden>

Restore detection of partition numbers greater than 9

6efeaf4... by Reed Slaby <email address hidden>

Accept NVMe partition naming format: nvmeXnXpX

3af210f... by Reed Slaby <email address hidden>

Add disks that use EUI-64 identifier to pass validation

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/curtin/block/schemas.py b/curtin/block/schemas.py
2index fb7507d..b26cabc 100644
3--- a/curtin/block/schemas.py
4+++ b/curtin/block/schemas.py
5@@ -135,6 +135,7 @@ DISK = {
6 'type': 'string',
7 'oneOf': [
8 {'pattern': r'^0x(\d|[a-zA-Z])+'},
9+ {'pattern': r'^eud\.(\d|[a-zA-Z])+'},
10 {'pattern': r'^nvme\.(\d|[a-zA-Z]-)+'}],
11 },
12 'grub_device': {
13diff --git a/curtin/storage_config.py b/curtin/storage_config.py
14index 7278669..a50e7c5 100644
15--- a/curtin/storage_config.py
16+++ b/curtin/storage_config.py
17@@ -683,7 +683,7 @@ class BlockdevParser(ProbertParser):
18 part = None
19 for pentry in ptable['partitions']:
20 node = pentry['node']
21- if node.lstrip(parent_devname) == attrs['partition']:
22+ if node.lstrip(parent_devname).lstrip('p') == attrs['partition']:
23 part = pentry
24 break
25

Subscribers

People subscribed via source and target branches