Comment 10 for bug 1887558

Revision history for this message
Andy Wu (qch2012) wrote : Re: Multipath JBOD storage devices are not shown via /dev/mapper but each path as a single device.

we have the this issue during PS6 deployment , MAAS 3.2.6 list all multipath devices separately, so it is not possible to configure bcache using multipath directly in MAAS

The workaround (credit to Junien Fririck) is to do the bache config in post-deployment, as following:

1. make-bcache -C /dev/nvme6n1p1 -B /dev/mapper/mpatha --writeback
2. copy /lib/udev/rules.d/69-bcache.rules to /etc/udev/rules.d/ folder, modify the rules to not register backing device (eg sd*) , so those device can still be used by multipathd

    cp /lib/udev/rules.d/69-bcache.rules /etc/udev/rules.d/.
    sed -i 's/sr\*/sr\*|sd\*/' /etc/udev/rules.d/69-bcache.rules

    # line 7 of modified rules look like this
    KERNEL=="fd*|sr*|sd*", GOTO="bcache_end

3. normally if bache is configured in MAAS, curtin will create udev rules to link the bache to /dev/disk/by-dname , here we need to do it manually

    uuid=$(bcache-super-show /dev/mapper/mpatha | grep dev.uuid | awk '{print $2}')
    echo "SUBSYSTEM==\"block\", ACTION==\"add|change\", ENV{CACHED_UUID}==\"$uuid\", SYMLINK+=\"disk/by-dname/bcache-osd1\"" > /etc/udev/rules.d/bcache-osd1.rules

4. trigger udev rules

    sudo udevadm trigger

5. update initramfs

    update-initramfs -u -k all