opensvc / multipath-tools

Other
59 stars 47 forks source link

basic-build-and-ci compile and unit test on native arch compile and unit test on foreign arch

multipath-tools for Linux

https://github.com/opensvc/multipath-tools

This package provides the following binaries to drive the Device Mapper multipathing driver:

Releases

To get a specific X.Y.Z release, use one of the following method:

Git

git clone https://github.com/opensvc/multipath-tools.git
cd multipath-tools
git tag
git archive --format=tar.gz --prefix=multipath-tools-X.Y.Z/ X.Y.Z > ../multipath-tools-X.Y.Z.tar.gz

Direct download

wget "https://github.com/opensvc/multipath-tools/archive/X.Y.Z.tar.gz" -O multipath-tools-X.Y.Z.tar.gz

Browser

Go to: https://github.com/opensvc/multipath-tools/tags Select a release-tag and then click on "zip" or "tar.gz".

Building multipath-tools

Prerequisites: development packages of for libdevmapper, libaio, libudev, libjson-c, liburcu, and libsystemd. If commandline editing is enabled (see below), the development package for either libedit or libreadline is required as well.

Then, build and install multipath-tools with:

make
make DESTDIR="/my/target/dir" install

To uninstall, type:

make uninstall

By default, the build will run quietly, just printing one-line messages about the files being built. To enable more verbose output, run make V=1.

Customizing the build

Note: With very few exceptions, the build process does not read configuration from the environment. So using syntax like

SOME_VAR=some_value make

will not have the intended effect. Use the following instead:

make SOME_VAR=some_value

See "Passing standard compiler flags" below for an exception. The following variables can be passed to the make command line:

Installation Paths

The options configdir, plugindir, configfile, and statedir above can be used for setting individual paths where the prefix variables don't provide sufficient control. See Makefile.inc for even more fine-grained control.

[^systemd]: systemd installations up to v254 which have been built with split-usr=true may use separate prefixdir and rootprefixdir directories, where prefixdir is a subdirectory of rootprefixdir. multipath-tools' systemd_prefix corresponds to systemd's prefixdir. On such distributions, override unitdir and libudevdir to use systemd's rootprefix: make libudevdir=/lib/udev unitdir=/lib/systemd/system

prefix, DESTDIR and TGTDIR

prefix and related variables are included in compiled-in paths like plugindir and are used by make install. Using prefix is useful if multipath-tools is built locally on the same host where it's supposed to be installed.

By convention, the DESTDIR variable is prepended to all paths by make install, but not to any compiled-in paths. It is useful if the software is built on one system (build host) but intended to be run on another system (installation host). This is typically used in build systems like rpmbuild to set a root directory for all the installed files.

On the contrary, the TGTDIR variable is used for compiled-in paths only, and ignored by make install. It is useful for running multipath-tools in a separate subdirectory in the installation host, mostly for testing / development purposes.

For example,

make prefix=/opt DESTDIR=/build TGTDIR=/test install

will install plugins into /build/opt/lib64/multipath on the build host. On the installation host, the plugins will be expected to be found under /test/opt/lib64/multipath. If the developer runs

rsync -a $BUILD_HOST:$DESTDIR/ $INSTALL_HOST:$TGTDIR/

and adds $TGTDIR/lib64 to LD_LIBRARY_PATH on the installation host, the multipath binaries installed under $TGTDIR will find their plugins and configuration files in the expected compiled-in paths.

Compiler Options

Use OPTFLAGS to change optimization-related compiler options; e.g. OPTFLAGS="-g -O0" to disable all optimizations.

Passing standard compiler flags

Contrary to most other variables, the standard variables CFLAGS, CPPFLAGS, and LDFLAGS must be passed to make via the environment if they need to be customized:

CPPFLAGS="-D_SECRET_=secret" make

Special Makefile targets

The following targets are intended for developers only.

Contributing

Please send patches or contributions for general discussion about multipath tools to the mailing list (see below). You can also create issues or pull requests on GitHub. You will be asked to send your patches to the mailing list unless your patch is trivial.

Mailing list

The mailing list for multipath-tools is dm-devel@lists.linux.dev. To subscribe, send an email to dm-devel+subscribe@lists.linux.dev. Mailing list archives are available on lore.kernel.org and marc.info. See also the lists.linux.dev home page.

When sending patches to the mailing list, please add a Signed-off-by: tag, and add Benjamin Marzinski bmarzins@redhat.com and Martin Wilck mwilck@suse.com to the Cc list.

Staging area

Between releases, the latest reviewed code can be obtained from the queue branch in the openSUSE/multipath-tools repository on GitHub. From there, pull requests for new releases in the master repository are created roughly every 3 months.

Adding new storage devices

If you want to add special settings for a storage device which is new on the market, follow the instructions at the top of the file libmultipath/hwtable.c.

Changelog

Maintainer

Christophe Varoqui christophe.varoqui@opensvc.com Device-mapper development mailing list dm-devel@lists.linux.dev

Licence

The multipath-tools source code is covered by several different licences. Refer to the individual source files for details. Source files which do not specify a licence are shipped under LGPL-2.0 (see LICENSES/LGPL-2.0).

ALUA

This is a rough guide, consult your storage device manufacturer documentation.

ALUA is supported in some devices, but usually it's disabled by default. To enable ALUA, the following options should be changed:

NVMe

Using dm-multipath with NVMe

NVMe multipath is natively supported by the Linux kernel. If for some reason you prefer using device mapper multipath with NVMe devices, you need to disable native multipathing first:

echo "options nvme_core multipath=N" > /etc/modprobe.d/01-nvme_core-mp.conf

Afterwards, regenerate the initramfs (dracut -f or update-initramfs) and reboot.

Using multipath-tools with native NVMe multipath

If native NVMe multipathing is enabled, you can still use multipath-tools for displaying the topology and some other information about native NVMe multipath setups. This feature is disabled by default. To enable it, set enable_foreign nvme in the defaults section of multipath.conf. Commands like multipath -ll will then display information about NVMe native multipath. This support is read-only; modifying the native multipath configuration is not supported.