Skip to content

Instantly share code, notes, and snippets.

@ancorgs
Last active August 22, 2019 15:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ancorgs/a91f840bb7a2896b6500134982bbca27 to your computer and use it in GitHub Desktop.
Save ancorgs/a91f840bb7a2896b6500134982bbca27 to your computer and use it in GitHub Desktop.
Multipath and AutoYaST experiments

Facts

  • When multipath is activated in a Linux system, ALL disks in such system are grouped into multipath devices. For example, if sda is an individual disk while sdb and sdc are actually part of the same multipath, the system will contain two multipath block devices (one for sdb+sdc and another one for sda only). That's represented in the targetmap by the corresponding CT_DISK and CT_DMMULTIPATH elements. When using libstorage-ng, all those disks and multipath devices are also represented in the devicegraph.
  • With AutoYaST, multipath is only activated if start_multipath is true. The presence of a CT_DMMULTIPATH drive has no influence.
  • Important: AutoYaST in SLE12-SPX will often select the disk with bios_id=0x80 for the first drive, no matter whether such drive is CT_DISK or CT_DMMULTIPATH and no matter whether the disk is part of a multipath device. See this code.
  • Except the exception mentioned above, drives only match elements in the targetmap with its very own type (CT_MULTIPATH or CT_DISK).

So...

  • With start_multipath

    • Only CT_DMMULTIPATH drives should be used, since you never want to use disks directly.
    • CT_DISK drives are useless, they will only match disks that are part of a multipath device.
    • Moreover, drives that were assigned to such disks will be ignored later.
    • Pitfall: a disk with bios_id=0x80 can match a CT_DMMULTIPATH drive, which mess everything up.
  • Without start_multipath

    • Only CT_DISK drives should be used, there are no multipath devices in the system.
    • CT_DMMULTIPATH drives are useless, they SHOULD match with nothing.
    • Exception to CT_DMMULTIPATH matching nothing: if the first drive is CT_DMMULTIPATH and there is a disk with bios_id=0x80, that will match.

The Experiments we did (all of them without bios_id=0x80) if you are curious

You can use edd=off to prevent bios_id to introduce noise in your experiments, although it didn't work in some of my tests. You can also use EFI.

Martin's scenario - Only one multipath device and only one drive in profile

start_mp type MP activated Device matched Note
(missing) CT_DISK no first individual disk - sda
(missing) CT_DMMULTIPATH no none
true CT_DISK yes first individual disk - sda BootStorage err. Missing '/'
true CT_DMMULTIPATH yes multipath device

Imo's scenario A - System with no multipath devices (2 disks)

start_mp type (/ + /home) MP activated Devices matched
irrelevant CT_DISK x2 no individual disks, by position
irrelevant CT_DMMULTIPATH x2 no error. Why?
irrelevant CT_DMMULTIPATH no first individual disk?

Imo's scenario B - System with 1 regular disk and 1 multipath (in that order?)

Important: when multipath is activated, the targetmap contains this

  • /dev/mapper/QEMU_HARDDISK_0001 - CT_DMMULTIPATH - devices: (/dev/sdb, /dev/sdc)
  • /dev/mapper/QEMU_HARDDISK_QM00001 - CT_DMMULTIPATH - devices: (/dev/sda)
  • /dev/sda - CT_DISK
  • /dev/sdb - CT_DISK
  • /dev/sdc - CT_DISK
start_mp type (/ + /home) MP activated Devices matched Note
true CT_DM x2 yes QEMU_HARDDISK_0001 + QEMU_HARDDISK_QM00001
true CT_DISK + CT_DM yes sda + QEMU_HARDDISK_0001 BootStorage err. Missing '/'
true CT_DM + CT_DISK yes QEMU_HARDDISK_0001 + sda /home (that was assigned to sda) was ignored
false CT_DM x2 no? none?
false CT_DISK x2 no? it works... but how it matches?

See also https://bugzilla.suse.com/show_bug.cgi?id=1135735 (to be turned into a similar table)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment