Skip to content

Commit

Permalink
Merge pull request #26 from xcp-ng-rpms/stormi/update-multipath-config
Browse files Browse the repository at this point in the history
Update multipath configuration handling of custom configurations
  • Loading branch information
stormi authored Aug 28, 2023
2 parents f81bfc9 + faf7376 commit bcc8b75
Show file tree
Hide file tree
Showing 21 changed files with 207 additions and 34 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From ca464c9f43c5e52420b75f37854cf5db826a929c Mon Sep 17 00:00:00 2001
From: Mark Syms <[email protected]>
Date: Thu, 20 May 2021 17:40:06 +0100
Subject: [PATCH 01/16] backport of ccd121cc248d79b749a63d4ad099e6d5f4b8b588:
Subject: [PATCH 01/19] backport of ccd121cc248d79b749a63d4ad099e6d5f4b8b588:
CA-354692: check for device parameter in create/probe calls

Signed-off-by: Mark Syms <[email protected]>
Expand Down Expand Up @@ -87,5 +87,5 @@ index 3311e55..ad28649 100755
def registerSR(SRClass):
"""Register SR with handler. All SR subclasses should call this in
--
2.41.0
2.30.2

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 618d0f65369b2dd5b6243aae937cca516355205c Mon Sep 17 00:00:00 2001
From: Samuel Verschelde <[email protected]>
Date: Thu, 13 Aug 2020 15:22:17 +0200
Subject: [PATCH 02/16] Update xs-sm.service's description for XCP-ng
Subject: [PATCH 02/19] Update xs-sm.service's description for XCP-ng

This was a patch added to the sm RPM git repo before we had this
forked git repo for sm in the xcp-ng github organisation.
Expand All @@ -21,5 +21,5 @@ index 99cb313..609c6ef 100644
Conflicts=shutdown.target
RefuseManualStop=yes
--
2.41.0
2.30.2

4 changes: 2 additions & 2 deletions SOURCES/0003-Add-TrueNAS-multipath-config.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 37b279a8daca22aae97862bed2a3976132b218bd Mon Sep 17 00:00:00 2001
From: Samuel Verschelde <[email protected]>
Date: Thu, 13 Aug 2020 15:26:43 +0200
Subject: [PATCH 03/16] Add TrueNAS multipath config
Subject: [PATCH 03/19] Add TrueNAS multipath config

This was a patch added to the sm RPM git repo before we had this
forked git repo for sm in the xcp-ng github organisation.
Expand All @@ -26,5 +26,5 @@ index aaf45e5..1073faa 100644
+ }
}
--
2.41.0
2.30.2

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 21ad2a6035dca5e2dc889880a90020348be52dd8 Mon Sep 17 00:00:00 2001
From: Ronan Abhamon <[email protected]>
Date: Mon, 20 Jul 2020 16:26:42 +0200
Subject: [PATCH 04/16] feat(drivers): add CephFS, GlusterFS and XFS drivers
Subject: [PATCH 04/19] feat(drivers): add CephFS, GlusterFS and XFS drivers

---
Makefile | 3 +
Expand Down Expand Up @@ -888,5 +888,5 @@ index 97c332c..ad1ee86 100755
if not type in SR.TYPES:
raise util.SMException("Unsupported SR type: %s" % type)
--
2.41.0
2.30.2

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 9cb3f6724c62bfda5eaf5a29952c4d0b83dcffdf Mon Sep 17 00:00:00 2001
From: Ronan Abhamon <[email protected]>
Date: Wed, 12 Aug 2020 11:14:33 +0200
Subject: [PATCH 05/16] feat(drivers): add ZFS driver to avoid losing VDI
Subject: [PATCH 05/19] feat(drivers): add ZFS driver to avoid losing VDI
metadata (xcp-ng/xcp#401)

---
Expand Down Expand Up @@ -201,5 +201,5 @@ index ad1ee86..327103f 100755
type = SR.TYPE_FILE
if not type in SR.TYPES:
--
2.41.0
2.30.2

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From ece61a8594f7337fb86bb1ea4893d43d8c554fec Mon Sep 17 00:00:00 2001
From: Samuel Verschelde <[email protected]>
Date: Thu, 13 Aug 2020 17:10:12 +0200
Subject: [PATCH 06/16] Re-add the ext4 driver for users who need to transition
Subject: [PATCH 06/19] Re-add the ext4 driver for users who need to transition

The driver is needed to transition to the ext driver.
Users who upgrade from XCP-ng <= 8.0 need a working driver so that they
Expand Down Expand Up @@ -287,5 +287,5 @@ index 327103f..867c789 100755
type = SR.TYPE_FILE
if not type in SR.TYPES:
--
2.41.0
2.30.2

4 changes: 2 additions & 2 deletions SOURCES/0007-feat-drivers-add-LinstorSR-driver.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From dec7d21fc5380fc6c2866fbfe8dcece9e937071c Mon Sep 17 00:00:00 2001
From: Ronan Abhamon <[email protected]>
Date: Mon, 16 Mar 2020 15:39:44 +0100
Subject: [PATCH 07/16] feat(drivers): add LinstorSR driver
Subject: [PATCH 07/19] feat(drivers): add LinstorSR driver

Some important points:

Expand Down Expand Up @@ -5675,5 +5675,5 @@ diff --git a/tests/mocks/linstor/__init__.py b/tests/mocks/linstor/__init__.py
new file mode 100644
index 0000000..e69de29
--
2.41.0
2.30.2

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 5f4ae6317d4505fcab4ed7e959f11389a4d7a442 Mon Sep 17 00:00:00 2001
From: Ronan Abhamon <[email protected]>
Date: Tue, 27 Oct 2020 15:04:36 +0100
Subject: [PATCH 08/16] feat(tests): add unit tests concerning ZFS (close
Subject: [PATCH 08/19] feat(tests): add unit tests concerning ZFS (close
xcp-ng/xcp#425)

- Check if "create" doesn't succeed without zfs packages
Expand Down Expand Up @@ -205,5 +205,5 @@ index 0000000..6f8040d
+ failed = True
+ self.assertTrue(failed)
--
2.41.0
2.30.2

4 changes: 2 additions & 2 deletions SOURCES/0009-If-no-NFS-ACLs-provided-assume-everyone.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From a53beccf65c329a7f1af25c330c20f770252b7fd Mon Sep 17 00:00:00 2001
From: BenjiReis <[email protected]>
Date: Thu, 25 Feb 2021 09:54:52 +0100
Subject: [PATCH 09/16] If no NFS ACLs provided, assume everyone:
Subject: [PATCH 09/19] If no NFS ACLs provided, assume everyone:

Some QNAP devices do not provide ACL when fetching NFS mounts.
In this case the assumed ACL should be: "*".
Expand Down Expand Up @@ -71,5 +71,5 @@ index 71800ab..cef414f 100644
+ self.assertEqual(len(pread2.mock_calls), 1)
+ pread2.assert_called_with(['/usr/sbin/showmount', '--no-headers', '-e', 'aServer'])
--
2.41.0
2.30.2

4 changes: 2 additions & 2 deletions SOURCES/0010-Added-SM-Driver-for-MooseFS.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From c1483fc0d2394cf297ff304ee09faafd2b2b2143 Mon Sep 17 00:00:00 2001
From: Aleksander Wieliczko <[email protected]>
Date: Fri, 29 Jan 2021 15:21:23 +0100
Subject: [PATCH 10/16] Added SM Driver for MooseFS
Subject: [PATCH 10/19] Added SM Driver for MooseFS

Co-authored-by: Piotr Robert Konopelko <[email protected]>
Signed-off-by: Aleksander Wieliczko <[email protected]>
Expand Down Expand Up @@ -386,5 +386,5 @@ index 0000000..5a61cf5
+ mfssr.detach('asr_uuid')
+ self.assertTrue(mfssr.attached)
--
2.41.0
2.30.2

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From fc0e53774691db631e3bfadfabe4e8de81d686bd Mon Sep 17 00:00:00 2001
From: Ronan Abhamon <[email protected]>
Date: Thu, 2 Dec 2021 09:28:37 +0100
Subject: [PATCH 11/16] Avoid usage of `umount` in `ISOSR` when `legacy_mode`
Subject: [PATCH 11/19] Avoid usage of `umount` in `ISOSR` when `legacy_mode`
is used

`umount` should not be called when `legacy_mode` is enabled, otherwise a mounted dir
Expand Down Expand Up @@ -103,5 +103,5 @@ index 914b961..a5b3290 100644
class TestISOSR_overNFS(unittest.TestCase):

--
2.41.0
2.30.2

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 037e7181a8faf00d01cda4813d3c833e81296279 Mon Sep 17 00:00:00 2001
From: Ronan Abhamon <[email protected]>
Date: Wed, 18 May 2022 17:28:09 +0200
Subject: [PATCH 12/16] MooseFS SR uses now UUID subdirs for each SR
Subject: [PATCH 12/19] MooseFS SR uses now UUID subdirs for each SR

A sm-config boolean param `subdir` is available to configure where to store the VHDs:
- In a subdir with the SR UUID, the new behavior
Expand Down Expand Up @@ -126,5 +126,5 @@ index be5112c..ab72f4e 100755
self.detach(sr_uuid)
if inst.code != errno.ENOENT:
--
2.41.0
2.30.2

4 changes: 2 additions & 2 deletions SOURCES/0013-Fix-is_open-call-for-many-drivers-25.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From ad8693df57172278677a61607cecc057efc729a1 Mon Sep 17 00:00:00 2001
From: Ronan Abhamon <[email protected]>
Date: Thu, 23 Jun 2022 10:36:36 +0200
Subject: [PATCH 13/16] Fix is_open call for many drivers (#25)
Subject: [PATCH 13/19] Fix is_open call for many drivers (#25)

Ensure all shared drivers are imported in `_is_open` definition to register
them in the driver list. Otherwise this function always fails with a SRUnknownType exception.
Expand Down Expand Up @@ -104,5 +104,5 @@ index 0d60d96..534e6c9 100755

driver = SR.driver(srType)
--
2.41.0
2.30.2

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 32be9cfcd581a06075c549f68aff3ed709affcad Mon Sep 17 00:00:00 2001
From: Ronan Abhamon <[email protected]>
Date: Thu, 23 Jun 2022 10:37:07 +0200
Subject: [PATCH 14/16] Remove SR_CACHING capability for many SR types (#24)
Subject: [PATCH 14/19] Remove SR_CACHING capability for many SR types (#24)

SR_CACHING offers the capacity to use IntelliCache, but this
feature is only available using NFS SR.
Expand Down Expand Up @@ -56,5 +56,5 @@ index ab72f4e..212f1ad 100755
"VDI_UPDATE", "VDI_CLONE", "VDI_SNAPSHOT", "VDI_RESIZE", "VDI_MIRROR",
"VDI_GENERATE_CONFIG",
--
2.41.0
2.30.2

4 changes: 2 additions & 2 deletions SOURCES/0015-Remove-SR_PROBE-from-ZFS-capabilities-37.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 1167204e6869853c63c9a0daa0b7582bccac0fc4 Mon Sep 17 00:00:00 2001
From: BenjiReis <[email protected]>
Date: Fri, 4 Aug 2023 12:10:08 +0200
Subject: [PATCH 15/16] Remove `SR_PROBE` from ZFS capabilities (#37)
Subject: [PATCH 15/19] Remove `SR_PROBE` from ZFS capabilities (#37)

The probe method is not implemented so we
shouldn't advertise it.
Expand All @@ -24,5 +24,5 @@ index d375210..b803211 100644
'VDI_CREATE',
'VDI_DELETE',
--
2.41.0
2.30.2

4 changes: 2 additions & 2 deletions SOURCES/0016-Fix-vdi-ref-when-static-vdis-are-used.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 3bf41acc381c3d89e0bd0e017fd1653076987ae9 Mon Sep 17 00:00:00 2001
From: Guillaume <[email protected]>
Date: Wed, 16 Aug 2023 13:42:21 +0200
Subject: [PATCH 16/16] Fix vdi-ref when static vdis are used
Subject: [PATCH 16/19] Fix vdi-ref when static vdis are used

When static vdis are used there is no snapshots and we don't want to
call method from XAPI.
Expand Down Expand Up @@ -32,5 +32,5 @@ index dd8e20b..6ac3f80 100755
if needDeflate:
try:
--
2.41.0
2.30.2

34 changes: 34 additions & 0 deletions SOURCES/0017-Tell-users-not-to-edit-multipath.conf-directly.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
From 341ac817e7df747233bc0147a9353f8a308373eb Mon Sep 17 00:00:00 2001
From: Samuel Verschelde <[email protected]>
Date: Fri, 27 Jan 2023 12:03:15 +0100
Subject: [PATCH 17/19] Tell users not to edit multipath.conf directly

This file is meant to remain unchanged and regularly updated along with
the SM component. Users can create a custom configuration file in
/etc/multipath/conf.d/ instead.

Signed-off-by: Samuel Verschelde <[email protected]>
(cherry picked from commit b44d3f5db6d22d5a649fffebebb284afd6da39f7)
---
multipath/multipath.conf | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/multipath/multipath.conf b/multipath/multipath.conf
index 1073faa..3de1144 100644
--- a/multipath/multipath.conf
+++ b/multipath/multipath.conf
@@ -1,3 +1,11 @@
+# --- WARNING: DO NOT EDIT THIS FILE ---
+# The contents of this file may be overwritten at any future time through a
+# system update, causing any custom configuration to be lost.
+#
+# For custom multipath configuration, create a separate .conf file in the
+# /etc/multipath/conf.d/ directory.
+# --- END OF WARNING ---
+
# This configuration file is used to overwrite the built-in configuration of
# multipathd.
# For information on the syntax refer to `man multipath.conf` and the examples
--
2.30.2

31 changes: 31 additions & 0 deletions SOURCES/0018-Add-custom.conf-multipath-configuration-file.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
From c6b87140a83b81e5c40a76fd0633f44fe0cb49ef Mon Sep 17 00:00:00 2001
From: Samuel Verschelde <[email protected]>
Date: Fri, 27 Jan 2023 12:23:13 +0100
Subject: [PATCH 18/19] Add custom.conf multipath configuration file

Meant to be installed as /etc/multipath/conf.d/custom.conf for users
to have an easy entry point for editing, as well as information on what
will happen to this file through future system updates and upgrades.

Signed-off-by: Samuel Verschelde <[email protected]>
(cherry picked from commit 18b79a5b1f49c02d8ee8ba2408d0395d1cfb3ee9)
---
multipath/custom.conf | 6 ++++++
1 file changed, 6 insertions(+)
create mode 100644 multipath/custom.conf

diff --git a/multipath/custom.conf b/multipath/custom.conf
new file mode 100644
index 0000000..3c8583f
--- /dev/null
+++ b/multipath/custom.conf
@@ -0,0 +1,6 @@
+# Custom configuration for multipathd
+
+# Changes made to this file will not be overwritten by future system updates.
+# They will also be retained through system upgrades to newer releases.
+
+# Refer to "man multipath.conf"
--
2.30.2

52 changes: 52 additions & 0 deletions SOURCES/0019-Install-etc-multipath-conf.d-custom.conf.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
From b7bc5c6e4debc75067c1c3bac96928385f1daffe Mon Sep 17 00:00:00 2001
From: Samuel Verschelde <[email protected]>
Date: Fri, 25 Aug 2023 17:47:34 +0200
Subject: [PATCH 19/19] Install /etc/multipath/conf.d/custom.conf

Update Makefile so that the file is installed along with sm.

Signed-off-by: Samuel Verschelde <[email protected]>
---
Makefile | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/Makefile b/Makefile
index ab9a15e..f56f61e 100755
--- a/Makefile
+++ b/Makefile
@@ -77,6 +77,7 @@ SM_LIBS += cbtutil
UDEV_RULES = 65-multipath 55-xs-mpath-scsidev 57-usb 58-xapi
MPATH_DAEMON = sm-multipath
MPATH_CONF = multipath.conf
+MPATH_CUSTOM_CONF = custom.conf
SMLOG_CONF = SMlog

SM_XML := XE_SR_ERRORCODES
@@ -92,6 +93,7 @@ UDEV_SCRIPTS_DIR := /etc/udev/scripts/
SYSTEMD_SERVICE_DIR := /usr/lib/systemd/system/
INIT_DIR := /etc/rc.d/init.d/
MPATH_CONF_DIR := /etc/multipath.xenserver/
+MPATH_CUSTOM_CONF_DIR := /etc/multipath/conf.d/
MODPROBE_DIR := /etc/modprobe.d/
EXTENSION_SCRIPT_DEST := /etc/xapi.d/extensions/
LOGROTATE_DIR := /etc/logrotate.d/
@@ -145,6 +147,7 @@ install: precheck
mkdir -p $(SM_STAGING)$(INIT_DIR)
mkdir -p $(SM_STAGING)$(SYSTEMD_SERVICE_DIR)
mkdir -p $(SM_STAGING)$(MPATH_CONF_DIR)
+ mkdir -p $(SM_STAGING)$(MPATH_CUSTOM_CONF_DIR)
mkdir -p $(SM_STAGING)$(MODPROBE_DIR)
mkdir -p $(SM_STAGING)$(LOGROTATE_DIR)
mkdir -p $(SM_STAGING)$(DEBUG_DEST)
@@ -162,6 +165,8 @@ install: precheck
$(SM_STAGING)$(SM_DEST)/plugins/
install -m 644 multipath/$(MPATH_CONF) \
$(SM_STAGING)/$(MPATH_CONF_DIR)
+ install -m 644 multipath/$(MPATH_CUSTOM_CONF) \
+ $(SM_STAGING)/$(MPATH_CUSTOM_CONF_DIR)
install -m 755 multipath/sm-multipath \
$(SM_STAGING)/$(INIT_DIR)
install -m 755 multipath/multipath-root-setup \
--
2.30.2

Loading

0 comments on commit bcc8b75

Please sign in to comment.