partitions on multipathed disk confuse extract_storage_config
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
curtin |
Fix Released
|
High
|
Unassigned |
Bug Description
probe-data-mp.json is attached:
(master)
Python 3.6.8 (default, Jan 14 2019, 11:02:34)
[GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys, json; from curtin import log, storage_config
>>> log.basicConfig
>>> c = json.load(
>>> storage_
Extracting storage config from probe data
Sorting extracted configurations
Validating extracted storage config components
Extracted (unmerged) storage config:
storage:
- id: disk-sda
path: /dev/sda
ptable: gpt
serial: '30000000000000064'
type: disk
wwn: '0x000000000000
- id: disk-sdb
path: /dev/sdb
ptable: gpt
serial: '30000000000000064'
type: disk
wwn: '0x000000000000
- device: disk-sda
flag: bios_grub
id: partition-sda1
number: 1
offset: 1048576
size: 1048576
type: partition
- device: disk-sda
flag: linux
id: partition-sda2
number: 2
offset: 2097152
size: 10734272512
type: partition
- device: disk-sdb
flag: bios_grub
id: partition-sdb1
number: 1
offset: 1048576
size: 1048576
type: partition
- device: disk-sdb
flag: linux
id: partition-sdb2
number: 2
offset: 2097152
size: 10734272512
type: partition
- fstype: ext4
id: format-
type: format
uuid: 80ca57a0-
volume: partition-sda2
- fstype: ext4
id: format-
type: format
uuid: 80ca57a0-
volume: partition-sdb2
- fstype: ext4
id: format-disk-dm-2
type: format
uuid: 80ca57a0-
volume: disk-dm-2
Generating storage config dependencies
Validate: partition-
Validate: partition-
Validate: partition-
Validate: partition-
Validate: format-
Validate: partition-
Validate: format-
Validate: partition-
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/opensourc
tree = get_config_
File "/opt/opensourc
for dep in find_item_
File "/opt/opensourc
_validate_
File "/opt/opensourc
'Invalid dep_id (%s) not in storage config' % dep_id)
ValueError: Invalid dep_id (disk-dm-2) not in storage config
>>>
The immediate problem here I guess is that curtin hasn't figured out that dm-2 is a partition of dm-0. But I'm not really sure in general what should be happening here -- it seems to me that, in general, it would be more useful to emit one disk action with path=/dev/
Related branches
- Server Team CI bot: Approve (continuous-integration)
- Michael Hudson-Doyle: Approve
- curtin developers: Pending requested
-
Diff: 8303 lines (+8176/-7)7 files modifiedcurtin/block/schemas.py (+2/-0)
curtin/storage_config.py (+78/-5)
doc/topics/storage.rst (+15/-0)
tests/data/probert_storage_multipath.json (+1059/-0)
tests/data/probert_storage_zlp6.json (+6980/-0)
tests/unittests/test_storage_config.py (+39/-1)
tools/block-discover-to-config (+3/-1)
Changed in curtin: | |
status: | Fix Committed → Fix Released |
Thanks for filing the bug. I had some probert data that could reproduce as well.
One of the challenges, as you see, is that multipath "partitions" are really additional dm devices, except, they are actual partitions on the underlying disks.
so, you'll have dm2 "partition" on dm0 (mpath device) which is on top of sda which will have an actual sda2.
So curtin generally wants to ignore the mpath device itself, and deal with _one_ path.
We have a couple of options; MAAS currently dumps *all* of the disks it found in the config, and constructs a layout from just *one* of the disks since MAAS and curtin don't *construct* multipath devices (the construction is how the devices are wired up).
Subiquity can also use this method, including all of the paths, but creating partitions/devices against just a single path. Alternatively, we can exclude any of the additional paths after selecting one of the paths and curtin will detect that the underlying disk is part of a multipath and ensure that the target OS has multipath enabled/configured.