‘Not POSIX compatible’ error

Today I ran into the following error message while configuring software (mdadm) based RAID with OpenStack Ironic:

mdadm --create /dev/md0 --force --run --metadata=1 --level 1 --name /dev/md0 --raid-devices 2 /dev/sda1 /dev/sdb1
Exit code: 2
Stdout: ''
Stderr: 'mdadm: Value "/dev/md0" cannot be set as name. Reason: Not POSIX compatible.

This was with the following RAID basic configuration:

{
   "logical_disks":[
      {
         "size_gb":"MAX",
         "controller":"software",
         "raid_level":"1"
      }
   ]
}

The Ironic Python Agent (IPA) images provided by OpenStack are based on CentOS (the latest being CentOS 9). The image I downloaded at the time contained a new version of mdadm which added this ‘POSIX compatible’ error, this was introduced in mdadm version 4.3.

The IPA version that was built into the image did not take into account this new validation rule mdadm version. This causes the create_configuration cleaning step to fail. This has only recently been fixed and released in IPA version 9.7.3 (Bobcat) and 10.1.0 (Epoxy).

Building an IPA image

To get an updated version of IPA I will build my own IPA initramfs and kernel image, as we mostly Debian based distributions in our company I will also use the Debian flavor.

Interestingly though, Debian 12 uses mdadm version 4.2-5 so with Debian 12 this new validation rule wouldn’t be triggered. To use Debian 12 I’m going to actually build the image in the next steps:

First create a Python virtualenv with the following command:

virtualenv venv

Then install the ironic-python-agent-builder package with:

pip install ironic-python-agent-builder

As we are building a Debian based image we will need some extra apt packages used for bootstrapping Debian based images:

sudo apt install debootstrap qemu-utils

Then build the image with:

ironic-python-agent-builder -o ipa debian -r bookworm -e debian-minimal

This will generate a ipa.initramfs and ipa.kernel image based on Debian 12 Bookworm.

Uploading the image to Glance

# Upload the initramfs image
zcat ipa.initramfs | CHECKSUM=$(cat ipa.sha256 | grep ipa.initramfs | cut -d' ' -f1) openstack image create deploy-ipa-initramfs-${CHECKSUM:0:8}
# Upload the kernel image
cat ipa.kernel | CHECKSUM=$(cat ipa.sha256 | grep ipa.kernel | cut -d' ' -f1) openstack image create deploy-ipa-kernel-${CHECKSUM:0:8}

Configuring them in Ironic

In /etc/ironic/ironic.conf:

deploy_kernel_by_arch = x86_64:15d1caf7-1b65-4cbf-9bf1-728d60a2e1c7
deploy_ramdisk_by_arch = x86_64:b19425fb-c4fe-4909-9ed2-593e7aa464b1

>> Home