Incorrect name assigned to software raid device
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| ironic-python-agent |
Fix Released
|
Undecided
|
Jakub Jelinek | ||
Bug Description
According to documentation (https:/
If I omit the "volume_name" parameter, creation of software raid via "agent" interface fails:
"mdadm --create /dev/md0 --force --run --metadata=1 --level 1 --name /dev/md0 --raid-devices 2 /dev/sda1 /dev/sdb1\nExit code: 2\nStdout: ''\nStderr: 'mdadm: Value \"/dev/md0\" cannot be set as name. Reason: Not POSIX compatible."
The "--name" mdadm parameter has to be "md0" instead of "/dev/md0", or we may just omit it.
Probably, there is a bug there - https:/
and we have to use basename instead of full path.
When supplying the "volume_name" parameter in Ironic raid config (e.g. with the "md0" value) everything works fine. But it contradicts with the docs and can't be used with Metal3 (since it doesn't match it's spec)
| Changed in ironic-python-agent: | |
| assignee: | nobody → Jakub Jelinek (kubajj) |
I was just hit by the same issue.
I'm trying to provision bare-metal using metal3 and baremetal-operator.
The configuration supplied to baremetal-operator is as follows:
raid: DVolumes:
physicalDisks:
softwareRAI
- level: '1'
- serialNumber: S664NN0W200258
- serialNumber: S664NN0W200257
and results in error:
Command: mdadm --create /dev/md0 --force --run --metadata=1 --level 1 --name /dev/md0 --raid-devices 2 /dev/sdf1 /dev/sde1
Exit code: 2
Stdout: ''
Stderr: 'mdadm: Value "/dev/md0" cannot be set as name. Reason: Not POSIX compatible.\n'
As stated above metal3 does not support any 'name' parameter, but more importantly the logic in lines: /github. com/openstack/ ironic- python- agent/blob/ master/ ironic_ python_ agent/raid_ utils.py# L229-L230
https:/
is just wrong. The mdadm will always fail when md_device is put in a --name parameter.
As suggested above the last part of the md_device should be put into volume_name and possibly more validation for POSIX compatibility might be needed.