Skip to content

Commit

Permalink
Import 8.2 LINSTOR changes on 8.3
Browse files Browse the repository at this point in the history
- Robustify HA: use a specific group with a replication count of 3
- Export helpers in linstor-manager regarding network interfaces
- Improve health-check helper: more details and simple API
- Fix pause/unpause: always load a valid VHD chain
- Robustify remote "vhdutil check" command
- Robustify SR destruction
- Prevent diskless destruction on master host
- Prevent tiebreaker destruction
- Reduce LINSTOR vhdutil queries

Last commit: 9207abe1f2e1ff1795cdba1a0aeb76574412a583
"fix(linstor): check if resource is tiebreaker (#62)"

Signed-off-by: Ronan Abhamon <[email protected]>
  • Loading branch information
Wescoeur committed Sep 20, 2024
1 parent a719b34 commit d2d5ca0
Show file tree
Hide file tree
Showing 30 changed files with 1,557 additions and 144 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From de38d2672887c47a4e0600426d87137185243d38 Mon Sep 17 00:00:00 2001
From: Samuel Verschelde <[email protected]>
Date: Thu, 13 Aug 2020 15:22:17 +0200
Subject: [PATCH 01/28] Update xs-sm.service's description for XCP-ng
Subject: [PATCH 01/29] 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 @@ -10,7 +10,7 @@ forked git repo for sm in the xcp-ng github organisation.
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/systemd/xs-sm.service b/systemd/xs-sm.service
index 99cb313..609c6ef 100644
index 99cb313f..609c6ef5 100644
--- a/systemd/xs-sm.service
+++ b/systemd/xs-sm.service
@@ -1,5 +1,5 @@
Expand Down
10 changes: 5 additions & 5 deletions SOURCES/0002-feat-drivers-add-CephFS-and-GlusterFS-drivers.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 1809f021bf3af5fa18419e248469cd970bded9f3 Mon Sep 17 00:00:00 2001
From: Ronan Abhamon <[email protected]>
Date: Mon, 20 Jul 2020 16:26:42 +0200
Subject: [PATCH 02/28] feat(drivers): add CephFS and GlusterFS drivers
Subject: [PATCH 02/29] feat(drivers): add CephFS and GlusterFS drivers

---
Makefile | 2 +
Expand All @@ -13,7 +13,7 @@ Subject: [PATCH 02/28] feat(drivers): add CephFS and GlusterFS drivers
create mode 100644 drivers/GlusterFSSR.py

diff --git a/Makefile b/Makefile
index ad81be4..0750482 100755
index ad81be40..07504828 100755
--- a/Makefile
+++ b/Makefile
@@ -14,6 +14,8 @@ SM_DRIVERS += LVHDoHBA
Expand All @@ -27,7 +27,7 @@ index ad81be4..0750482 100755
SM_LIBS += SRCommand
diff --git a/drivers/CephFSSR.py b/drivers/CephFSSR.py
new file mode 100644
index 0000000..415152f
index 00000000..415152f7
--- /dev/null
+++ b/drivers/CephFSSR.py
@@ -0,0 +1,296 @@
Expand Down Expand Up @@ -329,7 +329,7 @@ index 0000000..415152f
+ SR.registerSR(CephFSSR)
diff --git a/drivers/GlusterFSSR.py b/drivers/GlusterFSSR.py
new file mode 100644
index 0000000..72c482a
index 00000000..72c482ae
--- /dev/null
+++ b/drivers/GlusterFSSR.py
@@ -0,0 +1,287 @@
Expand Down Expand Up @@ -621,7 +621,7 @@ index 0000000..72c482a
+else:
+ SR.registerSR(GlusterFSSR)
diff --git a/drivers/cleanup.py b/drivers/cleanup.py
index 042fe99..d3dfc0e 100755
index 042fe998..d3dfc0e4 100755
--- a/drivers/cleanup.py
+++ b/drivers/cleanup.py
@@ -2887,7 +2887,9 @@ def normalizeType(type):
Expand Down
8 changes: 4 additions & 4 deletions SOURCES/0003-feat-drivers-add-XFS-driver.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 4517b34462a3285630dc134de99eb84f6aa4fb58 Mon Sep 17 00:00:00 2001
From: Ronan Abhamon <[email protected]>
Date: Mon, 20 Jul 2020 16:26:42 +0200
Subject: [PATCH 03/28] feat(drivers): add XFS driver
Subject: [PATCH 03/29] feat(drivers): add XFS driver

Originally-by: Ronan Abhamon <[email protected]>

Expand All @@ -21,7 +21,7 @@ Signed-off-by: Yann Dirson <[email protected]>
create mode 100755 drivers/XFSSR.py

diff --git a/Makefile b/Makefile
index 0750482..7cb6ba4 100755
index 07504828..7cb6ba49 100755
--- a/Makefile
+++ b/Makefile
@@ -16,6 +16,7 @@ SM_DRIVERS += SMB
Expand All @@ -34,7 +34,7 @@ index 0750482..7cb6ba4 100755
SM_LIBS += SRCommand
diff --git a/drivers/XFSSR.py b/drivers/XFSSR.py
new file mode 100755
index 0000000..1dfde09
index 00000000..1dfde095
--- /dev/null
+++ b/drivers/XFSSR.py
@@ -0,0 +1,249 @@
Expand Down Expand Up @@ -288,7 +288,7 @@ index 0000000..1dfde09
+else:
+ SR.registerSR(XFSSR)
diff --git a/drivers/cleanup.py b/drivers/cleanup.py
index d3dfc0e..57522b8 100755
index d3dfc0e4..57522b8b 100755
--- a/drivers/cleanup.py
+++ b/drivers/cleanup.py
@@ -2889,6 +2889,7 @@ def normalizeType(type):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From cd3cd24251e847eb20ac5b32a374109718c8cca0 Mon Sep 17 00:00:00 2001
From: Ronan Abhamon <[email protected]>
Date: Wed, 12 Aug 2020 11:14:33 +0200
Subject: [PATCH 04/28] feat(drivers): add ZFS driver to avoid losing VDI
Subject: [PATCH 04/29] feat(drivers): add ZFS driver to avoid losing VDI
metadata (xcp-ng/xcp#401)

---
Expand All @@ -13,7 +13,7 @@ Subject: [PATCH 04/28] feat(drivers): add ZFS driver to avoid losing VDI
create mode 100644 drivers/ZFSSR.py

diff --git a/Makefile b/Makefile
index 7cb6ba4..2b2b980 100755
index 7cb6ba49..2b2b980a 100755
--- a/Makefile
+++ b/Makefile
@@ -17,6 +17,7 @@ SM_DRIVERS += LVHDoFCoE
Expand All @@ -25,7 +25,7 @@ index 7cb6ba4..2b2b980 100755
SM_LIBS := SR
SM_LIBS += SRCommand
diff --git a/drivers/XE_SR_ERRORCODES.xml b/drivers/XE_SR_ERRORCODES.xml
index 725d14f..d4b7f29 100755
index 725d14fe..d4b7f292 100755
--- a/drivers/XE_SR_ERRORCODES.xml
+++ b/drivers/XE_SR_ERRORCODES.xml
@@ -910,5 +910,15 @@
Expand All @@ -46,7 +46,7 @@ index 725d14f..d4b7f29 100755
</SM-errorcodes>
diff --git a/drivers/ZFSSR.py b/drivers/ZFSSR.py
new file mode 100644
index 0000000..1b2f398
index 00000000..1b2f398f
--- /dev/null
+++ b/drivers/ZFSSR.py
@@ -0,0 +1,137 @@
Expand Down Expand Up @@ -188,7 +188,7 @@ index 0000000..1b2f398
+else:
+ SR.registerSR(ZFSSR)
diff --git a/drivers/cleanup.py b/drivers/cleanup.py
index 57522b8..81cf032 100755
index 57522b8b..81cf0324 100755
--- a/drivers/cleanup.py
+++ b/drivers/cleanup.py
@@ -2889,7 +2889,7 @@ def normalizeType(type):
Expand Down
30 changes: 15 additions & 15 deletions SOURCES/0005-feat-drivers-add-LinstorSR-driver.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From ee88ac2658f10fe367a1a299f8b17b10209388ff Mon Sep 17 00:00:00 2001
From: Ronan Abhamon <[email protected]>
Date: Mon, 16 Mar 2020 15:39:44 +0100
Subject: [PATCH 05/28] feat(drivers): add LinstorSR driver
Subject: [PATCH 05/29] feat(drivers): add LinstorSR driver

Some important points:

Expand Down Expand Up @@ -78,7 +78,7 @@ module imports are protected by try.. except... blocks.
create mode 100644 tests/mocks/linstor/__init__.py

diff --git a/Makefile b/Makefile
index 2b2b980..dc370cf 100755
index 2b2b980a..dc370cfd 100755
--- a/Makefile
+++ b/Makefile
@@ -8,6 +8,7 @@ SM_DRIVERS += Dummy
Expand Down Expand Up @@ -141,7 +141,7 @@ index 2b2b980..dc370cf 100755
-
diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py
new file mode 100755
index 0000000..ffd70ab
index 00000000..ffd70abf
--- /dev/null
+++ b/drivers/LinstorSR.py
@@ -0,0 +1,2100 @@
Expand Down Expand Up @@ -2246,7 +2246,7 @@ index 0000000..ffd70ab
+else:
+ SR.registerSR(LinstorSR)
diff --git a/drivers/XE_SR_ERRORCODES.xml b/drivers/XE_SR_ERRORCODES.xml
index d4b7f29..ae871c8 100755
index d4b7f292..ae871c81 100755
--- a/drivers/XE_SR_ERRORCODES.xml
+++ b/drivers/XE_SR_ERRORCODES.xml
@@ -921,4 +921,40 @@
Expand Down Expand Up @@ -2291,7 +2291,7 @@ index d4b7f29..ae871c8 100755
+ </code>
</SM-errorcodes>
diff --git a/drivers/cleanup.py b/drivers/cleanup.py
index 81cf032..3bf84d5 100755
index 81cf0324..3bf84d5e 100755
--- a/drivers/cleanup.py
+++ b/drivers/cleanup.py
@@ -46,10 +46,19 @@ import xs_errors
Expand Down Expand Up @@ -2714,7 +2714,7 @@ index 81cf032..3bf84d5 100755

diff --git a/drivers/linstor-manager b/drivers/linstor-manager
new file mode 100755
index 0000000..f7ce180
index 00000000..f7ce1809
--- /dev/null
+++ b/drivers/linstor-manager
@@ -0,0 +1,272 @@
Expand Down Expand Up @@ -2992,7 +2992,7 @@ index 0000000..f7ce180
+ })
diff --git a/drivers/linstorjournaler.py b/drivers/linstorjournaler.py
new file mode 100755
index 0000000..7495330
index 00000000..74953305
--- /dev/null
+++ b/drivers/linstorjournaler.py
@@ -0,0 +1,155 @@
Expand Down Expand Up @@ -3153,7 +3153,7 @@ index 0000000..7495330
+ return '{}/{}'.format(type, identifier)
diff --git a/drivers/linstorvhdutil.py b/drivers/linstorvhdutil.py
new file mode 100644
index 0000000..f31c752
index 00000000..f31c7525
--- /dev/null
+++ b/drivers/linstorvhdutil.py
@@ -0,0 +1,186 @@
Expand Down Expand Up @@ -3345,7 +3345,7 @@ index 0000000..f31c752
+ )
diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py
new file mode 100755
index 0000000..d400421
index 00000000..d4004217
--- /dev/null
+++ b/drivers/linstorvolumemanager.py
@@ -0,0 +1,1713 @@
Expand Down Expand Up @@ -5063,7 +5063,7 @@ index 0000000..d400421
+ return True
+ return False
diff --git a/drivers/tapdisk-pause b/drivers/tapdisk-pause
index 6b7fc09..932fc3c 100755
index 6b7fc09f..932fc3ca 100755
--- a/drivers/tapdisk-pause
+++ b/drivers/tapdisk-pause
@@ -29,6 +29,12 @@ import lvhdutil
Expand Down Expand Up @@ -5133,7 +5133,7 @@ index 6b7fc09..932fc3c 100755
def Pause(self):
util.SMlog("Pause for %s" % self.vdi_uuid)
diff --git a/drivers/util.py b/drivers/util.py
index 8fa80da..a64512f 100755
index 8fa80da4..a64512f4 100755
--- a/drivers/util.py
+++ b/drivers/util.py
@@ -694,10 +694,35 @@ def get_this_host():
Expand Down Expand Up @@ -5201,7 +5201,7 @@ index 8fa80da..a64512f 100755
if retries >= maxretry:
diff --git a/linstor/Makefile b/linstor/Makefile
new file mode 100644
index 0000000..c329ca3
index 00000000..c329ca30
--- /dev/null
+++ b/linstor/Makefile
@@ -0,0 +1,22 @@
Expand Down Expand Up @@ -5229,7 +5229,7 @@ index 0000000..c329ca3
+ rm -f linstor-monitord
diff --git a/linstor/linstor-monitord.c b/linstor/linstor-monitord.c
new file mode 100644
index 0000000..8161813
index 00000000..8161813d
--- /dev/null
+++ b/linstor/linstor-monitord.c
@@ -0,0 +1,402 @@
Expand Down Expand Up @@ -5637,7 +5637,7 @@ index 0000000..8161813
+}
diff --git a/systemd/linstor-monitor.service b/systemd/linstor-monitor.service
new file mode 100644
index 0000000..5f8f0a7
index 00000000..5f8f0a76
--- /dev/null
+++ b/systemd/linstor-monitor.service
@@ -0,0 +1,13 @@
Expand All @@ -5656,4 +5656,4 @@ index 0000000..5f8f0a7
+WantedBy=multi-user.target
diff --git a/tests/mocks/linstor/__init__.py b/tests/mocks/linstor/__init__.py
new file mode 100644
index 0000000..e69de29
index 00000000..e69de29b
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 52c6e98da6238b6a624f7e59b4e0d896ca0728bc Mon Sep 17 00:00:00 2001
From: Ronan Abhamon <[email protected]>
Date: Tue, 27 Oct 2020 15:04:36 +0100
Subject: [PATCH 06/28] feat(tests): add unit tests concerning ZFS (close
Subject: [PATCH 06/29] feat(tests): add unit tests concerning ZFS (close
xcp-ng/xcp#425)

- Check if "create" doesn't succeed without zfs packages
Expand All @@ -13,7 +13,7 @@ Subject: [PATCH 06/28] feat(tests): add unit tests concerning ZFS (close
create mode 100644 tests/test_ZFSSR.py

diff --git a/drivers/ZFSSR.py b/drivers/ZFSSR.py
index 1b2f398..d375210 100644
index 1b2f398f..d3752101 100644
--- a/drivers/ZFSSR.py
+++ b/drivers/ZFSSR.py
@@ -58,6 +58,18 @@ DRIVER_INFO = {
Expand Down Expand Up @@ -85,7 +85,7 @@ index 1b2f398..d375210 100644
class ZFSFileVDI(FileSR.FileVDI):
diff --git a/tests/test_ZFSSR.py b/tests/test_ZFSSR.py
new file mode 100644
index 0000000..879ea37
index 00000000..879ea372
--- /dev/null
+++ b/tests/test_ZFSSR.py
@@ -0,0 +1,121 @@
Expand Down
10 changes: 5 additions & 5 deletions SOURCES/0007-Added-SM-Driver-for-MooseFS.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 1dc43ae24403979db03fb7bbf90aeffe81d6c28b Mon Sep 17 00:00:00 2001
From: Aleksander Wieliczko <[email protected]>
Date: Fri, 29 Jan 2021 15:21:23 +0100
Subject: [PATCH 07/28] Added SM Driver for MooseFS
Subject: [PATCH 07/29] Added SM Driver for MooseFS

Co-authored-by: Piotr Robert Konopelko <[email protected]>
Signed-off-by: Aleksander Wieliczko <[email protected]>
Expand All @@ -16,7 +16,7 @@ Signed-off-by: Ronan Abhamon <[email protected]>
create mode 100644 tests/test_MooseFSSR.py

diff --git a/Makefile b/Makefile
index dc370cf..c2f6f46 100755
index dc370cfd..c2f6f463 100755
--- a/Makefile
+++ b/Makefile
@@ -19,6 +19,7 @@ SM_DRIVERS += CephFS
Expand All @@ -29,7 +29,7 @@ index dc370cf..c2f6f46 100755
SM_LIBS += SRCommand
diff --git a/drivers/MooseFSSR.py b/drivers/MooseFSSR.py
new file mode 100755
index 0000000..53485a0
index 00000000..53485a0c
--- /dev/null
+++ b/drivers/MooseFSSR.py
@@ -0,0 +1,271 @@
Expand Down Expand Up @@ -305,7 +305,7 @@ index 0000000..53485a0
+else:
+ SR.registerSR(MooseFSSR)
diff --git a/drivers/cleanup.py b/drivers/cleanup.py
index 3bf84d5..9fa6f27 100755
index 3bf84d5e..9fa6f27b 100755
--- a/drivers/cleanup.py
+++ b/drivers/cleanup.py
@@ -3245,7 +3245,7 @@ def normalizeType(type):
Expand All @@ -319,7 +319,7 @@ index 3bf84d5..9fa6f27 100755
if type in ["linstor"]:
diff --git a/tests/test_MooseFSSR.py b/tests/test_MooseFSSR.py
new file mode 100644
index 0000000..3349a44
index 00000000..3349a449
--- /dev/null
+++ b/tests/test_MooseFSSR.py
@@ -0,0 +1,64 @@
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 0f993508af755b52d46b216b503e81914eb570ef Mon Sep 17 00:00:00 2001
From: Ronan Abhamon <[email protected]>
Date: Thu, 2 Dec 2021 09:28:37 +0100
Subject: [PATCH 08/28] Avoid usage of `umount` in `ISOSR` when `legacy_mode`
Subject: [PATCH 08/29] 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 All @@ -15,7 +15,7 @@ Signed-off-by: Ronan Abhamon <[email protected]>
2 files changed, 60 insertions(+), 2 deletions(-)

diff --git a/drivers/ISOSR.py b/drivers/ISOSR.py
index f591d23..9ca4450 100755
index f591d237..9ca44506 100755
--- a/drivers/ISOSR.py
+++ b/drivers/ISOSR.py
@@ -569,8 +569,7 @@ class ISOSR(SR.SR):
Expand All @@ -29,7 +29,7 @@ index f591d23..9ca4450 100755

try:
diff --git a/tests/test_ISOSR.py b/tests/test_ISOSR.py
index 3aea796..760c566 100644
index 3aea7963..760c566a 100644
--- a/tests/test_ISOSR.py
+++ b/tests/test_ISOSR.py
@@ -24,6 +24,65 @@ class FakeISOSR(ISOSR.ISOSR):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 1f67bfaffbd431c166a5e61322ea7d179ee4d687 Mon Sep 17 00:00:00 2001
From: Ronan Abhamon <[email protected]>
Date: Wed, 18 May 2022 17:28:09 +0200
Subject: [PATCH 09/28] MooseFS SR uses now UUID subdirs for each SR
Subject: [PATCH 09/29] 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 All @@ -17,7 +17,7 @@ Signed-off-by: Ronan Abhamon <[email protected]>
1 file changed, 52 insertions(+), 4 deletions(-)

diff --git a/drivers/MooseFSSR.py b/drivers/MooseFSSR.py
index 53485a0..b2e056a 100755
index 53485a0c..b2e056af 100755
--- a/drivers/MooseFSSR.py
+++ b/drivers/MooseFSSR.py
@@ -18,6 +18,7 @@
Expand Down
Loading

0 comments on commit d2d5ca0

Please sign in to comment.