/dev/by-dname symlinks based on wwn/wwid
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Invalid
|
Undecided
|
Unassigned | ||
curtin |
Fix Released
|
High
|
Unassigned |
Bug Description
Currently /dev/disk/by-dname symlinks are not created if a device does not have a partition table or a super block.
There needs to be a way to create auto-create by-dname symlinks based on unique wwn/eui identifiers and symlinks via udev rules installed during the deployment stage.
Old description:
Block devices can be identified by a GPT placed on them.
Each partition table contains a UUID which uniquely identifies a device.
sudo blkid -o udev -p /dev/nvme0n1
ID_PART_
ID_PART_
gdisk:
Command (? for help): p
Disk /dev/nvme0n1: 1000215216 sectors, 476.9 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 8C5E98A4-
We could leverage that for software that needs to create its own partitions after deployment in MAAS for example. In this case there will be no need to create a new partition table post-deployment but there will be no partitions or file systems on a block device which will be ready for any use.
Example: Ceph needs to use block devices to create partitions but "zapping" of a partition table is configurable. If a partition table is pre-zapped during the deployment and a new clean one is created ceph-disk can just create partitions on an existing partition table. This may help us workaround this: pad.lv/1604501
Serial numbers are not super reliable as they depend on a block driver while in this case we rely on a superblock written at the deployment time. Even if we have an odd device that doesn't have reliable means of identification we can rely on a persistent UUID we ourselves put onto that device.
MAAS needs to grow an ability to configure empty block devices which will get a clean partition table at will too.
I think it's worthwhile to create a udev rule for ubuntu server in general: /dev/disk/
Related branches
- Server Team CI bot: Approve (continuous-integration)
- Chad Smith: Approve
-
Diff: 116 lines (+49/-12)2 files modifiedcurtin/commands/block_meta.py (+4/-2)
tests/unittests/test_make_dname.py (+45/-10)
- Server Team CI bot: Approve (continuous-integration)
- curtin developers: Pending requested
-
Diff: 3184 lines (+1417/-240)59 files modifiedcurtin/__init__.py (+1/-1)
curtin/commands/apt_config.py (+22/-6)
curtin/commands/block_meta.py (+157/-49)
curtin/swap.py (+9/-3)
curtin/udev.py (+37/-0)
debian/changelog (+27/-0)
doc/topics/apt_source.rst (+57/-0)
doc/topics/storage.rst (+45/-2)
examples/tests/basic.yaml (+9/-0)
examples/tests/basic_scsi.yaml (+27/-0)
examples/tests/multipath.yaml (+1/-0)
examples/tests/nvme.yaml (+2/-2)
examples/tests/nvme_bcache.yaml (+1/-1)
examples/tests/simple-storage.yaml (+48/-0)
helpers/common (+50/-5)
tests/unittests/helpers.py (+7/-0)
tests/unittests/test_apt_custom_sources_list.py (+61/-29)
tests/unittests/test_commands_block_meta.py (+4/-3)
tests/unittests/test_commands_extract.py (+2/-1)
tests/unittests/test_make_dname.py (+172/-30)
tests/unittests/test_swap.py (+42/-28)
tests/unittests/test_udev.py (+68/-0)
tests/vmtests/__init__.py (+124/-20)
tests/vmtests/releases.py (+6/-0)
tests/vmtests/test_apt_config_cmd.py (+11/-2)
tests/vmtests/test_apt_source.py (+7/-2)
tests/vmtests/test_basic.py (+61/-8)
tests/vmtests/test_bcache_basic.py (+6/-0)
tests/vmtests/test_bcache_bug1718699.py (+4/-0)
tests/vmtests/test_fs_battery.py (+5/-0)
tests/vmtests/test_iscsi.py (+6/-0)
tests/vmtests/test_journald_reporter.py (+4/-0)
tests/vmtests/test_lvm.py (+5/-0)
tests/vmtests/test_lvm_iscsi.py (+13/-7)
tests/vmtests/test_lvm_raid.py (+16/-8)
tests/vmtests/test_lvm_root.py (+2/-0)
tests/vmtests/test_mdadm_bcache.py (+42/-0)
tests/vmtests/test_mdadm_iscsi.py (+13/-6)
tests/vmtests/test_multipath.py (+31/-0)
tests/vmtests/test_network.py (+6/-0)
tests/vmtests/test_network_alias.py (+6/-0)
tests/vmtests/test_network_bonding.py (+6/-0)
tests/vmtests/test_network_bridging.py (+7/-0)
tests/vmtests/test_network_ipv6.py (+8/-0)
tests/vmtests/test_network_ipv6_static.py (+4/-0)
tests/vmtests/test_network_ipv6_vlan.py (+4/-0)
tests/vmtests/test_network_mtu.py (+9/-0)
tests/vmtests/test_network_static.py (+4/-0)
tests/vmtests/test_network_static_routes.py (+5/-0)
tests/vmtests/test_network_vlan.py (+6/-0)
tests/vmtests/test_nvme.py (+17/-4)
tests/vmtests/test_old_apt_features.py (+7/-2)
tests/vmtests/test_pollinate_useragent.py (+6/-0)
tests/vmtests/test_raid5_bcache.py (+15/-7)
tests/vmtests/test_simple.py (+67/-1)
tests/vmtests/test_ubuntu_core.py (+2/-0)
tests/vmtests/test_uefi_basic.py (+17/-7)
tests/vmtests/test_zfsroot.py (+10/-0)
tools/jenkins-runner (+6/-6)
- Scott Moser (community): Approve
- Server Team CI bot: Approve (continuous-integration)
- Chad Smith: Pending requested
-
Diff: 974 lines (+484/-63)13 files modifiedcurtin/commands/block_meta.py (+74/-15)
curtin/udev.py (+37/-0)
doc/topics/storage.rst (+37/-2)
examples/tests/basic.yaml (+2/-0)
examples/tests/basic_scsi.yaml (+15/-0)
examples/tests/nvme.yaml (+2/-2)
examples/tests/nvme_bcache.yaml (+1/-1)
tests/unittests/helpers.py (+7/-0)
tests/unittests/test_make_dname.py (+172/-30)
tests/unittests/test_udev.py (+68/-0)
tests/vmtests/__init__.py (+55/-5)
tests/vmtests/test_basic.py (+8/-4)
tests/vmtests/test_nvme.py (+6/-4)
description: | updated |
Changed in curtin: | |
importance: | Undecided → Wishlist |
status: | New → Triaged |
Changed in maas: | |
status: | New → Triaged |
importance: | Undecided → Wishlist |
milestone: | none → 2.4.x |
summary: |
- feature request: /dev/by-dname symlinks based on GUID patition table - UUIDs + feature request: /dev/by-dname symlinks based on wwn/wwid |
summary: |
- feature request: /dev/by-dname symlinks based on wwn/wwid + /dev/by-dname symlinks based on wwn/wwid |
Changed in maas: | |
status: | Triaged → Invalid |
importance: | Wishlist → Undecided |
milestone: | 2.4.x → none |
Changed in curtin: | |
importance: | Wishlist → High |
status: | Triaged → In Progress |
Changed in curtin: | |
status: | New → Incomplete |
For dname links and regular disk devices it looks like ID_PART_TABLE_UUID is already used:
https:/ /bazaar. launchpad. net/~curtin- dev/curtin/ trunk/view/ head:/curtin/ commands/ block_meta. py#L229
rule.append( compose_ udev_equality( 'ENV{DEVTYPE} ', "disk"))
rule.append( compose_ udev_equality( 'ENV{ID_ PART_TABLE_ UUID}', ptuuid))
def make_dname(volume, storage_config):
...
if vol.get('type') == "disk":
For other devices this is not present by default but they have other identification methods.
elif vol.get('type') == "bcache":
rule.append( compose_ udev_equality( "ENV{DEVNAME} ", path))
Still, this is not usable for disks without partitions from MAAS.