multipath curthook appears to execute whether or not multipath is disabled

Asked by Matthew Steele

I've been working on some custom designs with autoinstall, and I've run into a problem which appears to be Curtin trying to detect and handle my root partition as a multipath device. I have multipath disabled as per the documentation with the top-level setting:

Beginning snip of my user-data file
---------

#cloud-config
autoinstall:
  version: 1
  early-commands:
    - /custom-installation/pre.sh
  late-commands:
    - /custom-installation/post.sh
  refresh-installer:
    update: true
  ssh:
    install-server: true
  multipath:
    mode: disabled

--------------

However, the installer still attempts to detect and configure multipath, and fails:

finish: cmd-install/stage-curthooks/builtin/cmd-curthooks/configuring-multipath: FAIL: configuring multipath
        finish: cmd-install/stage-curthooks/builtin/cmd-curthooks: FAIL: curtin command curthooks
        Traceback (most recent call last):
          File "/snap/subiquity/5097/lib/python3.10/site-packages/curtin/commands/main.py", line 202, in main
            ret = args.func(args)
          File "/snap/subiquity/5097/lib/python3.10/site-packages/curtin/commands/curthooks.py", line 1918, in curthooks
            builtin_curthooks(cfg, target, state)
          File "/snap/subiquity/5097/lib/python3.10/site-packages/curtin/commands/curthooks.py", line 1804, in builtin_curthooks
            detect_and_handle_multipath(cfg, target, osfamily=osfamily)
          File "/snap/subiquity/5097/lib/python3.10/site-packages/curtin/commands/curthooks.py", line 1114, in detect_and_handle_multipath
            mpname = block.multipath.get_mpath_id_from_device(mp_device)
          File "/snap/subiquity/5097/lib/python3.10/site-packages/curtin/block/multipath.py", line 192, in get_mpath_id_from_device
            info = udev.udevadm_info(device)
          File "/snap/subiquity/5097/lib/python3.10/site-packages/curtin/udev.py", line 86, in udevadm_info
            output, _ = util.subp(info_cmd, capture=True)
          File "/snap/subiquity/5097/lib/python3.10/site-packages/curtin/util.py", line 275, in subp
            return _subp(*args, **kwargs)
          File "/snap/subiquity/5097/lib/python3.10/site-packages/curtin/util.py", line 108, in _subp
            sp = subprocess.Popen(args, stdout=stdout,
          File "/snap/subiquity/5097/usr/lib/python3.10/subprocess.py", line 971, in __init__
            self._execute_child(args, executable, preexec_fn, close_fds,
          File "/snap/subiquity/5097/usr/lib/python3.10/subprocess.py", line 1796, in _execute_child
            self.pid = _posixsubprocess.fork_exec(
        TypeError: expected str, bytes or os.PathLike object, not bool
        expected str, bytes or os.PathLike object, not bool

--------------

Looking at the source in curthooks.py at detect_and_handle_multipath, the value of the setting appears to be read, but it appears to be overwritten to be "auto":

def detect_and_handle_multipath(cfg, target, osfamily=DISTROS.debian):
    DEFAULT_MULTIPATH_PACKAGES = {
        DISTROS.debian: ['multipath-tools-boot'],
        DISTROS.redhat: ['device-mapper-multipath'],
        DISTROS.suse: ['multipath-tools'],
    }
    if osfamily not in DEFAULT_MULTIPATH_PACKAGES:
        raise ValueError(
                'No multipath package mapping for distro: %s' % osfamily)

    mpcfg = cfg.get('multipath', {})
    mpmode = mpcfg.get('mode', 'auto')
    mppkgs = mpcfg.get('packages',
                       DEFAULT_MULTIPATH_PACKAGES.get(osfamily))
    mpbindings = mpcfg.get('overwrite_bindings', True)

    if isinstance(mppkgs, str):
        mppkgs = [mppkgs]

    if mpmode == 'disabled':
        return

My install storage is intel fake raid, not multipath - is there some other way to prevent the multipath curthook from executing?

Question information

Language:
English Edit question
Status:
Open
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

Can you help with this problem?

Provide an answer of your own, or ask Matthew Steele for more information if necessary.

To post a message you must log in.