Incorrect name assigned to software raid device

Bug #2073406 reported by typezz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ironic-python-agent
New
Undecided
Unassigned

Bug Description

According to documentation (https://docs.openstack.org/ironic/latest/admin/raid.html#software-raid), only mandatory parameters are supported when configuring software RAID. These parameters doesn't include "volume_name" (or docs aren't clear about that). Examples of software raid configs doesn't include "volume_name" parameter as well.

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://github.com/openstack/ironic-python-agent/blob/master/ironic_python_agent/raid_utils.py#L230
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)

Revision history for this message
Michal (groundnuty) wrote :

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:
    softwareRAIDVolumes:
      - level: '1'
        physicalDisks:
          - 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:
https://github.com/openstack/ironic-python-agent/blob/master/ironic_python_agent/raid_utils.py#L229-L230
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.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.