From 97d9c1237834b41c9063278a93d5d3fe150c8a0e Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 12 Jun 2024 18:47:38 +0200 Subject: [PATCH 1/8] Add many LINSTOR fixes/improvements Signed-off-by: Ronan Abhamon --- ...21cc248d79b749a63d4ad099e6d5f4b8b588.patch | 4 +- ...-sm.service-s-description-for-XCP-ng.patch | 4 +- .../0003-Add-TrueNAS-multipath-config.patch | 4 +- ...add-CephFS-GlusterFS-and-XFS-drivers.patch | 4 +- ...-ZFS-driver-to-avoid-losing-VDI-meta.patch | 4 +- ...driver-for-users-who-need-to-transit.patch | 5 +- ...07-feat-drivers-add-LinstorSR-driver.patch | 16 +- ...nit-tests-concerning-ZFS-close-xcp-n.patch | 6 +- ...no-NFS-ACLs-provided-assume-everyone.patch | 6 +- .../0010-Added-SM-Driver-for-MooseFS.patch | 6 +- ...mount-in-ISOSR-when-legacy_mode-is-u.patch | 6 +- ...SR-uses-now-UUID-subdirs-for-each-SR.patch | 6 +- ...Fix-is_open-call-for-many-drivers-25.patch | 6 +- ...HING-capability-for-many-SR-types-24.patch | 6 +- ...ve-SR_PROBE-from-ZFS-capabilities-37.patch | 6 +- ...ix-vdi-ref-when-static-vdis-are-used.patch | 6 +- ...-not-to-edit-multipath.conf-directly.patch | 6 +- ...om.conf-multipath-configuration-file.patch | 6 +- ...all-etc-multipath-conf.d-custom.conf.patch | 6 +- SOURCES/0020-Backport-NFS4-only-support.patch | 6 +- ...or-NFS4-when-rpcinfo-does-not-includ.patch | 6 +- ...Block-backport-of-largeblocksr-51-55.patch | 7 +- ...dd-a-way-to-modify-config-of-LVMs-56.patch | 7 +- ...-alarm-must-be-reset-in-case-of-succ.patch | 32 + ...urns-the-result-of-user-function-now.patch | 26 + ...e-pause-tag-from-VDIs-in-case-of-fai.patch | 58 + ...pair-volumes-only-if-an-exclusive-co.patch | 36 + ...instorSR-Improve-LINSTOR-performance.patch | 1421 +++++++++++ ...obustify-scan-to-avoid-losing-VDIs-i.patch | 91 + ...isplay-a-correctly-readable-size-for.patch | 281 +++ ...itord-scan-all-LINSTOR-SRs-every-12-.patch | 335 +++ ...ll-correctly-method-in-_locked_load-.patch | 44 + ...rSR-integrate-minidrbdcluster-daemon.patch | 2069 +++++++++++++++++ ...nsure-heartbeat-and-redo_log-VDIs-ar.patch | 168 ++ ...rotect-sr-commands-to-avoid-forgetti.patch | 166 ++ ...aler-ensure-uri-is-not-None-during-l.patch | 57 + ...dd-an-option-to-disable-auto-quorum-.patch | 145 ++ ...eManager-add-a-workaround-to-create-.patch | 36 + ...LinstorSR-add-optional-ips-parameter.patch | 123 + ...dd-a-helper-log_drbd_erofs-to-trace-.patch | 216 ++ ...y-to-restart-the-services-again-if-t.patch | 74 + ...bustify-linstor-manager-to-never-inc.patch | 39 + ...event-starting-controller-during-fai.patch | 65 + ...meManager-increase-peer-slots-limit-.patch | 170 ++ ...meManager-add-a-fallback-to-find-con.patch | 117 + ...tor.mount-ensure-we-always-mount-dat.patch | 110 + ...meManager-add-a-fallback-to-find-nod.patch | 52 + ...xplain-on-which-host-plugins-command.patch | 50 + ...eate-diskless-path-if-necessary-duri.patch | 36 + ...se-HTTP-NBD-instead-of-DRBD-directly.patch | 763 ++++++ ...nd-controller-when-XAPI-unreachable-.patch | 187 ++ ...e-IPs-instead-of-hostnames-in-NBD-se.patch | 208 ++ ...eManager-ensure-we-always-use-IPs-in.patch | 30 + ...ager-add-methods-to-add-remove-host-.patch | 425 ++++ ...meManager-support-SR-creation-with-d.patch | 130 ++ ...dd-a-config-var-to-disable-HTTP-NBD-.patch | 54 + ...nsure-LVM-group-is-activated-during-.patch | 99 + ...ager-add-method-to-create-LinstorSR-.patch | 247 ++ ...ways-set-vdi_path-in-generate_config.patch | 31 + ...ter-supports-new-properties-like-for.patch | 37 + ...abled-disable-minidrbcluster-with-fi.patch | 84 + ...ger-change-linstor-satellite-start-b.patch | 41 + .../0063-Fix-is_open-call-for-LinstorSR.patch | 106 + ...til-fix-boolean-params-of-check-call.patch | 50 + ...tor-manager-robustify-exec_create_sr.patch | 206 ++ ...t-LINSTOR-VDI-UUID-if-error-during-i.patch | 27 + ...se-and-dump-DRBD-openers-in-case-of-.patch | 146 ++ ...til-trace-DRBD-openers-in-case-of-ER.patch | 135 ++ ...emanager-compute-correctly-size-in-a.patch | 98 + ...se-DRBD-openers-instead-of-lsof-to-l.patch | 327 +++ ...upport-cProfile-to-trace-calls-when-.patch | 93 + ...aler-reset-namespace-when-get-is-cal.patch | 26 + ...il-fix-coalesce-with-VM-running-unde.patch | 554 +++++ ...emanager-_get_volumes_info-doesn-t-r.patch | 50 + ...emanager-remove-double-prefix-on-kv-.patch | 40 + ...dd-linstor-kv-dump-helper-to-print-k.patch | 72 + ...sable-VHD-key-hash-usage-to-limit-ex.patch | 37 + ...ter-ensure-SIGINT-is-handled-correct.patch | 99 + ...ster-stop-resource-services-at-start.patch | 135 ++ ...ager-add-new-healthCheck-function-to.patch | 361 +++ ...x-xha-conf-parsing-return-host-ip-no.patch | 54 + ...art-correctly-HA-servers-HTTP-NBD-af.patch | 44 + ...emanager-use-an-array-to-store-diskf.patch | 78 + ...memanager-support-snaps-when-a-host-.patch | 33 + ...emanager-support-offline-hosts-when-.patch | 115 + ...emanager-define-_base_group_name-mem.patch | 34 + ...til-modify-logic-of-local-vhdutil-ca.patch | 148 ++ ...memanager-robustify-failed-snapshots.patch | 53 + ...emanager-use-a-namespace-for-volumes.patch | 29 + ...dump-rename-to-linstor-kv-tool-add-r.patch | 97 + ...ndle-correctly-localhost-during-star.patch | 75 + ...all-repair-on-another-host-when-EROF.patch | 62 + ...void-introduction-of-DELETED-volumes.patch | 27 + ...tool-remove-all-volumes-supports-jou.patch | 30 + ...il-due-to-bad-refactoring-check-call.patch | 33 + ...til-ensure-we-use-VHD-parent-to-find.patch | 69 + ...memanager-force-DRBD-demote-after-fa.patch | 239 ++ ...il-ensure-we-retry-creation-in-all-s.patch | 121 + ...il-don-t-retry-local-vhdutil-call-wh.patch | 158 ++ ...-feat-fork-log-daemon-ignore-SIGTERM.patch | 35 + ...SR-wait-for-http-disk-server-startup.patch | 116 + ...ndle-inflate-resize-actions-correctl.patch | 134 ++ ...ger-add-a-static-iptables-rule-for-D.patch | 125 + ...ync-with-last-http-nbd-transfer-vers.patch | 122 + ...n-t-check-VDI-metadata-while-listing.patch | 38 + ...n-t-check-metadata-when-destroying-s.patch | 35 + ...il-handle-correctly-generic-exceptio.patch | 63 + ...ter-robustify-to-unmount-correctly-L.patch | 89 + ...ter-handle-correctly-KeyboardInterru.patch | 37 + ...se-drbd-reactor-instead-of-minidrbdc.patch | 621 +++++ ...sure-vhdutil-calls-are-correctly-exe.patch | 147 ++ ...eplace-bad-param-in-detach_thin-impl.patch | 28 + ...lumemanager-remove-usage-of-realpath.patch | 56 + ...vhdutil-avoid-parent-path-resolution.patch | 111 + ...rSR-create-parent-path-during-attach.patch | 41 + ...retry-if-we-can-t-build-volume-cache.patch | 33 + ...emanager-reduce-peer-slots-param-to-.patch | 57 + ...tach-a-valid-XAPI-session-is_open-is.patch | 31 + ...sure-we-always-have-a-DRBD-path-to-s.patch | 28 + ...fix-LinstorSR-remove-hosts-ips-param.patch | 168 ++ ...mpute-correctly-SR-size-using-pool-c.patch | 93 + ...re-we-can-import-this-module-when-LI.patch | 48 + ...ensure-volume-cache-can-be-recreated.patch | 112 + ...ger-remove-dead-useless-code-in-add-.patch | 209 ++ ...sure-we-always-have-a-device-path-du.patch | 59 + ...ways-use-lock.acquire-during-attach-.patch | 59 + ...re-sure-hostnames-are-unique-at-SR-c.patch | 31 + ...sure-we-can-attach-non-special-stati.patch | 28 + ...sure-we-can-detach-when-deflate-call.patch | 85 + ...sume-VDI-is-always-a-VHD-when-the-in.patch | 34 + ...move-SR-lock-during-thin-attach-deta.patch | 152 ++ ...sure-database-is-mounted-during-scan.patch | 69 + ...start-drbd-reactor-in-case-of-failur.patch | 53 + ...emanager-retry-in-case-of-failure-du.patch | 33 + ...emanager-avoid-diskless-creation-whe.patch | 146 ++ ...move-diskless-after-VDI.detach-calls.patch | 91 + ...bustify-_load_vdi_info-in-cleanup.py.patch | 99 + ...sure-detach-never-fails-on-plugin-fa.patch | 32 + ...sure-we-coalesce-only-volumes-with-a.patch | 140 ++ ...n-t-try-to-repair-persistent-volumes.patch | 199 ++ ...il-format-correctly-message-if-vhd-u.patch | 28 + ...wait-during-attach-to-open-DRBD-path.patch | 46 + ...pport-different-volume-sizes-in-clea.patch | 517 ++++ ...rSR-remove-useless-IPS_XHA_CACHE-var.patch | 31 + ...sure-we-can-deflate-on-any-host-afte.patch | 318 +++ ...sure-we-always-use-real-DRBD-VHD-siz.patch | 149 ++ ...tool-If-no-controller-uri-option-is-.patch | 56 + ...olumemanager-robustify-SR-destroy-46.patch | 210 ++ ...ager-extend-API-with-createNodeInter.patch | 108 + ...-support-VDI.resize-on-thick-volumes.patch | 31 + ...emanager-format-correctly-exception-.patch | 30 + ...sure-we-can-skip-coalesces-if-device.patch | 32 + ...ager-add-methods-to-modify-destroy-l.patch | 255 ++ ...rce-a-defined-volume-prefix-if-we-ca.patch | 27 + ...plicit-error-message-when-a-group-is.patch | 29 + ...ke-sure-VDI.delete-doesn-t-throw-und.patch | 70 + ...d-drbd-in-the-blacklist-of-multipath.patch | 34 + ...emanager-create-cloned-volumes-on-ho.patch | 126 + ...emanager-don-t-align-volumes-on-LVM-.patch | 32 + ...emanager-assert-with-message-after-l.patch | 33 + ...emanager-retry-resize-if-volume-is-n.patch | 58 + ...eate-DRBD-diskless-if-necessary-for-.patch | 101 + ...x-bad-call-to-vhdutil.inflate-bad-ex.patch | 36 + ...tivate-VG-if-attach-from-config-is-a.patch | 27 + ...se-a-specific-resource-group-for-DB-.patch | 521 +++++ ...ager-add-getNodePreferredInterface-h.patch | 76 + ...emanager-blocks-deletion-of-default-.patch | 31 + ...memanager-change-logic-of-get_resour.patch | 104 + ...ager-add-error-codes-to-healthCheck-.patch | 251 ++ ...x-bad-exception-reference-during-sna.patch | 39 + ...e-ensure-LINSTOR-VHD-chain-is-availa.patch | 159 ++ ...SISR-disable-restart-of-ISCSI-daemon.patch | 96 + ...il-retry-check-on-another-machine-in.patch | 76 + ...plicit-errors-when-database-path-is-.patch | 49 + ...-fix-LinstorSR-Misc-fixes-on-destroy.patch | 136 ++ SPECS/sm.spec | 166 +- 176 files changed, 20459 insertions(+), 69 deletions(-) create mode 100644 SOURCES/0024-Fix-timeout_call-alarm-must-be-reset-in-case-of-succ.patch create mode 100644 SOURCES/0025-timeout_call-returns-the-result-of-user-function-now.patch create mode 100644 SOURCES/0026-Always-remove-the-pause-tag-from-VDIs-in-case-of-fai.patch create mode 100644 SOURCES/0027-fix-LinstorSR-repair-volumes-only-if-an-exclusive-co.patch create mode 100644 SOURCES/0028-feat-LinstorSR-Improve-LINSTOR-performance.patch create mode 100644 SOURCES/0029-feat-LinstorSR-robustify-scan-to-avoid-losing-VDIs-i.patch create mode 100644 SOURCES/0030-feat-LinstorSR-display-a-correctly-readable-size-for.patch create mode 100644 SOURCES/0031-feat-linstor-monitord-scan-all-LINSTOR-SRs-every-12-.patch create mode 100644 SOURCES/0032-fix-LinstorSR-call-correctly-method-in-_locked_load-.patch create mode 100644 SOURCES/0033-feat-LinstorSR-integrate-minidrbdcluster-daemon.patch create mode 100644 SOURCES/0034-feat-LinstorSR-ensure-heartbeat-and-redo_log-VDIs-ar.patch create mode 100644 SOURCES/0035-feat-LinstorSR-protect-sr-commands-to-avoid-forgetti.patch create mode 100644 SOURCES/0036-fix-LinstorJournaler-ensure-uri-is-not-None-during-l.patch create mode 100644 SOURCES/0037-feat-LinstorSR-add-an-option-to-disable-auto-quorum-.patch create mode 100644 SOURCES/0038-fix-LinstorVolumeManager-add-a-workaround-to-create-.patch create mode 100644 SOURCES/0039-feat-LinstorSR-add-optional-ips-parameter.patch create mode 100644 SOURCES/0040-feat-LinstorSR-add-a-helper-log_drbd_erofs-to-trace-.patch create mode 100644 SOURCES/0041-fix-LinstorSR-try-to-restart-the-services-again-if-t.patch create mode 100644 SOURCES/0042-fix-LinstorSR-robustify-linstor-manager-to-never-inc.patch create mode 100644 SOURCES/0043-fix-LinstorSR-prevent-starting-controller-during-fai.patch create mode 100644 SOURCES/0044-feat-LinstorVolumeManager-increase-peer-slots-limit-.patch create mode 100644 SOURCES/0045-feat-LinstorVolumeManager-add-a-fallback-to-find-con.patch create mode 100644 SOURCES/0046-fix-var-lib-linstor.mount-ensure-we-always-mount-dat.patch create mode 100644 SOURCES/0047-feat-LinstorVolumeManager-add-a-fallback-to-find-nod.patch create mode 100644 SOURCES/0048-feat-LinstorSR-explain-on-which-host-plugins-command.patch create mode 100644 SOURCES/0049-fix-LinstorSR-create-diskless-path-if-necessary-duri.patch create mode 100644 SOURCES/0050-feat-LinstorSR-use-HTTP-NBD-instead-of-DRBD-directly.patch create mode 100644 SOURCES/0051-fix-LinstorSR-find-controller-when-XAPI-unreachable-.patch create mode 100644 SOURCES/0052-fix-LinstorSR-use-IPs-instead-of-hostnames-in-NBD-se.patch create mode 100644 SOURCES/0053-fix-LinstorVolumeManager-ensure-we-always-use-IPs-in.patch create mode 100644 SOURCES/0054-feat-linstor-manager-add-methods-to-add-remove-host-.patch create mode 100644 SOURCES/0055-feat-LinstorVolumeManager-support-SR-creation-with-d.patch create mode 100644 SOURCES/0056-feat-LinstorSR-add-a-config-var-to-disable-HTTP-NBD-.patch create mode 100644 SOURCES/0057-feat-LinstorSr-ensure-LVM-group-is-activated-during-.patch create mode 100644 SOURCES/0058-feat-linstor-manager-add-method-to-create-LinstorSR-.patch create mode 100644 SOURCES/0059-fix-LinstorSR-always-set-vdi_path-in-generate_config.patch create mode 100644 SOURCES/0060-fix-minidrbdcluster-supports-new-properties-like-for.patch create mode 100644 SOURCES/0061-fix-LinstorSR-enabled-disable-minidrbcluster-with-fi.patch create mode 100644 SOURCES/0062-fix-linstor-manager-change-linstor-satellite-start-b.patch create mode 100644 SOURCES/0063-Fix-is_open-call-for-LinstorSR.patch create mode 100644 SOURCES/0064-fix-linstorvhdutil-fix-boolean-params-of-check-call.patch create mode 100644 SOURCES/0065-feat-linstor-manager-robustify-exec_create_sr.patch create mode 100644 SOURCES/0066-fix-cleanup-print-LINSTOR-VDI-UUID-if-error-during-i.patch create mode 100644 SOURCES/0067-feat-cleanup-raise-and-dump-DRBD-openers-in-case-of-.patch create mode 100644 SOURCES/0068-feat-linstorvhdutil-trace-DRBD-openers-in-case-of-ER.patch create mode 100644 SOURCES/0069-fix-linstorvolumemanager-compute-correctly-size-in-a.patch create mode 100644 SOURCES/0070-feat-LinstorSR-use-DRBD-openers-instead-of-lsof-to-l.patch create mode 100644 SOURCES/0071-feat-LinstorSR-support-cProfile-to-trace-calls-when-.patch create mode 100644 SOURCES/0072-fix-LinstorJournaler-reset-namespace-when-get-is-cal.patch create mode 100644 SOURCES/0073-fix-linstorvhdutil-fix-coalesce-with-VM-running-unde.patch create mode 100644 SOURCES/0074-fix-linstorvolumemanager-_get_volumes_info-doesn-t-r.patch create mode 100644 SOURCES/0075-fix-linstorvolumemanager-remove-double-prefix-on-kv-.patch create mode 100644 SOURCES/0076-feat-LinstorSR-add-linstor-kv-dump-helper-to-print-k.patch create mode 100644 SOURCES/0077-fix-LinstorSR-disable-VHD-key-hash-usage-to-limit-ex.patch create mode 100644 SOURCES/0078-fix-minidrbdcluster-ensure-SIGINT-is-handled-correct.patch create mode 100644 SOURCES/0079-feat-minidrbdcluster-stop-resource-services-at-start.patch create mode 100644 SOURCES/0080-feat-linstor-manager-add-new-healthCheck-function-to.patch create mode 100644 SOURCES/0081-fix-LinstorSR-fix-xha-conf-parsing-return-host-ip-no.patch create mode 100644 SOURCES/0082-fix-LinstorSR-start-correctly-HA-servers-HTTP-NBD-af.patch create mode 100644 SOURCES/0083-fix-linstorvolumemanager-use-an-array-to-store-diskf.patch create mode 100644 SOURCES/0084-feat-linstorvolumemanager-support-snaps-when-a-host-.patch create mode 100644 SOURCES/0085-fix-linstorvolumemanager-support-offline-hosts-when-.patch create mode 100644 SOURCES/0086-fix-linstorvolumemanager-define-_base_group_name-mem.patch create mode 100644 SOURCES/0087-feat-linstorvhdutil-modify-logic-of-local-vhdutil-ca.patch create mode 100644 SOURCES/0088-fix-linstorvolumemanager-robustify-failed-snapshots.patch create mode 100644 SOURCES/0089-fix-linstorvolumemanager-use-a-namespace-for-volumes.patch create mode 100644 SOURCES/0090-feat-linstor-kv-dump-rename-to-linstor-kv-tool-add-r.patch create mode 100644 SOURCES/0091-fix-LinstorSR-handle-correctly-localhost-during-star.patch create mode 100644 SOURCES/0092-fix-cleanup.py-call-repair-on-another-host-when-EROF.patch create mode 100644 SOURCES/0093-fix-LinstorSR-avoid-introduction-of-DELETED-volumes.patch create mode 100644 SOURCES/0094-feat-linstor-kv-tool-remove-all-volumes-supports-jou.patch create mode 100644 SOURCES/0095-fix-linstorvhdutil-due-to-bad-refactoring-check-call.patch create mode 100644 SOURCES/0096-feat-linstorvhdutil-ensure-we-use-VHD-parent-to-find.patch create mode 100644 SOURCES/0097-feat-linstorvolumemanager-force-DRBD-demote-after-fa.patch create mode 100644 SOURCES/0098-fix-linstorvhdutil-ensure-we-retry-creation-in-all-s.patch create mode 100644 SOURCES/0099-fix-linstorvhdutil-don-t-retry-local-vhdutil-call-wh.patch create mode 100644 SOURCES/0100-feat-fork-log-daemon-ignore-SIGTERM.patch create mode 100644 SOURCES/0101-feat-LinstorSR-wait-for-http-disk-server-startup.patch create mode 100644 SOURCES/0102-fix-LinstorSR-handle-inflate-resize-actions-correctl.patch create mode 100644 SOURCES/0103-fix-linstor-manager-add-a-static-iptables-rule-for-D.patch create mode 100644 SOURCES/0104-feat-LinstorSR-sync-with-last-http-nbd-transfer-vers.patch create mode 100644 SOURCES/0105-fix-LinstorSR-don-t-check-VDI-metadata-while-listing.patch create mode 100644 SOURCES/0106-fix-LinstorSR-don-t-check-metadata-when-destroying-s.patch create mode 100644 SOURCES/0107-fix-linstorvhdutil-handle-correctly-generic-exceptio.patch create mode 100644 SOURCES/0108-fix-minidrbdcluster-robustify-to-unmount-correctly-L.patch create mode 100644 SOURCES/0109-fix-minidrbdcluster-handle-correctly-KeyboardInterru.patch create mode 100644 SOURCES/0110-feat-LinstorSR-use-drbd-reactor-instead-of-minidrbdc.patch create mode 100644 SOURCES/0111-fix-LinstorSR-ensure-vhdutil-calls-are-correctly-exe.patch create mode 100644 SOURCES/0112-fix-LinstorSR-replace-bad-param-in-detach_thin-impl.patch create mode 100644 SOURCES/0113-fix-linstorvolumemanager-remove-usage-of-realpath.patch create mode 100644 SOURCES/0114-fix-linstorvhdutil-avoid-parent-path-resolution.patch create mode 100644 SOURCES/0115-fix-LinstorSR-create-parent-path-during-attach.patch create mode 100644 SOURCES/0116-fix-LinstorSR-retry-if-we-can-t-build-volume-cache.patch create mode 100644 SOURCES/0117-fix-linstorvolumemanager-reduce-peer-slots-param-to-.patch create mode 100644 SOURCES/0118-fix-LinstorSR-attach-a-valid-XAPI-session-is_open-is.patch create mode 100644 SOURCES/0119-fix-LinstorSR-ensure-we-always-have-a-DRBD-path-to-s.patch create mode 100644 SOURCES/0120-fix-LinstorSR-remove-hosts-ips-param.patch create mode 100644 SOURCES/0121-fix-LinstorSR-compute-correctly-SR-size-using-pool-c.patch create mode 100644 SOURCES/0122-fix-blktap2-ensure-we-can-import-this-module-when-LI.patch create mode 100644 SOURCES/0123-fix-LinstorSR-ensure-volume-cache-can-be-recreated.patch create mode 100644 SOURCES/0124-fix-linstor-manager-remove-dead-useless-code-in-add-.patch create mode 100644 SOURCES/0125-fix-LinstorSR-Ensure-we-always-have-a-device-path-du.patch create mode 100644 SOURCES/0126-fix-LinstorSR-always-use-lock.acquire-during-attach-.patch create mode 100644 SOURCES/0127-fix-LinstorSR-mare-sure-hostnames-are-unique-at-SR-c.patch create mode 100644 SOURCES/0128-fix-LinstorSR-ensure-we-can-attach-non-special-stati.patch create mode 100644 SOURCES/0129-fix-LinstorSR-ensure-we-can-detach-when-deflate-call.patch create mode 100644 SOURCES/0130-fix-LinstorSR-assume-VDI-is-always-a-VHD-when-the-in.patch create mode 100644 SOURCES/0131-fix-LinstorSR-remove-SR-lock-during-thin-attach-deta.patch create mode 100644 SOURCES/0132-fix-LinstorSR-ensure-database-is-mounted-during-scan.patch create mode 100644 SOURCES/0133-fix-LinstorSR-restart-drbd-reactor-in-case-of-failur.patch create mode 100644 SOURCES/0134-fix-linstorvolumemanager-retry-in-case-of-failure-du.patch create mode 100644 SOURCES/0135-fix-linstorvolumemanager-avoid-diskless-creation-whe.patch create mode 100644 SOURCES/0136-fix-LinstorSR-remove-diskless-after-VDI.detach-calls.patch create mode 100644 SOURCES/0137-fix-LinstorSR-robustify-_load_vdi_info-in-cleanup.py.patch create mode 100644 SOURCES/0138-fix-LinstorSR-ensure-detach-never-fails-on-plugin-fa.patch create mode 100644 SOURCES/0139-fix-LinstorSR-ensure-we-coalesce-only-volumes-with-a.patch create mode 100644 SOURCES/0140-fix-LinstorSR-don-t-try-to-repair-persistent-volumes.patch create mode 100644 SOURCES/0141-fix-linstorvhdutil-format-correctly-message-if-vhd-u.patch create mode 100644 SOURCES/0142-fix-LinstorSR-wait-during-attach-to-open-DRBD-path.patch create mode 100644 SOURCES/0143-fix-LinstorSR-support-different-volume-sizes-in-clea.patch create mode 100644 SOURCES/0144-fix-LinstorSR-remove-useless-IPS_XHA_CACHE-var.patch create mode 100644 SOURCES/0145-fix-LinstorSR-ensure-we-can-deflate-on-any-host-afte.patch create mode 100644 SOURCES/0146-fix-LinstorSR-ensure-we-always-use-real-DRBD-VHD-siz.patch create mode 100644 SOURCES/0147-feat-linstor-kv-tool-If-no-controller-uri-option-is-.patch create mode 100644 SOURCES/0148-fix-linstorvolumemanager-robustify-SR-destroy-46.patch create mode 100644 SOURCES/0149-feat-linstor-manager-extend-API-with-createNodeInter.patch create mode 100644 SOURCES/0150-fix-LinstorSR-support-VDI.resize-on-thick-volumes.patch create mode 100644 SOURCES/0151-fix-linstorvolumemanager-format-correctly-exception-.patch create mode 100644 SOURCES/0152-fix-LinstorSR-ensure-we-can-skip-coalesces-if-device.patch create mode 100644 SOURCES/0153-feat-linstor-manager-add-methods-to-modify-destroy-l.patch create mode 100644 SOURCES/0154-fix-LinstorSR-force-a-defined-volume-prefix-if-we-ca.patch create mode 100644 SOURCES/0155-fix-LinstorSR-explicit-error-message-when-a-group-is.patch create mode 100644 SOURCES/0156-fix-LinstorSR-make-sure-VDI.delete-doesn-t-throw-und.patch create mode 100644 SOURCES/0157-fix-LinstorSR-add-drbd-in-the-blacklist-of-multipath.patch create mode 100644 SOURCES/0158-fix-linstorvolumemanager-create-cloned-volumes-on-ho.patch create mode 100644 SOURCES/0159-fix-linstorvolumemanager-don-t-align-volumes-on-LVM-.patch create mode 100644 SOURCES/0160-fix-linstorvolumemanager-assert-with-message-after-l.patch create mode 100644 SOURCES/0161-fix-linstorvolumemanager-retry-resize-if-volume-is-n.patch create mode 100644 SOURCES/0162-fix-LinstorSR-create-DRBD-diskless-if-necessary-for-.patch create mode 100644 SOURCES/0163-fix-LinstorSR-fix-bad-call-to-vhdutil.inflate-bad-ex.patch create mode 100644 SOURCES/0164-fix-LinstorSR-activate-VG-if-attach-from-config-is-a.patch create mode 100644 SOURCES/0165-feat-LinstorSR-use-a-specific-resource-group-for-DB-.patch create mode 100644 SOURCES/0166-feat-linstor-manager-add-getNodePreferredInterface-h.patch create mode 100644 SOURCES/0167-fix-linstorvolumemanager-blocks-deletion-of-default-.patch create mode 100644 SOURCES/0168-feat-linstorvolumemanager-change-logic-of-get_resour.patch create mode 100644 SOURCES/0169-feat-linstor-manager-add-error-codes-to-healthCheck-.patch create mode 100644 SOURCES/0170-fix-LinstorSR-fix-bad-exception-reference-during-sna.patch create mode 100644 SOURCES/0171-fix-tapdisk-pause-ensure-LINSTOR-VHD-chain-is-availa.patch create mode 100644 SOURCES/0172-fix-LVHDoISCSISR-disable-restart-of-ISCSI-daemon.patch create mode 100644 SOURCES/0173-fix-linstorvhdutil-retry-check-on-another-machine-in.patch create mode 100644 SOURCES/0174-fix-LinstorSR-explicit-errors-when-database-path-is-.patch create mode 100644 SOURCES/0175-fix-LinstorSR-Misc-fixes-on-destroy.patch diff --git a/SOURCES/0001-backport-of-ccd121cc248d79b749a63d4ad099e6d5f4b8b588.patch b/SOURCES/0001-backport-of-ccd121cc248d79b749a63d4ad099e6d5f4b8b588.patch index 89c9c45b..a7530744 100644 --- a/SOURCES/0001-backport-of-ccd121cc248d79b749a63d4ad099e6d5f4b8b588.patch +++ b/SOURCES/0001-backport-of-ccd121cc248d79b749a63d4ad099e6d5f4b8b588.patch @@ -1,7 +1,7 @@ From a365619c2835e593259dad3c26761575f64066d6 Mon Sep 17 00:00:00 2001 From: Mark Syms Date: Thu, 20 May 2021 17:40:06 +0100 -Subject: [PATCH 01/23] backport of ccd121cc248d79b749a63d4ad099e6d5f4b8b588: +Subject: [PATCH 001/175] backport of ccd121cc248d79b749a63d4ad099e6d5f4b8b588: CA-354692: check for device parameter in create/probe calls Signed-off-by: Mark Syms @@ -87,5 +87,5 @@ index aa5a6b1..c752863 100755 def registerSR(SRClass): """Register SR with handler. All SR subclasses should call this in -- -2.44.0 +2.45.2 diff --git a/SOURCES/0002-Update-xs-sm.service-s-description-for-XCP-ng.patch b/SOURCES/0002-Update-xs-sm.service-s-description-for-XCP-ng.patch index 710c3dab..62d810a6 100644 --- a/SOURCES/0002-Update-xs-sm.service-s-description-for-XCP-ng.patch +++ b/SOURCES/0002-Update-xs-sm.service-s-description-for-XCP-ng.patch @@ -1,7 +1,7 @@ From 283242d159438c4b301e153a95adde5dfaea3b58 Mon Sep 17 00:00:00 2001 From: Samuel Verschelde Date: Thu, 13 Aug 2020 15:22:17 +0200 -Subject: [PATCH 02/23] Update xs-sm.service's description for XCP-ng +Subject: [PATCH 002/175] 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. @@ -21,5 +21,5 @@ index 99cb313..609c6ef 100644 Conflicts=shutdown.target RefuseManualStop=yes -- -2.44.0 +2.45.2 diff --git a/SOURCES/0003-Add-TrueNAS-multipath-config.patch b/SOURCES/0003-Add-TrueNAS-multipath-config.patch index 3333cad0..b86ab1e6 100644 --- a/SOURCES/0003-Add-TrueNAS-multipath-config.patch +++ b/SOURCES/0003-Add-TrueNAS-multipath-config.patch @@ -1,7 +1,7 @@ From d6528d899b762ec5d7ceec1fb9c8b13c2c7e6f73 Mon Sep 17 00:00:00 2001 From: Samuel Verschelde Date: Thu, 13 Aug 2020 15:26:43 +0200 -Subject: [PATCH 03/23] Add TrueNAS multipath config +Subject: [PATCH 003/175] 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. @@ -26,5 +26,5 @@ index 9f3dfa7..f63506d 100644 + } } -- -2.44.0 +2.45.2 diff --git a/SOURCES/0004-feat-drivers-add-CephFS-GlusterFS-and-XFS-drivers.patch b/SOURCES/0004-feat-drivers-add-CephFS-GlusterFS-and-XFS-drivers.patch index bfd40cd0..eeddb59a 100644 --- a/SOURCES/0004-feat-drivers-add-CephFS-GlusterFS-and-XFS-drivers.patch +++ b/SOURCES/0004-feat-drivers-add-CephFS-GlusterFS-and-XFS-drivers.patch @@ -1,7 +1,7 @@ From 13542e244eea28a4c60708de99a50fa8c3d4ec5a Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 20 Jul 2020 16:26:42 +0200 -Subject: [PATCH 04/23] feat(drivers): add CephFS, GlusterFS and XFS drivers +Subject: [PATCH 004/175] feat(drivers): add CephFS, GlusterFS and XFS drivers --- Makefile | 3 + @@ -888,5 +888,5 @@ index dce460e..aff51ae 100755 if not type in SR.TYPES: raise util.SMException("Unsupported SR type: %s" % type) -- -2.44.0 +2.45.2 diff --git a/SOURCES/0005-feat-drivers-add-ZFS-driver-to-avoid-losing-VDI-meta.patch b/SOURCES/0005-feat-drivers-add-ZFS-driver-to-avoid-losing-VDI-meta.patch index 83df38f9..c84d1d3a 100644 --- a/SOURCES/0005-feat-drivers-add-ZFS-driver-to-avoid-losing-VDI-meta.patch +++ b/SOURCES/0005-feat-drivers-add-ZFS-driver-to-avoid-losing-VDI-meta.patch @@ -1,7 +1,7 @@ From 4525a55b84eb46f4c67797da6eaf61a329dac9d7 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 12 Aug 2020 11:14:33 +0200 -Subject: [PATCH 05/23] feat(drivers): add ZFS driver to avoid losing VDI +Subject: [PATCH 005/175] feat(drivers): add ZFS driver to avoid losing VDI metadata (xcp-ng/xcp#401) --- @@ -201,5 +201,5 @@ index aff51ae..feb7c18 100755 type = SR.TYPE_FILE if not type in SR.TYPES: -- -2.44.0 +2.45.2 diff --git a/SOURCES/0006-Re-add-the-ext4-driver-for-users-who-need-to-transit.patch b/SOURCES/0006-Re-add-the-ext4-driver-for-users-who-need-to-transit.patch index 4a0e47fe..d8031c33 100644 --- a/SOURCES/0006-Re-add-the-ext4-driver-for-users-who-need-to-transit.patch +++ b/SOURCES/0006-Re-add-the-ext4-driver-for-users-who-need-to-transit.patch @@ -1,7 +1,8 @@ From 5987a43e40444a524768b1434de1a67c6e53000a Mon Sep 17 00:00:00 2001 From: Samuel Verschelde Date: Thu, 13 Aug 2020 17:10:12 +0200 -Subject: [PATCH 06/23] Re-add the ext4 driver for users who need to transition +Subject: [PATCH 006/175] 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 @@ -287,5 +288,5 @@ index feb7c18..12e4428 100755 type = SR.TYPE_FILE if not type in SR.TYPES: -- -2.44.0 +2.45.2 diff --git a/SOURCES/0007-feat-drivers-add-LinstorSR-driver.patch b/SOURCES/0007-feat-drivers-add-LinstorSR-driver.patch index 58378476..349c98dd 100644 --- a/SOURCES/0007-feat-drivers-add-LinstorSR-driver.patch +++ b/SOURCES/0007-feat-drivers-add-LinstorSR-driver.patch @@ -1,7 +1,7 @@ -From 2c71c3ce33cd02573824a57bd4b3917b45c890b0 Mon Sep 17 00:00:00 2001 +From 3b19f4d691a10f0023d936a0328e4a7684b4d3fa Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 16 Mar 2020 15:39:44 +0100 -Subject: [PATCH 07/23] feat(drivers): add LinstorSR driver +Subject: [PATCH 007/175] feat(drivers): add LinstorSR driver Some important points: @@ -64,8 +64,8 @@ module imports are protected by try.. except... blocks. drivers/util.py | 46 +- linstor/Makefile | 22 + linstor/linstor-monitord.c | 402 ++++++ + mocks/linstor/__init__.py | 0 systemd/linstor-monitor.service | 13 + - tests/mocks/linstor/__init__.py | 0 14 files changed, 5361 insertions(+), 30 deletions(-) create mode 100755 drivers/LinstorSR.py create mode 100755 drivers/linstor-manager @@ -74,8 +74,8 @@ module imports are protected by try.. except... blocks. create mode 100755 drivers/linstorvolumemanager.py create mode 100644 linstor/Makefile create mode 100644 linstor/linstor-monitord.c + create mode 100644 mocks/linstor/__init__.py create mode 100644 systemd/linstor-monitor.service - create mode 100644 tests/mocks/linstor/__init__.py diff --git a/Makefile b/Makefile index 9bc0a9d..609e182 100755 @@ -5657,6 +5657,9 @@ index 0000000..8161813 + close(inotifyFd); + return -ret; +} +diff --git a/mocks/linstor/__init__.py b/mocks/linstor/__init__.py +new file mode 100644 +index 0000000..e69de29 diff --git a/systemd/linstor-monitor.service b/systemd/linstor-monitor.service new file mode 100644 index 0000000..5f8f0a7 @@ -5676,9 +5679,6 @@ index 0000000..5f8f0a7 + +[Install] +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 -- -2.44.0 +2.45.2 diff --git a/SOURCES/0008-feat-tests-add-unit-tests-concerning-ZFS-close-xcp-n.patch b/SOURCES/0008-feat-tests-add-unit-tests-concerning-ZFS-close-xcp-n.patch index b378f707..3ad4bf63 100644 --- a/SOURCES/0008-feat-tests-add-unit-tests-concerning-ZFS-close-xcp-n.patch +++ b/SOURCES/0008-feat-tests-add-unit-tests-concerning-ZFS-close-xcp-n.patch @@ -1,7 +1,7 @@ -From 89cee57b097a681edc800be05d1dfc7d97aec995 Mon Sep 17 00:00:00 2001 +From c43a4dbdff827fe7a65f93a4fa4b817344c854aa Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 27 Oct 2020 15:04:36 +0100 -Subject: [PATCH 08/23] feat(tests): add unit tests concerning ZFS (close +Subject: [PATCH 008/175] feat(tests): add unit tests concerning ZFS (close xcp-ng/xcp#425) - Check if "create" doesn't succeed without zfs packages @@ -205,5 +205,5 @@ index 0000000..6f8040d + failed = True + self.assertTrue(failed) -- -2.44.0 +2.45.2 diff --git a/SOURCES/0009-If-no-NFS-ACLs-provided-assume-everyone.patch b/SOURCES/0009-If-no-NFS-ACLs-provided-assume-everyone.patch index e57e5eb0..04062c30 100644 --- a/SOURCES/0009-If-no-NFS-ACLs-provided-assume-everyone.patch +++ b/SOURCES/0009-If-no-NFS-ACLs-provided-assume-everyone.patch @@ -1,7 +1,7 @@ -From c338e356dcad6ad17b2f2248ff45fcf983173e0e Mon Sep 17 00:00:00 2001 +From c1f90914648fc31104ebc535f653c9b70d27fc47 Mon Sep 17 00:00:00 2001 From: BenjiReis Date: Thu, 25 Feb 2021 09:54:52 +0100 -Subject: [PATCH 09/23] If no NFS ACLs provided, assume everyone: +Subject: [PATCH 009/175] 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: "*". @@ -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.44.0 +2.45.2 diff --git a/SOURCES/0010-Added-SM-Driver-for-MooseFS.patch b/SOURCES/0010-Added-SM-Driver-for-MooseFS.patch index c13a71ce..ddc703b8 100644 --- a/SOURCES/0010-Added-SM-Driver-for-MooseFS.patch +++ b/SOURCES/0010-Added-SM-Driver-for-MooseFS.patch @@ -1,7 +1,7 @@ -From 359dd15436b153bedf32af7768973febc2b84c2f Mon Sep 17 00:00:00 2001 +From 46f4c9f02e0c0bacecf4fba09bdf94a419955d10 Mon Sep 17 00:00:00 2001 From: Aleksander Wieliczko Date: Fri, 29 Jan 2021 15:21:23 +0100 -Subject: [PATCH 10/23] Added SM Driver for MooseFS +Subject: [PATCH 010/175] Added SM Driver for MooseFS Co-authored-by: Piotr Robert Konopelko Signed-off-by: Aleksander Wieliczko @@ -386,5 +386,5 @@ index 0000000..5a61cf5 + mfssr.detach('asr_uuid') + self.assertTrue(mfssr.attached) -- -2.44.0 +2.45.2 diff --git a/SOURCES/0011-Avoid-usage-of-umount-in-ISOSR-when-legacy_mode-is-u.patch b/SOURCES/0011-Avoid-usage-of-umount-in-ISOSR-when-legacy_mode-is-u.patch index 1708f9f9..319bef15 100644 --- a/SOURCES/0011-Avoid-usage-of-umount-in-ISOSR-when-legacy_mode-is-u.patch +++ b/SOURCES/0011-Avoid-usage-of-umount-in-ISOSR-when-legacy_mode-is-u.patch @@ -1,7 +1,7 @@ -From c984a5c3510b12c44a9fd2d0297cdb21111d20f7 Mon Sep 17 00:00:00 2001 +From 78e02205515d1926448d9148e07190278f192fe1 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 2 Dec 2021 09:28:37 +0100 -Subject: [PATCH 11/23] Avoid usage of `umount` in `ISOSR` when `legacy_mode` +Subject: [PATCH 011/175] 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 @@ -103,5 +103,5 @@ index 7655f14..03c8851 100644 class TestISOSR_overNFS(unittest.TestCase): -- -2.44.0 +2.45.2 diff --git a/SOURCES/0012-MooseFS-SR-uses-now-UUID-subdirs-for-each-SR.patch b/SOURCES/0012-MooseFS-SR-uses-now-UUID-subdirs-for-each-SR.patch index a4748437..dd25b1ee 100644 --- a/SOURCES/0012-MooseFS-SR-uses-now-UUID-subdirs-for-each-SR.patch +++ b/SOURCES/0012-MooseFS-SR-uses-now-UUID-subdirs-for-each-SR.patch @@ -1,7 +1,7 @@ -From c701f410bdac559ac8384da2f8b40833e5e89866 Mon Sep 17 00:00:00 2001 +From 96777e1aebf0b4bf800d71c03a87908282669971 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 18 May 2022 17:28:09 +0200 -Subject: [PATCH 12/23] MooseFS SR uses now UUID subdirs for each SR +Subject: [PATCH 012/175] 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 @@ -126,5 +126,5 @@ index be5112c..ab72f4e 100755 self.detach(sr_uuid) if inst.code != errno.ENOENT: -- -2.44.0 +2.45.2 diff --git a/SOURCES/0013-Fix-is_open-call-for-many-drivers-25.patch b/SOURCES/0013-Fix-is_open-call-for-many-drivers-25.patch index daf7fc13..647e06af 100644 --- a/SOURCES/0013-Fix-is_open-call-for-many-drivers-25.patch +++ b/SOURCES/0013-Fix-is_open-call-for-many-drivers-25.patch @@ -1,7 +1,7 @@ -From cba6bde2b5243bac634b5e5e910db685355ba83e Mon Sep 17 00:00:00 2001 +From ebb716f123eb8b6c4e8b2ff1147926211af183db Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 23 Jun 2022 10:36:36 +0200 -Subject: [PATCH 13/23] Fix is_open call for many drivers (#25) +Subject: [PATCH 013/175] 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. @@ -104,5 +104,5 @@ index 0d60d96..534e6c9 100755 driver = SR.driver(srType) -- -2.44.0 +2.45.2 diff --git a/SOURCES/0014-Remove-SR_CACHING-capability-for-many-SR-types-24.patch b/SOURCES/0014-Remove-SR_CACHING-capability-for-many-SR-types-24.patch index db3b536a..6c163746 100644 --- a/SOURCES/0014-Remove-SR_CACHING-capability-for-many-SR-types-24.patch +++ b/SOURCES/0014-Remove-SR_CACHING-capability-for-many-SR-types-24.patch @@ -1,7 +1,7 @@ -From bf7577ff65e882686af8e7ca1748cfb0b7934a14 Mon Sep 17 00:00:00 2001 +From 658d391b17fa66a312401e43b22cefb897ea3b57 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 23 Jun 2022 10:37:07 +0200 -Subject: [PATCH 14/23] Remove SR_CACHING capability for many SR types (#24) +Subject: [PATCH 014/175] 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. @@ -56,5 +56,5 @@ index ab72f4e..212f1ad 100755 "VDI_UPDATE", "VDI_CLONE", "VDI_SNAPSHOT", "VDI_RESIZE", "VDI_MIRROR", "VDI_GENERATE_CONFIG", -- -2.44.0 +2.45.2 diff --git a/SOURCES/0015-Remove-SR_PROBE-from-ZFS-capabilities-37.patch b/SOURCES/0015-Remove-SR_PROBE-from-ZFS-capabilities-37.patch index ca7dcbde..08605897 100644 --- a/SOURCES/0015-Remove-SR_PROBE-from-ZFS-capabilities-37.patch +++ b/SOURCES/0015-Remove-SR_PROBE-from-ZFS-capabilities-37.patch @@ -1,7 +1,7 @@ -From 1a7496b75ae96edf79f2da481b54b80e8d2925f8 Mon Sep 17 00:00:00 2001 +From 7263d70aa77dbc18b40b000811be3cf01ab8f4ad Mon Sep 17 00:00:00 2001 From: BenjiReis Date: Fri, 4 Aug 2023 12:10:08 +0200 -Subject: [PATCH 15/23] Remove `SR_PROBE` from ZFS capabilities (#37) +Subject: [PATCH 015/175] Remove `SR_PROBE` from ZFS capabilities (#37) The probe method is not implemented so we shouldn't advertise it. @@ -24,5 +24,5 @@ index d375210..b803211 100644 'VDI_CREATE', 'VDI_DELETE', -- -2.44.0 +2.45.2 diff --git a/SOURCES/0016-Fix-vdi-ref-when-static-vdis-are-used.patch b/SOURCES/0016-Fix-vdi-ref-when-static-vdis-are-used.patch index 57e0a290..6c46aa1c 100644 --- a/SOURCES/0016-Fix-vdi-ref-when-static-vdis-are-used.patch +++ b/SOURCES/0016-Fix-vdi-ref-when-static-vdis-are-used.patch @@ -1,7 +1,7 @@ -From 37c79431e2c6654c5afdb6cde6e23c4c321c4cda Mon Sep 17 00:00:00 2001 +From 85c1fa8737facb51f419b0539661f8fffcc36d8d Mon Sep 17 00:00:00 2001 From: Guillaume Date: Wed, 16 Aug 2023 13:42:21 +0200 -Subject: [PATCH 16/23] Fix vdi-ref when static vdis are used +Subject: [PATCH 016/175] 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. @@ -32,5 +32,5 @@ index dd8e20b..6ac3f80 100755 if needDeflate: try: -- -2.44.0 +2.45.2 diff --git a/SOURCES/0017-Tell-users-not-to-edit-multipath.conf-directly.patch b/SOURCES/0017-Tell-users-not-to-edit-multipath.conf-directly.patch index ebfed0a7..6f18c4db 100644 --- a/SOURCES/0017-Tell-users-not-to-edit-multipath.conf-directly.patch +++ b/SOURCES/0017-Tell-users-not-to-edit-multipath.conf-directly.patch @@ -1,7 +1,7 @@ -From 9bfcb0be3ff34354c9299bf6e0a90e691f14e813 Mon Sep 17 00:00:00 2001 +From 0d635eac00e89fcfa16856f53947511f0911e2bc Mon Sep 17 00:00:00 2001 From: Samuel Verschelde Date: Fri, 27 Jan 2023 12:03:15 +0100 -Subject: [PATCH 17/23] Tell users not to edit multipath.conf directly +Subject: [PATCH 017/175] 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 @@ -30,5 +30,5 @@ index f63506d..c854b57 100644 # multipathd. # For information on the syntax refer to `man multipath.conf` and the examples -- -2.44.0 +2.45.2 diff --git a/SOURCES/0018-Add-custom.conf-multipath-configuration-file.patch b/SOURCES/0018-Add-custom.conf-multipath-configuration-file.patch index 355cc034..8357419f 100644 --- a/SOURCES/0018-Add-custom.conf-multipath-configuration-file.patch +++ b/SOURCES/0018-Add-custom.conf-multipath-configuration-file.patch @@ -1,7 +1,7 @@ -From 383f9128fb1a788074a5a6aca09a249bfeaa44f5 Mon Sep 17 00:00:00 2001 +From 6fc44ae6ca8bf73c576ec9f74b53de0ed51cd5de Mon Sep 17 00:00:00 2001 From: Samuel Verschelde Date: Fri, 27 Jan 2023 12:23:13 +0100 -Subject: [PATCH 18/23] Add custom.conf multipath configuration file +Subject: [PATCH 018/175] 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 @@ -27,5 +27,5 @@ index 0000000..3c8583f + +# Refer to "man multipath.conf" -- -2.44.0 +2.45.2 diff --git a/SOURCES/0019-Install-etc-multipath-conf.d-custom.conf.patch b/SOURCES/0019-Install-etc-multipath-conf.d-custom.conf.patch index 1b098535..42d61ea5 100644 --- a/SOURCES/0019-Install-etc-multipath-conf.d-custom.conf.patch +++ b/SOURCES/0019-Install-etc-multipath-conf.d-custom.conf.patch @@ -1,7 +1,7 @@ -From 507c2f067878ee88765c5750d3e618c8c63208c7 Mon Sep 17 00:00:00 2001 +From 17129f5341223dae7a0b38516e8b01990b61df1d Mon Sep 17 00:00:00 2001 From: Samuel Verschelde Date: Fri, 25 Aug 2023 17:47:34 +0200 -Subject: [PATCH 19/23] Install /etc/multipath/conf.d/custom.conf +Subject: [PATCH 019/175] Install /etc/multipath/conf.d/custom.conf Update Makefile so that the file is installed along with sm. @@ -48,5 +48,5 @@ index b0ae353..3357cbf 100755 $(SM_STAGING)/$(INIT_DIR) install -m 755 multipath/multipath-root-setup \ -- -2.44.0 +2.45.2 diff --git a/SOURCES/0020-Backport-NFS4-only-support.patch b/SOURCES/0020-Backport-NFS4-only-support.patch index 7691d728..a6f6f278 100644 --- a/SOURCES/0020-Backport-NFS4-only-support.patch +++ b/SOURCES/0020-Backport-NFS4-only-support.patch @@ -1,7 +1,7 @@ -From 2d197ca1c046dce44579f77f4e2ac23397edb9c1 Mon Sep 17 00:00:00 2001 +From 8f5cd11745a54fcfb127a23494a1fc2af5ed723b Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Mon, 18 Dec 2023 10:22:26 +0100 -Subject: [PATCH 20/23] Backport NFS4 only support +Subject: [PATCH 020/175] Backport NFS4 only support See: https://github.com/xapi-project/sm/pull/617 @@ -426,5 +426,5 @@ index cef414f..9ea807f 100644 expected = """ -- -2.44.0 +2.45.2 diff --git a/SOURCES/0021-Backport-probe-for-NFS4-when-rpcinfo-does-not-includ.patch b/SOURCES/0021-Backport-probe-for-NFS4-when-rpcinfo-does-not-includ.patch index 884df915..fa43b4c2 100644 --- a/SOURCES/0021-Backport-probe-for-NFS4-when-rpcinfo-does-not-includ.patch +++ b/SOURCES/0021-Backport-probe-for-NFS4-when-rpcinfo-does-not-includ.patch @@ -1,7 +1,7 @@ -From bcebd6854894ddd9cc6af7d41a54daab7a45f7be Mon Sep 17 00:00:00 2001 +From ee88d74e603d364e0fb958ce867dc38ea61281db Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Mon, 18 Dec 2023 10:35:46 +0100 -Subject: [PATCH 21/23] Backport probe for NFS4 when rpcinfo does not include +Subject: [PATCH 021/175] Backport probe for NFS4 when rpcinfo does not include it See: https://github.com/xapi-project/sm/pull/655 @@ -164,5 +164,5 @@ index 9ea807f..3874d8e 100644 return ([binary, 'remoteserver:remotepath', 'mountpoint', '-o', 'soft,proto=transport,vers=%s,acdirmin=0,acdirmax=0' % vers]) -- -2.44.0 +2.45.2 diff --git a/SOURCES/0022-feat-LargeBlock-backport-of-largeblocksr-51-55.patch b/SOURCES/0022-feat-LargeBlock-backport-of-largeblocksr-51-55.patch index fb540598..09d8feb1 100644 --- a/SOURCES/0022-feat-LargeBlock-backport-of-largeblocksr-51-55.patch +++ b/SOURCES/0022-feat-LargeBlock-backport-of-largeblocksr-51-55.patch @@ -1,7 +1,8 @@ -From 52d495879ebf8c1caee78f3e10f7febd65d8ccd3 Mon Sep 17 00:00:00 2001 +From 86d936b5359bfaee5a3d392daed5c9199839901f Mon Sep 17 00:00:00 2001 From: Damien Thenot Date: Tue, 7 May 2024 15:20:22 +0200 -Subject: [PATCH 22/23] feat(LargeBlock): backport of largeblocksr (#51) (#55) +Subject: [PATCH 022/175] feat(LargeBlock): backport of largeblocksr (#51) + (#55) A SR inheriting from a EXTSR allowing to use a 4KiB blocksize device as SR. @@ -395,5 +396,5 @@ index 534e6c9..3c7bd34 100755 import LVHDSR import MooseFSSR -- -2.44.0 +2.45.2 diff --git a/SOURCES/0023-feat-LVHDSR-add-a-way-to-modify-config-of-LVMs-56.patch b/SOURCES/0023-feat-LVHDSR-add-a-way-to-modify-config-of-LVMs-56.patch index 973c0467..2854833e 100644 --- a/SOURCES/0023-feat-LVHDSR-add-a-way-to-modify-config-of-LVMs-56.patch +++ b/SOURCES/0023-feat-LVHDSR-add-a-way-to-modify-config-of-LVMs-56.patch @@ -1,7 +1,8 @@ -From ec5c7c6cd4732e7f70122ccdb8ccdaf6711e5f31 Mon Sep 17 00:00:00 2001 +From 906aede91ac5b450e6e11332ab070d0ec7b71dbb Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 28 May 2024 15:17:21 +0200 -Subject: [PATCH 23/23] feat(LVHDSR): add a way to modify config of LVMs (#56) +Subject: [PATCH 023/175] feat(LVHDSR): add a way to modify config of LVMs + (#56) With this change the driver supports a "lvm-conf" param on "other-config". For now The configuration is only used by "remove" calls from LVMCache. @@ -105,5 +106,5 @@ index ea0bc17..54930b4 100644 self._removeTag(lvName, tag) del self.lvs[lvName] -- -2.44.0 +2.45.2 diff --git a/SOURCES/0024-Fix-timeout_call-alarm-must-be-reset-in-case-of-succ.patch b/SOURCES/0024-Fix-timeout_call-alarm-must-be-reset-in-case-of-succ.patch new file mode 100644 index 00000000..ce87b8e3 --- /dev/null +++ b/SOURCES/0024-Fix-timeout_call-alarm-must-be-reset-in-case-of-succ.patch @@ -0,0 +1,32 @@ +From b1bffda87658150032f68a59d90117eb8260ae14 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Wed, 16 Feb 2022 18:24:56 +0100 +Subject: [PATCH 024/175] Fix timeout_call: alarm must be reset in case of + success + +Otherwise the SIGALRM signal can be emitted after the execution +of the given user function. + +Signed-off-by: Ronan Abhamon +--- + drivers/util.py | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/drivers/util.py b/drivers/util.py +index 8bd3635..77f3f19 100755 +--- a/drivers/util.py ++++ b/drivers/util.py +@@ -852,9 +852,8 @@ def timeout_call(timeoutseconds, function, *arguments): + signal.alarm(timeoutseconds) + try: + function(*arguments) +- except: ++ finally: + signal.alarm(0) +- raise + + + def _incr_iscsiSR_refcount(targetIQN, uuid): +-- +2.45.2 + diff --git a/SOURCES/0025-timeout_call-returns-the-result-of-user-function-now.patch b/SOURCES/0025-timeout_call-returns-the-result-of-user-function-now.patch new file mode 100644 index 00000000..70edef7f --- /dev/null +++ b/SOURCES/0025-timeout_call-returns-the-result-of-user-function-now.patch @@ -0,0 +1,26 @@ +From e4fa58e917a6d5e090778cfd654383e966abfe9e Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Wed, 16 Feb 2022 18:28:06 +0100 +Subject: [PATCH 025/175] timeout_call returns the result of user function now + +Signed-off-by: Ronan Abhamon +--- + drivers/util.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/util.py b/drivers/util.py +index 77f3f19..54fda46 100755 +--- a/drivers/util.py ++++ b/drivers/util.py +@@ -851,7 +851,7 @@ def timeout_call(timeoutseconds, function, *arguments): + signal.signal(signal.SIGALRM, handler) + signal.alarm(timeoutseconds) + try: +- function(*arguments) ++ return function(*arguments) + finally: + signal.alarm(0) + +-- +2.45.2 + diff --git a/SOURCES/0026-Always-remove-the-pause-tag-from-VDIs-in-case-of-fai.patch b/SOURCES/0026-Always-remove-the-pause-tag-from-VDIs-in-case-of-fai.patch new file mode 100644 index 00000000..4cfaa461 --- /dev/null +++ b/SOURCES/0026-Always-remove-the-pause-tag-from-VDIs-in-case-of-fai.patch @@ -0,0 +1,58 @@ +From b32670416ce70d546b3569a6f4cb507c0d3507bf Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Mon, 5 Feb 2024 23:16:16 +0100 +Subject: [PATCH 026/175] Always remove the pause tag from VDIs in case of + failure + +During VDI activation in the blktap module and in case of failure +in "sm.VDI.from_uuid" call, the pause tag is never removed. +As a result a VDI can no longer be used correctly: an assert is +triggered each time we try to re-activate this volume because +the tag is still present. + +Signed-off-by: Ronan Abhamon +--- + drivers/blktap2.py | 22 +++++++++++++--------- + 1 file changed, 13 insertions(+), 9 deletions(-) + +diff --git a/drivers/blktap2.py b/drivers/blktap2.py +index e1f75e9..e9305ce 100755 +--- a/drivers/blktap2.py ++++ b/drivers/blktap2.py +@@ -1599,20 +1599,24 @@ class VDI(object): + import VDI as sm + + #util.SMlog("VDI.activate %s" % vdi_uuid) ++ refresh = False + if self.tap_wanted(): + if not self._add_tag(vdi_uuid, not options["rdonly"]): + return False +- # it is possible that while the VDI was paused some of its +- # attributes have changed (e.g. its size if it was inflated; or its +- # path if it was leaf-coalesced onto a raw LV), so refresh the +- # object completely +- params = self.target.vdi.sr.srcmd.params +- target = sm.VDI.from_uuid(self.target.vdi.session, vdi_uuid) +- target.sr.srcmd.params = params +- driver_info = target.sr.srcmd.driver_info +- self.target = self.TargetDriver(target, driver_info) ++ refresh = True + + try: ++ if refresh: ++ # it is possible that while the VDI was paused some of its ++ # attributes have changed (e.g. its size if it was inflated; or its ++ # path if it was leaf-coalesced onto a raw LV), so refresh the ++ # object completely ++ params = self.target.vdi.sr.srcmd.params ++ target = sm.VDI.from_uuid(self.target.vdi.session, vdi_uuid) ++ target.sr.srcmd.params = params ++ driver_info = target.sr.srcmd.driver_info ++ self.target = self.TargetDriver(target, driver_info) ++ + util.fistpoint.activate_custom_fn( + "blktap_activate_inject_failure", + lambda: util.inject_failure()) +-- +2.45.2 + diff --git a/SOURCES/0027-fix-LinstorSR-repair-volumes-only-if-an-exclusive-co.patch b/SOURCES/0027-fix-LinstorSR-repair-volumes-only-if-an-exclusive-co.patch new file mode 100644 index 00000000..28454331 --- /dev/null +++ b/SOURCES/0027-fix-LinstorSR-repair-volumes-only-if-an-exclusive-co.patch @@ -0,0 +1,36 @@ +From 56bdcd5312a20c92f5a1683b506ce447fa1914fa Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Fri, 20 Nov 2020 16:42:52 +0100 +Subject: [PATCH 027/175] fix(LinstorSR): repair volumes only if an exclusive + command is executed + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 8be1836..a5bf5ab 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -388,10 +388,16 @@ class LinstorSR(SR.SR): + + try: + # Try to open SR if exists. ++ # We can repair only if we are on the master AND if ++ # we are trying to execute an exclusive operation. ++ # Otherwise we could try to delete a VDI being created or ++ # during a snapshot. An exclusive op is the guarantee that the ++ # SR is locked. + self._linstor = LinstorVolumeManager( + self._master_uri, + self._group_name, +- repair=self._is_master, ++ repair=self._is_master and ++ self.srcmd.cmd in self.ops_exclusive, + logger=util.SMlog + ) + self._vhdutil = LinstorVhdUtil(self.session, self._linstor) +-- +2.45.2 + diff --git a/SOURCES/0028-feat-LinstorSR-Improve-LINSTOR-performance.patch b/SOURCES/0028-feat-LinstorSR-Improve-LINSTOR-performance.patch new file mode 100644 index 00000000..0a9b199b --- /dev/null +++ b/SOURCES/0028-feat-LinstorSR-Improve-LINSTOR-performance.patch @@ -0,0 +1,1421 @@ +From 7e1008189ee1d49545d65f14bf6bee65cec21d5c Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Thu, 10 Dec 2020 17:56:15 +0100 +Subject: [PATCH 028/175] feat(LinstorSR): Improve LINSTOR performance + +Details: +- vdi_attach and vdi_detach are now exclusive +- lock volumes on slaves (when vdi_xxx command is used) and avoid release if a timeout is reached +- load all VDIs only when necessary, so only if it exists at least a journal entry or if sr_scan/sr_attach is executed +- use a __slots__ attr in LinstorVolumeManager to increase performance +- use a cache directly in LinstorVolumeManager to reduce network request count with LINSTOR +- try to always use the same LINSTOR KV object to limit netwok usage +- use a cache to avoid a new JSON parsing when all VDIs are loaded in LinstorSR +- limit request count when LINSTOR storage pool info is fetched using a fetch interval +- avoid race condition in cleanup: check if a volume is locked in a slave or not before modify it +- ... + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 150 ++++++++--- + drivers/cleanup.py | 52 ++-- + drivers/linstor-manager | 9 +- + drivers/linstorvhdutil.py | 58 ++++- + drivers/linstorvolumemanager.py | 432 +++++++++++++++++++------------- + 5 files changed, 463 insertions(+), 238 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index a5bf5ab..548f4b1 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -92,7 +92,8 @@ DRIVER_CONFIG = {'ATTACH_FROM_CONFIG_WITH_TAPDISK': False} + + OPS_EXCLUSIVE = [ + 'sr_create', 'sr_delete', 'sr_attach', 'sr_detach', 'sr_scan', +- 'sr_update', 'vdi_create', 'vdi_delete', 'vdi_clone', 'vdi_snapshot' ++ 'sr_update', 'sr_probe', 'vdi_init', 'vdi_create', 'vdi_delete', ++ 'vdi_attach', 'vdi_detach', 'vdi_clone', 'vdi_snapshot', + ] + + # ============================================================================== +@@ -185,7 +186,9 @@ def detach_thin(session, linstor, sr_uuid, vdi_uuid): + + volume_info = linstor.get_volume_info(vdi_uuid) + old_volume_size = volume_info.virtual_size +- deflate(vdi_uuid, device_path, new_volume_size, old_volume_size) ++ deflate( ++ linstor, vdi_uuid, device_path, new_volume_size, old_volume_size ++ ) + finally: + lock.release() + +@@ -215,11 +218,11 @@ def inflate(journaler, linstor, vdi_uuid, vdi_path, new_size, old_size): + opterr='Failed to zero out VHD footer {}'.format(vdi_path) + ) + +- vhdutil.setSizePhys(vdi_path, new_size, False) ++ LinstorVhdUtil(None, linstor).set_size_phys(vdi_path, new_size, False) + journaler.remove(LinstorJournaler.INFLATE, vdi_uuid) + + +-def deflate(vdi_uuid, vdi_path, new_size, old_size): ++def deflate(linstor, vdi_uuid, vdi_path, new_size, old_size): + new_size = LinstorVolumeManager.round_up_volume_size(new_size) + if new_size >= old_size: + return +@@ -229,7 +232,7 @@ def deflate(vdi_uuid, vdi_path, new_size, old_size): + .format(vdi_uuid, new_size, old_size) + ) + +- vhdutil.setSizePhys(vdi_path, new_size) ++ LinstorVhdUtil(None, linstor).set_size_phys(vdi_path, new_size) + # TODO: Change the LINSTOR volume size using linstor.resize_volume. + + +@@ -318,10 +321,13 @@ class LinstorSR(SR.SR): + self._group_name = self.dconf['group-name'] + + self._master_uri = None +- self._vdi_shared_locked = False ++ self._vdi_shared_time = 0 + + self._initialized = False + ++ self._all_volume_info_cache = None ++ self._all_volume_metadata_cache = None ++ + def _locked_load(method): + @functools.wraps(method) + def wrap(self, *args, **kwargs): +@@ -374,7 +380,7 @@ class LinstorSR(SR.SR): + # behaviors if the GC is executed during an action on a slave. + if self.cmd.startswith('vdi_'): + self._shared_lock_vdi(self.srcmd.params['vdi_uuid']) +- self._vdi_shared_locked = True ++ self._vdi_shared_time = time.time() + + self._journaler = LinstorJournaler( + self._master_uri, self._group_name, logger=util.SMlog +@@ -396,8 +402,10 @@ class LinstorSR(SR.SR): + self._linstor = LinstorVolumeManager( + self._master_uri, + self._group_name, +- repair=self._is_master and +- self.srcmd.cmd in self.ops_exclusive, ++ repair=( ++ self._is_master and ++ self.srcmd.cmd in self.ops_exclusive ++ ), + logger=util.SMlog + ) + self._vhdutil = LinstorVhdUtil(self.session, self._linstor) +@@ -422,22 +430,55 @@ class LinstorSR(SR.SR): + if hosts: + util.SMlog('Failed to join node(s): {}'.format(hosts)) + ++ # Ensure we use a non-locked volume when vhdutil is called. ++ if ( ++ self._is_master and self.cmd.startswith('vdi_') and ++ self.cmd != 'vdi_create' ++ ): ++ self._linstor.ensure_volume_is_not_locked( ++ self.srcmd.params['vdi_uuid'] ++ ) ++ + try: +- # If the command is a SR command on the master, we must +- # load all VDIs and clean journal transactions. +- # We must load the VDIs in the snapshot case too. ++ # If the command is a SR scan command on the master, ++ # we must load all VDIs and clean journal transactions. ++ # We must load the VDIs in the snapshot case too only if ++ # there is at least one entry in the journal. ++ # ++ # If the command is a SR command we want at least to remove ++ # resourceless volumes. + if self._is_master and self.cmd not in [ + 'vdi_attach', 'vdi_detach', + 'vdi_activate', 'vdi_deactivate', + 'vdi_epoch_begin', 'vdi_epoch_end', + 'vdi_update', 'vdi_destroy' + ]: +- self._load_vdis() +- self._undo_all_journal_transactions() ++ load_vdis = ( ++ self.cmd == 'sr_scan' or ++ self.cmd == 'sr_attach' ++ ) or len( ++ self._journaler.get_all(LinstorJournaler.INFLATE) ++ ) or len( ++ self._journaler.get_all(LinstorJournaler.CLONE) ++ ) ++ ++ if load_vdis: ++ # We use a cache to avoid repeated JSON parsing. ++ # The performance gain is not big but we can still ++ # enjoy it with a few lines. ++ self._create_linstor_cache() ++ self._load_vdis() ++ self._destroy_linstor_cache() ++ ++ self._undo_all_journal_transactions() + self._linstor.remove_resourceless_volumes() + + self._synchronize_metadata() + except Exception as e: ++ if self.cmd == 'sr_scan': ++ # Always raise, we don't want to remove VDIs ++ # from the XAPI database otherwise. ++ raise e + util.SMlog( + 'Ignoring exception in LinstorSR.load: {}'.format(e) + ) +@@ -449,7 +490,7 @@ class LinstorSR(SR.SR): + + @_locked_load + def cleanup(self): +- if self._vdi_shared_locked: ++ if self._vdi_shared_time: + self._shared_lock_vdi(self.srcmd.params['vdi_uuid'], locked=False) + + @_locked_load +@@ -605,6 +646,23 @@ class LinstorSR(SR.SR): + 'locked': str(locked) + } + ++ # Note: We must avoid to unlock the volume if the timeout is reached ++ # because during volume unlock, the SR lock is not used. Otherwise ++ # we could destroy a valid lock acquired from another host... ++ # ++ # This code is not very clean, the ideal solution would be to acquire ++ # the SR lock during volume unlock (like lock) but it's not easy ++ # to implement without impacting performance. ++ if not locked: ++ elapsed_time = time.time() - self._vdi_shared_time ++ timeout = LinstorVolumeManager.LOCKED_EXPIRATION_DELAY * 0.7 ++ if elapsed_time >= timeout: ++ util.SMlog( ++ 'Avoid unlock call of {} because timeout has been reached' ++ .format(vdi_uuid) ++ ) ++ return ++ + ret = self.session.xenapi.host.call_plugin( + master, self.MANAGER_PLUGIN, method, args + ) +@@ -659,7 +717,7 @@ class LinstorSR(SR.SR): + + # Now update the VDI information in the metadata if required. + xenapi = self.session.xenapi +- volumes_metadata = self._linstor.volumes_with_metadata ++ volumes_metadata = self._linstor.get_volumes_with_metadata() + for vdi_uuid, volume_metadata in volumes_metadata.items(): + try: + vdi_ref = xenapi.VDI.get_by_uuid(vdi_uuid) +@@ -751,8 +809,8 @@ class LinstorSR(SR.SR): + xapi_vdi_uuids.add(xenapi.VDI.get_uuid(vdi)) + + # 2. Get volumes info. +- all_volume_info = self._linstor.volumes_with_info +- volumes_metadata = self._linstor.volumes_with_metadata ++ all_volume_info = self._all_volume_info_cache ++ volumes_metadata = self._all_volume_metadata_cache + + # 3. Get CBT vdis. + # See: https://support.citrix.com/article/CTX230619 +@@ -1020,13 +1078,13 @@ class LinstorSR(SR.SR): + util.SMlog('Cannot deflate missing VDI {}'.format(vdi_uuid)) + return + +- current_size = self._linstor.get_volume_info(self.uuid).virtual_size ++ current_size = self._all_volume_info_cache.get(self.uuid).virtual_size + util.zeroOut( + vdi.path, + current_size - vhdutil.VHD_FOOTER_SIZE, + vhdutil.VHD_FOOTER_SIZE + ) +- deflate(vdi_uuid, vdi.path, old_size, current_size) ++ deflate(self._linstor, vdi_uuid, vdi.path, old_size, current_size) + + def _handle_interrupted_clone( + self, vdi_uuid, clone_info, force_undo=False +@@ -1039,7 +1097,7 @@ class LinstorSR(SR.SR): + base_uuid, snap_uuid = clone_info.split('_') + + # Use LINSTOR data because new VDIs may not be in the XAPI. +- volume_names = self._linstor.volumes_with_name ++ volume_names = self._linstor.get_volumes_with_name() + + # Check if we don't have a base VDI. (If clone failed at startup.) + if base_uuid not in volume_names: +@@ -1095,7 +1153,7 @@ class LinstorSR(SR.SR): + if base_type == vhdutil.VDI_TYPE_VHD: + vhd_info = self._vhdutil.get_vhd_info(base_uuid, False) + if vhd_info.hidden: +- vhdutil.setHidden(base_path, False) ++ self._vhdutil.set_hidden(base_path, False) + elif base_type == vhdutil.VDI_TYPE_RAW and \ + base_metadata.get(HIDDEN_TAG): + self._linstor.update_volume_metadata( +@@ -1156,6 +1214,19 @@ class LinstorSR(SR.SR): + + util.SMlog('*** INTERRUPTED CLONE OP: rollback success') + ++ # -------------------------------------------------------------------------- ++ # Cache. ++ # -------------------------------------------------------------------------- ++ ++ def _create_linstor_cache(self): ++ self._all_volume_metadata_cache = \ ++ self._linstor.get_volumes_with_metadata() ++ self._all_volume_info_cache = self._linstor.get_volumes_with_info() ++ ++ def _destroy_linstor_cache(self): ++ self._all_volume_info_cache = None ++ self._all_volume_metadata_cache = None ++ + # -------------------------------------------------------------------------- + # Misc. + # -------------------------------------------------------------------------- +@@ -1326,16 +1397,16 @@ class LinstorVDI(VDI.VDI): + if self.vdi_type == vhdutil.VDI_TYPE_RAW: + self.size = volume_info.virtual_size + else: +- vhdutil.create( ++ self.sr._vhdutil.create( + self.path, size, False, self.MAX_METADATA_VIRT_SIZE + ) + self.size = self.sr._vhdutil.get_size_virt(self.uuid) + + if self._key_hash: +- vhdutil.setKey(self.path, self._key_hash) ++ self.sr._vhdutil.set_key(self.path, self._key_hash) + + # Because vhdutil commands modify the volume data, +- # we must retrieve a new time the utilisation size. ++ # we must retrieve a new time the utilization size. + volume_info = self._linstor.get_volume_info(self.uuid) + + volume_metadata = { +@@ -1548,7 +1619,7 @@ class LinstorVDI(VDI.VDI): + self.sr._journaler, self._linstor, self.uuid, self.path, + new_volume_size, old_volume_size + ) +- vhdutil.setSizeVirtFast(self.path, size) ++ self.sr._vhdutil.set_size_virt_fast(self.path, size) + + # Reload size attributes. + self._load_this() +@@ -1580,8 +1651,8 @@ class LinstorVDI(VDI.VDI): + if not blktap2.VDI.tap_pause(self.session, self.sr.uuid, self.uuid): + raise util.SMException('Failed to pause VDI {}'.format(self.uuid)) + try: +- vhdutil.setParent(self.path, parent_path, False) +- vhdutil.setHidden(parent_path) ++ self.sr._vhdutil.set_parent(self.path, parent_path, False) ++ self.sr._vhdutil.set_hidden(parent_path) + self.sr.session.xenapi.VDI.set_managed( + self.sr.srcmd.params['args'][0], False + ) +@@ -1658,11 +1729,20 @@ class LinstorVDI(VDI.VDI): + .format(self.uuid) + ) + +- vhdutil.killData(self.path) ++ self.sr._vhdutil.kill_data(self.path) + + def _load_this(self): +- volume_metadata = self._linstor.get_volume_metadata(self.uuid) +- volume_info = self._linstor.get_volume_info(self.uuid) ++ volume_metadata = None ++ if self.sr._all_volume_metadata_cache: ++ volume_metadata = self.sr._all_volume_metadata_cache.get(self.uuid) ++ if volume_metadata is None: ++ volume_metadata = self._linstor.get_volume_metadata(self.uuid) ++ ++ volume_info = None ++ if self.sr._all_volume_info_cache: ++ volume_info = self.sr._all_volume_info_cache.get(self.uuid) ++ if volume_info is None: ++ volume_info = self._linstor.get_volume_info(self.uuid) + + # Contains the physical size used on all disks. + # When LINSTOR LVM driver is used, the size should be similar to +@@ -1697,7 +1777,7 @@ class LinstorVDI(VDI.VDI): + return + + if self.vdi_type == vhdutil.VDI_TYPE_VHD: +- vhdutil.setHidden(self.path, hidden) ++ self.sr._vhdutil.set_hidden(self.path, hidden) + else: + self._linstor.update_volume_metadata(self.uuid, { + HIDDEN_TAG: hidden +@@ -1813,9 +1893,7 @@ class LinstorVDI(VDI.VDI): + 'VDIUnavailable', + opterr='failed to get vdi_type in metadata' + ) +- self._update_device_name( +- self._linstor.get_volume_name(self.uuid) +- ) ++ self._update_device_name(self._linstor.get_volume_name(self.uuid)) + + def _update_device_name(self, device_name): + self._device_name = device_name +@@ -1838,7 +1916,7 @@ class LinstorVDI(VDI.VDI): + + # 2. Write the snapshot content. + is_raw = (self.vdi_type == vhdutil.VDI_TYPE_RAW) +- vhdutil.snapshot( ++ self.sr._vhdutil.snapshot( + snap_path, self.path, is_raw, self.MAX_METADATA_VIRT_SIZE + ) + +diff --git a/drivers/cleanup.py b/drivers/cleanup.py +index 926525f..895f36e 100755 +--- a/drivers/cleanup.py ++++ b/drivers/cleanup.py +@@ -449,7 +449,7 @@ class XAPI: + # + # VDI + # +-class VDI: ++class VDI(object): + """Object representing a VDI of a VHD-based SR""" + + POLL_INTERVAL = 1 +@@ -1425,17 +1425,15 @@ class LinstorVDI(VDI): + self.sr.unlock() + VDI.delete(self) + +- def pauseVDIs(self, vdiList): +- self.sr._linstor.ensure_volume_list_is_not_locked( +- vdiList, timeout=self.VOLUME_LOCK_TIMEOUT +- ) +- return super(VDI).pauseVDIs(vdiList) ++ def validate(self, fast=False): ++ if not self.sr._vhdutil.check(self.uuid, fast=fast): ++ raise util.SMException('VHD {} corrupted'.format(self)) + +- def _liveLeafCoalesce(self, vdi): ++ def pause(self, failfast=False): + self.sr._linstor.ensure_volume_is_not_locked( +- vdi.uuid, timeout=self.VOLUME_LOCK_TIMEOUT ++ self.uuid, timeout=self.VOLUME_LOCK_TIMEOUT + ) +- return super(VDI)._liveLeafCoalesce(vdi) ++ return super(LinstorVDI, self).pause(failfast) + + def _relinkSkip(self): + abortFlag = IPCFlag(self.sr.uuid) +@@ -1479,7 +1477,7 @@ class LinstorVDI(VDI): + # + # SR + # +-class SR: ++class SR(object): + class LogFilter: + def __init__(self, sr): + self.sr = sr +@@ -2902,6 +2900,12 @@ class LinstorSR(SR): + self.logFilter.logState() + self._handleInterruptedCoalesceLeaf() + ++ def pauseVDIs(self, vdiList): ++ self._linstor.ensure_volume_list_is_not_locked( ++ vdiList, timeout=LinstorVDI.VOLUME_LOCK_TIMEOUT ++ ) ++ return super(LinstorSR, self).pauseVDIs(vdiList) ++ + def _reloadLinstor(self): + session = self.xapi.session + host_ref = util.get_this_host_ref(session) +@@ -2952,8 +2956,8 @@ class LinstorSR(SR): + + # TODO: Ensure metadata contains the right info. + +- all_volume_info = self._linstor.volumes_with_info +- volumes_metadata = self._linstor.volumes_with_metadata ++ all_volume_info = self._linstor.get_volumes_with_info() ++ volumes_metadata = self._linstor.get_volumes_with_metadata() + for vdi_uuid, volume_info in all_volume_info.items(): + try: + if not volume_info.name and \ +@@ -2984,8 +2988,10 @@ class LinstorSR(SR): + virtual_size = LinstorVolumeManager.round_up_volume_size( + parent.sizeVirt + meta_overhead + bitmap_overhead + ) +- # TODO: Check result. +- return virtual_size - self._linstor.get_volume_size(parent.uuid) ++ volume_size = self._linstor.get_volume_size(parent.uuid) ++ ++ assert virtual_size >= volume_size ++ return virtual_size - volume_size + + def _hasValidDevicePath(self, uuid): + try: +@@ -2995,6 +3001,16 @@ class LinstorSR(SR): + return False + return True + ++ def _liveLeafCoalesce(self, vdi): ++ self.lock() ++ try: ++ self._linstor.ensure_volume_is_not_locked( ++ vdi.uuid, timeout=LinstorVDI.VOLUME_LOCK_TIMEOUT ++ ) ++ return super(LinstorSR, self)._liveLeafCoalesce(vdi) ++ finally: ++ self.unlock() ++ + def _handleInterruptedCoalesceLeaf(self): + entries = self.journaler.get_all(VDI.JRN_LEAF) + for uuid, parentUuid in entries.iteritems(): +@@ -3021,7 +3037,6 @@ class LinstorSR(SR): + 'Renaming parent back: {} -> {}'.format(childUuid, parentUuid) + ) + parent.rename(parentUuid) +- util.fistpoint.activate('LVHDRT_coaleaf_undo_after_rename', self.uuid) + + child = self.getVDI(childUuid) + if not child: +@@ -3037,9 +3052,6 @@ class LinstorSR(SR): + Util.log('Updating the VDI record') + child.setConfig(VDI.DB_VHD_PARENT, parentUuid) + child.setConfig(VDI.DB_VDI_TYPE, vhdutil.VDI_TYPE_VHD) +- util.fistpoint.activate( +- 'LVHDRT_coaleaf_undo_after_rename2', self.uuid +- ) + + # TODO: Maybe deflate here. + +@@ -3048,10 +3060,7 @@ class LinstorSR(SR): + if not parent.hidden: + parent._setHidden(True) + self._updateSlavesOnUndoLeafCoalesce(parent, child) +- util.fistpoint.activate('LVHDRT_coaleaf_undo_end', self.uuid) + Util.log('*** leaf-coalesce undo successful') +- if util.fistpoint.is_active('LVHDRT_coaleaf_stop_after_recovery'): +- child.setConfig(VDI.DB_LEAFCLSC, VDI.LEAFCLSC_DISABLED) + + def _finishInterruptedCoalesceLeaf(self, childUuid, parentUuid): + Util.log('*** FINISH LEAF-COALESCE') +@@ -3064,7 +3073,6 @@ class LinstorSR(SR): + except XenAPI.Failure: + pass + self._updateSlavesOnResize(vdi) +- util.fistpoint.activate('LVHDRT_coaleaf_finish_end', self.uuid) + Util.log('*** finished leaf-coalesce successfully') + + def _checkSlaves(self, vdi): +diff --git a/drivers/linstor-manager b/drivers/linstor-manager +index f7ce180..e7e58fd 100755 +--- a/drivers/linstor-manager ++++ b/drivers/linstor-manager +@@ -118,7 +118,9 @@ def detach(session, args): + def check(session, args): + try: + device_path = args['devicePath'] +- return str(vhdutil.check(device_path)) ++ ignore_missing_footer = args['ignoreMissingFooter'] ++ fast = args['fast'] ++ return str(vhdutil.check(device_path, ignore_missing_footer, fast)) + except Exception as e: + util.SMlog('linstor-manager:check error: {}'.format(e)) + raise +@@ -236,7 +238,10 @@ def lock_vdi(session, args): + group_name = args['groupName'] + locked = distutils.util.strtobool(args['locked']) + ++ # We must lock to mark the VDI. + lock = Lock(vhdutil.LOCK_TYPE_SR, sr_uuid) ++ if locked: ++ lock.acquire() + + linstor = LinstorVolumeManager( + get_linstor_uri(session), +@@ -249,7 +254,7 @@ def lock_vdi(session, args): + except Exception as e: + util.SMlog('linstor-manager:lock_vdi error: {}'.format(e)) + finally: +- if lock: ++ if locked and lock: + lock.release() + return str(False) + +diff --git a/drivers/linstorvhdutil.py b/drivers/linstorvhdutil.py +index f31c752..ac85837 100644 +--- a/drivers/linstorvhdutil.py ++++ b/drivers/linstorvhdutil.py +@@ -89,13 +89,33 @@ def linstorhostcall(local_method, remote_method): + return decorated + + ++def linstormodifier(): ++ def decorated(func): ++ def wrapper(*args, **kwargs): ++ self = args[0] ++ ++ ret = func(*args, **kwargs) ++ self._linstor.invalidate_resource_cache() ++ return ret ++ return wrapper ++ return decorated ++ ++ + class LinstorVhdUtil: + def __init__(self, session, linstor): + self._session = session + self._linstor = linstor + ++ # -------------------------------------------------------------------------- ++ # Getters. ++ # -------------------------------------------------------------------------- ++ ++ def check(self, vdi_uuid, ignore_missing_footer=False, fast=False): ++ kwargs = {'ignoreMissingFooter': ignore_missing_footer, 'fast': fast} ++ return self._check(vdi_uuid, **kwargs) ++ + @linstorhostcall(vhdutil.check, 'check') +- def check(self, vdi_uuid, **kwargs): ++ def _check(self, vdi_uuid, **kwargs): + return distutils.util.strtobool(kwargs['response']) + + def get_vhd_info(self, vdi_uuid, include_parent=True): +@@ -148,6 +168,42 @@ class LinstorVhdUtil: + def get_block_bitmap(self, vdi_uuid, **kwargs): + return base64.b64decode(kwargs['response']) + ++ # -------------------------------------------------------------------------- ++ # Setters. ++ # -------------------------------------------------------------------------- ++ ++ @linstormodifier() ++ def create(self, path, size, static, msize=0): ++ return vhdutil.create(path, size, static, msize) ++ ++ @linstormodifier() ++ def set_size_virt_fast(self, path, size): ++ return vhdutil.setSizeVirtFast(path, size) ++ ++ @linstormodifier() ++ def set_size_phys(self, path, size, debug=True): ++ return vhdutil.setSizePhys(path, size, debug) ++ ++ @linstormodifier() ++ def set_parent(self, path, parentPath, parentRaw): ++ return vhdutil.setParent(path, parentPath, parentRaw) ++ ++ @linstormodifier() ++ def set_hidden(self, path, hidden=True): ++ return vhdutil.setHidden(path, hidden) ++ ++ @linstormodifier() ++ def set_key(self, path, key_hash): ++ return vhdutil.setKey(path, key_hash) ++ ++ @linstormodifier() ++ def kill_data(self, path): ++ return vhdutil.killData(path) ++ ++ @linstormodifier() ++ def snapshot(self, path, parent, parentRaw, msize=0, checkEmpty=True): ++ return vhdutil.snapshot(path, parent, parentRaw, msize, checkEmpty) ++ + # -------------------------------------------------------------------------- + # Helpers. + # -------------------------------------------------------------------------- +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index d400421..d617655 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -63,6 +63,16 @@ class LinstorVolumeManager(object): + A volume in this context is a physical part of the storage layer. + """ + ++ __slots__ = ( ++ '_linstor', '_logger', ++ '_uri', '_base_group_name', ++ '_redundancy', '_group_name', ++ '_volumes', '_storage_pools', ++ '_storage_pools_time', ++ '_kv_cache', '_resource_cache', '_volume_info_cache', ++ '_kv_cache_dirty', '_resource_cache_dirty', '_volume_info_cache_dirty' ++ ) ++ + DEV_ROOT_PATH = '/dev/drbd/by-res/' + + # Default LVM extent size. +@@ -106,6 +116,10 @@ class LinstorVolumeManager(object): + PREFIX_SR = 'xcp-sr-' + PREFIX_VOLUME = 'xcp-volume-' + ++ # Limit request number when storage pool info is asked, we fetch ++ # the current pool status after N elapsed seconds. ++ STORAGE_POOLS_FETCH_INTERVAL = 15 ++ + @staticmethod + def default_logger(*args): + print(args) +@@ -164,6 +178,16 @@ class LinstorVolumeManager(object): + self._logger = logger + self._redundancy = groups[0].select_filter.place_count + self._group_name = group_name ++ self._volumes = set() ++ self._storage_pools_time = 0 ++ ++ # To increate performance and limit request count to LINSTOR services, ++ # we use caches. ++ self._kv_cache = self._create_kv_cache() ++ self._resource_cache = None ++ self._resource_cache_dirty = True ++ self._volume_info_cache = None ++ self._volume_info_cache_dirty = True + self._build_volumes(repair=repair) + + @property +@@ -184,66 +208,6 @@ class LinstorVolumeManager(object): + """ + return self._volumes + +- @property +- def volumes_with_name(self): +- """ +- Give a volume dictionnary that contains names actually owned. +- :return: A volume/name dict. +- :rtype: dict(str, str) +- """ +- return self._get_volumes_by_property(self.REG_VOLUME_NAME) +- +- @property +- def volumes_with_info(self): +- """ +- Give a volume dictionnary that contains VolumeInfos. +- :return: A volume/VolumeInfo dict. +- :rtype: dict(str, VolumeInfo) +- """ +- +- volumes = {} +- +- all_volume_info = self._get_volumes_info() +- volume_names = self.volumes_with_name +- for volume_uuid, volume_name in volume_names.items(): +- if volume_name: +- volume_info = all_volume_info.get(volume_name) +- if volume_info: +- volumes[volume_uuid] = volume_info +- continue +- +- # Well I suppose if this volume is not available, +- # LINSTOR has been used directly without using this API. +- volumes[volume_uuid] = self.VolumeInfo('') +- +- return volumes +- +- @property +- def volumes_with_metadata(self): +- """ +- Give a volume dictionnary that contains metadata. +- :return: A volume/metadata dict. +- :rtype: dict(str, dict) +- """ +- +- volumes = {} +- +- metadata = self._get_volumes_by_property(self.REG_METADATA) +- for volume_uuid, volume_metadata in metadata.items(): +- if volume_metadata: +- volume_metadata = json.loads(volume_metadata) +- if isinstance(volume_metadata, dict): +- volumes[volume_uuid] = volume_metadata +- continue +- raise LinstorVolumeManagerError( +- 'Expected dictionary in volume metadata: {}' +- .format(volume_uuid) +- ) +- +- volumes[volume_uuid] = {} +- +- return volumes +- + @property + def max_volume_size_allowed(self): + """ +@@ -292,7 +256,7 @@ class LinstorVolumeManager(object): + """ + + size = 0 +- for resource in self._linstor.resource_list_raise().resources: ++ for resource in self._get_resource_cache().resources: + for volume in resource.volumes: + # We ignore diskless pools of the form "DfltDisklessStorPool". + if volume.storage_pool_name == self._group_name: +@@ -346,12 +310,8 @@ class LinstorVolumeManager(object): + :rtype: set(str) + """ + +- pools = self._linstor.storage_pool_list_raise( +- filter_by_stor_pools=[self._group_name] +- ).storage_pools +- + disconnected_hosts = set() +- for pool in pools: ++ for pool in self._get_storage_pools(): + for report in pool.reports: + if report.ret_code & linstor.consts.WARN_NOT_CONNECTED == \ + linstor.consts.WARN_NOT_CONNECTED: +@@ -397,7 +357,7 @@ class LinstorVolumeManager(object): + ) + return device_path + except Exception: +- self._force_destroy_volume(volume_uuid, volume_properties) ++ self._force_destroy_volume(volume_uuid) + raise + + def mark_volume_as_persistent(self, volume_uuid): +@@ -426,7 +386,7 @@ class LinstorVolumeManager(object): + volume_properties[self.PROP_NOT_EXISTS] = self.STATE_NOT_EXISTS + + self._volumes.remove(volume_uuid) +- self._destroy_volume(volume_uuid, volume_properties) ++ self._destroy_volume(volume_uuid) + + def lock_volume(self, volume_uuid, locked=True): + """ +@@ -476,12 +436,15 @@ class LinstorVolumeManager(object): + + waiting = False + ++ volume_properties = self._get_kv_cache() ++ + start = time.time() + while True: + # Can't delete in for loop, use a copy of the list. + remaining = checked.copy() + for volume_uuid in checked: +- volume_properties = self._get_volume_properties(volume_uuid) ++ volume_properties.namespace = \ ++ self._build_volume_namespace(volume_uuid) + timestamp = volume_properties.get( + self.PROP_IS_READONLY_TIMESTAMP + ) +@@ -519,6 +482,7 @@ class LinstorVolumeManager(object): + # We must wait to use the volume. After that we can modify it + # ONLY if the SR is locked to avoid bad reads on the slaves. + time.sleep(1) ++ volume_properties = self._create_kv_cache() + + if waiting: + self._logger('No volume locked now!') +@@ -542,6 +506,9 @@ class LinstorVolumeManager(object): + volume_nr=0, + size=new_size / 1024 + ) ++ ++ self._mark_resource_cache_as_dirty() ++ + error_str = self._get_error_str(result) + if error_str: + raise LinstorVolumeManagerError( +@@ -596,7 +563,7 @@ class LinstorVolumeManager(object): + """ + + volume_name = self.get_volume_name(volume_uuid) +- return self._get_volumes_info(filter=[volume_name])[volume_name] ++ return self._get_volumes_info()[volume_name] + + def get_device_path(self, volume_uuid): + """ +@@ -620,7 +587,7 @@ class LinstorVolumeManager(object): + expected_volume_name = \ + self.get_volume_name_from_device_path(device_path) + +- volume_names = self.volumes_with_name ++ volume_names = self.get_volumes_with_name() + for volume_uuid, volume_name in volume_names.items(): + if volume_name == expected_volume_name: + return volume_uuid +@@ -638,9 +605,11 @@ class LinstorVolumeManager(object): + """ + + node_name = socket.gethostname() +- resources = self._linstor.resource_list_raise( +- filter_by_nodes=[node_name] +- ).resources ++ ++ resources = filter( ++ lambda resource: resource.node_name == node_name, ++ self._get_resource_cache().resources ++ ) + + real_device_path = os.path.realpath(device_path) + for resource in resources: +@@ -664,6 +633,8 @@ class LinstorVolumeManager(object): + deleted VDI. + """ + ++ assert volume_uuid != new_volume_uuid ++ + self._logger( + 'Trying to update volume UUID {} to {}...' + .format(volume_uuid, new_volume_uuid) +@@ -685,36 +656,41 @@ class LinstorVolumeManager(object): + .format(volume_uuid) + ) + +- new_volume_properties = self._get_volume_properties( ++ # 1. Copy in temp variables metadata and volume_name. ++ metadata = volume_properties.get(self.PROP_METADATA) ++ volume_name = volume_properties.get(self.PROP_VOLUME_NAME) ++ ++ # 2. Switch to new volume namespace. ++ volume_properties.namespace = self._build_volume_namespace( + new_volume_uuid + ) +- if list(new_volume_properties.items()): ++ ++ if list(volume_properties.items()): + raise LinstorVolumeManagerError( + 'Cannot update volume uuid {} to {}: ' + .format(volume_uuid, new_volume_uuid) + + 'this last one is not empty' + ) + +- assert volume_properties.namespace != \ +- new_volume_properties.namespace +- + try: +- # 1. Mark new volume properties with PROP_UPDATING_UUID_SRC. ++ # 3. Mark new volume properties with PROP_UPDATING_UUID_SRC. + # If we crash after that, the new properties can be removed + # properly. +- new_volume_properties[self.PROP_NOT_EXISTS] = self.STATE_NOT_EXISTS +- new_volume_properties[self.PROP_UPDATING_UUID_SRC] = volume_uuid ++ volume_properties[self.PROP_NOT_EXISTS] = self.STATE_NOT_EXISTS ++ volume_properties[self.PROP_UPDATING_UUID_SRC] = volume_uuid + +- # 2. Copy the properties. +- for property in [self.PROP_METADATA, self.PROP_VOLUME_NAME]: +- new_volume_properties[property] = \ +- volume_properties.get(property) ++ # 4. Copy the properties. ++ volume_properties[self.PROP_METADATA] = metadata ++ volume_properties[self.PROP_VOLUME_NAME] = volume_name + +- # 3. Ok! +- new_volume_properties[self.PROP_NOT_EXISTS] = self.STATE_EXISTS ++ # 5. Ok! ++ volume_properties[self.PROP_NOT_EXISTS] = self.STATE_EXISTS + except Exception as e: + try: +- new_volume_properties.clear() ++ # Clear the new volume properties in case of failure. ++ assert volume_properties.namespace == \ ++ self._build_volume_namespace(new_volume_uuid) ++ volume_properties.clear() + except Exception as e: + self._logger( + 'Failed to clear new volume properties: {} (ignoring...)' +@@ -725,11 +701,21 @@ class LinstorVolumeManager(object): + ) + + try: +- # 4. After this point, it's ok we can remove the ++ # 6. After this point, it's ok we can remove the + # PROP_UPDATING_UUID_SRC property and clear the src properties + # without problems. ++ ++ # 7. Switch to old volume namespace. ++ volume_properties.namespace = self._build_volume_namespace( ++ volume_uuid ++ ) + volume_properties.clear() +- new_volume_properties.pop(self.PROP_UPDATING_UUID_SRC) ++ ++ # 8. Switch a last time to new volume namespace. ++ volume_properties.namespace = self._build_volume_namespace( ++ new_volume_uuid ++ ) ++ volume_properties.pop(self.PROP_UPDATING_UUID_SRC) + except Exception as e: + raise LinstorVolumeManagerError( + 'Failed to clear volume properties ' +@@ -743,7 +729,7 @@ class LinstorVolumeManager(object): + 'UUID update succeeded of {} to {}! (properties={})' + .format( + volume_uuid, new_volume_uuid, +- self._get_filtered_properties(new_volume_properties) ++ self._get_filtered_properties(volume_properties) + ) + ) + +@@ -788,6 +774,63 @@ class LinstorVolumeManager(object): + + return states + ++ def get_volumes_with_name(self): ++ """ ++ Give a volume dictionnary that contains names actually owned. ++ :return: A volume/name dict. ++ :rtype: dict(str, str) ++ """ ++ return self._get_volumes_by_property(self.REG_VOLUME_NAME) ++ ++ def get_volumes_with_info(self): ++ """ ++ Give a volume dictionnary that contains VolumeInfos. ++ :return: A volume/VolumeInfo dict. ++ :rtype: dict(str, VolumeInfo) ++ """ ++ ++ volumes = {} ++ ++ all_volume_info = self._get_volumes_info() ++ volume_names = self.get_volumes_with_name() ++ for volume_uuid, volume_name in volume_names.items(): ++ if volume_name: ++ volume_info = all_volume_info.get(volume_name) ++ if volume_info: ++ volumes[volume_uuid] = volume_info ++ continue ++ ++ # Well I suppose if this volume is not available, ++ # LINSTOR has been used directly without using this API. ++ volumes[volume_uuid] = self.VolumeInfo('') ++ ++ return volumes ++ ++ def get_volumes_with_metadata(self): ++ """ ++ Give a volume dictionnary that contains metadata. ++ :return: A volume/metadata dict. ++ :rtype: dict(str, dict) ++ """ ++ ++ volumes = {} ++ ++ metadata = self._get_volumes_by_property(self.REG_METADATA) ++ for volume_uuid, volume_metadata in metadata.items(): ++ if volume_metadata: ++ volume_metadata = json.loads(volume_metadata) ++ if isinstance(volume_metadata, dict): ++ volumes[volume_uuid] = volume_metadata ++ continue ++ raise LinstorVolumeManagerError( ++ 'Expected dictionary in volume metadata: {}' ++ .format(volume_uuid) ++ ) ++ ++ volumes[volume_uuid] = {} ++ ++ return volumes ++ + def get_volume_metadata(self, volume_uuid): + """ + Get the metadata of a volume. +@@ -918,9 +961,9 @@ class LinstorVolumeManager(object): + )) + + # 5. Create resources! +- def clean(properties): ++ def clean(): + try: +- self._destroy_volume(clone_uuid, properties) ++ self._destroy_volume(clone_uuid) + except Exception as e: + self._logger( + 'Unable to destroy volume {} after shallow clone fail: {}' +@@ -946,7 +989,7 @@ class LinstorVolumeManager(object): + ) + return volume_properties + except Exception: +- clean(volume_properties) ++ clean() + raise + + # Retry because we can get errors like this: +@@ -962,7 +1005,7 @@ class LinstorVolumeManager(object): + self._volumes.add(clone_uuid) + return device_path + except Exception as e: +- clean(volume_properties) ++ clean() + raise + + def remove_resourceless_volumes(self): +@@ -974,7 +1017,7 @@ class LinstorVolumeManager(object): + """ + + resource_names = self._fetch_resource_names() +- for volume_uuid, volume_name in self.volumes_with_name.items(): ++ for volume_uuid, volume_name in self.get_volumes_with_name().items(): + if not volume_name or volume_name not in resource_names: + self.destroy_volume(volume_uuid) + +@@ -992,11 +1035,7 @@ class LinstorVolumeManager(object): + # TODO: What's the required action if it exists remaining volumes? + + self._destroy_resource_group(self._linstor, self._group_name) +- +- pools = self._linstor.storage_pool_list_raise( +- filter_by_stor_pools=[self._group_name] +- ).storage_pools +- for pool in pools: ++ for pool in self._get_storage_pools(force=True): + self._destroy_storage_pool( + self._linstor, pool.name, pool.node_name + ) +@@ -1014,10 +1053,13 @@ class LinstorVolumeManager(object): + + in_use = False + node_names = set() +- resource_list = self._linstor.resource_list_raise( +- filter_by_resources=[volume_name] ++ ++ resource_states = filter( ++ lambda resource_state: resource_state.name == volume_name, ++ self._get_resource_cache().resource_states + ) +- for resource_state in resource_list.resource_states: ++ ++ for resource_state in resource_states: + volume_state = resource_state.volume_states[0] + if volume_state.disk_state == 'UpToDate': + node_names.add(resource_state.node_name) +@@ -1026,6 +1068,14 @@ class LinstorVolumeManager(object): + + return (node_names, in_use) + ++ def invalidate_resource_cache(self): ++ """ ++ If resources are impacted by external commands like vhdutil, ++ it's necessary to call this function to invalidate current resource ++ cache. ++ """ ++ self._mark_resource_cache_as_dirty() ++ + @classmethod + def create_sr( + cls, uri, group_name, node_names, redundancy, +@@ -1149,6 +1199,12 @@ class LinstorVolumeManager(object): + instance._redundancy = redundancy + instance._group_name = group_name + instance._volumes = set() ++ instance._storage_pools_time = 0 ++ instance._kv_cache = instance._create_kv_cache() ++ instance._resource_cache = None ++ instance._resource_cache_dirty = True ++ instance._volume_info_cache = None ++ instance._volume_info_cache_dirty = True + return instance + + @classmethod +@@ -1196,6 +1252,32 @@ class LinstorVolumeManager(object): + # Private helpers. + # -------------------------------------------------------------------------- + ++ def _create_kv_cache(self): ++ self._kv_cache = self._create_linstor_kv('/') ++ self._kv_cache_dirty = False ++ return self._kv_cache ++ ++ def _get_kv_cache(self): ++ if self._kv_cache_dirty: ++ self._kv_cache = self._create_kv_cache() ++ return self._kv_cache ++ ++ def _create_resource_cache(self): ++ self._resource_cache = self._linstor.resource_list_raise() ++ self._resource_cache_dirty = False ++ return self._resource_cache ++ ++ def _get_resource_cache(self): ++ if self._resource_cache_dirty: ++ self._resource_cache = self._create_resource_cache() ++ return self._resource_cache ++ ++ def _mark_resource_cache_as_dirty(self): ++ self._resource_cache_dirty = True ++ self._volume_info_cache_dirty = True ++ ++ # -------------------------------------------------------------------------- ++ + def _ensure_volume_exists(self, volume_uuid): + if volume_uuid not in self._volumes: + raise LinstorVolumeManagerError( +@@ -1224,12 +1306,13 @@ class LinstorVolumeManager(object): + resource_names.add(dfn.name) + return resource_names + +- def _get_volumes_info(self, filter=None): ++ def _get_volumes_info(self, volume_name=None): + all_volume_info = {} +- resources = self._linstor.resource_list_raise( +- filter_by_resources=filter +- ) +- for resource in resources.resources: ++ ++ if not self._volume_info_cache_dirty: ++ return self._volume_info_cache ++ ++ for resource in self._get_resource_cache().resources: + if resource.name not in all_volume_info: + current = all_volume_info[resource.name] = self.VolumeInfo( + resource.name +@@ -1261,6 +1344,9 @@ class LinstorVolumeManager(object): + current.physical_size *= 1024 + current.virtual_size *= 1024 + ++ self._volume_info_cache_dirty = False ++ self._volume_info_cache = all_volume_info ++ + return all_volume_info + + def _get_volume_node_names_and_size(self, volume_name): +@@ -1289,12 +1375,8 @@ class LinstorVolumeManager(object): + return (node_names, size * 1024) + + def _compute_size(self, attr): +- pools = self._linstor.storage_pool_list_raise( +- filter_by_stor_pools=[self._group_name] +- ).storage_pools +- + capacity = 0 +- for pool in pools: ++ for pool in self._get_storage_pools(force=True): + space = pool.free_space + if space: + size = getattr(space, attr) +@@ -1308,13 +1390,22 @@ class LinstorVolumeManager(object): + + def _get_node_names(self): + node_names = set() +- pools = self._linstor.storage_pool_list_raise( +- filter_by_stor_pools=[self._group_name] +- ).storage_pools +- for pool in pools: ++ for pool in self._get_storage_pools(): + node_names.add(pool.node_name) + return node_names + ++ def _get_storage_pools(self, force=False): ++ cur_time = time.time() ++ elsaped_time = cur_time - self._storage_pools_time ++ ++ if force or elsaped_time >= self.STORAGE_POOLS_FETCH_INTERVAL: ++ self._storage_pools = self._linstor.storage_pool_list_raise( ++ filter_by_stor_pools=[self._group_name] ++ ).storage_pools ++ self._storage_pools_time = time.time() ++ ++ return self._storage_pools ++ + def _check_volume_creation_errors(self, result, volume_uuid): + errors = self._filter_errors(result) + if self._check_errors(errors, [ +@@ -1338,6 +1429,7 @@ class LinstorVolumeManager(object): + def _create_volume(self, volume_uuid, volume_name, size, place_resources): + size = self.round_up_volume_size(size) + ++ self._mark_resource_cache_as_dirty() + self._check_volume_creation_errors(self._linstor.resource_group_spawn( + rsc_grp_name=self._group_name, + rsc_dfn_name=volume_name, +@@ -1378,6 +1470,8 @@ class LinstorVolumeManager(object): + volume_uuid, volume_name, size, place_resources + ) + ++ assert volume_properties.namespace == \ ++ self._build_volume_namespace(volume_uuid) + return volume_properties + except LinstorVolumeManagerError as e: + # Do not destroy existing resource! +@@ -1387,10 +1481,10 @@ class LinstorVolumeManager(object): + # call in another host. + if e.code == LinstorVolumeManagerError.ERR_VOLUME_EXISTS: + raise +- self._force_destroy_volume(volume_uuid, volume_properties) ++ self._force_destroy_volume(volume_uuid) + raise + except Exception: +- self._force_destroy_volume(volume_uuid, volume_properties) ++ self._force_destroy_volume(volume_uuid) + raise + + def _find_device_path(self, volume_uuid, volume_name): +@@ -1417,34 +1511,26 @@ class LinstorVolumeManager(object): + + def _request_device_path(self, volume_uuid, volume_name, activate=False): + node_name = socket.gethostname() +- resources = self._linstor.resource_list( +- filter_by_nodes=[node_name], +- filter_by_resources=[volume_name] ++ ++ resources = filter( ++ lambda resource: resource.node_name == node_name and ++ resource.name == volume_name, ++ self._get_resource_cache().resources + ) + +- if not resources or not resources[0]: ++ if not resources: ++ if activate: ++ self._activate_device_path(node_name, volume_name) ++ return self._request_device_path(volume_uuid, volume_name) + raise LinstorVolumeManagerError( +- 'No response list for dev path of `{}`'.format(volume_uuid) +- ) +- if isinstance(resources[0], linstor.responses.ResourceResponse): +- if not resources[0].resources: +- if activate: +- self._activate_device_path(node_name, volume_name) +- return self._request_device_path(volume_uuid, volume_name) +- raise LinstorVolumeManagerError( +- 'Empty dev path for `{}`, but definition "seems" to exist' +- .format(volume_uuid) +- ) +- # Contains a path of the /dev/drbd form. +- return resources[0].resources[0].volumes[0].device_path +- +- raise LinstorVolumeManagerError( +- 'Unable to get volume dev path `{}`: {}'.format( +- volume_uuid, str(resources[0]) ++ 'Empty dev path for `{}`, but definition "seems" to exist' ++ .format(volume_uuid) + ) +- ) ++ # Contains a path of the /dev/drbd form. ++ return resources[0].volumes[0].device_path + + def _activate_device_path(self, node_name, volume_name): ++ self._mark_resource_cache_as_dirty() + result = self._linstor.resource_create([ + linstor.ResourceData(node_name, volume_name, diskless=True) + ]) +@@ -1463,6 +1549,7 @@ class LinstorVolumeManager(object): + ) + + def _destroy_resource(self, resource_name): ++ self._mark_resource_cache_as_dirty() + result = self._linstor.resource_dfn_delete(resource_name) + error_str = self._get_error_str(result) + if error_str: +@@ -1471,10 +1558,8 @@ class LinstorVolumeManager(object): + .format(resource_name, self._group_name, error_str) + ) + +- def _destroy_volume(self, volume_uuid, volume_properties): +- assert volume_properties.namespace == \ +- self._build_volume_namespace(volume_uuid) +- ++ def _destroy_volume(self, volume_uuid): ++ volume_properties = self._get_volume_properties(volume_uuid) + try: + volume_name = volume_properties.get(self.PROP_VOLUME_NAME) + if volume_name in self._fetch_resource_names(): +@@ -1487,19 +1572,14 @@ class LinstorVolumeManager(object): + 'Cannot destroy volume `{}`: {}'.format(volume_uuid, e) + ) + +- def _force_destroy_volume(self, volume_uuid, volume_properties): ++ def _force_destroy_volume(self, volume_uuid): + try: +- self._destroy_volume(volume_uuid, volume_properties) ++ self._destroy_volume(volume_uuid) + except Exception as e: + self._logger('Ignore fail: {}'.format(e)) + + def _build_volumes(self, repair): +- properties = linstor.KV( +- self._get_store_name(), +- uri=self._uri, +- namespace=self._build_volume_namespace() +- ) +- ++ properties = self._kv_cache + resource_names = self._fetch_resource_names() + + self._volumes = set() +@@ -1517,9 +1597,7 @@ class LinstorVolumeManager(object): + self.REG_NOT_EXISTS, ignore_inexisting_volumes=False + ) + for volume_uuid, not_exists in existing_volumes.items(): +- properties.namespace = self._build_volume_namespace( +- volume_uuid +- ) ++ properties.namespace = self._build_volume_namespace(volume_uuid) + + src_uuid = properties.get(self.PROP_UPDATING_UUID_SRC) + if src_uuid: +@@ -1580,36 +1658,31 @@ class LinstorVolumeManager(object): + ) + + for dest_uuid, src_uuid in updating_uuid_volumes.items(): +- dest_properties = self._get_volume_properties(dest_uuid) +- if int(dest_properties.get(self.PROP_NOT_EXISTS) or +- self.STATE_EXISTS): +- dest_properties.clear() ++ dest_namespace = self._build_volume_namespace(dest_uuid) ++ ++ properties.namespace = dest_namespace ++ if int(properties.get(self.PROP_NOT_EXISTS)): ++ properties.clear() + continue + +- src_properties = self._get_volume_properties(src_uuid) +- src_properties.clear() ++ properties.namespace = self._build_volume_namespace(src_uuid) ++ properties.clear() + +- dest_properties.pop(self.PROP_UPDATING_UUID_SRC) ++ properties.namespace = dest_namespace ++ properties.pop(self.PROP_UPDATING_UUID_SRC) + + if src_uuid in self._volumes: + self._volumes.remove(src_uuid) + self._volumes.add(dest_uuid) + + def _get_sr_properties(self): +- return linstor.KV( +- self._get_store_name(), +- uri=self._uri, +- namespace=self._build_sr_namespace() +- ) ++ return self._create_linstor_kv(self._build_sr_namespace()) + + def _get_volumes_by_property( + self, reg_prop, ignore_inexisting_volumes=True + ): +- base_properties = linstor.KV( +- self._get_store_name(), +- uri=self._uri, +- namespace=self._build_volume_namespace() +- ) ++ base_properties = self._get_kv_cache() ++ base_properties.namespace = self._build_volume_namespace() + + volume_properties = {} + for volume_uuid in self._volumes: +@@ -1625,13 +1698,18 @@ class LinstorVolumeManager(object): + + return volume_properties + +- def _get_volume_properties(self, volume_uuid): ++ def _create_linstor_kv(self, namespace): + return linstor.KV( + self._get_store_name(), + uri=self._uri, +- namespace=self._build_volume_namespace(volume_uuid) ++ namespace=namespace + ) + ++ def _get_volume_properties(self, volume_uuid): ++ properties = self._get_kv_cache() ++ properties.namespace = self._build_volume_namespace(volume_uuid) ++ return properties ++ + def _get_store_name(self): + return 'xcp-sr-{}'.format(self._group_name) + +-- +2.45.2 + diff --git a/SOURCES/0029-feat-LinstorSR-robustify-scan-to-avoid-losing-VDIs-i.patch b/SOURCES/0029-feat-LinstorSR-robustify-scan-to-avoid-losing-VDIs-i.patch new file mode 100644 index 00000000..91d4edc5 --- /dev/null +++ b/SOURCES/0029-feat-LinstorSR-robustify-scan-to-avoid-losing-VDIs-i.patch @@ -0,0 +1,91 @@ +From 78f29568ef2faee1f7fd01888169e07336f26f46 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Thu, 7 Jan 2021 11:17:08 +0100 +Subject: [PATCH 029/175] feat(LinstorSR): robustify scan to avoid losing VDIs + if function is called outside module + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 30 +++++++++++++++++++++--------- + 1 file changed, 21 insertions(+), 9 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 548f4b1..52131a5 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -325,6 +325,7 @@ class LinstorSR(SR.SR): + + self._initialized = False + ++ self._vdis_loaded = False + self._all_volume_info_cache = None + self._all_volume_metadata_cache = None + +@@ -463,19 +464,13 @@ class LinstorSR(SR.SR): + ) + + if load_vdis: +- # We use a cache to avoid repeated JSON parsing. +- # The performance gain is not big but we can still +- # enjoy it with a few lines. +- self._create_linstor_cache() + self._load_vdis() +- self._destroy_linstor_cache() + +- self._undo_all_journal_transactions() + self._linstor.remove_resourceless_volumes() + + self._synchronize_metadata() + except Exception as e: +- if self.cmd == 'sr_scan': ++ if self.cmd == 'sr_scan' or self.cmd == 'sr_attach': + # Always raise, we don't want to remove VDIs + # from the XAPI database otherwise. + raise e +@@ -612,6 +607,9 @@ class LinstorSR(SR.SR): + opterr='no such volume group: {}'.format(self._group_name) + ) + ++ # Note: `scan` can be called outside this module, so ensure the VDIs ++ # are loaded. ++ self._load_vdis() + self._update_physical_size() + + for vdi_uuid in self.vdis.keys(): +@@ -799,9 +797,22 @@ class LinstorSR(SR.SR): + # -------------------------------------------------------------------------- + + def _load_vdis(self): +- if self.vdis: ++ if self._vdis_loaded: + return ++ self._vdis_loaded = True ++ ++ assert self._is_master ++ ++ # We use a cache to avoid repeated JSON parsing. ++ # The performance gain is not big but we can still ++ # enjoy it with a few lines. ++ self._create_linstor_cache() ++ self._load_vdis_ex() ++ self._destroy_linstor_cache() ++ ++ self._undo_all_journal_transactions() + ++ def _load_vdis_ex(self): + # 1. Get existing VDIs in XAPI. + xenapi = self.session.xenapi + xapi_vdi_uuids = set() +@@ -822,7 +833,8 @@ class LinstorSR(SR.SR): + + introduce = False + +- if self.cmd == 'sr_scan': ++ # Try to introduce VDIs only during scan/attach. ++ if self.cmd == 'sr_scan' or self.cmd == 'sr_attach': + has_clone_entries = list(self._journaler.get_all( + LinstorJournaler.CLONE + ).items()) +-- +2.45.2 + diff --git a/SOURCES/0030-feat-LinstorSR-display-a-correctly-readable-size-for.patch b/SOURCES/0030-feat-LinstorSR-display-a-correctly-readable-size-for.patch new file mode 100644 index 00000000..80dc1744 --- /dev/null +++ b/SOURCES/0030-feat-LinstorSR-display-a-correctly-readable-size-for.patch @@ -0,0 +1,281 @@ +From fe6494d475ef9c2ef612c1273cdf6dc57f1b876a Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Fri, 8 Jan 2021 16:12:15 +0100 +Subject: [PATCH 030/175] feat(LinstorSR): display a correctly readable size + for the user + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 46 +++++++++------------ + drivers/linstorvolumemanager.py | 72 +++++++++++++++++++++++++++++---- + 2 files changed, 83 insertions(+), 35 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 52131a5..16cb0d6 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -770,27 +770,19 @@ class LinstorSR(SR.SR): + # Update size attributes of the SR parent class. + self.virtual_allocation = valloc + virt_alloc_delta + +- # Physical size contains the total physical size. +- # i.e. the sum of the sizes of all devices on all hosts, not the AVG. + self._update_physical_size() + + # Notify SR parent class. + self._db_update() + + def _update_physical_size(self): +- # Physical size contains the total physical size. +- # i.e. the sum of the sizes of all devices on all hosts, not the AVG. +- self.physical_size = self._linstor.physical_size ++ # We use the size of the smallest disk, this is an approximation that ++ # ensures the displayed physical size is reachable by the user. ++ self.physical_size = \ ++ self._linstor.min_physical_size * len(self._hosts) / \ ++ self._redundancy + +- # `self._linstor.physical_free_size` contains the total physical free +- # memory. If Thin provisioning is used we can't use it, we must use +- # LINSTOR volume size to gives a good idea of the required +- # usable memory to the users. +- self.physical_utilisation = self._linstor.total_allocated_volume_size +- +- # If Thick provisioning is used, we can use this line instead: +- # self.physical_utilisation = \ +- # self.physical_size - self._linstor.physical_free_size ++ self.physical_utilisation = self._linstor.allocated_volume_size + + # -------------------------------------------------------------------------- + # VDIs. +@@ -912,10 +904,10 @@ class LinstorSR(SR.SR): + + util.SMlog( + 'Introducing VDI {} '.format(vdi_uuid) + +- ' (name={}, virtual_size={}, physical_size={})'.format( ++ ' (name={}, virtual_size={}, allocated_size={})'.format( + name_label, + volume_info.virtual_size, +- volume_info.physical_size ++ volume_info.allocated_size + ) + ) + +@@ -933,7 +925,7 @@ class LinstorSR(SR.SR): + sm_config, + managed, + str(volume_info.virtual_size), +- str(volume_info.physical_size) ++ str(volume_info.allocated_size) + ) + + is_a_snapshot = volume_metadata.get(IS_A_SNAPSHOT_TAG) +@@ -1016,7 +1008,7 @@ class LinstorSR(SR.SR): + else: + geneology[vdi.parent] = [vdi_uuid] + if not vdi.hidden: +- self.virtual_allocation += vdi.utilisation ++ self.virtual_allocation += vdi.size + + # 9. Remove all hidden leaf nodes to avoid introducing records that + # will be GC'ed. +@@ -1453,11 +1445,11 @@ class LinstorVDI(VDI.VDI): + '{}'.format(e) + ) + +- self.utilisation = volume_info.physical_size ++ self.utilisation = volume_info.allocated_size + self.sm_config['vdi_type'] = self.vdi_type + + self.ref = self._db_introduce() +- self.sr._update_stats(volume_info.virtual_size) ++ self.sr._update_stats(self.size) + + return VDI.VDI.get_params(self) + +@@ -1496,7 +1488,7 @@ class LinstorVDI(VDI.VDI): + del self.sr.vdis[self.uuid] + + # TODO: Check size after delete. +- self.sr._update_stats(-self.capacity) ++ self.sr._update_stats(-self.size) + self.sr._kick_gc() + return super(LinstorVDI, self).delete(sr_uuid, vdi_uuid, data_only) + +@@ -1622,7 +1614,7 @@ class LinstorVDI(VDI.VDI): + space_needed = new_volume_size - old_volume_size + self.sr._ensure_space_available(space_needed) + +- old_capacity = self.capacity ++ old_size = self.size + if self.vdi_type == vhdutil.VDI_TYPE_RAW: + self._linstor.resize(self.uuid, new_volume_size) + else: +@@ -1641,7 +1633,7 @@ class LinstorVDI(VDI.VDI): + self.session.xenapi.VDI.set_physical_utilisation( + vdi_ref, str(self.utilisation) + ) +- self.sr._update_stats(self.capacity - old_capacity) ++ self.sr._update_stats(self.size - old_size) + return VDI.VDI.get_params(self) + + def clone(self, sr_uuid, vdi_uuid): +@@ -1756,13 +1748,13 @@ class LinstorVDI(VDI.VDI): + if volume_info is None: + volume_info = self._linstor.get_volume_info(self.uuid) + +- # Contains the physical size used on all disks. ++ # Contains the max physical size used on a disk. + # When LINSTOR LVM driver is used, the size should be similar to + # virtual size (i.e. the LINSTOR max volume size). + # When LINSTOR Thin LVM driver is used, the used physical size should + # be lower than virtual size at creation. + # The physical size increases after each write in a new block. +- self.utilisation = volume_info.physical_size ++ self.utilisation = volume_info.allocated_size + self.capacity = volume_info.virtual_size + + if self.vdi_type == vhdutil.VDI_TYPE_RAW: +@@ -1958,7 +1950,7 @@ class LinstorVDI(VDI.VDI): + volume_info = self._linstor.get_volume_info(snap_uuid) + + snap_vdi.size = self.sr._vhdutil.get_size_virt(snap_uuid) +- snap_vdi.utilisation = volume_info.physical_size ++ snap_vdi.utilisation = volume_info.allocated_size + + # 6. Update sm config. + snap_vdi.sm_config = {} +@@ -2156,7 +2148,7 @@ class LinstorVDI(VDI.VDI): + raise + + if snap_type != VDI.SNAPSHOT_INTERNAL: +- self.sr._update_stats(self.capacity) ++ self.sr._update_stats(self.size) + + # 10. Return info on the new user-visible leaf VDI. + ret_vdi = snap_vdi +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index d617655..a6f67d8 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -131,20 +131,19 @@ class LinstorVolumeManager(object): + class VolumeInfo(object): + __slots__ = ( + 'name', +- 'physical_size', # Total physical size used by this volume on +- # all disks. ++ 'allocated_size', # Allocated size, place count is not used. + 'virtual_size' # Total virtual available size of this volume + # (i.e. the user size at creation). + ) + + def __init__(self, name): + self.name = name +- self.physical_size = 0 ++ self.allocated_size = 0 + self.virtual_size = 0 + + def __repr__(self): + return 'VolumeInfo("{}", {}, {})'.format( +- self.name, self.physical_size, self.virtual_size ++ self.name, self.allocated_size, self.virtual_size + ) + + # -------------------------------------------------------------------------- +@@ -248,9 +247,31 @@ class LinstorVolumeManager(object): + return self._compute_size('free_capacity') + + @property +- def total_allocated_volume_size(self): ++ def min_physical_size(self): + """ +- Give the sum of all created volumes. ++ Give the minimum physical size of the SR. ++ I.e. the size of the smallest disk. ++ :return: The physical min size. ++ :rtype: int ++ """ ++ size = None ++ for pool in self._get_storage_pools(force=True): ++ space = pool.free_space ++ if space: ++ current_size = space.total_capacity ++ if current_size < 0: ++ raise LinstorVolumeManagerError( ++ 'Failed to get pool total_capacity attr of `{}`' ++ .format(pool.node_name) ++ ) ++ if size is None or current_size < size: ++ size = current_size ++ return size * 1024 ++ ++ @property ++ def total_volume_size(self): ++ """ ++ Give the sum of all created volumes. The place count is used. + :return: The physical required size to use the volumes. + :rtype: int + """ +@@ -269,6 +290,37 @@ class LinstorVolumeManager(object): + size += current_size + return size * 1024 + ++ @property ++ def allocated_volume_size(self): ++ """ ++ Give the allocated size for all volumes. The place count is not ++ used here. When thick lvm is used, the size for one volume should ++ be equal to the virtual volume size. With thin lvm, the size is equal ++ or lower to the volume size. ++ :return: The allocated size of all volumes. ++ :rtype: int ++ """ ++ ++ size = 0 ++ for resource in self._get_resource_cache().resources: ++ volume_size = None ++ for volume in resource.volumes: ++ # We ignore diskless pools of the form "DfltDisklessStorPool". ++ if volume.storage_pool_name == self._group_name: ++ current_size = volume.allocated_size ++ if current_size < 0: ++ raise LinstorVolumeManagerError( ++ 'Failed to get allocated size of `{}` on `{}`' ++ .format(resource.name, volume.storage_pool_name) ++ ) ++ ++ if volume_size is None or current_size > volume_size: ++ volume_size = current_size ++ if volume_size is not None: ++ size += volume_size ++ ++ return size * 1024 ++ + @property + def metadata(self): + """ +@@ -1328,7 +1380,11 @@ class LinstorVolumeManager(object): + 'Failed to get allocated size of `{}` on `{}`' + .format(resource.name, volume.storage_pool_name) + ) +- current.physical_size += volume.allocated_size ++ allocated_size = volume.allocated_size ++ ++ current.allocated_size = current.allocated_size and \ ++ max(current.allocated_size, allocated_size) or \ ++ allocated_size + + if volume.usable_size < 0: + raise LinstorVolumeManagerError( +@@ -1341,7 +1397,7 @@ class LinstorVolumeManager(object): + min(current.virtual_size, virtual_size) or virtual_size + + for current in all_volume_info.values(): +- current.physical_size *= 1024 ++ current.allocated_size *= 1024 + current.virtual_size *= 1024 + + self._volume_info_cache_dirty = False +-- +2.45.2 + diff --git a/SOURCES/0031-feat-linstor-monitord-scan-all-LINSTOR-SRs-every-12-.patch b/SOURCES/0031-feat-linstor-monitord-scan-all-LINSTOR-SRs-every-12-.patch new file mode 100644 index 00000000..3cfba4e4 --- /dev/null +++ b/SOURCES/0031-feat-linstor-monitord-scan-all-LINSTOR-SRs-every-12-.patch @@ -0,0 +1,335 @@ +From 6b1de43b38cabd9adc9888136c9134e167876c15 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Tue, 12 Jan 2021 14:06:34 +0100 +Subject: [PATCH 031/175] feat(linstor-monitord): scan all LINSTOR SRs every 12 + minutes to update allocated size stats + +Signed-off-by: Ronan Abhamon +--- + linstor/linstor-monitord.c | 194 ++++++++++++++++++++++++++++++++----- + 1 file changed, 171 insertions(+), 23 deletions(-) + +diff --git a/linstor/linstor-monitord.c b/linstor/linstor-monitord.c +index 8161813..a1592fd 100644 +--- a/linstor/linstor-monitord.c ++++ b/linstor/linstor-monitord.c +@@ -14,8 +14,10 @@ + * along with this program. If not, see . + */ + ++#include + #include + #include ++#include + #include + #include + #include +@@ -39,7 +41,8 @@ + #define POOL_CONF_ABS_FILE POOL_CONF_DIR "/" POOL_CONF_FILE + + // In milliseconds. +-#define POLL_TIMEOUT 2000 ++#define UPDATE_LINSTOR_NODE_TIMEOUT 2000 ++#define SR_SCAN_TIMEOUT 720000 + + // ----------------------------------------------------------------------------- + +@@ -130,24 +133,120 @@ static inline int isMasterHost (int *error) { + + typedef struct { + int inotifyFd; ++ struct timespec lastScanTime; ++ int isMaster; + // TODO: Should be completed with at least a hostname field. + } State; + + // ----------------------------------------------------------------------------- + +-static inline int execCommand (char *argv[]) { ++typedef struct { ++ char *data; ++ size_t size; ++ size_t capacity; ++} Buffer; ++ ++#define max(a, b) ({ \ ++ __typeof__(a) _a = (a); \ ++ __typeof__(b) _b = (b); \ ++ _a > _b ? _a : _b; \ ++}) ++ ++static inline ssize_t readAll (int fd, Buffer *buffer) { ++ assert(buffer->capacity >= buffer->size); ++ ++ ssize_t ret = 0; ++ do { ++ size_t byteCount = buffer->capacity - buffer->size; ++ if (byteCount < 16) { ++ const size_t newCapacity = max(buffer->capacity << 1, 64); ++ char *p = realloc(buffer->data, newCapacity); ++ if (!p) ++ return -errno; ++ ++ buffer->data = p; ++ buffer->capacity = newCapacity; ++ ++ byteCount = buffer->capacity - buffer->size; ++ } ++ ++ ret = read(fd, buffer->data + buffer->size, byteCount); ++ if (ret > 0) ++ buffer->size += ret; ++ else if (ret < 0 && (errno == EAGAIN || errno == EWOULDBLOCK)) ++ ret = 0; ++ } while (ret > 0); ++ ++ return ret; ++} ++ ++// ----------------------------------------------------------------------------- ++ ++static inline int execCommand (char *argv[], Buffer *buffer) { ++ int pipefd[2]; ++ if (buffer) { ++ if (pipe(pipefd) < 0) { ++ syslog(LOG_ERR, "Failed to exec pipe: `%s`.", strerror(errno)); ++ return -errno; ++ } ++ ++ if (fcntl(pipefd[0], F_SETFL, O_NONBLOCK) < 0) { ++ syslog(LOG_ERR, "Failed to exec fcntl on pipe in: `%s`.", strerror(errno)); ++ close(pipefd[0]); ++ close(pipefd[1]); ++ return -errno; ++ } ++ } ++ + const pid_t pid = fork(); +- if (pid < 0) ++ if (pid < 0) { ++ syslog(LOG_ERR, "Failed to fork: `%s`.", strerror(errno)); ++ if (buffer) { ++ close(pipefd[0]); ++ close(pipefd[1]); ++ } + return -errno; ++ } + + // Child process. + if (pid == 0) { ++ if (buffer) { ++ close(STDOUT_FILENO); ++ dup(pipefd[1]); ++ ++ close(pipefd[0]); ++ close(pipefd[1]); ++ } ++ + if (execvp(*argv, argv) < 0) + syslog(LOG_ERR, "Failed to exec `%s` command.", *argv); + exit(EXIT_FAILURE); + } + + // Main process. ++ int ret = 0; ++ if (buffer) { ++ close(pipefd[1]); ++ ++ do { ++ struct pollfd fds = { pipefd[0], POLLIN | POLLHUP, 0 }; ++ const int res = poll(&fds, 1, 0); ++ if (res < 0) { ++ if (errno == EAGAIN) ++ continue; ++ syslog(LOG_ERR, "Failed to poll from command: `%s`.", strerror(errno)); ++ ret = -errno; ++ } else if (res > 0) { ++ if (fds.revents & POLLIN) ++ ret = readAll(pipefd[0], buffer); ++ if (fds.revents & POLLHUP) ++ break; // Input has been closed. ++ } ++ } while (ret >= 0); ++ ++ close(pipefd[0]); ++ } ++ + int status; + if (waitpid(pid, &status, 0) < 0) { + syslog(LOG_ERR, "Failed to wait command: `%s`.", *argv); +@@ -163,7 +262,7 @@ static inline int execCommand (char *argv[]) { + } else if (WIFSIGNALED(status)) + syslog(LOG_ERR, "`%s` terminated by signal %d.", *argv, WTERMSIG(status)); + +- return 0; ++ return ret; + } + + // ----------------------------------------------------------------------------- +@@ -188,12 +287,7 @@ static inline int addInotifyWatch (int inotifyFd, const char *filepath, uint32_t + + // ----------------------------------------------------------------------------- + +-static inline int updateLinstorServices () { +- int error; +- const int isMaster = isMasterHost(&error); +- if (error) +- return error; +- ++static inline int updateLinstorController (int isMaster) { + syslog(LOG_INFO, "%s linstor-controller...", isMaster ? "Enabling" : "Disabling"); + char *argv[] = { + "systemctl", +@@ -202,7 +296,7 @@ static inline int updateLinstorServices () { + "linstor-controller", + NULL + }; +- return execCommand(argv); ++ return execCommand(argv, NULL); + } + + static inline int updateLinstorNode (State *state) { +@@ -219,14 +313,53 @@ static inline int updateLinstorNode (State *state) { + + // ----------------------------------------------------------------------------- + ++#define UUID_PARAM "uuid=" ++#define UUID_PARAM_LEN (sizeof(UUID_PARAM) - 1) ++#define UUID_LENGTH 36 ++ ++static inline void scanLinstorSr (const char *uuid) { ++ char uuidBuf[UUID_LENGTH + UUID_PARAM_LEN + 1] = UUID_PARAM; ++ strncpy(uuidBuf + UUID_PARAM_LEN, uuid, UUID_LENGTH); ++ uuidBuf[UUID_LENGTH + UUID_PARAM_LEN] = '\0'; ++ execCommand((char *[]){ "xe", "sr-scan", uuidBuf, NULL }, NULL); ++} ++ ++// Called to update the physical/virtual size used by LINSTOR SRs in XAPI DB. ++static inline int scanLinstorSrs () { ++ Buffer srs = {}; ++ const int ret = execCommand((char *[]){ "xe", "sr-list", "type=linstor", "--minimal", NULL }, &srs); ++ if (ret) { ++ free(srs.data); ++ return ret; ++ } ++ ++ const char *end = srs.data + srs.size; ++ char *pos = srs.data; ++ for (char *off; (off = memchr(pos, ',', end - pos)); pos = off + 1) ++ if (off - pos == UUID_LENGTH) ++ scanLinstorSr(pos); ++ ++ if (end - pos >= UUID_LENGTH) { ++ for (--end; end - pos >= UUID_LENGTH && isspace(*end); --end) {} ++ if (isalnum(*end)) ++ scanLinstorSr(pos); ++ } ++ ++ free(srs.data); ++ ++ return 0; ++} ++ ++// ----------------------------------------------------------------------------- ++ + #define PROCESS_MODE_DEFAULT 0 + #define PROCESS_MODE_WAIT_FILE_CREATION 1 + + static inline int waitForPoolConfCreation (State *state, int *wdFile); + +-static inline int processPoolConfEvents (int inotifyFd, int wd, char **buffer, size_t *bufferSize, int mode, int *process) { ++static inline int processPoolConfEvents (State *state, int wd, char **buffer, size_t *bufferSize, int mode, int *process) { + size_t size = 0; +- if (ioctl(inotifyFd, FIONREAD, (char *)&size) == -1) { ++ if (ioctl(state->inotifyFd, FIONREAD, (char *)&size) == -1) { + syslog(LOG_ERR, "Failed to get buffer size from inotify descriptor: `%s`.", strerror(errno)); + return -errno; + } +@@ -241,7 +374,7 @@ static inline int processPoolConfEvents (int inotifyFd, int wd, char **buffer, s + *bufferSize = size; + } + +- if ((size = (size_t)read(inotifyFd, *buffer, size)) == (size_t)-1) { ++ if ((size = (size_t)read(state->inotifyFd, *buffer, size)) == (size_t)-1) { + syslog(LOG_ERR, "Failed to read buffer from inotify descriptor: `%s`.", strerror(errno)); + return -errno; + } +@@ -280,10 +413,10 @@ static inline int processPoolConfEvents (int inotifyFd, int wd, char **buffer, s + syslog(LOG_INFO, "Updating linstor services... (Inotify mask=%" PRIu32 ")", mask); + if (mask & (IN_DELETE_SELF | IN_MOVE_SELF | IN_UNMOUNT)) { + syslog(LOG_ERR, "Watched `" POOL_CONF_ABS_FILE "` file has been removed!"); +- inotify_rm_watch(inotifyFd, wd); // Do not forget to remove watch to avoid leaks. ++ inotify_rm_watch(state->inotifyFd, wd); // Do not forget to remove watch to avoid leaks. + return -EIO; + } +- ret = updateLinstorServices(); ++ ret = updateLinstorController(state->isMaster); + } else { + if (mask & (IN_CREATE | IN_MOVED_TO)) { + syslog(LOG_ERR, "Watched `" POOL_CONF_ABS_FILE "` file has been recreated!"); +@@ -303,16 +436,24 @@ static inline int waitAndProcessEvents (State *state, int wd, int mode) { + + struct timespec previousTime = getCurrentTime(); + do { +- struct timespec currentTime = getCurrentTime(); ++ const struct timespec currentTime = getCurrentTime(); + const int64_t elapsedTime = convertToMilliseconds(getTimeDiff(¤tTime, &previousTime)); + + int timeout; +- if (elapsedTime >= POLL_TIMEOUT) { ++ if (elapsedTime >= UPDATE_LINSTOR_NODE_TIMEOUT) { + updateLinstorNode(state); +- timeout = POLL_TIMEOUT; ++ timeout = UPDATE_LINSTOR_NODE_TIMEOUT; + previousTime = getCurrentTime(); + } else { +- timeout = POLL_TIMEOUT - elapsedTime; ++ timeout = UPDATE_LINSTOR_NODE_TIMEOUT - elapsedTime; ++ } ++ ++ const int64_t elapsedScanTime = convertToMilliseconds(getTimeDiff(¤tTime, &state->lastScanTime)); ++ if (elapsedScanTime >= SR_SCAN_TIMEOUT) { ++ state->isMaster = isMasterHost(&ret); ++ if (state->isMaster) ++ scanLinstorSrs(); ++ state->lastScanTime = getCurrentTime(); + } + + struct pollfd fds = { state->inotifyFd, POLLIN, 0 }; +@@ -323,7 +464,9 @@ static inline int waitAndProcessEvents (State *state, int wd, int mode) { + syslog(LOG_ERR, "Failed to poll from inotify descriptor: `%s`.", strerror(errno)); + ret = -errno; + } else if (res > 0) { +- ret = processPoolConfEvents(state->inotifyFd, wd, &buffer, &bufferSize, mode, &process); ++ state->isMaster = isMasterHost(&ret); ++ if (!ret) ++ ret = processPoolConfEvents(state, wd, &buffer, &bufferSize, mode, &process); + } + } while (ret >= 0 && process); + +@@ -350,7 +493,10 @@ static inline int waitForPoolConfCreation (State *state, int *wdFile) { + do { + do { + // Update LINSTOR services... +- ret = updateLinstorServices(); ++ int ret; ++ state->isMaster = isMasterHost(&ret); ++ if (!ret) ++ ret = updateLinstorController(state->isMaster); + + // Ok we can't read the pool configuration file. + // Maybe the file doesn't exist. Waiting its creation... +@@ -378,7 +524,9 @@ int main (int argc, char *argv[]) { + setlogmask(LOG_UPTO(LOG_INFO)); + + State state = { +- .inotifyFd = -1 ++ .inotifyFd = -1, ++ .lastScanTime = getCurrentTime(), ++ .isMaster = 0 + }; + + const int inotifyFd = createInotifyInstance(); +-- +2.45.2 + diff --git a/SOURCES/0032-fix-LinstorSR-call-correctly-method-in-_locked_load-.patch b/SOURCES/0032-fix-LinstorSR-call-correctly-method-in-_locked_load-.patch new file mode 100644 index 00000000..0cce3f0f --- /dev/null +++ b/SOURCES/0032-fix-LinstorSR-call-correctly-method-in-_locked_load-.patch @@ -0,0 +1,44 @@ +From 6cdc1b2a0b9f5a8ec880800fc4c8ca5244987733 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Fri, 15 Jan 2021 17:01:05 +0100 +Subject: [PATCH 032/175] fix(LinstorSR): call correctly method in _locked_load + when vdi_attach_from_config is executed + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 19 ++++++------------- + 1 file changed, 6 insertions(+), 13 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 16cb0d6..2df2d68 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -347,19 +347,12 @@ class LinstorSR(SR.SR): + self._master_uri, self._group_name, logger=util.SMlog + ) + +- try: +- self._linstor = LinstorVolumeManager( +- self._master_uri, +- self._group_name, +- logger=util.SMlog +- ) +- return +- except Exception as e: +- util.SMlog( +- 'Ignore exception. Failed to build LINSTOR ' +- 'instance without session: {}'.format(e) +- ) +- return ++ self._linstor = LinstorVolumeManager( ++ self._master_uri, ++ self._group_name, ++ logger=util.SMlog ++ ) ++ return method(self, *args, **kwargs) + + self._master_uri = 'linstor://{}'.format( + util.get_master_rec(self.session)['address'] +-- +2.45.2 + diff --git a/SOURCES/0033-feat-LinstorSR-integrate-minidrbdcluster-daemon.patch b/SOURCES/0033-feat-LinstorSR-integrate-minidrbdcluster-daemon.patch new file mode 100644 index 00000000..9a175f65 --- /dev/null +++ b/SOURCES/0033-feat-LinstorSR-integrate-minidrbdcluster-daemon.patch @@ -0,0 +1,2069 @@ +From 88914c19b02c38e05fe457e45f1d41431a0bde8b Mon Sep 17 00:00:00 2001 +From: Wescoeur +Date: Wed, 20 Jan 2021 18:04:26 +0100 +Subject: [PATCH 033/175] feat(LinstorSR): integrate minidrbdcluster daemon + +Now, we can: +- Start a controller on any node +- Share the LINSTOR volume list using a specific volume "xcp-persistent-database" +- Use the HA with "xcp-persistent-ha-statefile" and "xcp-persistent-redo-log" volumes +- Create the nodes automatically during SR creation + +Signed-off-by: Ronan Abhamon +--- + Makefile | 14 + + drivers/LinstorSR.py | 269 ++++--- + drivers/cleanup.py | 12 +- + drivers/linstor-manager | 111 ++- + drivers/linstorjournaler.py | 40 +- + drivers/linstorvolumemanager.py | 691 +++++++++++++++--- + drivers/tapdisk-pause | 8 +- + drivers/util.py | 21 - + etc/minidrbdcluster.ini | 14 + + .../linstor-satellite.service.d/override.conf | 5 + + etc/systemd/system/var-lib-linstor.mount | 6 + + linstor/linstor-monitord.c | 15 - + scripts/minidrbdcluster | 171 +++++ + systemd/minidrbdcluster.service | 18 + + 14 files changed, 1124 insertions(+), 271 deletions(-) + create mode 100644 etc/minidrbdcluster.ini + create mode 100644 etc/systemd/system/linstor-satellite.service.d/override.conf + create mode 100644 etc/systemd/system/var-lib-linstor.mount + create mode 100755 scripts/minidrbdcluster + create mode 100644 systemd/minidrbdcluster.service + +diff --git a/Makefile b/Makefile +index 284b9a3..43dd569 100755 +--- a/Makefile ++++ b/Makefile +@@ -92,6 +92,7 @@ PLUGIN_SCRIPT_DEST := /etc/xapi.d/plugins/ + LIBEXEC := /opt/xensource/libexec/ + UDEV_RULES_DIR := /etc/udev/rules.d/ + UDEV_SCRIPTS_DIR := /etc/udev/scripts/ ++SYSTEMD_CONF_DIR := /etc/systemd/system/ + SYSTEMD_SERVICE_DIR := /usr/lib/systemd/system/ + INIT_DIR := /etc/rc.d/init.d/ + MPATH_CONF_DIR := /etc/multipath.xenserver/ +@@ -99,6 +100,7 @@ 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/ ++MINI_DRBD_CLUSTER_CONF_DIR := /etc/ + + SM_STAGING := $(DESTDIR) + SM_STAMP := $(MY_OBJ_DIR)/.staging_stamp +@@ -147,11 +149,14 @@ install: precheck + mkdir -p $(SM_STAGING)$(UDEV_RULES_DIR) + mkdir -p $(SM_STAGING)$(UDEV_SCRIPTS_DIR) + mkdir -p $(SM_STAGING)$(INIT_DIR) ++ mkdir -p $(SM_STAGING)$(SYSTEMD_CONF_DIR) ++ mkdir -p $(SM_STAGING)$(SYSTEMD_CONF_DIR)/linstor-satellite.service.d + 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)$(MINI_DRBD_CLUSTER_CONF_DIR) + mkdir -p $(SM_STAGING)$(DEBUG_DEST) + mkdir -p $(SM_STAGING)$(BIN_DEST) + mkdir -p $(SM_STAGING)$(MASTER_SCRIPT_DEST) +@@ -175,6 +180,12 @@ install: precheck + $(SM_STAGING)/$(SM_DEST) + install -m 644 etc/logrotate.d/$(SMLOG_CONF) \ + $(SM_STAGING)/$(LOGROTATE_DIR) ++ install -m 644 etc/systemd/system/linstor-satellite.service.d/override.conf \ ++ $(SM_STAGING)/$(SYSTEMD_CONF_DIR)/linstor-satellite.service.d/ ++ install -m 644 etc/systemd/system/var-lib-linstor.mount \ ++ $(SM_STAGING)/$(SYSTEMD_CONF_DIR) ++ install -m 644 etc/minidrbdcluster.ini \ ++ $(SM_STAGING)/$(MINI_DRBD_CLUSTER_CONF_DIR) + install -m 644 etc/make-dummy-sr.service \ + $(SM_STAGING)/$(SYSTEMD_SERVICE_DIR) + install -m 644 systemd/xs-sm.service \ +@@ -193,6 +204,8 @@ install: precheck + $(SM_STAGING)/$(SYSTEMD_SERVICE_DIR) + install -m 644 systemd/linstor-monitor.service \ + $(SM_STAGING)/$(SYSTEMD_SERVICE_DIR) ++ install -m 644 systemd/minidrbdcluster.service \ ++ $(SM_STAGING)/$(SYSTEMD_SERVICE_DIR) + for i in $(UDEV_RULES); do \ + install -m 644 udev/$$i.rules \ + $(SM_STAGING)$(UDEV_RULES_DIR); done +@@ -242,6 +255,7 @@ install: precheck + install -m 755 scripts/xe-getlunidentifier $(SM_STAGING)$(BIN_DEST) + install -m 755 scripts/make-dummy-sr $(SM_STAGING)$(LIBEXEC) + install -m 755 scripts/storage-init $(SM_STAGING)$(LIBEXEC) ++ install -m 755 scripts/minidrbdcluster $(SM_STAGING)$(LIBEXEC) + + .PHONY: clean + clean: +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 2df2d68..9650d71 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -19,8 +19,11 @@ from constants import CBTLOG_TAG + try: + from linstorjournaler import LinstorJournaler + from linstorvhdutil import LinstorVhdUtil +- from linstorvolumemanager \ +- import LinstorVolumeManager, LinstorVolumeManagerError ++ from linstorvolumemanager import get_controller_uri ++ from linstorvolumemanager import get_controller_node_name ++ from linstorvolumemanager import LinstorVolumeManager ++ from linstorvolumemanager import LinstorVolumeManagerError ++ + LINSTOR_AVAILABLE = True + except ImportError: + LINSTOR_AVAILABLE = False +@@ -310,7 +313,7 @@ class LinstorSR(SR.SR): + self.lock = Lock(vhdutil.LOCK_TYPE_SR, self.uuid) + self.sr_vditype = SR.DEFAULT_TAP + +- self._hosts = self.dconf['hosts'].split(',') ++ self._hosts = list(set(self.dconf['hosts'].split(','))) + self._redundancy = int(self.dconf['redundancy'] or 1) + self._linstor = None # Ensure that LINSTOR attribute exists. + self._journaler = None +@@ -320,7 +323,6 @@ class LinstorSR(SR.SR): + self._is_master = True + self._group_name = self.dconf['group-name'] + +- self._master_uri = None + self._vdi_shared_time = 0 + + self._initialized = False +@@ -340,24 +342,18 @@ class LinstorSR(SR.SR): + if self.srcmd.cmd == 'vdi_attach_from_config': + # We must have a valid LINSTOR instance here without using + # the XAPI. +- self._master_uri = 'linstor://{}'.format( +- util.get_master_address() +- ) ++ controller_uri = get_controller_uri() + self._journaler = LinstorJournaler( +- self._master_uri, self._group_name, logger=util.SMlog ++ controller_uri, self._group_name, logger=util.SMlog + ) + + self._linstor = LinstorVolumeManager( +- self._master_uri, ++ controller_uri, + self._group_name, + logger=util.SMlog + ) + return method(self, *args, **kwargs) + +- self._master_uri = 'linstor://{}'.format( +- util.get_master_rec(self.session)['address'] +- ) +- + if not self._is_master: + if self.cmd in [ + 'sr_create', 'sr_delete', 'sr_update', 'sr_probe', +@@ -376,43 +372,31 @@ class LinstorSR(SR.SR): + self._shared_lock_vdi(self.srcmd.params['vdi_uuid']) + self._vdi_shared_time = time.time() + +- self._journaler = LinstorJournaler( +- self._master_uri, self._group_name, logger=util.SMlog +- ) ++ if self.srcmd.cmd != 'sr_create' and self.srcmd.cmd != 'sr_detach': ++ try: ++ controller_uri = get_controller_uri() + +- # Ensure ports are opened and LINSTOR controller/satellite +- # are activated. +- if self.srcmd.cmd == 'sr_create': +- # TODO: Disable if necessary +- self._enable_linstor_on_all_hosts(status=True) ++ self._journaler = LinstorJournaler( ++ controller_uri, self._group_name, logger=util.SMlog ++ ) + +- try: +- # Try to open SR if exists. +- # We can repair only if we are on the master AND if +- # we are trying to execute an exclusive operation. +- # Otherwise we could try to delete a VDI being created or +- # during a snapshot. An exclusive op is the guarantee that the +- # SR is locked. +- self._linstor = LinstorVolumeManager( +- self._master_uri, +- self._group_name, +- repair=( +- self._is_master and +- self.srcmd.cmd in self.ops_exclusive +- ), +- logger=util.SMlog +- ) +- self._vhdutil = LinstorVhdUtil(self.session, self._linstor) +- except Exception as e: +- if self.srcmd.cmd == 'sr_create' or \ +- self.srcmd.cmd == 'sr_detach': +- # Ignore exception in this specific case: sr_create. +- # At this moment the LinstorVolumeManager cannot be +- # instantiated. Concerning the sr_detach command, we must +- # ignore LINSTOR exceptions (if the volume group doesn't +- # exist for example after a bad user action). +- pass +- else: ++ # Try to open SR if exists. ++ # We can repair only if we are on the master AND if ++ # we are trying to execute an exclusive operation. ++ # Otherwise we could try to delete a VDI being created or ++ # during a snapshot. An exclusive op is the guarantee that ++ # the SR is locked. ++ self._linstor = LinstorVolumeManager( ++ controller_uri, ++ self._group_name, ++ repair=( ++ self._is_master and ++ self.srcmd.cmd in self.ops_exclusive ++ ), ++ logger=util.SMlog ++ ) ++ self._vhdutil = LinstorVhdUtil(self.session, self._linstor) ++ except Exception as e: + raise xs_errors.XenError('SRUnavailable', opterr=str(e)) + + if self._linstor: +@@ -507,13 +491,44 @@ class LinstorSR(SR.SR): + opterr='group name must be unique' + ) + ++ if srs: ++ raise xs_errors.XenError( ++ 'LinstorSRCreate', ++ opterr='LINSTOR SR must be unique in a pool' ++ ) ++ ++ online_hosts = util.get_online_hosts(self.session) ++ if len(online_hosts) < len(self._hosts): ++ raise xs_errors.XenError( ++ 'LinstorSRCreate', ++ opterr='Not enough online hosts' ++ ) ++ ++ ips = {} ++ for host in online_hosts: ++ record = self.session.xenapi.host.get_record(host) ++ hostname = record['hostname'] ++ if hostname in self._hosts: ++ ips[hostname] = record['address'] ++ ++ if len(ips) != len(self._hosts): ++ raise xs_errors.XenError( ++ 'LinstorSRCreate', ++ opterr='Not enough online hosts' ++ ) ++ ++ # Ensure ports are opened and LINSTOR satellites ++ # are activated. In the same time the minidrbdcluster instances ++ # must be stopped. ++ self._prepare_sr_on_all_hosts(enabled=True) ++ + # Create SR. + # Throw if the SR already exists. + try: + self._linstor = LinstorVolumeManager.create_sr( +- self._master_uri, + self._group_name, + self._hosts, ++ ips, + self._redundancy, + thin_provisioning=self._provisioning == 'thin', + logger=util.SMlog +@@ -523,30 +538,79 @@ class LinstorSR(SR.SR): + util.SMlog('Failed to create LINSTOR SR: {}'.format(e)) + raise xs_errors.XenError('LinstorSRCreate', opterr=str(e)) + ++ try: ++ util.SMlog( ++ "Finishing SR creation, enable minidrbdcluster on all hosts..." ++ ) ++ self._update_minidrbdcluster_on_all_hosts(enabled=True) ++ except Exception as e: ++ try: ++ self._linstor.destroy() ++ except Exception as e2: ++ util.SMlog( ++ 'Failed to destroy LINSTOR SR after creation fail: {}' ++ .format(e2) ++ ) ++ raise e ++ + @_locked_load + def delete(self, uuid): + util.SMlog('LinstorSR.delete for {}'.format(self.uuid)) + cleanup.gc_force(self.session, self.uuid) + +- if self.vdis: ++ if self.vdis or self._linstor._volumes: + raise xs_errors.XenError('SRNotEmpty') + +- try: +- # TODO: Use specific exceptions. If the LINSTOR group doesn't +- # exist, we can remove it without problem. ++ node_name = get_controller_node_name() ++ if not node_name: ++ raise xs_errors.XenError( ++ 'LinstorSRDelete', ++ opterr='Cannot get controller node name' ++ ) + +- # TODO: Maybe remove all volumes unused by the SMAPI. +- # We must ensure it's a safe idea... ++ host = None ++ if node_name == 'localhost': ++ host = util.get_this_host_ref(self.session) ++ else: ++ for slave in util.get_all_slaves(self.session): ++ r_name = self.session.xenapi.host.get_record(slave)['hostname'] ++ if r_name == node_name: ++ host = slave ++ break + +- self._linstor.destroy() +- Lock.cleanupAll(self.uuid) ++ if not host: ++ raise xs_errors.XenError( ++ 'LinstorSRDelete', ++ opterr='Failed to find host with hostname: {}'.format( ++ node_name ++ ) ++ ) ++ ++ try: ++ self._update_minidrbdcluster_on_all_hosts(enabled=False) ++ ++ args = { ++ 'groupName': self._group_name, ++ } ++ self._exec_manager_command( ++ host, 'destroy', args, 'LinstorSRDelete' ++ ) + except Exception as e: ++ try: ++ self._update_minidrbdcluster_on_all_hosts(enabled=True) ++ except Exception as e2: ++ util.SMlog( ++ 'Failed to restart minidrbdcluster after destroy fail: {}' ++ .format(e2) ++ ) + util.SMlog('Failed to delete LINSTOR SR: {}'.format(e)) + raise xs_errors.XenError( + 'LinstorSRDelete', + opterr=str(e) + ) + ++ Lock.cleanupAll(self.uuid) ++ + @_locked_load + def update(self, uuid): + util.SMlog('LinstorSR.update for {}'.format(self.uuid)) +@@ -626,10 +690,9 @@ class LinstorSR(SR.SR): + # -------------------------------------------------------------------------- + + def _shared_lock_vdi(self, vdi_uuid, locked=True): +- pools = self.session.xenapi.pool.get_all() +- master = self.session.xenapi.pool.get_master(pools[0]) ++ master = util.get_master_ref(self.session) + +- method = 'lockVdi' ++ command = 'lockVdi' + args = { + 'groupName': self._group_name, + 'srUuid': self.uuid, +@@ -654,48 +717,56 @@ class LinstorSR(SR.SR): + ) + return + +- ret = self.session.xenapi.host.call_plugin( +- master, self.MANAGER_PLUGIN, method, args +- ) +- util.SMlog( +- 'call-plugin ({} with {}) returned: {}' +- .format(method, args, ret) +- ) +- if ret == 'False': +- raise xs_errors.XenError( +- 'VDIUnavailable', +- opterr='Plugin {} failed'.format(self.MANAGER_PLUGIN) +- ) ++ self._exec_manager_command(master, command, args, 'VDIUnavailable') + + # -------------------------------------------------------------------------- + # Network. + # -------------------------------------------------------------------------- + +- def _enable_linstor(self, host, status): +- method = 'enable' +- args = {'enabled': str(bool(status))} +- ++ def _exec_manager_command(self, host, command, args, error): + ret = self.session.xenapi.host.call_plugin( +- host, self.MANAGER_PLUGIN, method, args ++ host, self.MANAGER_PLUGIN, command, args + ) + util.SMlog( +- 'call-plugin ({} with {}) returned: {}'.format(method, args, ret) ++ 'call-plugin ({}:{} with {}) returned: {}'.format( ++ self.MANAGER_PLUGIN, command, args, ret ++ ) + ) + if ret == 'False': + raise xs_errors.XenError( +- 'SRUnavailable', ++ error, + opterr='Plugin {} failed'.format(self.MANAGER_PLUGIN) + ) + +- def _enable_linstor_on_master(self, status): +- pools = self.session.xenapi.pool.get_all() +- master = self.session.xenapi.pool.get_master(pools[0]) +- self._enable_linstor(master, status) ++ def _prepare_sr(self, host, enabled): ++ self._exec_manager_command( ++ host, ++ 'prepareSr' if enabled else 'releaseSr', ++ {}, ++ 'SRUnavailable' ++ ) ++ ++ def _prepare_sr_on_all_hosts(self, enabled): ++ master = util.get_master_ref(self.session) ++ self._prepare_sr(master, enabled) + +- def _enable_linstor_on_all_hosts(self, status): +- self._enable_linstor_on_master(status) + for slave in util.get_all_slaves(self.session): +- self._enable_linstor(slave, status) ++ self._prepare_sr(slave, enabled) ++ ++ def _update_minidrbdcluster(self, host, enabled): ++ self._exec_manager_command( ++ host, ++ 'updateMinidrbdcluster', ++ {'enabled': str(enabled)}, ++ 'SRUnavailable' ++ ) ++ ++ def _update_minidrbdcluster_on_all_hosts(self, enabled): ++ master = util.get_master_ref(self.session) ++ self._update_minidrbdcluster(master, enabled) ++ ++ for slave in util.get_all_slaves(self.session): ++ self._update_minidrbdcluster(slave, enabled) + + # -------------------------------------------------------------------------- + # Metadata. +@@ -1384,8 +1455,15 @@ class LinstorVDI(VDI.VDI): + # 4. Create! + failed = False + try: ++ volume_name = None ++ if self.ty == 'ha_statefile': ++ volume_name = 'xcp-persistent-ha-statefile' ++ elif self.ty == 'redo_log': ++ volume_name = 'xcp-persistent-redo-log' ++ + self._linstor.create_volume( +- self.uuid, volume_size, persistent=False ++ self.uuid, volume_size, persistent=False, ++ volume_name=volume_name + ) + volume_info = self._linstor.get_volume_info(self.uuid) + +@@ -1822,25 +1900,14 @@ class LinstorVDI(VDI.VDI): + else: + fn = 'attach' if attach else 'detach' + +- # We assume the first pool is always the one currently in use. +- pools = self.session.xenapi.pool.get_all() +- master = self.session.xenapi.pool.get_master(pools[0]) ++ master = util.get_master_ref(self.session) ++ + args = { + 'groupName': self.sr._group_name, + 'srUuid': self.sr.uuid, + 'vdiUuid': self.uuid + } +- ret = self.session.xenapi.host.call_plugin( +- master, self.sr.MANAGER_PLUGIN, fn, args +- ) +- util.SMlog( +- 'call-plugin ({} with {}) returned: {}'.format(fn, args, ret) +- ) +- if ret == 'False': +- raise xs_errors.XenError( +- 'VDIUnavailable', +- opterr='Plugin {} failed'.format(self.sr.MANAGER_PLUGIN) +- ) ++ self.sr._exec_manager_command(master, fn, args, 'VDIUnavailable') + + # Reload size attrs after inflate or deflate! + self._load_this() +diff --git a/drivers/cleanup.py b/drivers/cleanup.py +index 895f36e..9e3a5b0 100755 +--- a/drivers/cleanup.py ++++ b/drivers/cleanup.py +@@ -52,8 +52,10 @@ from srmetadata import LVMMetadataHandler, VDI_TYPE_TAG + try: + from linstorjournaler import LinstorJournaler + from linstorvhdutil import LinstorVhdUtil +- from linstorvolumemanager \ +- import LinstorVolumeManager, LinstorVolumeManagerError ++ from linstorvolumemanager import get_controller_uri ++ from linstorvolumemanager import LinstorVolumeManager ++ from linstorvolumemanager import LinstorVolumeManagerError ++ + LINSTOR_AVAILABLE = True + except ImportError: + LINSTOR_AVAILABLE = False +@@ -2873,7 +2875,6 @@ class LinstorSR(SR): + ) + + SR.__init__(self, uuid, xapi, createLock, force) +- self._master_uri = 'linstor://localhost' + self.path = LinstorVolumeManager.DEV_ROOT_PATH + self._reloadLinstor() + +@@ -2918,12 +2919,13 @@ class LinstorSR(SR): + dconf = session.xenapi.PBD.get_device_config(pbd) + group_name = dconf['group-name'] + ++ controller_uri = get_controller_uri() + self.journaler = LinstorJournaler( +- self._master_uri, group_name, logger=util.SMlog ++ controller_uri, group_name, logger=util.SMlog + ) + + self._linstor = LinstorVolumeManager( +- self._master_uri, ++ controller_uri, + group_name, + repair=True, + logger=util.SMlog +diff --git a/drivers/linstor-manager b/drivers/linstor-manager +index e7e58fd..f82b73f 100755 +--- a/drivers/linstor-manager ++++ b/drivers/linstor-manager +@@ -22,7 +22,7 @@ import XenAPIPlugin + + sys.path.append('/opt/xensource/sm/') + from linstorjournaler import LinstorJournaler +-from linstorvolumemanager import LinstorVolumeManager ++from linstorvolumemanager import get_controller_uri, LinstorVolumeManager + from lock import Lock + import json + import LinstorSR +@@ -34,10 +34,6 @@ FIREWALL_PORT_SCRIPT = '/etc/xapi.d/plugins/firewall-port' + LINSTOR_PORTS = [3366, 3370, 3376, 3377, '7000:8000'] + + +-def get_linstor_uri(session): +- return 'linstor://{}'.format(util.get_master_rec(session)['address']) +- +- + def update_port(port, open): + fn = 'open' if open else 'close' + args = ( +@@ -55,23 +51,72 @@ def update_all_ports(open): + update_port(port, open) + + +-def update_service(start): ++def enable_and_start_service(name, start): + fn = 'enable' if start else 'disable' +- args = ('systemctl', fn, '--now', 'linstor-satellite') ++ args = ('systemctl', fn, '--now', name) + (ret, out, err) = util.doexec(args) + if ret == 0: + return +- raise Exception('Failed to {} satellite: {} {}'.format(fn, out, err)) ++ raise Exception('Failed to {} {}: {} {}'.format(fn, name, out, err)) ++ ++ ++def restart_service(name): ++ args = ('systemctl', 'restart', name) ++ (ret, out, err) = util.doexec(args) ++ if ret == 0: ++ return ++ raise Exception('Failed to restart {}: {} {}'.format(name, out, err)) ++ ++ ++def stop_service(name): ++ args = ('systemctl', 'stop', name) ++ (ret, out, err) = util.doexec(args) ++ if ret == 0: ++ return ++ raise Exception('Failed to stop {}: {} {}'.format(name, out, err)) ++ ++ ++def update_linstor_satellite_service(start): ++ enable_and_start_service('linstor-satellite', start) ++ ++ ++def update_minidrbdcluster_service(start): ++ enable_and_start_service('minidrbdcluster', start) ++ ++ ++def prepare_sr(session, args): ++ try: ++ update_all_ports(open=True) ++ # We don't want to enable and start minidrbdcluster daemon during ++ # SR creation. ++ update_minidrbdcluster_service(start=False) ++ update_linstor_satellite_service(start=True) ++ return str(True) ++ except Exception as e: ++ util.SMlog('linstor-manager:prepare_sr error: {}'.format(e)) ++ return str(False) + + +-def enable(session, args): ++def release_sr(session, args): ++ try: ++ update_linstor_satellite_service(start=False) ++ update_minidrbdcluster_service(start=False) ++ update_all_ports(open=False) ++ return str(True) ++ except Exception as e: ++ util.SMlog('linstor-manager:release_sr error: {}'.format(e)) ++ return str(False) ++ ++ ++def update_minidrbdcluster(session, args): + try: + enabled = distutils.util.strtobool(args['enabled']) +- update_all_ports(open=enabled) +- update_service(start=enabled) ++ update_minidrbdcluster_service(start=enabled) + return str(True) + except Exception as e: +- util.SMlog('linstor-manager:disable error: {}'.format(e)) ++ util.SMlog( ++ 'linstor-manager:update_minidrbdcluster error: {}'.format(e) ++ ) + return str(False) + + +@@ -81,12 +126,12 @@ def attach(session, args): + vdi_uuid = args['vdiUuid'] + group_name = args['groupName'] + +- linstor_uri = get_linstor_uri(session) ++ controller_uri = get_controller_uri() + journaler = LinstorJournaler( +- linstor_uri, group_name, logger=util.SMlog ++ controller_uri, group_name, logger=util.SMlog + ) + linstor = LinstorVolumeManager( +- linstor_uri, ++ controller_uri, + group_name, + logger=util.SMlog + ) +@@ -104,7 +149,7 @@ def detach(session, args): + group_name = args['groupName'] + + linstor = LinstorVolumeManager( +- get_linstor_uri(session), ++ get_controller_uri(), + group_name, + logger=util.SMlog + ) +@@ -115,6 +160,29 @@ def detach(session, args): + return str(False) + + ++def destroy(session, args): ++ try: ++ group_name = args['groupName'] ++ ++ # When destroy is called, there are no running minidrbdcluster daemons. ++ # So the controllers are stopped too, we must start an instance. ++ restart_service('var-lib-linstor.mount') ++ restart_service('linstor-controller') ++ ++ linstor = LinstorVolumeManager( ++ 'linstor://localhost', ++ group_name, ++ logger=util.SMlog ++ ) ++ linstor.destroy() ++ return str(True) ++ except Exception as e: ++ stop_service('linstor-controller') ++ stop_service('var-lib-linstor.mount') ++ util.SMlog('linstor-manager:destroy error: {}'.format(e)) ++ return str(False) ++ ++ + def check(session, args): + try: + device_path = args['devicePath'] +@@ -133,7 +201,7 @@ def get_vhd_info(session, args): + include_parent = distutils.util.strtobool(args['includeParent']) + + linstor = LinstorVolumeManager( +- get_linstor_uri(session), ++ get_controller_uri(), + group_name, + logger=util.SMlog + ) +@@ -168,7 +236,7 @@ def get_parent(session, args): + group_name = args['groupName'] + + linstor = LinstorVolumeManager( +- get_linstor_uri(session), ++ get_controller_uri(), + group_name, + logger=util.SMlog + ) +@@ -244,7 +312,7 @@ def lock_vdi(session, args): + lock.acquire() + + linstor = LinstorVolumeManager( +- get_linstor_uri(session), ++ get_controller_uri(), + group_name, + logger=util.SMlog + ) +@@ -261,9 +329,12 @@ def lock_vdi(session, args): + + if __name__ == '__main__': + XenAPIPlugin.dispatch({ +- 'enable': enable, ++ 'prepareSr': prepare_sr, ++ 'releaseSr': release_sr, ++ 'updateMinidrbdcluster': update_minidrbdcluster, + 'attach': attach, + 'detach': detach, ++ 'destroy': destroy, + 'check': check, + 'getVHDInfo': get_vhd_info, + 'hasParent': has_parent, +diff --git a/drivers/linstorjournaler.py b/drivers/linstorjournaler.py +index 7495330..285012c 100755 +--- a/drivers/linstorjournaler.py ++++ b/drivers/linstorjournaler.py +@@ -16,7 +16,7 @@ + # + + +-from linstorvolumemanager import LinstorVolumeManager ++from linstorvolumemanager import get_controller_uri, LinstorVolumeManager + import linstor + import re + import util +@@ -52,20 +52,10 @@ class LinstorJournaler: + self._namespace = '{}journal/'.format( + LinstorVolumeManager._build_sr_namespace() + ) +- +- def connect(): +- self._journal = linstor.KV( +- LinstorVolumeManager._build_group_name(group_name), +- uri=uri, +- namespace=self._namespace +- ) +- +- util.retry( +- connect, +- maxretry=60, +- exceptions=[linstor.errors.LinstorNetworkError] +- ) + self._logger = logger ++ self._journal = self._create_journal_instance( ++ uri, group_name, self._namespace ++ ) + + def create(self, type, identifier, value): + # TODO: Maybe rename to 'add' in the future (in Citrix code too). +@@ -150,6 +140,28 @@ class LinstorJournaler: + def _reset_namespace(self): + self._journal.namespace = self._namespace + ++ @classmethod ++ def _create_journal_instance(cls, uri, group_name, namespace): ++ def connect(uri): ++ if not uri: ++ uri = get_controller_uri() ++ return linstor.KV( ++ LinstorVolumeManager._build_group_name(group_name), ++ uri=uri, ++ namespace=namespace ++ ) ++ ++ try: ++ return connect(uri) ++ except linstor.errors.LinstorNetworkError: ++ pass ++ ++ return util.retry( ++ lambda: connect(None), ++ maxretry=10, ++ exceptions=[linstor.errors.LinstorNetworkError] ++ ) ++ + @staticmethod + def _get_key(type, identifier): + return '{}/{}'.format(type, identifier) +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index a6f67d8..a383e32 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -16,15 +16,30 @@ + # + + ++import glob + import json + import linstor + import os.path + import re ++import shutil + import socket + import time + import util ++import uuid + + ++# Contains the data of the "/var/lib/linstor" directory. ++DATABASE_VOLUME_NAME = 'xcp-persistent-database' ++DATABASE_SIZE = 1 << 30 # 1GB. ++DATABASE_PATH = '/var/lib/linstor' ++DATABASE_MKFS = 'mkfs.ext4' ++ ++REG_DRBDADM_PRIMARY = re.compile("([^\\s]+)\\s+role:Primary") ++REG_DRBDSETUP_IP = re.compile('[^\\s]+\\s+(.*):.*$') ++ ++ ++# ============================================================================== ++ + def round_up(value, divisor): + assert divisor + divisor = int(divisor) +@@ -37,6 +52,79 @@ def round_down(value, divisor): + return value - (value % int(divisor)) + + ++# ============================================================================== ++ ++def get_remote_host_ip(node_name): ++ (ret, stdout, stderr) = util.doexec([ ++ 'drbdsetup', 'show', DATABASE_VOLUME_NAME, '--json' ++ ]) ++ if ret != 0: ++ return ++ ++ try: ++ conf = json.loads(stdout) ++ if not conf: ++ return ++ ++ for connection in conf[0]['connections']: ++ if connection['net']['_name'] == node_name: ++ value = connection['path']['_remote_host'] ++ res = REG_DRBDSETUP_IP.match(value) ++ if res: ++ return res.groups()[0] ++ break ++ except Exception: ++ pass ++ ++ ++def _get_controller_uri(): ++ (ret, stdout, stderr) = util.doexec([ ++ 'drbdadm', 'status', DATABASE_VOLUME_NAME ++ ]) ++ if ret != 0: ++ return ++ ++ if stdout.startswith('{} role:Primary'.format(DATABASE_VOLUME_NAME)): ++ return 'linstor://localhost' ++ ++ res = REG_DRBDADM_PRIMARY.search(stdout) ++ if res: ++ node_name = res.groups()[0] ++ ip = get_remote_host_ip(node_name) ++ if ip: ++ return 'linstor://' + ip ++ ++ ++def get_controller_uri(): ++ retries = 0 ++ while True: ++ uri = _get_controller_uri() ++ if uri: ++ return uri ++ ++ retries += 1 ++ if retries >= 10: ++ break ++ time.sleep(1) ++ ++ ++def get_controller_node_name(): ++ (ret, stdout, stderr) = util.doexec([ ++ 'drbdadm', 'status', DATABASE_VOLUME_NAME ++ ]) ++ if ret != 0: ++ return ++ ++ if stdout.startswith('{} role:Primary'.format(DATABASE_VOLUME_NAME)): ++ return 'localhost' ++ ++ res = REG_DRBDADM_PRIMARY.search(stdout) ++ if res: ++ return res.groups()[0] ++ ++ ++# ============================================================================== ++ + class LinstorVolumeManagerError(Exception): + ERR_GENERIC = 0, + ERR_VOLUME_EXISTS = 1, +@@ -50,6 +138,7 @@ class LinstorVolumeManagerError(Exception): + def code(self): + return self._code + ++ + # ============================================================================== + + # Note: +@@ -152,7 +241,7 @@ class LinstorVolumeManager(object): + self, uri, group_name, repair=False, logger=default_logger.__func__ + ): + """ +- Create a new LinstorApi object. ++ Create a new LinstorVolumeManager object. + :param str uri: URI to communicate with the LINSTOR controller. + :param str group_name: The SR goup name to use. + :param bool repair: If true we try to remove bad volumes due to a crash +@@ -160,7 +249,6 @@ class LinstorVolumeManager(object): + :param function logger: Function to log messages. + """ + +- self._uri = uri + self._linstor = self._create_linstor_instance(uri) + self._base_group_name = group_name + +@@ -266,7 +354,7 @@ class LinstorVolumeManager(object): + ) + if size is None or current_size < size: + size = current_size +- return size * 1024 ++ return (size or 0) * 1024 + + @property + def total_volume_size(self): +@@ -379,19 +467,24 @@ class LinstorVolumeManager(object): + """ + return volume_uuid in self._volumes + +- def create_volume(self, volume_uuid, size, persistent=True): ++ def create_volume( ++ self, volume_uuid, size, persistent=True, volume_name=None ++ ): + """ + Create a new volume on the SR. + :param str volume_uuid: The volume uuid to use. + :param int size: volume size in B. + :param bool persistent: If false the volume will be unavailable + on the next constructor call LinstorSR(...). ++ :param str volume_name: If set, this name is used in the LINSTOR ++ database instead of a generated name. + :return: The current device path of the volume. + :rtype: str + """ + + self._logger('Creating LINSTOR volume {}...'.format(volume_uuid)) +- volume_name = self.build_volume_name(util.gen_uuid()) ++ if not volume_name: ++ volume_name = self.build_volume_name(util.gen_uuid()) + volume_properties = self._create_volume_with_properties( + volume_uuid, volume_name, size, place_resources=True + ) +@@ -1073,23 +1166,56 @@ class LinstorVolumeManager(object): + if not volume_name or volume_name not in resource_names: + self.destroy_volume(volume_uuid) + +- def destroy(self, force=False): ++ def destroy(self): + """ + Destroy this SR. Object should not be used after that. + :param bool force: Try to destroy volumes before if true. + """ + +- if (force): +- for volume_uuid in self._volumes: +- self.destroy_volume(volume_uuid) ++ if self._volumes: ++ raise LinstorVolumeManagerError( ++ 'Cannot destroy LINSTOR volume manager: ' ++ 'It exists remaining volumes' ++ ) + +- # TODO: Throw exceptions in the helpers below if necessary. +- # TODO: What's the required action if it exists remaining volumes? ++ uri = 'linstor://localhost' ++ try: ++ self._start_controller(start=False) + +- self._destroy_resource_group(self._linstor, self._group_name) +- for pool in self._get_storage_pools(force=True): +- self._destroy_storage_pool( +- self._linstor, pool.name, pool.node_name ++ # 1. Umount LINSTOR database. ++ self._mount_database_volume( ++ self.build_device_path(DATABASE_VOLUME_NAME), ++ mount=False, ++ force=True ++ ) ++ ++ # 2. Refresh instance. ++ self._start_controller(start=True) ++ self._linstor = self._create_linstor_instance( ++ uri, keep_uri_unmodified=True ++ ) ++ ++ # 3. Destroy database volume. ++ self._destroy_resource(DATABASE_VOLUME_NAME) ++ ++ # 4. Destroy group and storage pools. ++ self._destroy_resource_group(self._linstor, self._group_name) ++ for pool in self._get_storage_pools(force=True): ++ self._destroy_storage_pool( ++ self._linstor, pool.name, pool.node_name ++ ) ++ except Exception as e: ++ self._start_controller(start=True) ++ raise e ++ ++ try: ++ self._start_controller(start=False) ++ for file in glob.glob(DATABASE_PATH + '/'): ++ os.remove(file) ++ except Exception as e: ++ util.SMlog( ++ 'Ignoring failure after LINSTOR SR destruction: {}' ++ .format(e) + ) + + def find_up_to_date_diskfull_nodes(self, volume_uuid): +@@ -1130,29 +1256,75 @@ class LinstorVolumeManager(object): + + @classmethod + def create_sr( +- cls, uri, group_name, node_names, redundancy, ++ cls, group_name, node_names, ips, redundancy, + thin_provisioning=False, + logger=default_logger.__func__ + ): + """ + Create a new SR on the given nodes. +- :param str uri: URI to communicate with the LINSTOR controller. + :param str group_name: The SR group_name to use. + :param list[str] node_names: String list of nodes. + :param int redundancy: How many copy of volumes should we store? ++ :param set(str) ips: Node ips + :param function logger: Function to log messages. + :return: A new LinstorSr instance. + :rtype: LinstorSr + """ + ++ try: ++ cls._start_controller(start=True) ++ sr = cls._create_sr( ++ group_name, ++ node_names, ++ ips, ++ redundancy, ++ thin_provisioning, ++ logger ++ ) ++ finally: ++ # Controller must be stopped and volume unmounted because ++ # it is the role of the minidrbdcluster daemon to do the right ++ # actions. ++ cls._start_controller(start=False) ++ cls._mount_volume( ++ cls.build_device_path(DATABASE_VOLUME_NAME), ++ DATABASE_PATH, ++ mount=False ++ ) ++ return sr ++ ++ @classmethod ++ def _create_sr( ++ cls, group_name, node_names, ips, redundancy, ++ thin_provisioning=False, ++ logger=default_logger.__func__ ++ ): + # 1. Check if SR already exists. +- lin = cls._create_linstor_instance(uri) ++ uri = 'linstor://localhost' ++ ++ lin = cls._create_linstor_instance(uri, keep_uri_unmodified=True) ++ ++ for node_name in node_names: ++ ip = ips[node_name] ++ result = lin.node_create( ++ node_name, ++ linstor.consts.VAL_NODE_TYPE_CMBD, ++ ip ++ ) ++ errors = cls._filter_errors(result) ++ if cls._check_errors(errors, [linstor.consts.FAIL_EXISTS_NODE]): ++ continue ++ ++ if errors: ++ raise LinstorVolumeManagerError( ++ 'Failed to create node `{}` with ip `{}`: {}'.format( ++ node_name, ip, cls._get_error_str(errors) ++ ) ++ ) ++ + driver_pool_name = group_name + group_name = cls._build_group_name(group_name) + pools = lin.storage_pool_list_raise(filter_by_stor_pools=[group_name]) +- +- # TODO: Maybe if the SR already exists and if the nodes are the same, +- # we can try to use it directly. + pools = pools.storage_pools + if pools: + existing_node_names = map(lambda pool: pool.node_name, pools) +@@ -1227,25 +1399,64 @@ class LinstorVolumeManager(object): + ) + ) + +- # 3. Remove storage pools/resource/volume group in the case of errors. ++ # 3. Create the LINSTOR database volume and mount it. ++ try: ++ logger('Creating database volume...') ++ volume_path = cls._create_database_volume(lin, group_name) ++ except LinstorVolumeManagerError as e: ++ if e.code != LinstorVolumeManagerError.ERR_VOLUME_EXISTS: ++ logger('Destroying database volume after creation fail...') ++ cls._force_destroy_database_volume(lin, group_name) ++ raise ++ ++ try: ++ logger('Mounting database volume...') ++ ++ # First we must disable the controller to move safely the ++ # LINSTOR config. ++ cls._start_controller(start=False) ++ ++ cls._mount_database_volume(volume_path) ++ except Exception as e: ++ # Ensure we are connected because controller has been ++ # restarted during mount call. ++ logger('Destroying database volume after mount fail...') ++ ++ try: ++ cls._start_controller(start=True) ++ except Exception: ++ pass ++ ++ lin = cls._create_linstor_instance( ++ uri, keep_uri_unmodified=True ++ ) ++ cls._force_destroy_database_volume(lin, group_name) ++ raise e ++ ++ cls._start_controller(start=True) ++ lin = cls._create_linstor_instance(uri, keep_uri_unmodified=True) ++ ++ # 4. Remove storage pools/resource/volume group in the case of errors. + except Exception as e: ++ logger('Destroying resource group and storage pools after fail...') + try: + cls._destroy_resource_group(lin, group_name) +- except Exception: ++ except Exception as e2: ++ logger('Failed to destroy resource group: {}'.format(e2)) + pass + j = 0 + i = min(i, len(node_names) - 1) + while j <= i: + try: + cls._destroy_storage_pool(lin, group_name, node_names[j]) +- except Exception: ++ except Exception as e2: ++ logger('Failed to destroy resource group: {}'.format(e2)) + pass + j += 1 + raise e + +- # 4. Return new instance. ++ # 5. Return new instance. + instance = cls.__new__(cls) +- instance._uri = uri + instance._linstor = lin + instance._logger = logger + instance._redundancy = redundancy +@@ -1462,26 +1673,6 @@ class LinstorVolumeManager(object): + + return self._storage_pools + +- def _check_volume_creation_errors(self, result, volume_uuid): +- errors = self._filter_errors(result) +- if self._check_errors(errors, [ +- linstor.consts.FAIL_EXISTS_RSC, linstor.consts.FAIL_EXISTS_RSC_DFN +- ]): +- raise LinstorVolumeManagerError( +- 'Failed to create volume `{}` from SR `{}`, it already exists' +- .format(volume_uuid, self._group_name), +- LinstorVolumeManagerError.ERR_VOLUME_EXISTS +- ) +- +- if errors: +- raise LinstorVolumeManagerError( +- 'Failed to create volume `{}` from SR `{}`: {}'.format( +- volume_uuid, +- self._group_name, +- self._get_error_str(errors) +- ) +- ) +- + def _create_volume(self, volume_uuid, volume_name, size, place_resources): + size = self.round_up_volume_size(size) + +@@ -1491,7 +1682,7 @@ class LinstorVolumeManager(object): + rsc_dfn_name=volume_name, + vlm_sizes=['{}B'.format(size)], + definitions_only=not place_resources +- ), volume_uuid) ++ ), volume_uuid, self._group_name) + + def _create_volume_with_properties( + self, volume_uuid, volume_name, size, place_resources +@@ -1535,12 +1726,8 @@ class LinstorVolumeManager(object): + # before the `self._create_volume` case. + # It can only happen if the same volume uuid is used in the same + # call in another host. +- if e.code == LinstorVolumeManagerError.ERR_VOLUME_EXISTS: +- raise +- self._force_destroy_volume(volume_uuid) +- raise +- except Exception: +- self._force_destroy_volume(volume_uuid) ++ if e.code != LinstorVolumeManagerError.ERR_VOLUME_EXISTS: ++ self._force_destroy_volume(volume_uuid) + raise + + def _find_device_path(self, volume_uuid, volume_name): +@@ -1576,7 +1763,10 @@ class LinstorVolumeManager(object): + + if not resources: + if activate: +- self._activate_device_path(node_name, volume_name) ++ self._mark_resource_cache_as_dirty() ++ self._activate_device_path( ++ self._linstor, node_name, volume_name ++ ) + return self._request_device_path(volume_uuid, volume_name) + raise LinstorVolumeManagerError( + 'Empty dev path for `{}`, but definition "seems" to exist' +@@ -1585,25 +1775,6 @@ class LinstorVolumeManager(object): + # Contains a path of the /dev/drbd form. + return resources[0].volumes[0].device_path + +- def _activate_device_path(self, node_name, volume_name): +- self._mark_resource_cache_as_dirty() +- result = self._linstor.resource_create([ +- linstor.ResourceData(node_name, volume_name, diskless=True) +- ]) +- if linstor.Linstor.all_api_responses_no_error(result): +- return +- errors = linstor.Linstor.filter_api_call_response_errors(result) +- if len(errors) == 1 and errors[0].is_error( +- linstor.consts.FAIL_EXISTS_RSC +- ): +- return +- +- raise LinstorVolumeManagerError( +- 'Unable to activate device path of `{}` on node `{}`: {}' +- .format(volume_name, node_name, ', '.join( +- [str(x) for x in result])) +- ) +- + def _destroy_resource(self, resource_name): + self._mark_resource_cache_as_dirty() + result = self._linstor.resource_dfn_delete(resource_name) +@@ -1757,7 +1928,7 @@ class LinstorVolumeManager(object): + def _create_linstor_kv(self, namespace): + return linstor.KV( + self._get_store_name(), +- uri=self._uri, ++ uri=self._linstor.controller_host(), + namespace=namespace + ) + +@@ -1787,46 +1958,347 @@ class LinstorVolumeManager(object): + ]) + + @classmethod +- def _create_linstor_instance(cls, uri): +- def connect(): ++ def _create_linstor_instance(cls, uri, keep_uri_unmodified=False): ++ retry = False ++ ++ def connect(uri): ++ if not uri: ++ uri = get_controller_uri() ++ if not uri: ++ raise LinstorVolumeManagerError( ++ 'Unable to find controller uri...' ++ ) + instance = linstor.Linstor(uri, keep_alive=True) + instance.connect() + return instance + ++ try: ++ return connect(uri) ++ except (linstor.errors.LinstorNetworkError, LinstorVolumeManagerError): ++ pass ++ ++ if not keep_uri_unmodified: ++ uri = None ++ + return util.retry( +- connect, +- maxretry=60, +- exceptions=[linstor.errors.LinstorNetworkError] ++ lambda: connect(uri), ++ maxretry=10, ++ exceptions=[ ++ linstor.errors.LinstorNetworkError, ++ LinstorVolumeManagerError ++ ] + ) + + @classmethod +- def _destroy_storage_pool(cls, lin, group_name, node_name): +- result = lin.storage_pool_delete(node_name, group_name) ++ def _activate_device_path(cls, lin, node_name, volume_name): ++ result = lin.resource_create([ ++ linstor.ResourceData(node_name, volume_name, diskless=True) ++ ]) ++ if linstor.Linstor.all_api_responses_no_error(result): ++ return ++ errors = linstor.Linstor.filter_api_call_response_errors(result) ++ if len(errors) == 1 and errors[0].is_error( ++ linstor.consts.FAIL_EXISTS_RSC ++ ): ++ return ++ ++ raise LinstorVolumeManagerError( ++ 'Unable to activate device path of `{}` on node `{}`: {}' ++ .format(volume_name, node_name, ', '.join( ++ [str(x) for x in result])) ++ ) ++ ++ @classmethod ++ def _request_database_path(cls, lin, activate=False): ++ node_name = socket.gethostname() ++ ++ try: ++ resources = filter( ++ lambda resource: resource.node_name == node_name and ++ resource.name == DATABASE_VOLUME_NAME, ++ lin.resource_list_raise().resources ++ ) ++ except Exception as e: ++ raise LinstorVolumeManagerError( ++ 'Unable to get resources during database creation: {}' ++ .format(e) ++ ) ++ ++ if not resources: ++ if activate: ++ cls._activate_device_path( ++ lin, node_name, DATABASE_VOLUME_NAME ++ ) ++ return cls._request_database_path( ++ DATABASE_VOLUME_NAME, DATABASE_VOLUME_NAME ++ ) ++ raise LinstorVolumeManagerError( ++ 'Empty dev path for `{}`, but definition "seems" to exist' ++ .format(DATABASE_PATH) ++ ) ++ # Contains a path of the /dev/drbd form. ++ return resources[0].volumes[0].device_path ++ ++ @classmethod ++ def _create_database_volume(cls, lin, group_name): ++ try: ++ dfns = lin.resource_dfn_list_raise().resource_definitions ++ except Exception as e: ++ raise LinstorVolumeManagerError( ++ 'Unable to get definitions during database creation: {}' ++ .format(e) ++ ) ++ ++ if dfns: ++ raise LinstorVolumeManagerError( ++ 'Could not create volume `{}` from SR `{}`, '.format( ++ DATABASE_VOLUME_NAME, group_name ++ ) + 'LINSTOR volume list must be empty.' ++ ) ++ ++ size = cls.round_up_volume_size(DATABASE_SIZE) ++ cls._check_volume_creation_errors(lin.resource_group_spawn( ++ rsc_grp_name=group_name, ++ rsc_dfn_name=DATABASE_VOLUME_NAME, ++ vlm_sizes=['{}B'.format(size)], ++ definitions_only=False ++ ), DATABASE_VOLUME_NAME, group_name) ++ ++ # We must modify the quorum. Otherwise we can't use correctly the ++ # minidrbdcluster daemon. ++ result = lin.resource_dfn_modify(DATABASE_VOLUME_NAME, { ++ 'DrbdOptions/auto-quorum': 'disabled', ++ 'DrbdOptions/Resource/quorum': 'majority' ++ }) + error_str = cls._get_error_str(result) + if error_str: + raise LinstorVolumeManagerError( +- 'Failed to destroy SP `{}` on node `{}`: {}'.format( +- group_name, +- node_name, +- error_str ++ 'Could not activate quorum on database volume: {}' ++ .format(error_str) ++ ) ++ ++ current_device_path = cls._request_database_path(lin, activate=True) ++ ++ # We use realpath here to get the /dev/drbd path instead of ++ # /dev/drbd/by-res/. ++ expected_device_path = cls.build_device_path(DATABASE_VOLUME_NAME) ++ util.wait_for_path(expected_device_path, 5) ++ ++ device_realpath = os.path.realpath(expected_device_path) ++ if current_device_path != device_realpath: ++ raise LinstorVolumeManagerError( ++ 'Invalid path, current={}, expected={} (realpath={})' ++ .format( ++ current_device_path, ++ expected_device_path, ++ device_realpath + ) + ) + ++ try: ++ util.pread2([DATABASE_MKFS, expected_device_path]) ++ except Exception as e: ++ raise LinstorVolumeManagerError( ++ 'Failed to execute {} on database volume: {}' ++ .format(DATABASE_MKFS, e) ++ ) ++ ++ return expected_device_path ++ + @classmethod +- def _destroy_resource_group(cls, lin, group_name): +- result = lin.resource_group_delete(group_name) +- error_str = cls._get_error_str(result) ++ def _destroy_database_volume(cls, lin, group_name): ++ error_str = cls._get_error_str( ++ lin.resource_dfn_delete(DATABASE_VOLUME_NAME) ++ ) + if error_str: + raise LinstorVolumeManagerError( +- 'Failed to destroy RG `{}`: {}'.format(group_name, error_str) ++ 'Could not destroy resource `{}` from SR `{}`: {}' ++ .format(DATABASE_VOLUME_NAME, group_name, error_str) + ) + ++ @classmethod ++ def _mount_database_volume(cls, volume_path, mount=True, force=False): ++ backup_path = DATABASE_PATH + '-' + str(uuid.uuid4()) ++ ++ try: ++ # 1. Create a backup config folder. ++ database_not_empty = bool(os.listdir(DATABASE_PATH)) ++ if database_not_empty: ++ try: ++ os.mkdir(backup_path) ++ except Exception as e: ++ raise LinstorVolumeManagerError( ++ 'Failed to create backup path {} of LINSTOR config: {}' ++ .format(backup_path, e) ++ ) ++ ++ # 2. Move the config in the mounted volume. ++ if database_not_empty: ++ cls._move_files(DATABASE_PATH, backup_path) ++ ++ cls._mount_volume(volume_path, DATABASE_PATH, mount) ++ ++ if database_not_empty: ++ cls._move_files(backup_path, DATABASE_PATH, force) ++ ++ # 3. Remove useless backup directory. ++ try: ++ os.rmdir(backup_path) ++ except Exception: ++ raise LinstorVolumeManagerError( ++ 'Failed to remove backup path {} of LINSTOR config {}' ++ .format(backup_path, e) ++ ) ++ except Exception as e: ++ def force_exec(fn): ++ try: ++ fn() ++ except Exception: ++ pass ++ ++ if mount == cls._is_mounted(DATABASE_PATH): ++ force_exec(lambda: cls._move_files( ++ DATABASE_PATH, backup_path ++ )) ++ force_exec(lambda: cls._mount_volume( ++ volume_path, DATABASE_PATH, not mount ++ )) ++ ++ if mount != cls._is_mounted(DATABASE_PATH): ++ force_exec(lambda: cls._move_files( ++ backup_path, DATABASE_PATH ++ )) ++ ++ force_exec(lambda: os.rmdir(backup_path)) ++ raise e ++ ++ @classmethod ++ def _force_destroy_database_volume(cls, lin, group_name): ++ try: ++ cls._destroy_database_volume(lin, group_name) ++ except Exception: ++ pass ++ ++ @classmethod ++ def _destroy_storage_pool(cls, lin, group_name, node_name): ++ def destroy(): ++ result = lin.storage_pool_delete(node_name, group_name) ++ errors = cls._filter_errors(result) ++ if cls._check_errors(errors, [ ++ linstor.consts.FAIL_NOT_FOUND_STOR_POOL, ++ linstor.consts.FAIL_NOT_FOUND_STOR_POOL_DFN ++ ]): ++ return ++ ++ if errors: ++ raise LinstorVolumeManagerError( ++ 'Failed to destroy SP `{}` on node `{}`: {}'.format( ++ group_name, ++ node_name, ++ cls._get_error_str(errors) ++ ) ++ ) ++ ++ # We must retry to avoid errors like: ++ # "can not be deleted as volumes / snapshot-volumes are still using it" ++ # after LINSTOR database volume destruction. ++ return util.retry(destroy, maxretry=10) ++ ++ @classmethod ++ def _destroy_resource_group(cls, lin, group_name): ++ def destroy(): ++ result = lin.resource_group_delete(group_name) ++ errors = cls._filter_errors(result) ++ if cls._check_errors(errors, [ ++ linstor.consts.FAIL_NOT_FOUND_RSC_GRP ++ ]): ++ return ++ ++ if errors: ++ raise LinstorVolumeManagerError( ++ 'Failed to destroy RG `{}`: {}' ++ .format(group_name, cls._get_error_str(errors)) ++ ) ++ ++ return util.retry(destroy, maxretry=10) ++ + @classmethod + def _build_group_name(cls, base_name): + # If thin provisioning is used we have a path like this: + # `VG/LV`. "/" is not accepted by LINSTOR. + return '{}{}'.format(cls.PREFIX_SR, base_name.replace('/', '_')) + ++ @classmethod ++ def _check_volume_creation_errors(cls, result, volume_uuid, group_name): ++ errors = cls._filter_errors(result) ++ if cls._check_errors(errors, [ ++ linstor.consts.FAIL_EXISTS_RSC, linstor.consts.FAIL_EXISTS_RSC_DFN ++ ]): ++ raise LinstorVolumeManagerError( ++ 'Failed to create volume `{}` from SR `{}`, it already exists' ++ .format(volume_uuid, group_name), ++ LinstorVolumeManagerError.ERR_VOLUME_EXISTS ++ ) ++ ++ if errors: ++ raise LinstorVolumeManagerError( ++ 'Failed to create volume `{}` from SR `{}`: {}'.format( ++ volume_uuid, ++ group_name, ++ cls._get_error_str(errors) ++ ) ++ ) ++ ++ @classmethod ++ def _move_files(cls, src_dir, dest_dir, force=False): ++ def listdir(dir): ++ ignored = ['lost+found'] ++ return filter(lambda file: file not in ignored, os.listdir(dir)) ++ ++ try: ++ if not force: ++ files = listdir(dest_dir) ++ if files: ++ raise LinstorVolumeManagerError( ++ 'Cannot move files from {} to {} because destination ' ++ 'contains: {}'.format(src_dir, dest_dir, files) ++ ) ++ except LinstorVolumeManagerError: ++ raise ++ except Exception as e: ++ raise LinstorVolumeManagerError( ++ 'Cannot list dir {}: {}'.format(dest_dir, e) ++ ) ++ ++ try: ++ for file in listdir(src_dir): ++ try: ++ dest_file = os.path.join(dest_dir, file) ++ if not force and os.path.exists(dest_file): ++ raise LinstorVolumeManagerError( ++ 'Cannot move {} because it already exists in the ' ++ 'destination'.format(file) ++ ) ++ shutil.move(os.path.join(src_dir, file), dest_file) ++ except LinstorVolumeManagerError: ++ raise ++ except Exception as e: ++ raise LinstorVolumeManagerError( ++ 'Cannot move {}: {}'.format(file, e) ++ ) ++ except Exception as e: ++ if not force: ++ try: ++ cls._move_files(dest_dir, src_dir, force=True) ++ except Exception: ++ pass ++ ++ raise LinstorVolumeManagerError( ++ 'Failed to move files from {} to {}: {}'.format( ++ src_dir, dest_dir, e ++ ) ++ ) ++ + @staticmethod + def _get_filtered_properties(properties): + return dict(properties.items()) +@@ -1845,3 +2317,44 @@ class LinstorVolumeManager(object): + if err.is_error(code): + return True + return False ++ ++ @classmethod ++ def _start_controller(cls, start=True): ++ return cls._start_service('linstor-controller', start) ++ ++ @staticmethod ++ def _start_service(name, start=True): ++ action = 'start' if start else 'stop' ++ (ret, out, err) = util.doexec([ ++ 'systemctl', action, name ++ ]) ++ if ret != 0: ++ raise LinstorVolumeManagerError( ++ 'Failed to {} {}: {} {}' ++ .format(action, name, out, err) ++ ) ++ ++ @staticmethod ++ def _is_mounted(mountpoint): ++ (ret, out, err) = util.doexec(['mountpoint', '-q', mountpoint]) ++ return ret == 0 ++ ++ @classmethod ++ def _mount_volume(cls, volume_path, mountpoint, mount=True): ++ if mount: ++ try: ++ util.pread(['mount', volume_path, mountpoint]) ++ except Exception as e: ++ raise LinstorVolumeManagerError( ++ 'Failed to mount volume {} on {}: {}' ++ .format(volume_path, mountpoint, e) ++ ) ++ else: ++ try: ++ if cls._is_mounted(mountpoint): ++ util.pread(['umount', mountpoint]) ++ except Exception as e: ++ raise LinstorVolumeManagerError( ++ 'Failed to umount volume {} on {}: {}' ++ .format(volume_path, mountpoint, e) ++ ) +diff --git a/drivers/tapdisk-pause b/drivers/tapdisk-pause +index ed6abed..e0bca7b 100755 +--- a/drivers/tapdisk-pause ++++ b/drivers/tapdisk-pause +@@ -30,7 +30,7 @@ import vhdutil + import lvmcache + + try: +- from linstorvolumemanager import LinstorVolumeManager ++ from linstorvolumemanager import get_controller_uri, LinstorVolumeManager + LINSTOR_AVAILABLE = True + except ImportError: + LINSTOR_AVAILABLE = False +@@ -152,10 +152,6 @@ class Tapdisk: + # "B" path. Note: "A", "B" and "OLD_A" are UUIDs. + session = self.session + +- linstor_uri = 'linstor://{}'.format( +- util.get_master_rec(session)['address'] +- ) +- + host_ref = util.get_this_host_ref(session) + sr_ref = session.xenapi.SR.get_by_uuid(self.sr_uuid) + +@@ -167,7 +163,7 @@ class Tapdisk: + group_name = dconf['group-name'] + + device_path = LinstorVolumeManager( +- linstor_uri, ++ get_controller_uri(), + group_name, + logger=util.SMlog + ).get_device_path(self.vdi_uuid) +diff --git a/drivers/util.py b/drivers/util.py +index 54fda46..7151f36 100755 +--- a/drivers/util.py ++++ b/drivers/util.py +@@ -659,31 +659,10 @@ def get_master_ref(session): + return session.xenapi.pool.get_master(pools[0]) + + +-def get_master_rec(session): +- return session.xenapi.host.get_record(get_master_ref(session)) +- +- + def is_master(session): + return get_this_host_ref(session) == get_master_ref(session) + + +-def get_master_address(): +- address = None +- try: +- fd = open('/etc/xensource/pool.conf', 'r') +- try: +- items = fd.readline().split(':') +- if items[0].strip() == 'master': +- address = 'localhost' +- else: +- address = items[1].strip() +- finally: +- fd.close() +- except Exception: +- pass +- return address +- +- + # XXX: this function doesn't do what it claims to do + def get_localhost_uuid(session): + filename = '/etc/xensource-inventory' +diff --git a/etc/minidrbdcluster.ini b/etc/minidrbdcluster.ini +new file mode 100644 +index 0000000..0126e86 +--- /dev/null ++++ b/etc/minidrbdcluster.ini +@@ -0,0 +1,14 @@ ++# minidrbdcluster keeps a service running on one of the nodes. ++# Quorum must be enabled in the DRBD resource! ++# ++# The section names are the names of DRBD resources. Within a ++# section name the systemd-units to activate on one of the nodes. ++ ++[xcp-persistent-database] ++systemd-units=var-lib-linstor.mount,linstor-controller.service ++ ++[xcp-persistent-ha-statefile] ++systemd-units= ++ ++[xcp-persistent-redo-log] ++systemd-units= +diff --git a/etc/systemd/system/linstor-satellite.service.d/override.conf b/etc/systemd/system/linstor-satellite.service.d/override.conf +new file mode 100644 +index 0000000..b1686b4 +--- /dev/null ++++ b/etc/systemd/system/linstor-satellite.service.d/override.conf +@@ -0,0 +1,5 @@ ++[Service] ++Environment=LS_KEEP_RES=^xcp-persistent* ++ ++[Unit] ++After=drbd.service +diff --git a/etc/systemd/system/var-lib-linstor.mount b/etc/systemd/system/var-lib-linstor.mount +new file mode 100644 +index 0000000..a05a7f7 +--- /dev/null ++++ b/etc/systemd/system/var-lib-linstor.mount +@@ -0,0 +1,6 @@ ++[Unit] ++Description=Filesystem for the LINSTOR controller ++ ++[Mount] ++What=/dev/drbd/by-res/xcp-persistent-database/0 ++Where=/var/lib/linstor +diff --git a/linstor/linstor-monitord.c b/linstor/linstor-monitord.c +index a1592fd..4774059 100644 +--- a/linstor/linstor-monitord.c ++++ b/linstor/linstor-monitord.c +@@ -287,18 +287,6 @@ static inline int addInotifyWatch (int inotifyFd, const char *filepath, uint32_t + + // ----------------------------------------------------------------------------- + +-static inline int updateLinstorController (int isMaster) { +- syslog(LOG_INFO, "%s linstor-controller...", isMaster ? "Enabling" : "Disabling"); +- char *argv[] = { +- "systemctl", +- isMaster ? "enable" : "disable", +- "--now", +- "linstor-controller", +- NULL +- }; +- return execCommand(argv, NULL); +-} +- + static inline int updateLinstorNode (State *state) { + char buffer[256]; + if (gethostname(buffer, sizeof buffer) == -1) { +@@ -416,7 +404,6 @@ static inline int processPoolConfEvents (State *state, int wd, char **buffer, si + inotify_rm_watch(state->inotifyFd, wd); // Do not forget to remove watch to avoid leaks. + return -EIO; + } +- ret = updateLinstorController(state->isMaster); + } else { + if (mask & (IN_CREATE | IN_MOVED_TO)) { + syslog(LOG_ERR, "Watched `" POOL_CONF_ABS_FILE "` file has been recreated!"); +@@ -495,8 +482,6 @@ static inline int waitForPoolConfCreation (State *state, int *wdFile) { + // Update LINSTOR services... + int ret; + state->isMaster = isMasterHost(&ret); +- if (!ret) +- ret = updateLinstorController(state->isMaster); + + // Ok we can't read the pool configuration file. + // Maybe the file doesn't exist. Waiting its creation... +diff --git a/scripts/minidrbdcluster b/scripts/minidrbdcluster +new file mode 100755 +index 0000000..a04b6c1 +--- /dev/null ++++ b/scripts/minidrbdcluster +@@ -0,0 +1,171 @@ ++#! /usr/bin/env python2 ++ ++import configparser ++import os ++import re ++import signal ++import subprocess ++ ++DRBDADM_OPEN_FAILED_RE = re.compile( ++ 'open\\((.*)\\) failed: No such file or directory' ++) ++MAY_PROMOT_RE = re.compile( ++ '(?:exists|change) resource name:((?:\\w|-)+) ' ++ '(?:\\w+\\:\\w+ )*may_promote:(yes|no) promotion_score:(\\d+)' ++) ++PEER_ROLE_RE = re.compile( ++ '(?:exists|change) connection name:((?:\\w|-)+) peer-node-id:(?:\\d+) ' ++ 'conn-name:(\\w+) (?:\\w+\\:\\w+ )*role:(Primary|Secondary|Unknown)' ++) ++HAVE_QUORUM_RE = re.compile( ++ '(?:exists|change) device name:((?:\\w|-)+) ' ++ '(?:\\w+\\:\\w+ )*quorum:(yes|no)' ++) ++ ++ ++class SigHupException(Exception): ++ pass ++ ++ ++def sig_handler(sig, frame): ++ raise SigHupException( ++ 'Received signal ' + str(sig) + ++ ' on line ' + str(frame.f_lineno) + ++ ' in ' + frame.f_code.co_filename ++ ) ++ ++ ++def call_systemd(operation, service): ++ verbose = operation in ('start', 'stop') ++ if verbose: ++ print('Trying to %s %s' % (operation, service)) ++ r = os.system('systemctl %s %s' % (operation, service)) ++ if verbose: ++ print('%s for %s %s' % ( ++ 'success' if r == 0 else 'failure', operation, service ++ )) ++ return r == 0 ++ ++ ++def ensure_systemd_started(service): ++ args = ['systemctl', 'is-active', '--quiet', service] ++ ++ proc = subprocess.Popen(args) ++ proc.wait() ++ if not proc.returncode: ++ return True # Already active. ++ ++ return call_systemd('start', service) ++ ++ ++def show_status(services, status): ++ print('status:') ++ for systemd_unit in services: ++ call_systemd('status', systemd_unit) ++ for res_name in status: ++ print('%s is %s' % (res_name, status[res_name])) ++ ++ ++def clean_up(services): ++ print('exiting:') ++ for systemd_unit in reversed(services): ++ call_systemd('stop', systemd_unit) ++ ++ ++def get_systemd_units(systemd_units_str): ++ systemd_units = [] ++ for systemd_unit in systemd_units_str.split(','): ++ systemd_unit = systemd_unit.strip() ++ if systemd_unit: ++ systemd_units.append(systemd_unit) ++ return systemd_units ++ ++ ++def process(events2, resources, services, status): ++ line = events2.stdout.readline() ++ m = MAY_PROMOT_RE.match(line) ++ if m: ++ res_name, may_promote, promotion_score = m.groups() ++ if res_name in resources and may_promote == 'yes': ++ systemd_units_str = resources[res_name]['systemd-units'] ++ for systemd_unit in get_systemd_units(systemd_units_str): ++ if not ensure_systemd_started(systemd_unit): ++ break ++ if systemd_unit not in services: ++ services.append(systemd_unit) ++ m = PEER_ROLE_RE.match(line) ++ if m: ++ res_name, conn_name, role = m.groups() ++ if res_name in status: ++ status[res_name][conn_name] = role ++ m = HAVE_QUORUM_RE.match(line) ++ if m: ++ res_name, have_quorum = m.groups() ++ if res_name in resources and have_quorum == 'no': ++ systemd_units_str = resources[res_name]['systemd-units'] ++ systemd_units = get_systemd_units(systemd_units_str) ++ to_stop = [x for x in systemd_units if x in services] ++ if to_stop: ++ print('Lost quorum on %s' % (res_name)) ++ for systemd_unit in reversed(to_stop): ++ r = call_systemd('stop', systemd_unit) ++ if r: ++ services.remove(systemd_unit) ++ ++ ++def active_drbd_volume(res_name): ++ retry = True ++ args = ['drbdadm', 'adjust', res_name] ++ while True: ++ proc = subprocess.Popen(args, stderr=subprocess.PIPE) ++ (stdout, stderr) = proc.communicate() ++ if not proc.returncode: ++ return # Success. \o/ ++ ++ if not retry: ++ break ++ ++ m = DRBDADM_OPEN_FAILED_RE.match(stderr) ++ if m and subprocess.call(['lvchange', '-ay', m.groups()[0]]) == 0: ++ retry = False ++ else: ++ break ++ ++ print('Failed to execute `{}`: {}'.format(args, stderr)) ++ ++ ++def main(): ++ services = [] ++ status = dict() ++ config = configparser.ConfigParser() ++ config.read('/etc/minidrbdcluster.ini') ++ resources = config._sections ++ if not resources: ++ raise Exception( ++ 'No resources to watch, maybe /etc/minidrbdcluster.ini missing' ++ ) ++ print('Managing DRBD resources: %s' % (' '.join(resources))) ++ for res_name in resources: ++ status[res_name] = dict() ++ active_drbd_volume(res_name) ++ ++ signal.signal(signal.SIGHUP, sig_handler) ++ ++ print('Starting process...') ++ events2 = subprocess.Popen( ++ ['drbdsetup', 'events2'], stdout=subprocess.PIPE ++ ) ++ run = True ++ while run: ++ try: ++ process(events2, resources, services, status) ++ except KeyboardInterrupt: ++ run = False ++ except SigHupException: ++ show_status(services, status) ++ ++ clean_up(services) ++ ++ ++if __name__ == '__main__': ++ main() +diff --git a/systemd/minidrbdcluster.service b/systemd/minidrbdcluster.service +new file mode 100644 +index 0000000..3de6ac4 +--- /dev/null ++++ b/systemd/minidrbdcluster.service +@@ -0,0 +1,18 @@ ++[Unit] ++Description=Minimalistic high-availability cluster resource manager ++Before=xs-sm.service ++Wants=network-online.target ++After=network-online.target ++ ++[Service] ++Type=simple ++Environment=PYTHONUNBUFFERED=1 ++ExecStart=/opt/xensource/libexec/minidrbdcluster ++KillMode=process ++KillSignal=SIGINT ++StandardOutput=journal ++StandardError=journal ++SyslogIdentifier=minidrbdcluster ++ ++[Install] ++WantedBy=multi-user.target +-- +2.45.2 + diff --git a/SOURCES/0034-feat-LinstorSR-ensure-heartbeat-and-redo_log-VDIs-ar.patch b/SOURCES/0034-feat-LinstorSR-ensure-heartbeat-and-redo_log-VDIs-ar.patch new file mode 100644 index 00000000..d6720efc --- /dev/null +++ b/SOURCES/0034-feat-LinstorSR-ensure-heartbeat-and-redo_log-VDIs-ar.patch @@ -0,0 +1,168 @@ +From 6e0d84cf900e9c41cba663093c911fa025debd34 Mon Sep 17 00:00:00 2001 +From: Wescoeur +Date: Wed, 24 Feb 2021 11:17:23 +0100 +Subject: [PATCH 034/175] feat(LinstorSR): ensure heartbeat and redo_log VDIs + are not diskless + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 2 +- + drivers/linstorvolumemanager.py | 97 +++++++++++++++++++++++++++++---- + 2 files changed, 86 insertions(+), 13 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 9650d71..d943d49 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -1463,7 +1463,7 @@ class LinstorVDI(VDI.VDI): + + self._linstor.create_volume( + self.uuid, volume_size, persistent=False, +- volume_name=volume_name ++ volume_name=volume_name, no_diskless=(volume_name is not None) + ) + volume_info = self._linstor.get_volume_info(self.uuid) + +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index a383e32..d8d64b4 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -468,7 +468,8 @@ class LinstorVolumeManager(object): + return volume_uuid in self._volumes + + def create_volume( +- self, volume_uuid, size, persistent=True, volume_name=None ++ self, volume_uuid, size, persistent=True, volume_name=None, ++ no_diskless=False + ): + """ + Create a new volume on the SR. +@@ -478,6 +479,8 @@ class LinstorVolumeManager(object): + on the next constructor call LinstorSR(...). + :param str volume_name: If set, this name is used in the LINSTOR + database instead of a generated name. ++ :param bool no_diskless: If set, the default group redundancy is not ++ used, instead the volume is created on all nodes. + :return: The current device path of the volume. + :rtype: str + """ +@@ -486,7 +489,8 @@ class LinstorVolumeManager(object): + if not volume_name: + volume_name = self.build_volume_name(util.gen_uuid()) + volume_properties = self._create_volume_with_properties( +- volume_uuid, volume_name, size, place_resources=True ++ volume_uuid, volume_name, size, place_resources=True, ++ no_diskless=no_diskless + ) + + try: +@@ -1673,19 +1677,88 @@ class LinstorVolumeManager(object): + + return self._storage_pools + +- def _create_volume(self, volume_uuid, volume_name, size, place_resources): ++ def _create_volume( ++ self, volume_uuid, volume_name, size, place_resources, ++ no_diskless=False ++ ): + size = self.round_up_volume_size(size) +- + self._mark_resource_cache_as_dirty() +- self._check_volume_creation_errors(self._linstor.resource_group_spawn( +- rsc_grp_name=self._group_name, +- rsc_dfn_name=volume_name, +- vlm_sizes=['{}B'.format(size)], +- definitions_only=not place_resources +- ), volume_uuid, self._group_name) ++ ++ # A. Basic case when we use the default redundancy of the group. ++ if not no_diskless: ++ self._check_volume_creation_errors( ++ self._linstor.resource_group_spawn( ++ rsc_grp_name=self._group_name, ++ rsc_dfn_name=volume_name, ++ vlm_sizes=['{}B'.format(size)], ++ definitions_only=not place_resources ++ ), ++ volume_uuid, ++ self._group_name ++ ) ++ return ++ ++ # B. Complex case. ++ if not place_resources: ++ raise LinstorVolumeManagerError( ++ 'Could not create volume `{}` from SR `{}`: it\'s impossible ' ++ .format(volume_uuid, self._group_name) + ++ 'to force no diskless without placing resources' ++ ) ++ ++ # B.1. Create resource list. ++ resources = [] ++ for node_name in self._get_node_names(): ++ resources.append(linstor.ResourceData( ++ node_name=node_name, ++ rsc_name=volume_name, ++ storage_pool=self._group_name ++ )) ++ ++ # B.2. Create volume! ++ def clean(): ++ try: ++ self._destroy_volume(volume_uuid) ++ except Exception as e: ++ self._logger( ++ 'Unable to destroy volume {} after creation fail: {}' ++ .format(volume_uuid, e) ++ ) ++ ++ def create(): ++ try: ++ self._check_volume_creation_errors( ++ self._linstor.resource_group_spawn( ++ rsc_grp_name=self._group_name, ++ rsc_dfn_name=volume_name, ++ vlm_sizes=['{}B'.format(size)], ++ definitions_only=True ++ ), ++ volume_uuid, ++ self._group_name ++ ) ++ ++ result = self._linstor.resource_create(resources) ++ error_str = self._get_error_str(result) ++ if error_str: ++ raise LinstorVolumeManagerError( ++ 'Could not create volume `{}` from SR `{}`: {}'.format( ++ volume_uuid, self._group_name, error_str ++ ) ++ ) ++ except LinstorVolumeManagerError as e: ++ if e.code != LinstorVolumeManagerError.ERR_VOLUME_EXISTS: ++ clean() ++ raise ++ except Exception: ++ clean() ++ raise ++ ++ util.retry(create, maxretry=5) + + def _create_volume_with_properties( +- self, volume_uuid, volume_name, size, place_resources ++ self, volume_uuid, volume_name, size, place_resources, ++ no_diskless=False + ): + if self.check_volume_exists(volume_uuid): + raise LinstorVolumeManagerError( +@@ -1714,7 +1787,7 @@ class LinstorVolumeManager(object): + volume_properties[self.PROP_VOLUME_NAME] = volume_name + + self._create_volume( +- volume_uuid, volume_name, size, place_resources ++ volume_uuid, volume_name, size, place_resources, no_diskless + ) + + assert volume_properties.namespace == \ +-- +2.45.2 + diff --git a/SOURCES/0035-feat-LinstorSR-protect-sr-commands-to-avoid-forgetti.patch b/SOURCES/0035-feat-LinstorSR-protect-sr-commands-to-avoid-forgetti.patch new file mode 100644 index 00000000..3cb3227e --- /dev/null +++ b/SOURCES/0035-feat-LinstorSR-protect-sr-commands-to-avoid-forgetti.patch @@ -0,0 +1,166 @@ +From 1039b9bb973e2911ae222cd40f4a683bc6fbb83b Mon Sep 17 00:00:00 2001 +From: Wescoeur +Date: Thu, 25 Feb 2021 17:52:57 +0100 +Subject: [PATCH 035/175] feat(LinstorSR): protect sr commands to avoid + forgetting LINSTOR volumes when master satellite is down + +Steps to reproduce: + +- Ensure the linstor satellite is not running on the master host, otherwise stop it +- Then restart the controller on the right host where the LINSTOR database is mounted +- Run st_attach command => All volumes will be forgotten + +To avoid this, it's possible to restart the satellite on the master before the sr_attach command. +Also it's funny to see you can start and stop the satellite juste before the sr_attach, and the volumes will not be removed. + +Explanations: + +In theory this bug is impossible because during the sr_attach execution, an exception is thrown +(so sr_scan should not be executed) BUT there is a piece of code that is executed +in SRCommand.py when sr_attach is called: + +```python +try: + return sr.attach(sr_uuid) +finally: + if is_master: + sr.after_master_attach(sr_uuid) +``` + +The exception is not immediately forwarded because a finally block must be executed before. +And what is the implementation of after_master_attach? + +```python +def after_master_attach(self, uuid): + """Perform actions required after attaching on the pool master + Return: + None + """ + self.scan(uuid) +``` + +Oh! Of course, a scan is always executed after a attach... What's the purpose of a scan if we can't +execute correctly an attach command before? I don't know, but it's probably error-prone like this context. +When scan is called, we suppose the SR is attached and we have all VDIs loaded but it's not the case +because an exception has been thrown. + +To solve this problem we forbid the execution of the scan if the attach failed. + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 47 ++++++++++++++++++++++++++++++++++---------- + 1 file changed, 37 insertions(+), 10 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index d943d49..092f5e8 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -256,6 +256,11 @@ class LinstorSR(SR.SR): + + MANAGER_PLUGIN = 'linstor-manager' + ++ INIT_STATUS_NOT_SET = 0 ++ INIT_STATUS_IN_PROGRESS = 1 ++ INIT_STATUS_OK = 2 ++ INIT_STATUS_FAIL = 3 ++ + # -------------------------------------------------------------------------- + # SR methods. + # -------------------------------------------------------------------------- +@@ -325,19 +330,18 @@ class LinstorSR(SR.SR): + + self._vdi_shared_time = 0 + +- self._initialized = False ++ self._init_status = self.INIT_STATUS_NOT_SET + + self._vdis_loaded = False + self._all_volume_info_cache = None + self._all_volume_metadata_cache = None + + def _locked_load(method): +- @functools.wraps(method) +- def wrap(self, *args, **kwargs): +- if self._initialized: +- return method(self, *args, **kwargs) +- self._initialized = True ++ def wrapped_method(self, *args, **kwargs): ++ self._init_status = self.INIT_STATUS_OK ++ return method(self, *args, **kwargs) + ++ def load(self, *args, **kwargs): + if not self._has_session: + if self.srcmd.cmd == 'vdi_attach_from_config': + # We must have a valid LINSTOR instance here without using +@@ -352,7 +356,7 @@ class LinstorSR(SR.SR): + self._group_name, + logger=util.SMlog + ) +- return method(self, *args, **kwargs) ++ return wrapped_method(self, *args, **kwargs) + + if not self._is_master: + if self.cmd in [ +@@ -456,11 +460,29 @@ class LinstorSR(SR.SR): + ) + util.SMlog(traceback.format_exc()) + +- return method(self, *args, **kwargs) ++ return wrapped_method(self, *args, **kwargs) ++ ++ @functools.wraps(wrapped_method) ++ def wrap(self, *args, **kwargs): ++ if self._init_status in \ ++ (self.INIT_STATUS_OK, self.INIT_STATUS_IN_PROGRESS): ++ return wrapped_method(self, *args, **kwargs) ++ if self._init_status == self.INIT_STATUS_FAIL: ++ util.SMlog( ++ 'Can\'t call method {} because initialization failed' ++ .format(method) ++ ) ++ else: ++ try: ++ self._init_status = self.INIT_STATUS_IN_PROGRESS ++ return load(self, *args, **kwargs) ++ except Exception: ++ if self._init_status != self.INIT_STATUS_OK: ++ self._init_status = self.INIT_STATUS_FAIL ++ raise + + return wrap + +- @_locked_load + def cleanup(self): + if self._vdi_shared_time: + self._shared_lock_vdi(self.srcmd.params['vdi_uuid'], locked=False) +@@ -657,6 +679,9 @@ class LinstorSR(SR.SR): + + @_locked_load + def scan(self, uuid): ++ if self._init_status == self.INIT_STATUS_FAIL: ++ return ++ + util.SMlog('LinstorSR.scan for {}'.format(self.uuid)) + if not self._linstor: + raise xs_errors.XenError( +@@ -855,7 +880,6 @@ class LinstorSR(SR.SR): + def _load_vdis(self): + if self._vdis_loaded: + return +- self._vdis_loaded = True + + assert self._is_master + +@@ -866,6 +890,9 @@ class LinstorSR(SR.SR): + self._load_vdis_ex() + self._destroy_linstor_cache() + ++ # We must mark VDIs as loaded only if the load is a success. ++ self._vdis_loaded = True ++ + self._undo_all_journal_transactions() + + def _load_vdis_ex(self): +-- +2.45.2 + diff --git a/SOURCES/0036-fix-LinstorJournaler-ensure-uri-is-not-None-during-l.patch b/SOURCES/0036-fix-LinstorJournaler-ensure-uri-is-not-None-during-l.patch new file mode 100644 index 00000000..3a8d0b43 --- /dev/null +++ b/SOURCES/0036-fix-LinstorJournaler-ensure-uri-is-not-None-during-l.patch @@ -0,0 +1,57 @@ +From b49cf026ac1d098feec5dbc14898285a59c16011 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Mon, 8 Mar 2021 13:25:28 +0100 +Subject: [PATCH 036/175] fix(LinstorJournaler): ensure uri is not None during + linstor.KV creation + +Signed-off-by: Ronan Abhamon +--- + drivers/linstorjournaler.py | 13 ++++++++++--- + 1 file changed, 10 insertions(+), 3 deletions(-) + +diff --git a/drivers/linstorjournaler.py b/drivers/linstorjournaler.py +index 285012c..3993f60 100755 +--- a/drivers/linstorjournaler.py ++++ b/drivers/linstorjournaler.py +@@ -16,7 +16,8 @@ + # + + +-from linstorvolumemanager import get_controller_uri, LinstorVolumeManager ++from linstorvolumemanager import \ ++ get_controller_uri, LinstorVolumeManager, LinstorVolumeManagerError + import linstor + import re + import util +@@ -145,6 +146,10 @@ class LinstorJournaler: + def connect(uri): + if not uri: + uri = get_controller_uri() ++ if not uri: ++ raise LinstorVolumeManagerError( ++ 'Unable to find controller uri...' ++ ) + return linstor.KV( + LinstorVolumeManager._build_group_name(group_name), + uri=uri, +@@ -153,13 +158,15 @@ class LinstorJournaler: + + try: + return connect(uri) +- except linstor.errors.LinstorNetworkError: ++ except (linstor.errors.LinstorNetworkError, LinstorVolumeManagerError): + pass + + return util.retry( + lambda: connect(None), + maxretry=10, +- exceptions=[linstor.errors.LinstorNetworkError] ++ exceptions=[ ++ linstor.errors.LinstorNetworkError, LinstorVolumeManagerError ++ ] + ) + + @staticmethod +-- +2.45.2 + diff --git a/SOURCES/0037-feat-LinstorSR-add-an-option-to-disable-auto-quorum-.patch b/SOURCES/0037-feat-LinstorSR-add-an-option-to-disable-auto-quorum-.patch new file mode 100644 index 00000000..a0473f7c --- /dev/null +++ b/SOURCES/0037-feat-LinstorSR-add-an-option-to-disable-auto-quorum-.patch @@ -0,0 +1,145 @@ +From cab8593814b9b741a20d218df673a58d98dc3a79 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Mon, 22 Mar 2021 17:32:26 +0100 +Subject: [PATCH 037/175] feat(LinstorSR): add an option to disable auto-quorum + on volume DB + fix doc + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 9 ++++++++- + drivers/linstorvolumemanager.py | 36 +++++++++++++++++++-------------- + 2 files changed, 29 insertions(+), 16 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 092f5e8..9f2be58 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -31,6 +31,7 @@ except ImportError: + from lock import Lock + import blktap2 + import cleanup ++import distutils + import errno + import functools + import scsiutil +@@ -77,7 +78,8 @@ CONFIGURATION = [ + ['group-name', 'LVM group name'], + ['hosts', 'host names to use'], + ['redundancy', 'replication count'], +- ['provisioning', '"thin" or "thick" are accepted'] ++ ['provisioning', '"thin" or "thick" are accepted (optional, defaults to thin)'], ++ ['monitor-db-quorum', 'disable controller when only one host is online (optional, defaults to true)'] + ] + + DRIVER_INFO = { +@@ -300,6 +302,10 @@ class LinstorSR(SR.SR): + else: + self._provisioning = self.PROVISIONING_DEFAULT + ++ monitor_db_quorum = self.dconf.get('monitor-db-quorum') ++ self._monitor_db_quorum = (monitor_db_quorum is None) or \ ++ distutils.util.strtobool(monitor_db_quorum) ++ + # Note: We don't have access to the session field if the + # 'vdi_attach_from_config' command is executed. + self._has_session = self.sr_ref and self.session is not None +@@ -553,6 +559,7 @@ class LinstorSR(SR.SR): + ips, + self._redundancy, + thin_provisioning=self._provisioning == 'thin', ++ auto_quorum=self._monitor_db_quorum, + logger=util.SMlog + ) + self._vhdutil = LinstorVhdUtil(self.session, self._linstor) +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index d8d64b4..27c8df5 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -1261,15 +1261,17 @@ class LinstorVolumeManager(object): + @classmethod + def create_sr( + cls, group_name, node_names, ips, redundancy, +- thin_provisioning=False, ++ thin_provisioning, auto_quorum, + logger=default_logger.__func__ + ): + """ + Create a new SR on the given nodes. + :param str group_name: The SR group_name to use. + :param list[str] node_names: String list of nodes. ++ :param set(str) ips: Node ips. + :param int redundancy: How many copy of volumes should we store? +- :param set(str) ips: Node ips ++ :param bool thin_provisioning: Use thin or thick provisioning. ++ :param bool auto_quorum: DB quorum is monitored by LINSTOR. + :param function logger: Function to log messages. + :return: A new LinstorSr instance. + :rtype: LinstorSr +@@ -1283,6 +1285,7 @@ class LinstorVolumeManager(object): + ips, + redundancy, + thin_provisioning, ++ auto_quorum, + logger + ) + finally: +@@ -1300,7 +1303,7 @@ class LinstorVolumeManager(object): + @classmethod + def _create_sr( + cls, group_name, node_names, ips, redundancy, +- thin_provisioning=False, ++ thin_provisioning, auto_quorum, + logger=default_logger.__func__ + ): + # 1. Check if SR already exists. +@@ -1406,7 +1409,9 @@ class LinstorVolumeManager(object): + # 3. Create the LINSTOR database volume and mount it. + try: + logger('Creating database volume...') +- volume_path = cls._create_database_volume(lin, group_name) ++ volume_path = cls._create_database_volume( ++ lin, group_name, auto_quorum ++ ) + except LinstorVolumeManagerError as e: + if e.code != LinstorVolumeManagerError.ERR_VOLUME_EXISTS: + logger('Destroying database volume after creation fail...') +@@ -2113,7 +2118,7 @@ class LinstorVolumeManager(object): + return resources[0].volumes[0].device_path + + @classmethod +- def _create_database_volume(cls, lin, group_name): ++ def _create_database_volume(cls, lin, group_name, auto_quorum): + try: + dfns = lin.resource_dfn_list_raise().resource_definitions + except Exception as e: +@@ -2139,16 +2144,17 @@ class LinstorVolumeManager(object): + + # We must modify the quorum. Otherwise we can't use correctly the + # minidrbdcluster daemon. +- result = lin.resource_dfn_modify(DATABASE_VOLUME_NAME, { +- 'DrbdOptions/auto-quorum': 'disabled', +- 'DrbdOptions/Resource/quorum': 'majority' +- }) +- error_str = cls._get_error_str(result) +- if error_str: +- raise LinstorVolumeManagerError( +- 'Could not activate quorum on database volume: {}' +- .format(error_str) +- ) ++ if auto_quorum: ++ result = lin.resource_dfn_modify(DATABASE_VOLUME_NAME, { ++ 'DrbdOptions/auto-quorum': 'disabled', ++ 'DrbdOptions/Resource/quorum': 'majority' ++ }) ++ error_str = cls._get_error_str(result) ++ if error_str: ++ raise LinstorVolumeManagerError( ++ 'Could not activate quorum on database volume: {}' ++ .format(error_str) ++ ) + + current_device_path = cls._request_database_path(lin, activate=True) + +-- +2.45.2 + diff --git a/SOURCES/0038-fix-LinstorVolumeManager-add-a-workaround-to-create-.patch b/SOURCES/0038-fix-LinstorVolumeManager-add-a-workaround-to-create-.patch new file mode 100644 index 00000000..550f18bc --- /dev/null +++ b/SOURCES/0038-fix-LinstorVolumeManager-add-a-workaround-to-create-.patch @@ -0,0 +1,36 @@ +From 9e0f7c02ae9c09c9d3be6ab4bcec31325d95e719 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Tue, 23 Mar 2021 14:49:39 +0100 +Subject: [PATCH 038/175] fix(LinstorVolumeManager): add a workaround to create + properly SR with thin LVM + +Signed-off-by: Ronan Abhamon +--- + drivers/linstorvolumemanager.py | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 27c8df5..3aaffdf 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -2134,6 +2134,17 @@ class LinstorVolumeManager(object): + ) + 'LINSTOR volume list must be empty.' + ) + ++ # Workaround to use thin lvm. Without this line an error is returned: ++ # "Not enough available nodes" ++ # I don't understand why but this command protect against this bug. ++ try: ++ lin.storage_pool_list_raise(filter_by_stor_pools=[group_name]) ++ except Exception as e: ++ raise LinstorVolumeManagerError( ++ 'Failed to get storage pool list before database creation: {}' ++ .format(e) ++ ) ++ + size = cls.round_up_volume_size(DATABASE_SIZE) + cls._check_volume_creation_errors(lin.resource_group_spawn( + rsc_grp_name=group_name, +-- +2.45.2 + diff --git a/SOURCES/0039-feat-LinstorSR-add-optional-ips-parameter.patch b/SOURCES/0039-feat-LinstorSR-add-optional-ips-parameter.patch new file mode 100644 index 00000000..cdc5c0f1 --- /dev/null +++ b/SOURCES/0039-feat-LinstorSR-add-optional-ips-parameter.patch @@ -0,0 +1,123 @@ +From 89daa5b5525c2636a624fa4cf583d5b43ca06aad Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Wed, 24 Mar 2021 10:06:58 +0100 +Subject: [PATCH 039/175] feat(LinstorSR): add optional ips parameter + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 30 ++++++++++++++++++++----- + drivers/linstorvolumemanager.py | 40 ++++++++++++++++++++++----------- + 2 files changed, 52 insertions(+), 18 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 9f2be58..4b761b5 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -77,6 +77,7 @@ CAPABILITIES = [ + CONFIGURATION = [ + ['group-name', 'LVM group name'], + ['hosts', 'host names to use'], ++ ['ips', 'ips to use (optional, defaults to management networks)'], + ['redundancy', 'replication count'], + ['provisioning', '"thin" or "thick" are accepted (optional, defaults to thin)'], + ['monitor-db-quorum', 'disable controller when only one host is online (optional, defaults to true)'] +@@ -325,6 +326,10 @@ class LinstorSR(SR.SR): + self.sr_vditype = SR.DEFAULT_TAP + + self._hosts = list(set(self.dconf['hosts'].split(','))) ++ if 'ips' not in self.dconf or not self.dconf['ips']: ++ self._ips = None ++ else: ++ self._ips = self.dconf['ips'].split(',') + self._redundancy = int(self.dconf['redundancy'] or 1) + self._linstor = None # Ensure that LINSTOR attribute exists. + self._journaler = None +@@ -533,11 +538,26 @@ class LinstorSR(SR.SR): + ) + + ips = {} +- for host in online_hosts: +- record = self.session.xenapi.host.get_record(host) +- hostname = record['hostname'] +- if hostname in self._hosts: +- ips[hostname] = record['address'] ++ if not self._ips: ++ for host in online_hosts: ++ record = self.session.xenapi.host.get_record(host) ++ hostname = record['hostname'] ++ if hostname in self._hosts: ++ ips[hostname] = record['address'] ++ elif len(self._ips) != len(self._hosts): ++ raise xs_errors.XenError( ++ 'LinstorSRCreate', ++ opterr='ips must be equal to host count' ++ ) ++ else: ++ for host in online_hosts: ++ record = self.session.xenapi.host.get_record(host) ++ hostname = record['hostname'] ++ try: ++ index = self._hosts.index(hostname) ++ ips[hostname] = self._ips[index] ++ except ValueError as e: ++ pass + + if len(ips) != len(self._hosts): + raise xs_errors.XenError( +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 3aaffdf..5c04d02 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -1313,22 +1313,36 @@ class LinstorVolumeManager(object): + + for node_name in node_names: + ip = ips[node_name] +- result = lin.node_create( +- node_name, +- linstor.consts.VAL_NODE_TYPE_CMBD, +- ip +- ) +- errors = cls._filter_errors(result) +- if cls._check_errors(errors, [linstor.consts.FAIL_EXISTS_NODE]): +- continue + +- if errors: +- raise LinstorVolumeManagerError( +- 'Failed to create node `{}` with ip `{}`: {}'.format( +- node_name, ip, cls._get_error_str(errors) +- ) ++ while True: ++ # Try to create node. ++ result = lin.node_create( ++ node_name, ++ linstor.consts.VAL_NODE_TYPE_CMBD, ++ ip + ) + ++ errors = cls._filter_errors(result) ++ if cls._check_errors( ++ errors, [linstor.consts.FAIL_EXISTS_NODE] ++ ): ++ # If it already exists, remove, then recreate. ++ result = lin.node_delete(node_name) ++ error_str = cls._get_error_str(result) ++ if error_str: ++ raise LinstorVolumeManagerError( ++ 'Failed to remove old node `{}`: {}' ++ .format(node_name, error_str) ++ ) ++ elif not errors: ++ break # Created! ++ else: ++ raise LinstorVolumeManagerError( ++ 'Failed to create node `{}` with ip `{}`: {}'.format( ++ node_name, ip, cls._get_error_str(errors) ++ ) ++ ) ++ + driver_pool_name = group_name + group_name = cls._build_group_name(group_name) + pools = lin.storage_pool_list_raise(filter_by_stor_pools=[group_name]) +-- +2.45.2 + diff --git a/SOURCES/0040-feat-LinstorSR-add-a-helper-log_drbd_erofs-to-trace-.patch b/SOURCES/0040-feat-LinstorSR-add-a-helper-log_drbd_erofs-to-trace-.patch new file mode 100644 index 00000000..167ecc14 --- /dev/null +++ b/SOURCES/0040-feat-LinstorSR-add-a-helper-log_drbd_erofs-to-trace-.patch @@ -0,0 +1,216 @@ +From a9b37afd7c792af514898a3128fc129b8d5c90e4 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Fri, 26 Mar 2021 16:13:20 +0100 +Subject: [PATCH 040/175] feat(LinstorSR): add a helper `log_drbd_erofs` to + trace EROFS errno code with DRBD resources + check EROFS error + +Signed-off-by: Ronan Abhamon +--- + drivers/blktap2.py | 18 ++++++- + drivers/linstor-manager | 19 +++++++- + drivers/linstorvolumemanager.py | 83 ++++++++++++++++++++++++++++++++- + drivers/vhdutil.py | 2 +- + 4 files changed, 118 insertions(+), 4 deletions(-) + +diff --git a/drivers/blktap2.py b/drivers/blktap2.py +index e9305ce..70e74c6 100755 +--- a/drivers/blktap2.py ++++ b/drivers/blktap2.py +@@ -36,6 +36,7 @@ import json + import xs_errors + import XenAPI + import scsiutil ++from linstorvolumemanager import log_lsof_drbd + from syslog import openlog, syslog + from stat import * # S_ISBLK(), ... + import nfs +@@ -817,7 +818,22 @@ class Tapdisk(object): + TapCtl.attach(pid, minor) + + try: +- TapCtl.open(pid, minor, _type, path, options) ++ retry_open = 0 ++ while True: ++ try: ++ TapCtl.open(pid, minor, _type, path, options) ++ except TapCtl.CommandFailure as e: ++ err = ( ++ 'status' in e.info and e.info['status'] ++ ) or None ++ if err in (errno.EIO, errno.EROFS, errno.EAGAIN): ++ if retry_open < 5: ++ retry_open += 1 ++ time.sleep(1) ++ continue ++ if err == errno.EROFS: ++ log_lsof_drbd(path) ++ break + try: + tapdisk = cls.__from_blktap(blktap) + node = '/sys/dev/block/%d:%d' % (tapdisk.major(), tapdisk.minor) +diff --git a/drivers/linstor-manager b/drivers/linstor-manager +index f82b73f..a06ed20 100755 +--- a/drivers/linstor-manager ++++ b/drivers/linstor-manager +@@ -327,6 +327,22 @@ def lock_vdi(session, args): + return str(False) + + ++def lsof_resource(session, args): ++ try: ++ drbd_path = args['drbdPath'] ++ (ret, stdout, stderr) = util.doexec(['lsof', drbd_path]) ++ if ret == 0: ++ return 'DRBD resource `{}` is open: {}'.format( ++ drbd_path, stdout ++ ) ++ return '`lsof` on DRBD resource `{}` returned {}: {}'.format( ++ drbd_path, ret, stderr ++ ) ++ except Exception as e: ++ util.SMlog('linstor-manager:lsof_drbd error: {}'.format(e)) ++ raise ++ ++ + if __name__ == '__main__': + XenAPIPlugin.dispatch({ + 'prepareSr': prepare_sr, +@@ -344,5 +360,6 @@ if __name__ == '__main__': + 'getDepth': get_depth, + 'getKeyHash': get_key_hash, + 'getBlockBitmap': get_block_bitmap, +- 'lockVdi': lock_vdi ++ 'lockVdi': lock_vdi, ++ 'lsofResource': lsof_resource + }) +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 5c04d02..0357b92 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -16,6 +16,7 @@ + # + + ++import errno + import glob + import json + import linstor +@@ -23,6 +24,7 @@ import os.path + import re + import shutil + import socket ++import stat + import time + import util + import uuid +@@ -37,6 +39,85 @@ DATABASE_MKFS = 'mkfs.ext4' + REG_DRBDADM_PRIMARY = re.compile("([^\\s]+)\\s+role:Primary") + REG_DRBDSETUP_IP = re.compile('[^\\s]+\\s+(.*):.*$') + ++DRBD_BY_RES_PATH = '/dev/drbd/by-res/' ++ ++ ++# Check if a path is a DRBD resource and log the process name/pid ++# that opened it. ++def log_lsof_drbd(path): ++ PLUGIN = 'linstor-manager' ++ PLUGIN_CMD = 'lsofResource' ++ ++ # Ignore if it's not a symlink to DRBD resource. ++ if not path.startswith(DRBD_BY_RES_PATH): ++ return ++ ++ # Compute resource name. ++ res_name_end = path.find('/', len(DRBD_BY_RES_PATH)) ++ if res_name_end == -1: ++ return ++ res_name = path[len(DRBD_BY_RES_PATH):res_name_end] ++ ++ try: ++ # Ensure path is a DRBD. ++ drbd_path = os.path.realpath(path) ++ stats = os.stat(drbd_path) ++ if not stat.S_ISBLK(stats.st_mode) or os.major(stats.st_rdev) != 147: ++ return ++ ++ # Find where the device is open. ++ (ret, stdout, stderr) = util.doexec(['drbdadm', 'status', res_name]) ++ if ret != 0: ++ util.SMlog('Failed to execute `drbdadm status` on `{}`: {}'.format( ++ res_name, stderr ++ )) ++ return ++ ++ # Is it a local device? ++ if stdout.startswith('{} role:Primary'.format(res_name)): ++ (ret, stdout, stderr) = util.doexec(['lsof', drbd_path]) ++ if ret == 0: ++ util.SMlog( ++ 'DRBD resource `{}` is open on local host: {}' ++ .format(path, stdout) ++ ) ++ else: ++ util.SMlog( ++ '`lsof` on local DRBD resource `{}` returned {}: {}' ++ .format(path, ret, stderr) ++ ) ++ return ++ ++ # Is it a remote device? ++ res = REG_DRBDADM_PRIMARY.search(stdout) ++ if not res: ++ util.SMlog( ++ 'Cannot find where is open DRBD resource `{}`' ++ .format(path) ++ ) ++ return ++ node_name = res.groups()[0] ++ ++ session = util.get_localAPI_session() ++ hosts = session.xenapi.host.get_all_records() ++ for host_ref, host_record in hosts.items(): ++ if node_name != host_record['hostname']: ++ continue ++ ++ ret = session.xenapi.host.call_plugin( ++ host_ref, PLUGIN, PLUGIN_CMD, {'drbdPath': drbd_path}, ++ ) ++ util.SMlog('DRBD resource `{}` status on host `{}`: {}'.format( ++ path, host_ref, ret ++ )) ++ return ++ util.SMlog('Cannot find primary host of DRBD resource {}'.format(path)) ++ except Exception as e: ++ util.SMlog( ++ 'Got exception while trying to determine where DRBD resource ' + ++ '`{}` is open: {}'.format(path, e) ++ ) ++ + + # ============================================================================== + +@@ -162,7 +243,7 @@ class LinstorVolumeManager(object): + '_kv_cache_dirty', '_resource_cache_dirty', '_volume_info_cache_dirty' + ) + +- DEV_ROOT_PATH = '/dev/drbd/by-res/' ++ DEV_ROOT_PATH = DRBD_BY_RES_PATH + + # Default LVM extent size. + BLOCK_SIZE = 4 * 1024 * 1024 +diff --git a/drivers/vhdutil.py b/drivers/vhdutil.py +index 422834e..0a8fe91 100755 +--- a/drivers/vhdutil.py ++++ b/drivers/vhdutil.py +@@ -99,7 +99,7 @@ def fullSizeVHD(virtual_size): + + def ioretry(cmd): + return util.ioretry(lambda: util.pread2(cmd), +- errlist = [errno.EIO, errno.EAGAIN]) ++ errlist = [errno.EIO, errno.EROFS, errno.EAGAIN]) + + def getVHDInfo(path, extractUuidFunction, includeParent = True): + """Get the VHD info. The parent info may optionally be omitted: vhd-util +-- +2.45.2 + diff --git a/SOURCES/0041-fix-LinstorSR-try-to-restart-the-services-again-if-t.patch b/SOURCES/0041-fix-LinstorSR-try-to-restart-the-services-again-if-t.patch new file mode 100644 index 00000000..e39f15d6 --- /dev/null +++ b/SOURCES/0041-fix-LinstorSR-try-to-restart-the-services-again-if-t.patch @@ -0,0 +1,74 @@ +From 8c41a8dd967155cebcaa814da070aca0d0e4f884 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Wed, 28 Apr 2021 15:15:58 +0200 +Subject: [PATCH 041/175] fix(LinstorSR): try to restart the services again if + there is a failure in linstor-manager + +Signed-off-by: Ronan Abhamon +--- + drivers/linstor-manager | 39 ++++++++++++++++++++++++++++----------- + 1 file changed, 28 insertions(+), 11 deletions(-) + +diff --git a/drivers/linstor-manager b/drivers/linstor-manager +index a06ed20..dcd4bc6 100755 +--- a/drivers/linstor-manager ++++ b/drivers/linstor-manager +@@ -16,6 +16,7 @@ + + import base64 + import distutils.util ++import time + import subprocess + import sys + import XenAPIPlugin +@@ -52,20 +53,36 @@ def update_all_ports(open): + + + def enable_and_start_service(name, start): +- fn = 'enable' if start else 'disable' +- args = ('systemctl', fn, '--now', name) +- (ret, out, err) = util.doexec(args) +- if ret == 0: +- return +- raise Exception('Failed to {} {}: {} {}'.format(fn, name, out, err)) ++ attempt = 0 ++ while True: ++ attempt += 1 ++ fn = 'enable' if start else 'disable' ++ args = ('systemctl', fn, '--now', name) ++ (ret, out, err) = util.doexec(args) ++ if ret == 0: ++ return ++ elif attempt >= 3: ++ raise Exception( ++ 'Failed to {} {}: {} {}'.format(fn, name, out, err) ++ ) ++ time.sleep(1) + + + def restart_service(name): +- args = ('systemctl', 'restart', name) +- (ret, out, err) = util.doexec(args) +- if ret == 0: +- return +- raise Exception('Failed to restart {}: {} {}'.format(name, out, err)) ++ attempt = 0 ++ while True: ++ attempt += 1 ++ util.SMlog('linstor-manager:restart service {} {}...'.format(name, attempt)) ++ args = ('systemctl', 'restart', name) ++ (ret, out, err) = util.doexec(args) ++ if ret == 0: ++ return ++ elif attempt >= 3: ++ util.SMlog('linstor-manager:restart service FAILED {} {}'.format(name, attempt)) ++ raise Exception( ++ 'Failed to restart {}: {} {}'.format(name, out, err) ++ ) ++ time.sleep(1) + + + def stop_service(name): +-- +2.45.2 + diff --git a/SOURCES/0042-fix-LinstorSR-robustify-linstor-manager-to-never-inc.patch b/SOURCES/0042-fix-LinstorSR-robustify-linstor-manager-to-never-inc.patch new file mode 100644 index 00000000..88d45675 --- /dev/null +++ b/SOURCES/0042-fix-LinstorSR-robustify-linstor-manager-to-never-inc.patch @@ -0,0 +1,39 @@ +From 37830a5946c792522da2ee00c7b0961714157d5f Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Thu, 26 Aug 2021 15:26:11 +0200 +Subject: [PATCH 042/175] fix(LinstorSR): robustify linstor-manager to never + include from plugins path + +Signed-off-by: Ronan Abhamon +--- + drivers/linstor-manager | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/drivers/linstor-manager b/drivers/linstor-manager +index dcd4bc6..f12747f 100755 +--- a/drivers/linstor-manager ++++ b/drivers/linstor-manager +@@ -14,14 +14,18 @@ + # You should have received a copy of the GNU General Public License + # along with this program. If not, see . + ++# We must modify default import path, we don't want to import modules ++# installed in plugins folder and instead we must import from LINSTOR driver ++# folder. ++import sys ++sys.path[0] = '/opt/xensource/sm/' ++ + import base64 + import distutils.util + import time + import subprocess +-import sys + import XenAPIPlugin + +-sys.path.append('/opt/xensource/sm/') + from linstorjournaler import LinstorJournaler + from linstorvolumemanager import get_controller_uri, LinstorVolumeManager + from lock import Lock +-- +2.45.2 + diff --git a/SOURCES/0043-fix-LinstorSR-prevent-starting-controller-during-fai.patch b/SOURCES/0043-fix-LinstorSR-prevent-starting-controller-during-fai.patch new file mode 100644 index 00000000..02a9c999 --- /dev/null +++ b/SOURCES/0043-fix-LinstorSR-prevent-starting-controller-during-fai.patch @@ -0,0 +1,65 @@ +From 11ec5ee20b72dc71fc2e06a8b9950fb9ba39d827 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Thu, 26 Aug 2021 16:52:01 +0200 +Subject: [PATCH 043/175] fix(LinstorSR): prevent starting controller during + fail in linstor manager destroy method + +Signed-off-by: Ronan Abhamon +--- + drivers/linstorvolumemanager.py | 17 +++++++++++++++-- + 1 file changed, 15 insertions(+), 2 deletions(-) + +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 0357b92..e9b7c2f 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -1263,9 +1263,11 @@ class LinstorVolumeManager(object): + 'It exists remaining volumes' + ) + ++ controller_is_running = self._controller_is_running() + uri = 'linstor://localhost' + try: +- self._start_controller(start=False) ++ if controller_is_running: ++ self._start_controller(start=False) + + # 1. Umount LINSTOR database. + self._mount_database_volume( +@@ -1290,7 +1292,7 @@ class LinstorVolumeManager(object): + self._linstor, pool.name, pool.node_name + ) + except Exception as e: +- self._start_controller(start=True) ++ self._start_controller(start=controller_is_running) + raise e + + try: +@@ -2503,6 +2505,10 @@ class LinstorVolumeManager(object): + return True + return False + ++ @classmethod ++ def _controller_is_running(cls): ++ return cls._service_is_running('linstor-controller') ++ + @classmethod + def _start_controller(cls, start=True): + return cls._start_service('linstor-controller', start) +@@ -2519,6 +2525,13 @@ class LinstorVolumeManager(object): + .format(action, name, out, err) + ) + ++ @staticmethod ++ def _service_is_running(name): ++ (ret, out, err) = util.doexec([ ++ 'systemctl', 'is-active', '--quiet', name ++ ]) ++ return not ret ++ + @staticmethod + def _is_mounted(mountpoint): + (ret, out, err) = util.doexec(['mountpoint', '-q', mountpoint]) +-- +2.45.2 + diff --git a/SOURCES/0044-feat-LinstorVolumeManager-increase-peer-slots-limit-.patch b/SOURCES/0044-feat-LinstorVolumeManager-increase-peer-slots-limit-.patch new file mode 100644 index 00000000..aaa92c9f --- /dev/null +++ b/SOURCES/0044-feat-LinstorVolumeManager-increase-peer-slots-limit-.patch @@ -0,0 +1,170 @@ +From 4cd5b2cf5839b03eac7a2ac283681814993521b8 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Tue, 19 Oct 2021 14:48:17 +0200 +Subject: [PATCH 044/175] feat(LinstorVolumeManager): increase peer slots limit + (support 31 connections to a DRBD) + +- Also, create diskless devices when db is created + +Signed-off-by: Ronan Abhamon +--- + drivers/linstorvolumemanager.py | 84 ++++++++++++++++++++++++++------- + 1 file changed, 67 insertions(+), 17 deletions(-) + +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index e9b7c2f..553e2f5 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -1507,7 +1507,7 @@ class LinstorVolumeManager(object): + try: + logger('Creating database volume...') + volume_path = cls._create_database_volume( +- lin, group_name, auto_quorum ++ lin, group_name, node_names, redundancy, auto_quorum + ) + except LinstorVolumeManagerError as e: + if e.code != LinstorVolumeManagerError.ERR_VOLUME_EXISTS: +@@ -1786,18 +1786,32 @@ class LinstorVolumeManager(object): + size = self.round_up_volume_size(size) + self._mark_resource_cache_as_dirty() + +- # A. Basic case when we use the default redundancy of the group. +- if not no_diskless: ++ def create_definition(): + self._check_volume_creation_errors( + self._linstor.resource_group_spawn( + rsc_grp_name=self._group_name, + rsc_dfn_name=volume_name, + vlm_sizes=['{}B'.format(size)], +- definitions_only=not place_resources ++ definitions_only=True + ), + volume_uuid, + self._group_name + ) ++ self._increase_volume_peer_slots(self._linstor, volume_name) ++ ++ # A. Basic case when we use the default redundancy of the group. ++ if not no_diskless: ++ create_definition() ++ if place_resources: ++ self._check_volume_creation_errors( ++ self._linstor.resource_auto_place( ++ rsc_name=volume_name, ++ place_count=self._redundancy, ++ diskless_on_remaining=not no_diskless ++ ), ++ volume_uuid, ++ self._group_name ++ ) + return + + # B. Complex case. +@@ -1829,17 +1843,7 @@ class LinstorVolumeManager(object): + + def create(): + try: +- self._check_volume_creation_errors( +- self._linstor.resource_group_spawn( +- rsc_grp_name=self._group_name, +- rsc_dfn_name=volume_name, +- vlm_sizes=['{}B'.format(size)], +- definitions_only=True +- ), +- volume_uuid, +- self._group_name +- ) +- ++ create_definition() + result = self._linstor.resource_create(resources) + error_str = self._get_error_str(result) + if error_str: +@@ -2164,6 +2168,16 @@ class LinstorVolumeManager(object): + ] + ) + ++ @classmethod ++ def _increase_volume_peer_slots(cls, lin, volume_name): ++ result = lin.resource_dfn_modify(volume_name, {}, peer_slots=31) ++ error_str = cls._get_error_str(result) ++ if error_str: ++ raise LinstorVolumeManagerError( ++ 'Could not increase volume peer slots of {}: {}' ++ .format(volume_name, error_str) ++ ) ++ + @classmethod + def _activate_device_path(cls, lin, node_name, volume_name): + result = lin.resource_create([ +@@ -2215,7 +2229,9 @@ class LinstorVolumeManager(object): + return resources[0].volumes[0].device_path + + @classmethod +- def _create_database_volume(cls, lin, group_name, auto_quorum): ++ def _create_database_volume( ++ cls, lin, group_name, node_names, redundancy, auto_quorum ++ ): + try: + dfns = lin.resource_dfn_list_raise().resource_definitions + except Exception as e: +@@ -2242,13 +2258,40 @@ class LinstorVolumeManager(object): + .format(e) + ) + ++ # Create the database definition. + size = cls.round_up_volume_size(DATABASE_SIZE) + cls._check_volume_creation_errors(lin.resource_group_spawn( + rsc_grp_name=group_name, + rsc_dfn_name=DATABASE_VOLUME_NAME, + vlm_sizes=['{}B'.format(size)], +- definitions_only=False ++ definitions_only=True + ), DATABASE_VOLUME_NAME, group_name) ++ cls._increase_volume_peer_slots(lin, DATABASE_VOLUME_NAME) ++ ++ # Create real resources on the first nodes. ++ resources = [] ++ for node_name in node_names[:redundancy]: ++ resources.append(linstor.ResourceData( ++ node_name=node_name, ++ rsc_name=DATABASE_VOLUME_NAME, ++ storage_pool=group_name ++ )) ++ # Create diskless resources on the remaining set. ++ for node_name in node_names[redundancy:]: ++ resources.append(linstor.ResourceData( ++ node_name=node_name, ++ rsc_name=DATABASE_VOLUME_NAME, ++ diskless=True ++ )) ++ ++ result = lin.resource_create(resources) ++ error_str = cls._get_error_str(result) ++ if error_str: ++ raise LinstorVolumeManagerError( ++ 'Could not create database volume from SR `{}`: {}'.format( ++ group_name, error_str ++ ) ++ ) + + # We must modify the quorum. Otherwise we can't use correctly the + # minidrbdcluster daemon. +@@ -2264,8 +2307,15 @@ class LinstorVolumeManager(object): + .format(error_str) + ) + ++ # Create database and ensure path exists locally and ++ # on replicated devices. + current_device_path = cls._request_database_path(lin, activate=True) + ++ # Ensure diskless paths exist on other hosts. Otherwise PBDs can't be ++ # plugged. ++ for node_name in node_names: ++ cls._activate_device_path(lin, node_name, DATABASE_VOLUME_NAME) ++ + # We use realpath here to get the /dev/drbd path instead of + # /dev/drbd/by-res/. + expected_device_path = cls.build_device_path(DATABASE_VOLUME_NAME) +-- +2.45.2 + diff --git a/SOURCES/0045-feat-LinstorVolumeManager-add-a-fallback-to-find-con.patch b/SOURCES/0045-feat-LinstorVolumeManager-add-a-fallback-to-find-con.patch new file mode 100644 index 00000000..3b1aed4c --- /dev/null +++ b/SOURCES/0045-feat-LinstorVolumeManager-add-a-fallback-to-find-con.patch @@ -0,0 +1,117 @@ +From 861d82036fb2bd397c7b97ce1d2720bc6d7a977b Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Wed, 20 Oct 2021 14:33:04 +0200 +Subject: [PATCH 045/175] feat(LinstorVolumeManager): add a fallback to find + controller uri (when len(hosts) >= 4) + +Signed-off-by: Ronan Abhamon +--- + drivers/linstor-manager | 10 +++++++- + drivers/linstorvolumemanager.py | 42 ++++++++++++++++++++++++--------- + 2 files changed, 40 insertions(+), 12 deletions(-) + +diff --git a/drivers/linstor-manager b/drivers/linstor-manager +index f12747f..afc4bfe 100755 +--- a/drivers/linstor-manager ++++ b/drivers/linstor-manager +@@ -364,6 +364,13 @@ def lsof_resource(session, args): + raise + + ++def has_controller_running(session, args): ++ (ret, stdout, stderr) = util.doexec([ ++ 'systemctl', 'is-active', '--quiet', 'linstor-controller' ++ ]) ++ return str(ret == 0) ++ ++ + if __name__ == '__main__': + XenAPIPlugin.dispatch({ + 'prepareSr': prepare_sr, +@@ -382,5 +389,6 @@ if __name__ == '__main__': + 'getKeyHash': get_key_hash, + 'getBlockBitmap': get_block_bitmap, + 'lockVdi': lock_vdi, +- 'lsofResource': lsof_resource ++ 'lsofResource': lsof_resource, ++ 'hasControllerRunning': has_controller_running + }) +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 553e2f5..821ef42 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -16,6 +16,7 @@ + # + + ++import distutils.util + import errno + import glob + import json +@@ -41,11 +42,12 @@ REG_DRBDSETUP_IP = re.compile('[^\\s]+\\s+(.*):.*$') + + DRBD_BY_RES_PATH = '/dev/drbd/by-res/' + ++PLUGIN = 'linstor-manager' ++ + + # Check if a path is a DRBD resource and log the process name/pid + # that opened it. + def log_lsof_drbd(path): +- PLUGIN = 'linstor-manager' + PLUGIN_CMD = 'lsofResource' + + # Ignore if it's not a symlink to DRBD resource. +@@ -159,21 +161,39 @@ def get_remote_host_ip(node_name): + + + def _get_controller_uri(): ++ PLUGIN_CMD = 'hasControllerRunning' ++ ++ # Try to find controller using drbdadm. + (ret, stdout, stderr) = util.doexec([ + 'drbdadm', 'status', DATABASE_VOLUME_NAME + ]) +- if ret != 0: +- return ++ if ret == 0: ++ # If we are here, the database device exists locally. + +- if stdout.startswith('{} role:Primary'.format(DATABASE_VOLUME_NAME)): +- return 'linstor://localhost' ++ if stdout.startswith('{} role:Primary'.format(DATABASE_VOLUME_NAME)): ++ # Nice case, we have the controller running on this local host. ++ return 'linstor://localhost' + +- res = REG_DRBDADM_PRIMARY.search(stdout) +- if res: +- node_name = res.groups()[0] +- ip = get_remote_host_ip(node_name) +- if ip: +- return 'linstor://' + ip ++ # Try to find the host using DRBD connections. ++ res = REG_DRBDADM_PRIMARY.search(stdout) ++ if res: ++ node_name = res.groups()[0] ++ ip = get_remote_host_ip(node_name) ++ if ip: ++ return 'linstor://' + ip ++ ++ # Worst case: we use many hosts in the pool (>= 4), so we can't find the ++ # primary using drbdadm because we don't have all connections to the ++ # replicated volume. `drbdadm status xcp-persistent-database` returns ++ # 3 connections by default. ++ session = util.get_localAPI_session() ++ for host_ref, host_record in session.xenapi.host.get_all_records().items(): ++ if distutils.util.strtobool( ++ session.xenapi.host.call_plugin(host_ref, PLUGIN, PLUGIN_CMD, {}) ++ ): ++ return 'linstor://' + host_record['hostname'] ++ ++ # Not found, maybe we are trying to create the SR... + + + def get_controller_uri(): +-- +2.45.2 + diff --git a/SOURCES/0046-fix-var-lib-linstor.mount-ensure-we-always-mount-dat.patch b/SOURCES/0046-fix-var-lib-linstor.mount-ensure-we-always-mount-dat.patch new file mode 100644 index 00000000..af66a68c --- /dev/null +++ b/SOURCES/0046-fix-var-lib-linstor.mount-ensure-we-always-mount-dat.patch @@ -0,0 +1,110 @@ +From 56ab590173a6de1d5958afd1642fe956353f631e Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Thu, 21 Oct 2021 11:13:07 +0200 +Subject: [PATCH 046/175] fix(var-lib-linstor.mount): ensure we always mount + database with RW flags + +Sometimes systemd fallback to read only FS if the volume can't be mounted, we must +forbid that. It's probably a DRBD error. + +Signed-off-by: Ronan Abhamon +--- + Makefile | 2 +- + drivers/linstor-manager | 4 ++-- + etc/minidrbdcluster.ini | 2 +- + etc/systemd/system/var-lib-linstor.mount | 6 ------ + etc/systemd/system/var-lib-linstor.service | 21 +++++++++++++++++++++ + 5 files changed, 25 insertions(+), 10 deletions(-) + delete mode 100644 etc/systemd/system/var-lib-linstor.mount + create mode 100644 etc/systemd/system/var-lib-linstor.service + +diff --git a/Makefile b/Makefile +index 43dd569..2eb6a86 100755 +--- a/Makefile ++++ b/Makefile +@@ -182,7 +182,7 @@ install: precheck + $(SM_STAGING)/$(LOGROTATE_DIR) + install -m 644 etc/systemd/system/linstor-satellite.service.d/override.conf \ + $(SM_STAGING)/$(SYSTEMD_CONF_DIR)/linstor-satellite.service.d/ +- install -m 644 etc/systemd/system/var-lib-linstor.mount \ ++ install -m 644 etc/systemd/system/var-lib-linstor.service \ + $(SM_STAGING)/$(SYSTEMD_CONF_DIR) + install -m 644 etc/minidrbdcluster.ini \ + $(SM_STAGING)/$(MINI_DRBD_CLUSTER_CONF_DIR) +diff --git a/drivers/linstor-manager b/drivers/linstor-manager +index afc4bfe..af8d2b9 100755 +--- a/drivers/linstor-manager ++++ b/drivers/linstor-manager +@@ -187,7 +187,7 @@ def destroy(session, args): + + # When destroy is called, there are no running minidrbdcluster daemons. + # So the controllers are stopped too, we must start an instance. +- restart_service('var-lib-linstor.mount') ++ restart_service('var-lib-linstor.service') + restart_service('linstor-controller') + + linstor = LinstorVolumeManager( +@@ -199,7 +199,7 @@ def destroy(session, args): + return str(True) + except Exception as e: + stop_service('linstor-controller') +- stop_service('var-lib-linstor.mount') ++ stop_service('var-lib-linstor.service') + util.SMlog('linstor-manager:destroy error: {}'.format(e)) + return str(False) + +diff --git a/etc/minidrbdcluster.ini b/etc/minidrbdcluster.ini +index 0126e86..9e52342 100644 +--- a/etc/minidrbdcluster.ini ++++ b/etc/minidrbdcluster.ini +@@ -5,7 +5,7 @@ + # section name the systemd-units to activate on one of the nodes. + + [xcp-persistent-database] +-systemd-units=var-lib-linstor.mount,linstor-controller.service ++systemd-units=var-lib-linstor.service,linstor-controller.service + + [xcp-persistent-ha-statefile] + systemd-units= +diff --git a/etc/systemd/system/var-lib-linstor.mount b/etc/systemd/system/var-lib-linstor.mount +deleted file mode 100644 +index a05a7f7..0000000 +--- a/etc/systemd/system/var-lib-linstor.mount ++++ /dev/null +@@ -1,6 +0,0 @@ +-[Unit] +-Description=Filesystem for the LINSTOR controller +- +-[Mount] +-What=/dev/drbd/by-res/xcp-persistent-database/0 +-Where=/var/lib/linstor +diff --git a/etc/systemd/system/var-lib-linstor.service b/etc/systemd/system/var-lib-linstor.service +new file mode 100644 +index 0000000..d230d04 +--- /dev/null ++++ b/etc/systemd/system/var-lib-linstor.service +@@ -0,0 +1,21 @@ ++# Regarding the current version of systemd (v.219) used in XCP-ng, we can't use ++# the ReadWriteOnly option (to apply the -w flag, it's not the same than -o rw). ++# This file is a workaround to avoid RO. It must be replaced with the code below ++# in a mount unit. Compatible with version >= 246. ++# ++# [Unit] ++# Description=Filesystem for the LINSTOR controller ++# ++# [Mount] ++# What=/dev/drbd/by-res/xcp-persistent-database/0 ++# Where=/var/lib/linstor ++# ReadWriteOnly=true ++ ++[Unit] ++Description=Mount filesystem for the LINSTOR controller ++ ++[Service] ++Type=oneshot ++ExecStart=/bin/mount -w /dev/drbd/by-res/xcp-persistent-database/0 /var/lib/linstor ++ExecStop=/bin/umount /var/lib/linstor ++RemainAfterExit=true +-- +2.45.2 + diff --git a/SOURCES/0047-feat-LinstorVolumeManager-add-a-fallback-to-find-nod.patch b/SOURCES/0047-feat-LinstorVolumeManager-add-a-fallback-to-find-nod.patch new file mode 100644 index 00000000..3eaed984 --- /dev/null +++ b/SOURCES/0047-feat-LinstorVolumeManager-add-a-fallback-to-find-nod.patch @@ -0,0 +1,52 @@ +From cd1ac514af440aae4cdf8d6feae40e49b681460b Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Thu, 21 Oct 2021 11:51:32 +0200 +Subject: [PATCH 047/175] feat(LinstorVolumeManager): add a fallback to find + node name (when len(hosts) >= 4) + +Signed-off-by: Ronan Abhamon +--- + drivers/linstorvolumemanager.py | 21 ++++++++++++++------- + 1 file changed, 14 insertions(+), 7 deletions(-) + +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 821ef42..e497afa 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -210,19 +210,26 @@ def get_controller_uri(): + + + def get_controller_node_name(): ++ PLUGIN_CMD = 'hasControllerRunning' ++ + (ret, stdout, stderr) = util.doexec([ + 'drbdadm', 'status', DATABASE_VOLUME_NAME + ]) +- if ret != 0: +- return + +- if stdout.startswith('{} role:Primary'.format(DATABASE_VOLUME_NAME)): +- return 'localhost' ++ if ret == 0: ++ if stdout.startswith('{} role:Primary'.format(DATABASE_VOLUME_NAME)): ++ return 'localhost' + +- res = REG_DRBDADM_PRIMARY.search(stdout) +- if res: +- return res.groups()[0] ++ res = REG_DRBDADM_PRIMARY.search(stdout) ++ if res: ++ return res.groups()[0] + ++ session = util.get_localAPI_session() ++ for host_ref, host_record in session.xenapi.host.get_all_records().items(): ++ if distutils.util.strtobool( ++ session.xenapi.host.call_plugin(host_ref, PLUGIN, PLUGIN_CMD, {}) ++ ): ++ return host_record['hostname'] + + # ============================================================================== + +-- +2.45.2 + diff --git a/SOURCES/0048-feat-LinstorSR-explain-on-which-host-plugins-command.patch b/SOURCES/0048-feat-LinstorSR-explain-on-which-host-plugins-command.patch new file mode 100644 index 00000000..af8309f0 --- /dev/null +++ b/SOURCES/0048-feat-LinstorSR-explain-on-which-host-plugins-command.patch @@ -0,0 +1,50 @@ +From 00e42259522a7df6ded203f021893abbc3da5faa Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Tue, 26 Oct 2021 10:44:00 +0200 +Subject: [PATCH 048/175] feat(LinstorSR): explain on which host, plugins + commands are executed + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 24 ++++++++++++++++++------ + 1 file changed, 18 insertions(+), 6 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 4b761b5..519afb2 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -775,13 +775,25 @@ class LinstorSR(SR.SR): + # Network. + # -------------------------------------------------------------------------- + +- def _exec_manager_command(self, host, command, args, error): +- ret = self.session.xenapi.host.call_plugin( +- host, self.MANAGER_PLUGIN, command, args +- ) ++ def _exec_manager_command(self, host_ref, command, args, error): ++ host_rec = self.session.xenapi.host.get_record(host_ref) ++ host_uuid = host_rec['uuid'] ++ ++ try: ++ ret = self.session.xenapi.host.call_plugin( ++ host_ref, self.MANAGER_PLUGIN, command, args ++ ) ++ except Exception as e: ++ util.SMlog( ++ 'call-plugin on {} ({}:{} with {}) raised'.format( ++ host_uuid, self.MANAGER_PLUGIN, command, args ++ ) ++ ) ++ raise e ++ + util.SMlog( +- 'call-plugin ({}:{} with {}) returned: {}'.format( +- self.MANAGER_PLUGIN, command, args, ret ++ 'call-plugin on {} ({}:{} with {}) returned: {}'.format( ++ host_uuid, self.MANAGER_PLUGIN, command, args, ret + ) + ) + if ret == 'False': +-- +2.45.2 + diff --git a/SOURCES/0049-fix-LinstorSR-create-diskless-path-if-necessary-duri.patch b/SOURCES/0049-fix-LinstorSR-create-diskless-path-if-necessary-duri.patch new file mode 100644 index 00000000..f1d2d04e --- /dev/null +++ b/SOURCES/0049-fix-LinstorSR-create-diskless-path-if-necessary-duri.patch @@ -0,0 +1,36 @@ +From 0ecc1e49f3ba17f7cbbc68d3b99fc66c629269bf Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Wed, 3 Nov 2021 14:59:31 +0100 +Subject: [PATCH 049/175] fix(LinstorSR): create diskless path if necessary + during VDI loading + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 519afb2..15b9dda 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -1899,7 +1899,16 @@ class LinstorVDI(VDI.VDI): + self.size = volume_info.virtual_size + self.parent = '' + else: +- vhd_info = self.sr._vhdutil.get_vhd_info(self.uuid) ++ try: ++ vhd_info = self.sr._vhdutil.get_vhd_info(self.uuid) ++ except util.CommandException as e: ++ if e.code != errno.ENOENT: ++ raise ++ # Path doesn't exist. Probably a diskless without local path. ++ # Force creation and retry. ++ self._linstor.get_device_path(self.uuid) ++ vhd_info = self.sr._vhdutil.get_vhd_info(self.uuid) ++ + self.hidden = vhd_info.hidden + self.size = vhd_info.sizeVirt + self.parent = vhd_info.parentUuid +-- +2.45.2 + diff --git a/SOURCES/0050-feat-LinstorSR-use-HTTP-NBD-instead-of-DRBD-directly.patch b/SOURCES/0050-feat-LinstorSR-use-HTTP-NBD-instead-of-DRBD-directly.patch new file mode 100644 index 00000000..c0aa72b6 --- /dev/null +++ b/SOURCES/0050-feat-LinstorSR-use-HTTP-NBD-instead-of-DRBD-directly.patch @@ -0,0 +1,763 @@ +From a10314cb88276569e22142659254ae78c636e285 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Thu, 12 May 2022 17:52:35 +0200 +Subject: [PATCH 050/175] feat(LinstorSR): use HTTP/NBD instead of DRBD + directly with heartbeat VDI + +Signed-off-by: Ronan Abhamon +--- + Makefile | 1 + + drivers/LinstorSR.py | 380 ++++++++++++++++++++++++++++---- + drivers/linstor-manager | 43 +--- + drivers/linstorvhdutil.py | 6 +- + drivers/linstorvolumemanager.py | 17 +- + drivers/util.py | 49 ++++ + scripts/fork-log-daemon | 34 +++ + 7 files changed, 438 insertions(+), 92 deletions(-) + create mode 100755 scripts/fork-log-daemon + +diff --git a/Makefile b/Makefile +index 2eb6a86..af1011a 100755 +--- a/Makefile ++++ b/Makefile +@@ -239,6 +239,7 @@ install: precheck + install -m 755 drivers/iscsilib.py $(SM_STAGING)$(SM_DEST) + install -m 755 drivers/fcoelib.py $(SM_STAGING)$(SM_DEST) + mkdir -p $(SM_STAGING)$(LIBEXEC) ++ install -m 755 scripts/fork-log-daemon $(SM_STAGING)$(LIBEXEC) + install -m 755 scripts/local-device-change $(SM_STAGING)$(LIBEXEC) + install -m 755 scripts/check-device-sharing $(SM_STAGING)$(LIBEXEC) + install -m 755 scripts/usb_change $(SM_STAGING)$(LIBEXEC) +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 15b9dda..5bdf676 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -34,9 +34,13 @@ import cleanup + import distutils + import errno + import functools ++import os ++import re + import scsiutil ++import signal + import SR + import SRCommand ++import subprocess + import time + import traceback + import util +@@ -52,6 +56,8 @@ from srmetadata import \ + + HIDDEN_TAG = 'hidden' + ++FORK_LOG_DAEMON = '/opt/xensource/libexec/fork-log-daemon' ++ + # ============================================================================== + + # TODO: Supports 'VDI_INTRODUCE', 'VDI_RESET_ON_BOOT/2', 'SR_TRIM', +@@ -354,7 +360,9 @@ class LinstorSR(SR.SR): + + def load(self, *args, **kwargs): + if not self._has_session: +- if self.srcmd.cmd == 'vdi_attach_from_config': ++ if self.srcmd.cmd in ( ++ 'vdi_attach_from_config', 'vdi_detach_from_config' ++ ): + # We must have a valid LINSTOR instance here without using + # the XAPI. + controller_uri = get_controller_uri() +@@ -1444,7 +1452,7 @@ class LinstorVDI(VDI.VDI): + if ( + self.sr.srcmd.cmd == 'vdi_attach_from_config' or + self.sr.srcmd.cmd == 'vdi_detach_from_config' +- ) and self.sr.srcmd.params['vdi_uuid'] == self.uuid: ++ ): + self.vdi_type = vhdutil.VDI_TYPE_RAW + self.path = self.sr.srcmd.params['vdi_path'] + else: +@@ -1529,7 +1537,7 @@ class LinstorVDI(VDI.VDI): + + self._linstor.create_volume( + self.uuid, volume_size, persistent=False, +- volume_name=volume_name, no_diskless=(volume_name is not None) ++ volume_name=volume_name + ) + volume_info = self._linstor.get_volume_info(self.uuid) + +@@ -1631,8 +1639,9 @@ class LinstorVDI(VDI.VDI): + + def attach(self, sr_uuid, vdi_uuid): + util.SMlog('LinstorVDI.attach for {}'.format(self.uuid)) ++ attach_from_config = self.sr.srcmd.cmd == 'vdi_attach_from_config' + if ( +- self.sr.srcmd.cmd != 'vdi_attach_from_config' or ++ not attach_from_config or + self.sr.srcmd.params['vdi_uuid'] != self.uuid + ) and self.sr._journaler.has_entries(self.uuid): + raise xs_errors.XenError( +@@ -1641,50 +1650,54 @@ class LinstorVDI(VDI.VDI): + 'scan SR first to trigger auto-repair' + ) + +- writable = 'args' not in self.sr.srcmd.params or \ +- self.sr.srcmd.params['args'][0] == 'true' ++ if not attach_from_config or self.sr._is_master: ++ writable = 'args' not in self.sr.srcmd.params or \ ++ self.sr.srcmd.params['args'][0] == 'true' + +- # We need to inflate the volume if we don't have enough place +- # to mount the VHD image. I.e. the volume capacity must be greater +- # than the VHD size + bitmap size. +- need_inflate = True +- if self.vdi_type == vhdutil.VDI_TYPE_RAW or not writable or \ +- self.capacity >= compute_volume_size(self.size, self.vdi_type): +- need_inflate = False +- +- if need_inflate: +- try: +- self._prepare_thin(True) +- except Exception as e: +- raise xs_errors.XenError( +- 'VDIUnavailable', +- opterr='Failed to attach VDI during "prepare thin": {}' +- .format(e) +- ) ++ # We need to inflate the volume if we don't have enough place ++ # to mount the VHD image. I.e. the volume capacity must be greater ++ # than the VHD size + bitmap size. ++ need_inflate = True ++ if ( ++ self.vdi_type == vhdutil.VDI_TYPE_RAW or ++ not writable or ++ self.capacity >= compute_volume_size(self.size, self.vdi_type) ++ ): ++ need_inflate = False + +- if not util.pathexists(self.path): +- raise xs_errors.XenError( +- 'VDIUnavailable', opterr='Could not find: {}'.format(self.path) +- ) ++ if need_inflate: ++ try: ++ self._prepare_thin(True) ++ except Exception as e: ++ raise xs_errors.XenError( ++ 'VDIUnavailable', ++ opterr='Failed to attach VDI during "prepare thin": {}' ++ .format(e) ++ ) + + if not hasattr(self, 'xenstore_data'): + self.xenstore_data = {} ++ self.xenstore_data['storage-type'] = LinstorSR.DRIVER_TYPE + +- # TODO: Is it useful? +- self.xenstore_data.update(scsiutil.update_XS_SCSIdata( +- self.uuid, scsiutil.gen_synthetic_page_data(self.uuid) +- )) ++ if attach_from_config and self.path.startswith('/dev/http-nbd/'): ++ return self._attach_using_http_nbd() + +- self.xenstore_data['storage-type'] = LinstorSR.DRIVER_TYPE ++ if not util.pathexists(self.path): ++ raise xs_errors.XenError( ++ 'VDIUnavailable', opterr='Could not find: {}'.format(self.path) ++ ) + + self.attached = True +- + return VDI.VDI.attach(self, self.sr.uuid, self.uuid) + + def detach(self, sr_uuid, vdi_uuid): + util.SMlog('LinstorVDI.detach for {}'.format(self.uuid)) ++ detach_from_config = self.sr.srcmd.cmd == 'vdi_detach_from_config' + self.attached = False + ++ if detach_from_config and self.path.startswith('/dev/http-nbd/'): ++ return self._detach_using_http_nbd() ++ + if self.vdi_type == vhdutil.VDI_TYPE_RAW: + return + +@@ -1816,25 +1829,40 @@ class LinstorVDI(VDI.VDI): + + util.SMlog('LinstorVDI.generate_config for {}'.format(self.uuid)) + +- if not self.path or not util.pathexists(self.path): +- available = False +- # Try to refresh symlink path... +- try: +- self.path = self._linstor.get_device_path(vdi_uuid) +- available = util.pathexists(self.path) +- except Exception: +- pass +- if not available: +- raise xs_errors.XenError('VDIUnavailable') +- + resp = {} + resp['device_config'] = self.sr.dconf + resp['sr_uuid'] = sr_uuid + resp['vdi_uuid'] = self.uuid + resp['sr_sm_config'] = self.sr.sm_config +- resp['vdi_path'] = self.path + resp['command'] = 'vdi_attach_from_config' + ++ # By default, we generate a normal config. ++ # But if the disk is persistent, we must use a HTTP/NBD ++ # server to ensure we can always write or read data. ++ # Why? DRBD is unsafe when used with more than 4 hosts: ++ # We are limited to use 1 diskless and 3 full. ++ # We can't increase this limitation, so we use a NBD/HTTP device ++ # instead. ++ volume_name = self._linstor.get_volume_name(self.uuid) ++ if volume_name not in [ ++ 'xcp-persistent-ha-statefile', 'xcp-persistent-redo-log' ++ ]: ++ if not self.path or not util.pathexists(self.path): ++ available = False ++ # Try to refresh symlink path... ++ try: ++ self.path = self._linstor.get_device_path(vdi_uuid) ++ available = util.pathexists(self.path) ++ except Exception: ++ pass ++ if not available: ++ raise xs_errors.XenError('VDIUnavailable') ++ ++ resp['vdi_path'] = self.path ++ else: ++ # Axiom: DRBD device is present on at least one host. ++ resp['vdi_path'] = '/dev/http-nbd/' + volume_name ++ + config = xmlrpclib.dumps(tuple([resp]), 'vdi_attach_from_config') + return xmlrpclib.dumps((config,), "", True) + +@@ -2314,6 +2342,268 @@ class LinstorVDI(VDI.VDI): + + return ret_vdi.get_params() + ++ @staticmethod ++ def _start_persistent_http_server(volume_name): ++ null = None ++ pid_path = None ++ http_server = None ++ ++ try: ++ null = open(os.devnull, 'w') ++ ++ if volume_name == 'xcp-persistent-ha-statefile': ++ port = '8076' ++ else: ++ port = '8077' ++ ++ arguments = [ ++ 'http-disk-server', ++ '--disk', ++ '/dev/drbd/by-res/{}/0'.format(volume_name), ++ '--port', ++ port ++ ] ++ ++ util.SMlog('Starting {} on port {}...'.format(arguments[0], port)) ++ http_server = subprocess.Popen( ++ [FORK_LOG_DAEMON] + arguments, ++ stdout=null, ++ stderr=null, ++ # Ensure we use another group id to kill this process without ++ # touch the current one. ++ preexec_fn=os.setsid ++ ) ++ ++ pid_path = '/run/http-server-{}.pid'.format(volume_name) ++ with open(pid_path, 'w') as pid_file: ++ pid_file.write(str(http_server.pid)) ++ except Exception as e: ++ if pid_path: ++ try: ++ os.remove(pid_path) ++ except Exception: ++ pass ++ ++ if http_server: ++ # Kill process and children in this case... ++ os.killpg(os.getpgid(http_server.pid), signal.SIGTERM) ++ ++ raise xs_errors.XenError( ++ 'VDIUnavailable', ++ opterr='Failed to start http-server: {}'.format(e) ++ ) ++ finally: ++ if null: ++ null.close() ++ ++ def _start_persistent_nbd_server(self, volume_name): ++ null = None ++ pid_path = None ++ nbd_path = None ++ nbd_server = None ++ ++ try: ++ null = open(os.devnull, 'w') ++ ++ if volume_name == 'xcp-persistent-ha-statefile': ++ port = '8076' ++ else: ++ port = '8077' ++ ++ arguments = [ ++ 'nbd-http-server', ++ '--socket-path', ++ '/run/{}.socket'.format(volume_name), ++ '--nbd-name', ++ volume_name, ++ '--urls', ++ ','.join(map( ++ lambda host: "http://" + host + ':' + port, ++ self.sr._hosts ++ )) ++ ] ++ ++ util.SMlog('Starting {} using port {}...'.format(arguments[0], port)) ++ nbd_server = subprocess.Popen( ++ [FORK_LOG_DAEMON] + arguments, ++ stdout=subprocess.PIPE, ++ stderr=subprocess.STDOUT, ++ # Ensure we use another group id to kill this process without ++ # touch the current one. ++ preexec_fn=os.setsid ++ ) ++ ++ reg_nbd_path = re.compile("^NBD `(/dev/nbd[0-9]+)` is now attached.$") ++ def get_nbd_path(): ++ while nbd_server.poll() is None: ++ line = nbd_server.stdout.readline() ++ match = reg_nbd_path.match(line) ++ if match: ++ return match.group(1) ++ # Use a timeout to never block the smapi if there is a problem. ++ try: ++ nbd_path = util.timeout_call(10, get_nbd_path) ++ if nbd_path is None: ++ raise Exception('Empty NBD path (NBD server is probably dead)') ++ except util.TimeoutException: ++ raise Exception('Unable to read NBD path') ++ ++ pid_path = '/run/nbd-server-{}.pid'.format(volume_name) ++ with open(pid_path, 'w') as pid_file: ++ pid_file.write(str(nbd_server.pid)) ++ ++ util.SMlog('Create symlink: {} -> {}'.format(self.path, nbd_path)) ++ os.symlink(nbd_path, self.path) ++ except Exception as e: ++ if pid_path: ++ try: ++ os.remove(pid_path) ++ except Exception: ++ pass ++ ++ if nbd_path: ++ try: ++ os.remove(nbd_path) ++ except Exception: ++ pass ++ ++ if nbd_server: ++ # Kill process and children in this case... ++ os.killpg(os.getpgid(nbd_server.pid), signal.SIGTERM) ++ ++ raise xs_errors.XenError( ++ 'VDIUnavailable', ++ opterr='Failed to start nbd-server: {}'.format(e) ++ ) ++ finally: ++ if null: ++ null.close() ++ ++ @classmethod ++ def _kill_persistent_server(self, type, volume_name, sig): ++ try: ++ path = '/run/{}-server-{}.pid'.format(type, volume_name) ++ if not os.path.exists(path): ++ return ++ ++ pid = None ++ with open(path, 'r') as pid_file: ++ try: ++ pid = int(pid_file.read()) ++ except Exception: ++ pass ++ ++ if pid is not None and util.check_pid_exists(pid): ++ util.SMlog('Kill {} server {} (pid={})'.format(type, path, pid)) ++ try: ++ os.killpg(os.getpgid(pid), sig) ++ except Exception as e: ++ util.SMlog('Failed to kill {} server: {}'.format(type, e)) ++ ++ os.remove(path) ++ except: ++ pass ++ ++ @classmethod ++ def _kill_persistent_http_server(self, volume_name, sig=signal.SIGTERM): ++ return self._kill_persistent_server('nbd', volume_name, sig) ++ ++ @classmethod ++ def _kill_persistent_nbd_server(self, volume_name, sig=signal.SIGTERM): ++ return self._kill_persistent_server('http', volume_name, sig) ++ ++ def _check_http_nbd_volume_name(self): ++ volume_name = self.path[14:] ++ if volume_name not in [ ++ 'xcp-persistent-ha-statefile', 'xcp-persistent-redo-log' ++ ]: ++ raise xs_errors.XenError( ++ 'VDIUnavailable', ++ opterr='Unsupported path: {}'.format(self.path) ++ ) ++ return volume_name ++ ++ def _attach_using_http_nbd(self): ++ volume_name = self._check_http_nbd_volume_name() ++ ++ # Ensure there is no NBD and HTTP server running. ++ self._kill_persistent_nbd_server(volume_name) ++ self._kill_persistent_http_server(volume_name) ++ ++ # 0. Fetch drbd path. ++ must_get_device_path = True ++ if not self.sr._is_master: ++ # We are on a slave, we must try to find a diskful locally. ++ try: ++ volume_info = self._linstor.get_volume_info(self.uuid) ++ except Exception as e: ++ raise xs_errors.XenError( ++ 'VDIUnavailable', ++ opterr='Cannot get volume info of {}: {}' ++ .format(self.uuid, e) ++ ) ++ ++ must_get_device_path = volume_info.is_diskful ++ ++ drbd_path = None ++ if must_get_device_path or self.sr._is_master: ++ # If we are master, we must ensure we have a diskless ++ # or diskful available to init HA. ++ # It also avoid this error in xensource.log ++ # (/usr/libexec/xapi/cluster-stack/xhad/ha_set_pool_state): ++ # init exited with code 8 [stdout = ''; stderr = 'SF: failed to write in State-File \x10 (fd 4208696). (sys 28)\x0A'] ++ # init returned MTC_EXIT_CAN_NOT_ACCESS_STATEFILE (State-File is inaccessible) ++ available = False ++ try: ++ drbd_path = self._linstor.get_device_path(self.uuid) ++ available = util.pathexists(drbd_path) ++ except Exception: ++ pass ++ ++ if not available: ++ raise xs_errors.XenError( ++ 'VDIUnavailable', ++ opterr='Cannot get device path of {}'.format(self.uuid) ++ ) ++ ++ # 1. Prepare http-nbd folder. ++ try: ++ if not os.path.exists('/dev/http-nbd/'): ++ os.makedirs('/dev/http-nbd/') ++ elif os.path.islink(self.path): ++ os.remove(self.path) ++ except OSError as e: ++ if e.errno != errno.EEXIST: ++ raise xs_errors.XenError( ++ 'VDIUnavailable', ++ opterr='Cannot prepare http-nbd: {}'.format(e) ++ ) ++ ++ # 2. Start HTTP service if we have a diskful or if we are master. ++ http_service = None ++ if drbd_path: ++ assert(drbd_path in ( ++ '/dev/drbd/by-res/xcp-persistent-ha-statefile/0', ++ '/dev/drbd/by-res/xcp-persistent-redo-log/0' ++ )) ++ self._start_persistent_http_server(volume_name) ++ ++ # 3. Start NBD server in all cases. ++ try: ++ self._start_persistent_nbd_server(volume_name) ++ except Exception as e: ++ if drbd_path: ++ self._kill_persistent_http_server(volume_name) ++ raise ++ ++ self.attached = True ++ return VDI.VDI.attach(self, self.sr.uuid, self.uuid) ++ ++ def _detach_using_http_nbd(self): ++ volume_name = self._check_http_nbd_volume_name() ++ self._kill_persistent_nbd_server(volume_name) ++ self._kill_persistent_http_server(volume_name) ++ + # ------------------------------------------------------------------------------ + + +diff --git a/drivers/linstor-manager b/drivers/linstor-manager +index af8d2b9..30230ad 100755 +--- a/drivers/linstor-manager ++++ b/drivers/linstor-manager +@@ -36,7 +36,7 @@ import vhdutil + + + FIREWALL_PORT_SCRIPT = '/etc/xapi.d/plugins/firewall-port' +-LINSTOR_PORTS = [3366, 3370, 3376, 3377, '7000:8000'] ++LINSTOR_PORTS = [3366, 3370, 3376, 3377, '7000:8000', 8076, 8077] + + + def update_port(port, open): +@@ -56,39 +56,6 @@ def update_all_ports(open): + update_port(port, open) + + +-def enable_and_start_service(name, start): +- attempt = 0 +- while True: +- attempt += 1 +- fn = 'enable' if start else 'disable' +- args = ('systemctl', fn, '--now', name) +- (ret, out, err) = util.doexec(args) +- if ret == 0: +- return +- elif attempt >= 3: +- raise Exception( +- 'Failed to {} {}: {} {}'.format(fn, name, out, err) +- ) +- time.sleep(1) +- +- +-def restart_service(name): +- attempt = 0 +- while True: +- attempt += 1 +- util.SMlog('linstor-manager:restart service {} {}...'.format(name, attempt)) +- args = ('systemctl', 'restart', name) +- (ret, out, err) = util.doexec(args) +- if ret == 0: +- return +- elif attempt >= 3: +- util.SMlog('linstor-manager:restart service FAILED {} {}'.format(name, attempt)) +- raise Exception( +- 'Failed to restart {}: {} {}'.format(name, out, err) +- ) +- time.sleep(1) +- +- + def stop_service(name): + args = ('systemctl', 'stop', name) + (ret, out, err) = util.doexec(args) +@@ -98,11 +65,11 @@ def stop_service(name): + + + def update_linstor_satellite_service(start): +- enable_and_start_service('linstor-satellite', start) ++ util.enable_and_start_service('linstor-satellite', start) + + + def update_minidrbdcluster_service(start): +- enable_and_start_service('minidrbdcluster', start) ++ util.enable_and_start_service('minidrbdcluster', start) + + + def prepare_sr(session, args): +@@ -187,8 +154,8 @@ def destroy(session, args): + + # When destroy is called, there are no running minidrbdcluster daemons. + # So the controllers are stopped too, we must start an instance. +- restart_service('var-lib-linstor.service') +- restart_service('linstor-controller') ++ util.restart_service('var-lib-linstor.service') ++ util.restart_service('linstor-controller') + + linstor = LinstorVolumeManager( + 'linstor://localhost', +diff --git a/drivers/linstorvhdutil.py b/drivers/linstorvhdutil.py +index ac85837..9ba0ac3 100644 +--- a/drivers/linstorvhdutil.py ++++ b/drivers/linstorvhdutil.py +@@ -42,7 +42,7 @@ def linstorhostcall(local_method, remote_method): + # Try to read locally if the device is not in use or if the device + # is up to date and not diskless. + (node_names, in_use) = \ +- self._linstor.find_up_to_date_diskfull_nodes(vdi_uuid) ++ self._linstor.find_up_to_date_diskful_nodes(vdi_uuid) + + try: + if not in_use or socket.gethostname() in node_names: +@@ -217,7 +217,7 @@ class LinstorVhdUtil: + def _get_readonly_host(self, vdi_uuid, device_path, node_names): + """ + When vhd-util is called to fetch VDI info we must find a +- diskfull DRBD disk to read the data. It's the goal of this function. ++ diskful DRBD disk to read the data. It's the goal of this function. + Why? Because when a VHD is open in RO mode, the LVM layer is used + directly to bypass DRBD verifications (we can have only one process + that reads/writes to disk with DRBD devices). +@@ -226,7 +226,7 @@ class LinstorVhdUtil: + if not node_names: + raise xs_errors.XenError( + 'VDIUnavailable', +- opterr='Unable to find diskfull node: {} (path={})' ++ opterr='Unable to find diskful node: {} (path={})' + .format(vdi_uuid, device_path) + ) + +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index e497afa..da98e0b 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -329,18 +329,21 @@ class LinstorVolumeManager(object): + __slots__ = ( + 'name', + 'allocated_size', # Allocated size, place count is not used. +- 'virtual_size' # Total virtual available size of this volume +- # (i.e. the user size at creation). ++ 'virtual_size', # Total virtual available size of this volume ++ # (i.e. the user size at creation). ++ 'is_diskful' + ) + + def __init__(self, name): + self.name = name + self.allocated_size = 0 + self.virtual_size = 0 ++ self.is_diskful = False + + def __repr__(self): +- return 'VolumeInfo("{}", {}, {})'.format( +- self.name, self.allocated_size, self.virtual_size ++ return 'VolumeInfo("{}", {}, {}, {})'.format( ++ self.name, self.allocated_size, self.virtual_size, ++ 'diskful' if self.is_diskful else 'diskless' + ) + + # -------------------------------------------------------------------------- +@@ -1332,9 +1335,9 @@ class LinstorVolumeManager(object): + .format(e) + ) + +- def find_up_to_date_diskfull_nodes(self, volume_uuid): ++ def find_up_to_date_diskful_nodes(self, volume_uuid): + """ +- Find all nodes that contain a specific volume using diskfull disks. ++ Find all nodes that contain a specific volume using diskful disks. + The disk must be up to data to be used. + :param str volume_uuid: The volume to use. + :return: The available nodes. +@@ -1716,6 +1719,8 @@ class LinstorVolumeManager(object): + else: + current = all_volume_info[resource.name] + ++ current.is_diskful = linstor.consts.FLAG_DISKLESS not in resource.flags ++ + for volume in resource.volumes: + # We ignore diskless pools of the form "DfltDisklessStorPool". + if volume.storage_pool_name == self._group_name: +diff --git a/drivers/util.py b/drivers/util.py +index 7151f36..6a9fc1a 100755 +--- a/drivers/util.py ++++ b/drivers/util.py +@@ -1801,3 +1801,52 @@ def sessions_less_than_targets(other_config, device_config): + else: + return False + ++ ++def enable_and_start_service(name, start): ++ attempt = 0 ++ while True: ++ attempt += 1 ++ fn = 'enable' if start else 'disable' ++ args = ('systemctl', fn, '--now', name) ++ (ret, out, err) = doexec(args) ++ if ret == 0: ++ return ++ elif attempt >= 3: ++ raise Exception( ++ 'Failed to {} {}: {} {}'.format(fn, name, out, err) ++ ) ++ time.sleep(1) ++ ++ ++def stop_service(name): ++ args = ('systemctl', 'stop', name) ++ (ret, out, err) = doexec(args) ++ if ret == 0: ++ return ++ raise Exception('Failed to stop {}: {} {}'.format(name, out, err)) ++ ++ ++def restart_service(name): ++ attempt = 0 ++ while True: ++ attempt += 1 ++ SMlog('Restarting service {} {}...'.format(name, attempt)) ++ args = ('systemctl', 'restart', name) ++ (ret, out, err) = doexec(args) ++ if ret == 0: ++ return ++ elif attempt >= 3: ++ SMlog('Restart service FAILED {} {}'.format(name, attempt)) ++ raise Exception( ++ 'Failed to restart {}: {} {}'.format(name, out, err) ++ ) ++ time.sleep(1) ++ ++ ++def check_pid_exists(pid): ++ try: ++ os.kill(pid, 0) ++ except OSError: ++ return False ++ else: ++ return True +diff --git a/scripts/fork-log-daemon b/scripts/fork-log-daemon +new file mode 100755 +index 0000000..eb0f0b0 +--- /dev/null ++++ b/scripts/fork-log-daemon +@@ -0,0 +1,34 @@ ++#!/usr/bin/env python ++ ++import select ++import subprocess ++import sys ++import syslog ++ ++def main(): ++ process = subprocess.Popen(sys.argv[1:], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) ++ write_to_stdout = True ++ ++ while process.poll() is None: ++ while True: ++ output = process.stdout.readline() ++ if not output: ++ break ++ ++ if write_to_stdout: ++ try: ++ print(output) ++ sys.stdout.flush() ++ except Exception: ++ # Probably a broken pipe. So the process reading stdout is dead. ++ write_to_stdout = False ++ syslog.syslog(output) ++ ++if __name__ == "__main__": ++ syslog.openlog(ident=sys.argv[1], facility=syslog.LOG_DAEMON) ++ try: ++ main() ++ except Exception as e: ++ syslog.syslog(sys.argv[1] + ' terminated with exception: {}'.format(e)) ++ finally: ++ syslog.syslog(sys.argv[1] + ' is now terminated!') +-- +2.45.2 + diff --git a/SOURCES/0051-fix-LinstorSR-find-controller-when-XAPI-unreachable-.patch b/SOURCES/0051-fix-LinstorSR-find-controller-when-XAPI-unreachable-.patch new file mode 100644 index 00000000..cce1612a --- /dev/null +++ b/SOURCES/0051-fix-LinstorSR-find-controller-when-XAPI-unreachable-.patch @@ -0,0 +1,187 @@ +From 0b679551a430853c7a661b58925e671607a74214 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Thu, 3 Mar 2022 15:02:17 +0100 +Subject: [PATCH 051/175] fix(LinstorSR): find controller when XAPI unreachable + (XHA) + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 60 +++++++++++++++++++++++++++++---- + drivers/linstorvolumemanager.py | 34 ++++++++++++------- + 2 files changed, 74 insertions(+), 20 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 5bdf676..a4f7afc 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -46,6 +46,7 @@ import traceback + import util + import VDI + import vhdutil ++import xml.etree.ElementTree as xml_parser + import xmlrpclib + import xs_errors + +@@ -56,6 +57,8 @@ from srmetadata import \ + + HIDDEN_TAG = 'hidden' + ++XHA_CONFIG_PATH = '/etc/xensource/xhad.conf' ++ + FORK_LOG_DAEMON = '/opt/xensource/libexec/fork-log-daemon' + + # ============================================================================== +@@ -248,6 +251,26 @@ def deflate(linstor, vdi_uuid, vdi_path, new_size, old_size): + # TODO: Change the LINSTOR volume size using linstor.resize_volume. + + ++def get_ips_from_xha_config_file(): ++ ips = [] ++ try: ++ # Ensure there is no dirty read problem. ++ # For example if the HA is reloaded. ++ tree = util.retry( ++ lambda: xml_parser.parse(XHA_CONFIG_PATH), ++ maxretry=10, ++ period=1 ++ ) ++ ++ for node in tree.getroot()[0]: ++ if node.tag == 'host': ++ for host_node in node: ++ if host_node.tag == 'IPaddress': ++ ips.append(host_node.text) ++ except: ++ pass ++ return ips ++ + # ============================================================================== + + # Usage example: +@@ -363,18 +386,41 @@ class LinstorSR(SR.SR): + if self.srcmd.cmd in ( + 'vdi_attach_from_config', 'vdi_detach_from_config' + ): +- # We must have a valid LINSTOR instance here without using +- # the XAPI. ++ def create_linstor(uri, attempt_count=30): ++ self._linstor = LinstorVolumeManager( ++ uri, ++ self._group_name, ++ logger=util.SMlog, ++ attempt_count=attempt_count ++ ) ++ + controller_uri = get_controller_uri() ++ if controller_uri: ++ create_linstor(controller_uri) ++ else: ++ def connect(): ++ # We must have a valid LINSTOR instance here without using ++ # the XAPI. Fallback with the HA config file. ++ for ip in get_ips_from_xha_config_file(): ++ controller_uri = 'linstor://' + ip ++ try: ++ util.SMlog('Connecting from config to LINSTOR controller using: {}'.format(ip)) ++ create_linstor(controller_uri, attempt_count=0) ++ return controller_uri ++ except: ++ pass ++ ++ controller_uri = util.retry(connect, maxretry=30, period=1) ++ if not controller_uri: ++ raise xs_errors.XenError( ++ 'SRUnavailable', ++ opterr='No valid controller URI to attach/detach from config' ++ ) ++ + self._journaler = LinstorJournaler( + controller_uri, self._group_name, logger=util.SMlog + ) + +- self._linstor = LinstorVolumeManager( +- controller_uri, +- self._group_name, +- logger=util.SMlog +- ) + return wrapped_method(self, *args, **kwargs) + + if not self._is_master: +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index da98e0b..b4ee783 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -186,15 +186,16 @@ def _get_controller_uri(): + # primary using drbdadm because we don't have all connections to the + # replicated volume. `drbdadm status xcp-persistent-database` returns + # 3 connections by default. +- session = util.get_localAPI_session() +- for host_ref, host_record in session.xenapi.host.get_all_records().items(): +- if distutils.util.strtobool( +- session.xenapi.host.call_plugin(host_ref, PLUGIN, PLUGIN_CMD, {}) +- ): +- return 'linstor://' + host_record['hostname'] +- +- # Not found, maybe we are trying to create the SR... +- ++ try: ++ session = util.get_localAPI_session() ++ for host_ref, host_record in session.xenapi.host.get_all_records().items(): ++ if distutils.util.strtobool( ++ session.xenapi.host.call_plugin(host_ref, PLUGIN, PLUGIN_CMD, {}) ++ ): ++ return 'linstor://' + host_record['hostname'] ++ except: ++ # Not found, maybe we are trying to create the SR... ++ pass + + def get_controller_uri(): + retries = 0 +@@ -349,7 +350,8 @@ class LinstorVolumeManager(object): + # -------------------------------------------------------------------------- + + def __init__( +- self, uri, group_name, repair=False, logger=default_logger.__func__ ++ self, uri, group_name, repair=False, logger=default_logger.__func__, ++ attempt_count=30 + ): + """ + Create a new LinstorVolumeManager object. +@@ -358,9 +360,12 @@ class LinstorVolumeManager(object): + :param bool repair: If true we try to remove bad volumes due to a crash + or unexpected behavior. + :param function logger: Function to log messages. ++ :param int attempt_count: Number of attempts to join the controller. + """ + +- self._linstor = self._create_linstor_instance(uri) ++ self._linstor = self._create_linstor_instance( ++ uri, attempt_count=attempt_count ++ ) + self._base_group_name = group_name + + # Ensure group exists. +@@ -2169,7 +2174,9 @@ class LinstorVolumeManager(object): + ]) + + @classmethod +- def _create_linstor_instance(cls, uri, keep_uri_unmodified=False): ++ def _create_linstor_instance( ++ cls, uri, keep_uri_unmodified=False, attempt_count=30 ++ ): + retry = False + + def connect(uri): +@@ -2193,7 +2200,8 @@ class LinstorVolumeManager(object): + + return util.retry( + lambda: connect(uri), +- maxretry=10, ++ maxretry=attempt_count, ++ period=1, + exceptions=[ + linstor.errors.LinstorNetworkError, + LinstorVolumeManagerError +-- +2.45.2 + diff --git a/SOURCES/0052-fix-LinstorSR-use-IPs-instead-of-hostnames-in-NBD-se.patch b/SOURCES/0052-fix-LinstorSR-use-IPs-instead-of-hostnames-in-NBD-se.patch new file mode 100644 index 00000000..8ad79396 --- /dev/null +++ b/SOURCES/0052-fix-LinstorSR-use-IPs-instead-of-hostnames-in-NBD-se.patch @@ -0,0 +1,208 @@ +From c4ff0f4c15ff0e74162ecf3c7f494356e6051404 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Thu, 24 Mar 2022 18:13:46 +0100 +Subject: [PATCH 052/175] fix(LinstorSR): use IPs instead of hostnames in NBD + server + +Without this patch we can't use XCP-ng hosts configured with static IPS. +Only servers with DHCP enabled can access the HTTP server(s) otherwise. + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 101 ++++++++++++++++++++++++++++++++++++------- + drivers/util.py | 12 +++++ + 2 files changed, 97 insertions(+), 16 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index a4f7afc..c0bfc3f 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -251,8 +251,15 @@ def deflate(linstor, vdi_uuid, vdi_path, new_size, old_size): + # TODO: Change the LINSTOR volume size using linstor.resize_volume. + + ++IPS_XHA_CACHE = None ++ ++ + def get_ips_from_xha_config_file(): +- ips = [] ++ if IPS_XHA_CACHE: ++ return IPS_XHA_CACHE ++ ++ ips = dict() ++ host_ip = None + try: + # Ensure there is no dirty read problem. + # For example if the HA is reloaded. +@@ -261,15 +268,50 @@ def get_ips_from_xha_config_file(): + maxretry=10, + period=1 + ) +- +- for node in tree.getroot()[0]: +- if node.tag == 'host': +- for host_node in node: +- if host_node.tag == 'IPaddress': +- ips.append(host_node.text) + except: +- pass +- return ips ++ return (host_ip, ips) ++ ++ def parse_host_nodes(ips, node): ++ current_id = None ++ current_ip = None ++ ++ for sub_node in node: ++ if sub_node.tag == 'IPaddress': ++ current_ip = sub_node.text ++ elif sub_node.tag == 'HostID': ++ current_id = sub_node.text ++ else: ++ continue ++ ++ if current_id and current_ip: ++ ips[current_id] = current_ip ++ return ++ util.SMlog('Ill-formed XHA file, missing IPaddress or/and HostID') ++ ++ def parse_common_config(ips, node): ++ for sub_node in node: ++ if sub_node.tag == 'host': ++ parse_host_nodes(ips, sub_node) ++ ++ def parse_local_config(ips, node): ++ for sub_node in node: ++ if sub_node.tag == 'localhost': ++ for host_node in sub_node: ++ if host_node.tag == 'HostID': ++ return host_node.text ++ ++ for node in tree.getroot(): ++ if node.tag == 'common-config': ++ parse_common_config(ips, node) ++ elif node.tag == 'local-config': ++ host_ip = parse_local_config(ips, node) ++ else: ++ continue ++ ++ if ips and host_ip: ++ break ++ ++ return (host_ip, ips) + + # ============================================================================== + +@@ -401,7 +443,7 @@ class LinstorSR(SR.SR): + def connect(): + # We must have a valid LINSTOR instance here without using + # the XAPI. Fallback with the HA config file. +- for ip in get_ips_from_xha_config_file(): ++ for ip in get_ips_from_xha_config_file()[1].values(): + controller_uri = 'linstor://' + ip + try: + util.SMlog('Connecting from config to LINSTOR controller using: {}'.format(ip)) +@@ -2402,10 +2444,23 @@ class LinstorVDI(VDI.VDI): + else: + port = '8077' + ++ try: ++ session = util.get_localAPI_session() ++ host_ip = util.get_this_host_address(session) ++ except: ++ # Fallback using the XHA file if session not available. ++ host_ip, _ = get_ips_from_xha_config_file() ++ if not host_ip: ++ raise Exception( ++ 'Cannot start persistent HTTP server: no XAPI session, nor XHA config file' ++ ) ++ + arguments = [ + 'http-disk-server', + '--disk', + '/dev/drbd/by-res/{}/0'.format(volume_name), ++ '--ip', ++ host_ip, + '--port', + port + ] +@@ -2432,7 +2487,10 @@ class LinstorVDI(VDI.VDI): + + if http_server: + # Kill process and children in this case... +- os.killpg(os.getpgid(http_server.pid), signal.SIGTERM) ++ try: ++ os.killpg(os.getpgid(http_server.pid), signal.SIGTERM) ++ except: ++ pass + + raise xs_errors.XenError( + 'VDIUnavailable', +@@ -2456,6 +2514,17 @@ class LinstorVDI(VDI.VDI): + else: + port = '8077' + ++ try: ++ session = util.get_localAPI_session() ++ ips = util.get_host_addresses(session) ++ except Exception as e: ++ _, ips = get_ips_from_xha_config_file() ++ if not ips: ++ raise Exception( ++ 'Cannot start persistent NBD server: no XAPI session, nor XHA config file ({})'.format(e) ++ ) ++ ips = ips.values() ++ + arguments = [ + 'nbd-http-server', + '--socket-path', +@@ -2463,10 +2532,7 @@ class LinstorVDI(VDI.VDI): + '--nbd-name', + volume_name, + '--urls', +- ','.join(map( +- lambda host: "http://" + host + ':' + port, +- self.sr._hosts +- )) ++ ','.join(map(lambda ip: 'http://' + ip + ':' + port, ips)) + ] + + util.SMlog('Starting {} using port {}...'.format(arguments[0], port)) +@@ -2515,7 +2581,10 @@ class LinstorVDI(VDI.VDI): + + if nbd_server: + # Kill process and children in this case... +- os.killpg(os.getpgid(nbd_server.pid), signal.SIGTERM) ++ try: ++ os.killpg(os.getpgid(nbd_server.pid), signal.SIGTERM) ++ except: ++ pass + + raise xs_errors.XenError( + 'VDIUnavailable', +diff --git a/drivers/util.py b/drivers/util.py +index 6a9fc1a..7c52703 100755 +--- a/drivers/util.py ++++ b/drivers/util.py +@@ -702,6 +702,18 @@ def get_hosts_attached_on(session, vdi_uuids): + host_refs[key[len('host_'):]] = True + return host_refs.keys() + ++def get_this_host_address(session): ++ host_uuid = get_this_host() ++ host_ref = session.xenapi.host.get_by_uuid(host_uuid) ++ return session.xenapi.host.get_record(host_ref)['address'] ++ ++def get_host_addresses(session): ++ addresses = [] ++ hosts = session.xenapi.host.get_all_records() ++ for record in hosts.itervalues(): ++ addresses.append(record['address']) ++ return addresses ++ + def get_this_host_ref(session): + host_uuid = get_this_host() + host_ref = session.xenapi.host.get_by_uuid(host_uuid) +-- +2.45.2 + diff --git a/SOURCES/0053-fix-LinstorVolumeManager-ensure-we-always-use-IPs-in.patch b/SOURCES/0053-fix-LinstorVolumeManager-ensure-we-always-use-IPs-in.patch new file mode 100644 index 00000000..6f0f5f12 --- /dev/null +++ b/SOURCES/0053-fix-LinstorVolumeManager-ensure-we-always-use-IPs-in.patch @@ -0,0 +1,30 @@ +From a6fe5b35ab2fd4a0086d8060ad449d6484911b0a Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Thu, 31 Mar 2022 11:21:19 +0200 +Subject: [PATCH 053/175] fix(LinstorVolumeManager): ensure we always use IPs + in _get_controller_uri + +Otherwise if a hostname is returned, we can't use it if the XCP-ng pool +is configurer using static IPs instead of DHCP. + +Signed-off-by: Ronan Abhamon +--- + drivers/linstorvolumemanager.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index b4ee783..2d5c63e 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -192,7 +192,7 @@ def _get_controller_uri(): + if distutils.util.strtobool( + session.xenapi.host.call_plugin(host_ref, PLUGIN, PLUGIN_CMD, {}) + ): +- return 'linstor://' + host_record['hostname'] ++ return 'linstor://' + host_record['address'] + except: + # Not found, maybe we are trying to create the SR... + pass +-- +2.45.2 + diff --git a/SOURCES/0054-feat-linstor-manager-add-methods-to-add-remove-host-.patch b/SOURCES/0054-feat-linstor-manager-add-methods-to-add-remove-host-.patch new file mode 100644 index 00000000..18b6a019 --- /dev/null +++ b/SOURCES/0054-feat-linstor-manager-add-methods-to-add-remove-host-.patch @@ -0,0 +1,425 @@ +From f0a4a15b68d15acce9b74b965c4ff46af3f62532 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Wed, 6 Apr 2022 17:53:02 +0200 +Subject: [PATCH 054/175] feat(linstor-manager): add methods to add remove/host + from LINSTOR SR + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 6 +- + drivers/linstor-manager | 283 +++++++++++++++++++++++++++++++- + drivers/linstorvolumemanager.py | 54 ++++++ + 3 files changed, 338 insertions(+), 5 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index c0bfc3f..413c550 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -401,7 +401,9 @@ class LinstorSR(SR.SR): + self._ips = None + else: + self._ips = self.dconf['ips'].split(',') +- self._redundancy = int(self.dconf['redundancy'] or 1) ++ ++ if self.cmd == 'sr_create': ++ self._redundancy = int(self.dconf['redundancy']) or 1 + self._linstor = None # Ensure that LINSTOR attribute exists. + self._journaler = None + +@@ -1004,7 +1006,7 @@ class LinstorSR(SR.SR): + # ensures the displayed physical size is reachable by the user. + self.physical_size = \ + self._linstor.min_physical_size * len(self._hosts) / \ +- self._redundancy ++ self._linstor.redundancy + + self.physical_utilisation = self._linstor.allocated_volume_size + +diff --git a/drivers/linstor-manager b/drivers/linstor-manager +index 30230ad..7e34ce6 100755 +--- a/drivers/linstor-manager ++++ b/drivers/linstor-manager +@@ -22,8 +22,7 @@ sys.path[0] = '/opt/xensource/sm/' + + import base64 + import distutils.util +-import time +-import subprocess ++import socket + import XenAPIPlugin + + from linstorjournaler import LinstorJournaler +@@ -72,6 +71,9 @@ def update_minidrbdcluster_service(start): + util.enable_and_start_service('minidrbdcluster', start) + + ++# ------------------------------------------------------------------------------ ++ ++ + def prepare_sr(session, args): + try: + update_all_ports(open=True) +@@ -338,6 +340,279 @@ def has_controller_running(session, args): + return str(ret == 0) + + ++def add_host(session, args): ++ group_name = args['groupName'] ++ ++ # 1. Find SR and PBDs. ++ srs = dict() ++ for sr_ref, sr in session.xenapi.SR.get_all_records().items(): ++ if sr.get('type') == 'linstor': ++ srs[sr_ref] = sr ++ ++ pbds = dict() ++ for pbd_ref, pbd in session.xenapi.PBD.get_all_records().items(): ++ device_config = pbd.get('device_config') ++ if ( ++ device_config and ++ device_config.get('group-name') == group_name ++ and pbd['SR'] in srs ++ ): ++ pbds[pbd_ref] = pbd ++ ++ # 2. Ensure there is at least one PBD and all PBDs are used in ++ # the same SR. ++ if not pbds: ++ raise Exception( ++ 'Failed to find PBDs of group `{}`'.format(group_name) ++ ) ++ ++ sr_ref = None ++ for pbd in pbds.values(): ++ if not sr_ref: ++ sr_ref = pbd['SR'] ++ elif pbd['SR'] != sr_ref: ++ raise Exception( ++ 'Group `{}` is used by many SRs!'.format(group_name) ++ ) ++ ++ # 3. Ensure node doesn't exist. ++ linstor = LinstorVolumeManager( ++ get_controller_uri(), ++ group_name, ++ logger=util.SMlog ++ ) ++ ++ node_name = socket.gethostname() ++ has_node = linstor.has_node(node_name) ++ ++ pbd_id = 0 ++ new_pbd_ref = None ++ ++ try: ++ # 4. Enable services. ++ update_all_ports(open=True) ++ update_minidrbdcluster_service(start=True) ++ update_linstor_satellite_service(start=True) ++ ++ # 5. Try to create local node. ++ if not has_node: ++ linstor.create_node(node_name, util.get_this_host_address(session)) ++ ++ # 6. Recreate PBDs. ++ # Use the redundancy given by Linstor instead of smapi config. ++ redundancy = linstor.redundancy ++ default_device_config = None ++ this_host = util.get_this_host_ref(session) ++ create_new_pbd = True ++ ++ assert pbds ++ pbds = pbds.items() ++ for pbd_ref, pbd in pbds: ++ device_config = pbd['device_config'] ++ ++ hosts = filter( ++ lambda host: len(host.strip()), ++ device_config.get('hosts', []).split(',') ++ ) ++ hosts.append(node_name) ++ hosts = ','.join(list(set(hosts))) ++ ++ # Should be the same on all hosts. ++ provisioning = device_config['provisioning'] ++ ++ if not default_device_config: ++ default_device_config = { ++ 'group-name': group_name, ++ 'redundancy': redundancy, ++ 'hosts': hosts, ++ 'provisioning': provisioning ++ } ++ ++ if pbd['currently_attached']: ++ session.xenapi.PBD.unplug(pbd_ref) ++ session.xenapi.PBD.destroy(pbd_ref) ++ pbd_id += 1 ++ ++ host = pbd['host'] ++ if host == this_host: ++ create_new_pbd = False ++ ++ pbd_ref = session.xenapi.PBD.create({ ++ 'host': host, ++ 'SR': sr_ref, ++ 'device_config': { ++ 'group-name': group_name, ++ 'redundancy': redundancy, ++ 'hosts': hosts, ++ 'provisioning': provisioning ++ } ++ }) ++ try: ++ session.xenapi.PBD.plug(pbd_ref) ++ except Exception as e: ++ util.SMlog('Failed to replug PBD: {}'.format(e)) ++ ++ # 7. Create new PBD. ++ if create_new_pbd: ++ new_pbd_ref = session.xenapi.PBD.create({ ++ 'host': this_host, ++ 'SR': sr_ref, ++ 'device_config': default_device_config ++ }) ++ try: ++ session.xenapi.PBD.plug(new_pbd_ref) ++ except Exception as e: ++ util.SMlog('Failed to plug new PBD: {}'.format(e)) ++ ++ return str(True) ++ except Exception as e: ++ stop_services = not has_node ++ if stop_services: ++ try: ++ linstor.destroy_node(node_name) ++ except Exception: ++ pass ++ ++ for pbd_ref, pbd in pbds[:pbd_id]: ++ try: ++ session.xenapi.PBD.unplug(pbd_ref) ++ except Exception: ++ pass ++ ++ try: ++ session.xenapi.PBD.destroy(pbd_ref) ++ except Exception: ++ pass ++ ++ try: ++ device_config = pbd['device_config'] ++ session.xenapi.PBD.create({ ++ 'host': host, ++ 'SR': sr_ref, ++ 'device_config': { ++ 'group-name': group_name, ++ 'redundancy': redundancy, ++ 'hosts': device_config['hosts'], ++ 'provisioning': device_config['provisioning'] ++ } ++ }) ++ except Exception as pbd_error: ++ util.SMlog('Failed to recreate PBD: {}'.format(pbd_error)) ++ pass ++ ++ try: ++ session.xenapi.PBD.plug(pbd_ref) ++ except Exception: ++ pass ++ ++ if new_pbd_ref: ++ try: ++ session.xenapi.PBD.unplug(new_pbd_ref) ++ except Exception: ++ pass ++ ++ try: ++ session.xenapi.PBD.destroy(new_pbd_ref) ++ except Exception: ++ pass ++ ++ try: ++ # If we failed to remove the node, we don't stop services. ++ if stop_services and not linstor.has_node(node_name): ++ update_linstor_satellite_service(start=False) ++ update_minidrbdcluster_service(start=False) ++ update_all_ports(open=False) ++ except Exception: ++ pass ++ ++ raise e ++ ++ ++def remove_host(session, args): ++ group_name = args['groupName'] ++ force = args.get('force') or False ++ ++ # 1. Find SRs and PBDs. ++ srs = dict() ++ for sr_ref, sr in session.xenapi.SR.get_all_records().items(): ++ if sr.get('type') == 'linstor': ++ srs[sr_ref] = sr ++ ++ pbds = dict() ++ for pbd_ref, pbd in session.xenapi.PBD.get_all_records().items(): ++ device_config = pbd.get('device_config') ++ if ( ++ device_config and ++ device_config.get('group-name') == group_name ++ and pbd['SR'] in srs ++ ): ++ pbds[pbd_ref] = pbd ++ ++ # 2. Remove node. ++ linstor = LinstorVolumeManager( ++ get_controller_uri(), ++ group_name, ++ logger=util.SMlog ++ ) ++ ++ node_name = socket.gethostname() ++ if linstor.has_node(node_name): ++ linstor.destroy_node(node_name) ++ if linstor.has_node(node_name): ++ raise Exception('Failed to remove node! Unknown error.') ++ ++ redundancy = linstor.redundancy ++ this_host = util.get_this_host_ref(session) ++ ++ # 3. Update PBDs. ++ for pbd_ref, pbd in pbds.items(): ++ host = pbd['host'] ++ if host == this_host: ++ if pbd['currently_attached']: ++ session.xenapi.PBD.unplug(pbd_ref) ++ session.xenapi.PBD.destroy(pbd_ref) ++ continue ++ ++ device_config = pbd['device_config'] ++ hosts = device_config.get('hosts', []).split(',') ++ try: ++ hosts.remove(node_name) ++ except Exception as e: ++ continue ++ hosts = ','.join(list(set(hosts))) ++ ++ if pbd['currently_attached']: ++ session.xenapi.PBD.unplug(pbd_ref) ++ session.xenapi.PBD.destroy(pbd_ref) ++ ++ pbd_ref = session.xenapi.PBD.create({ ++ 'host': host, ++ 'SR': pbd['SR'], ++ 'device_config': { ++ 'group-name': group_name, ++ 'redundancy': redundancy, ++ 'hosts': hosts, ++ 'provisioning': device_config['provisioning'] ++ } ++ }) ++ ++ try: ++ session.xenapi.PBD.plug(pbd_ref) ++ except Exception as e: ++ util.SMlog('Failed to replug PBD: {}'.format(e)) ++ ++ # 3. Stop services. ++ try: ++ update_linstor_satellite_service(start=False) ++ update_minidrbdcluster_service(start=False) ++ update_all_ports(open=False) ++ except Exception as e: ++ util.SMlog('Error while stopping services: {}'.format(e)) ++ pass ++ ++ return str('True') ++ ++ + if __name__ == '__main__': + XenAPIPlugin.dispatch({ + 'prepareSr': prepare_sr, +@@ -357,5 +632,7 @@ if __name__ == '__main__': + 'getBlockBitmap': get_block_bitmap, + 'lockVdi': lock_vdi, + 'lsofResource': lsof_resource, +- 'hasControllerRunning': has_controller_running ++ 'hasControllerRunning': has_controller_running, ++ 'addHost': add_host, ++ 'removeHost': remove_host + }) +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 2d5c63e..6c0d5aa 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -402,6 +402,15 @@ class LinstorVolumeManager(object): + """ + return self._base_group_name + ++ @property ++ def redundancy(self): ++ """ ++ Give the used redundancy. ++ :return: The redundancy. ++ :rtype: int ++ """ ++ return self._redundancy ++ + @property + def volumes(self): + """ +@@ -1376,6 +1385,51 @@ class LinstorVolumeManager(object): + """ + self._mark_resource_cache_as_dirty() + ++ def has_node(self, node_name): ++ """ ++ Check if a node exists in the LINSTOR database. ++ :rtype: bool ++ """ ++ result = self._linstor.node_list() ++ error_str = self._get_error_str(result) ++ if error_str: ++ raise LinstorVolumeManagerError( ++ 'Failed to list nodes using `{}`: {}' ++ .format(node_name, error_str) ++ ) ++ return bool(result[0].node(node_name)) ++ ++ def create_node(self, node_name, ip): ++ """ ++ Create a new node in the LINSTOR database. ++ :param str node_name: Node name to use. ++ :param str ip: Host IP to communicate. ++ """ ++ result = self._linstor.node_create( ++ node_name, ++ linstor.consts.VAL_NODE_TYPE_CMBD, ++ ip ++ ) ++ errors = self._filter_errors(result) ++ if errors: ++ error_str = self._get_error_str(errors) ++ raise LinstorVolumeManagerError( ++ 'Failed to create node `{}`: {}'.format(node_name, error_str) ++ ) ++ ++ def destroy_node(self, node_name): ++ """ ++ Destroy a node in the LINSTOR database. ++ :param str node_name: Node name to remove. ++ """ ++ result = self._linstor.node_delete(node_name) ++ errors = self._filter_errors(result) ++ if errors: ++ error_str = self._get_error_str(errors) ++ raise LinstorVolumeManagerError( ++ 'Failed to destroy node `{}`: {}'.format(node_name, error_str) ++ ) ++ + @classmethod + def create_sr( + cls, group_name, node_names, ips, redundancy, +-- +2.45.2 + diff --git a/SOURCES/0055-feat-LinstorVolumeManager-support-SR-creation-with-d.patch b/SOURCES/0055-feat-LinstorVolumeManager-support-SR-creation-with-d.patch new file mode 100644 index 00000000..720dd272 --- /dev/null +++ b/SOURCES/0055-feat-LinstorVolumeManager-support-SR-creation-with-d.patch @@ -0,0 +1,130 @@ +From cc4ab2139ea80d7367d7838c8c720616c2e89ac8 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Wed, 13 Apr 2022 15:56:42 +0200 +Subject: [PATCH 055/175] feat(LinstorVolumeManager): support SR creation with + diskless nodes + +Signed-off-by: Ronan Abhamon +--- + drivers/linstorvolumemanager.py | 66 +++++++++++++++++++++++++++------ + 1 file changed, 55 insertions(+), 11 deletions(-) + +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 6c0d5aa..430e080 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -1543,9 +1543,14 @@ class LinstorVolumeManager(object): + ) + + # 2. Create storage pool on each node + resource group. ++ reg_volume_group_not_found = re.compile( ++ ".*Volume group '.*' not found$" ++ ) ++ + i = 0 + try: + # 2.a. Create storage pools. ++ storage_pool_count = 0 + while i < len(node_names): + node_name = node_names[i] + +@@ -1556,17 +1561,35 @@ class LinstorVolumeManager(object): + driver_pool_name=driver_pool_name + ) + +- error_str = cls._get_error_str(result) +- if error_str: +- raise LinstorVolumeManagerError( +- 'Could not create SP `{}` on node `{}`: {}'.format( +- group_name, +- node_name, +- error_str ++ errors = linstor.Linstor.filter_api_call_response_errors( ++ result ++ ) ++ if errors: ++ if len(errors) == 1 and errors[0].is_error( ++ linstor.consts.FAIL_STOR_POOL_CONFIGURATION_ERROR ++ ) and reg_volume_group_not_found.match(errors[0].message): ++ logger( ++ 'Volume group `{}` not found on `{}`. Ignoring...' ++ .format(group_name, node_name) + ) +- ) ++ cls._destroy_storage_pool(lin, group_name, node_name) ++ else: ++ error_str = cls._get_error_str(result) ++ raise LinstorVolumeManagerError( ++ 'Could not create SP `{}` on node `{}`: {}' ++ .format(group_name, node_name, error_str) ++ ) ++ else: ++ storage_pool_count += 1 + i += 1 + ++ if not storage_pool_count: ++ raise LinstorVolumeManagerError( ++ 'Unable to create SR `{}`: No VG group found'.format( ++ group_name, ++ ) ++ ) ++ + # 2.b. Create resource group. + result = lin.resource_group_create( + name=group_name, +@@ -2345,13 +2368,22 @@ class LinstorVolumeManager(object): + # "Not enough available nodes" + # I don't understand why but this command protect against this bug. + try: +- lin.storage_pool_list_raise(filter_by_stor_pools=[group_name]) ++ pools = lin.storage_pool_list_raise( ++ filter_by_stor_pools=[group_name] ++ ) + except Exception as e: + raise LinstorVolumeManagerError( + 'Failed to get storage pool list before database creation: {}' + .format(e) + ) + ++ # Ensure we have a correct list of storage pools. ++ nodes_with_pool = map(lambda pool: pool.node_name, pools.storage_pools) ++ assert nodes_with_pool # We must have at least one storage pool! ++ for node_name in nodes_with_pool: ++ assert node_name in node_names ++ util.SMlog('Nodes with storage pool: {}'.format(nodes_with_pool)) ++ + # Create the database definition. + size = cls.round_up_volume_size(DATABASE_SIZE) + cls._check_volume_creation_errors(lin.resource_group_spawn( +@@ -2364,14 +2396,26 @@ class LinstorVolumeManager(object): + + # Create real resources on the first nodes. + resources = [] +- for node_name in node_names[:redundancy]: ++ ++ diskful_nodes = [] ++ diskless_nodes = [] ++ for node_name in node_names: ++ if node_name in nodes_with_pool: ++ diskful_nodes.append(node_name) ++ else: ++ diskless_nodes.append(node_name) ++ ++ assert diskful_nodes ++ for node_name in diskful_nodes[:redundancy]: ++ util.SMlog('Create database diskful on {}'.format(node_name)) + resources.append(linstor.ResourceData( + node_name=node_name, + rsc_name=DATABASE_VOLUME_NAME, + storage_pool=group_name + )) + # Create diskless resources on the remaining set. +- for node_name in node_names[redundancy:]: ++ for node_name in diskful_nodes[redundancy:] + diskless_nodes: ++ util.SMlog('Create database diskless on {}'.format(node_name)) + resources.append(linstor.ResourceData( + node_name=node_name, + rsc_name=DATABASE_VOLUME_NAME, +-- +2.45.2 + diff --git a/SOURCES/0056-feat-LinstorSR-add-a-config-var-to-disable-HTTP-NBD-.patch b/SOURCES/0056-feat-LinstorSR-add-a-config-var-to-disable-HTTP-NBD-.patch new file mode 100644 index 00000000..6328d2d0 --- /dev/null +++ b/SOURCES/0056-feat-LinstorSR-add-a-config-var-to-disable-HTTP-NBD-.patch @@ -0,0 +1,54 @@ +From c2b52c658307838fc3d3565452c426214b45c504 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Thu, 14 Apr 2022 10:30:23 +0200 +Subject: [PATCH 056/175] feat(LinstorSR): add a config var to disable HTTP/NBD + servers + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 15 +++++++++++++-- + 1 file changed, 13 insertions(+), 2 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 413c550..927e477 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -61,6 +61,13 @@ XHA_CONFIG_PATH = '/etc/xensource/xhad.conf' + + FORK_LOG_DAEMON = '/opt/xensource/libexec/fork-log-daemon' + ++# This flag can be disabled to debug the DRBD layer. ++# When this config var is False, the HA can only be used under ++# specific conditions: ++# - Only one heartbeat diskless VDI is present in the pool. ++# - The other hearbeat volumes must be diskful and limited to a maximum of 3. ++USE_HTTP_NBD_SERVERS = True ++ + # ============================================================================== + + # TODO: Supports 'VDI_INTRODUCE', 'VDI_RESET_ON_BOOT/2', 'SR_TRIM', +@@ -1769,7 +1776,11 @@ class LinstorVDI(VDI.VDI): + self.xenstore_data = {} + self.xenstore_data['storage-type'] = LinstorSR.DRIVER_TYPE + +- if attach_from_config and self.path.startswith('/dev/http-nbd/'): ++ if ( ++ USE_HTTP_NBD_SERVERS and ++ attach_from_config and ++ self.path.startswith('/dev/http-nbd/') ++ ): + return self._attach_using_http_nbd() + + if not util.pathexists(self.path): +@@ -1934,7 +1945,7 @@ class LinstorVDI(VDI.VDI): + # We can't increase this limitation, so we use a NBD/HTTP device + # instead. + volume_name = self._linstor.get_volume_name(self.uuid) +- if volume_name not in [ ++ if not USE_HTTP_NBD_SERVERS or volume_name not in [ + 'xcp-persistent-ha-statefile', 'xcp-persistent-redo-log' + ]: + if not self.path or not util.pathexists(self.path): +-- +2.45.2 + diff --git a/SOURCES/0057-feat-LinstorSr-ensure-LVM-group-is-activated-during-.patch b/SOURCES/0057-feat-LinstorSr-ensure-LVM-group-is-activated-during-.patch new file mode 100644 index 00000000..e0ffd003 --- /dev/null +++ b/SOURCES/0057-feat-LinstorSr-ensure-LVM-group-is-activated-during-.patch @@ -0,0 +1,99 @@ +From 97c81ae64c853e98c6bc48b61a0858b098c81938 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Thu, 14 Apr 2022 15:45:20 +0200 +Subject: [PATCH 057/175] feat(LinstorSr): ensure LVM group is activated during + SR.attach/create + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 23 +++++++++++++++++------ + drivers/linstor-manager | 2 ++ + 2 files changed, 19 insertions(+), 6 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 927e477..e2d3d78 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -34,6 +34,7 @@ import cleanup + import distutils + import errno + import functools ++import lvutil + import os + import re + import scsiutil +@@ -320,6 +321,15 @@ def get_ips_from_xha_config_file(): + + return (host_ip, ips) + ++ ++def activate_lvm_group(group_name): ++ path = group_name.split('/') ++ assert path and len(path) <= 2 ++ try: ++ lvutil.setActiveVG(path[0], True) ++ except Exception as e: ++ util.SMlog('Cannot active VG `{}`: {}'.format(path[0], e)) ++ + # ============================================================================== + + # Usage example: +@@ -673,7 +683,7 @@ class LinstorSR(SR.SR): + # Ensure ports are opened and LINSTOR satellites + # are activated. In the same time the minidrbdcluster instances + # must be stopped. +- self._prepare_sr_on_all_hosts(enabled=True) ++ self._prepare_sr_on_all_hosts(self._group_name, enabled=True) + + # Create SR. + # Throw if the SR already exists. +@@ -798,6 +808,7 @@ class LinstorSR(SR.SR): + 'SRUnavailable', + opterr='no such group: {}'.format(self._group_name) + ) ++ activate_lvm_group(self._group_name) + + @_locked_load + def detach(self, uuid): +@@ -907,20 +918,20 @@ class LinstorSR(SR.SR): + opterr='Plugin {} failed'.format(self.MANAGER_PLUGIN) + ) + +- def _prepare_sr(self, host, enabled): ++ def _prepare_sr(self, host, group_name, enabled): + self._exec_manager_command( + host, + 'prepareSr' if enabled else 'releaseSr', +- {}, ++ {'groupName': group_name}, + 'SRUnavailable' + ) + +- def _prepare_sr_on_all_hosts(self, enabled): ++ def _prepare_sr_on_all_hosts(self, group_name, enabled): + master = util.get_master_ref(self.session) +- self._prepare_sr(master, enabled) ++ self._prepare_sr(master, group_name, enabled) + + for slave in util.get_all_slaves(self.session): +- self._prepare_sr(slave, enabled) ++ self._prepare_sr(slave, group_name, enabled) + + def _update_minidrbdcluster(self, host, enabled): + self._exec_manager_command( +diff --git a/drivers/linstor-manager b/drivers/linstor-manager +index 7e34ce6..91731b1 100755 +--- a/drivers/linstor-manager ++++ b/drivers/linstor-manager +@@ -76,6 +76,8 @@ def update_minidrbdcluster_service(start): + + def prepare_sr(session, args): + try: ++ LinstorSR.activate_lvm_group(args['groupName']) ++ + update_all_ports(open=True) + # We don't want to enable and start minidrbdcluster daemon during + # SR creation. +-- +2.45.2 + diff --git a/SOURCES/0058-feat-linstor-manager-add-method-to-create-LinstorSR-.patch b/SOURCES/0058-feat-linstor-manager-add-method-to-create-LinstorSR-.patch new file mode 100644 index 00000000..58d6042c --- /dev/null +++ b/SOURCES/0058-feat-linstor-manager-add-method-to-create-LinstorSR-.patch @@ -0,0 +1,247 @@ +From 74c9cc1367cc31592f332aff0bdfd24cf2d20cb3 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Mon, 25 Apr 2022 14:47:51 +0200 +Subject: [PATCH 058/175] feat(linstor-manager): add method to create LinstorSR + + to list/destroy DRBD volumes + +Signed-off-by: Ronan Abhamon +--- + drivers/linstor-manager | 179 +++++++++++++++++++++++++++++++++++++--- + 1 file changed, 168 insertions(+), 11 deletions(-) + +diff --git a/drivers/linstor-manager b/drivers/linstor-manager +index 91731b1..7893ebc 100755 +--- a/drivers/linstor-manager ++++ b/drivers/linstor-manager +@@ -23,6 +23,7 @@ sys.path[0] = '/opt/xensource/sm/' + import base64 + import distutils.util + import socket ++import XenAPI + import XenAPIPlugin + + from linstorjournaler import LinstorJournaler +@@ -30,9 +31,13 @@ from linstorvolumemanager import get_controller_uri, LinstorVolumeManager + from lock import Lock + import json + import LinstorSR ++import re + import util + import vhdutil + ++BACKING_DISK_RE = re.compile('^/dev/([^/]+)/(?:[^/]+)$') ++LVM_PLUGIN = 'lvm' ++THIN_POOL = 'thin_pool' + + FIREWALL_PORT_SCRIPT = '/etc/xapi.d/plugins/firewall-port' + LINSTOR_PORTS = [3366, 3370, 3376, 3377, '7000:8000', 8076, 8077] +@@ -55,14 +60,6 @@ def update_all_ports(open): + update_port(port, open) + + +-def stop_service(name): +- args = ('systemctl', 'stop', name) +- (ret, out, err) = util.doexec(args) +- if ret == 0: +- return +- raise Exception('Failed to stop {}: {} {}'.format(name, out, err)) +- +- + def update_linstor_satellite_service(start): + util.enable_and_start_service('linstor-satellite', start) + +@@ -71,6 +68,111 @@ def update_minidrbdcluster_service(start): + util.enable_and_start_service('minidrbdcluster', start) + + ++def exec_create_sr(session, name, description, disks, volume_group, redundancy, thin, force): ++ disks = json.loads(disks) ++ disk_hostnames = disks.keys() ++ ++ # Create volumes. ++ hosts = session.xenapi.host.get_all_records() ++ hostnames = [] ++ for host_ref, host_record in hosts.items(): ++ hostname = host_record['hostname'] ++ if hostname not in disk_hostnames: ++ continue ++ ++ if force: ++ try: ++ session.xenapi.host.call_plugin( ++ host_ref, LVM_PLUGIN, 'destroy_volume_group', { ++ 'vg_name': volume_group, ++ 'force': 'True' ++ } ++ ) ++ except Exception as e: ++ try: ++ response = session.xenapi.host.call_plugin( ++ host_ref, LVM_PLUGIN, 'list_volume_groups', { ++ 'vg_name': volume_group ++ } ++ ) ++ if response != '{}': ++ raise e ++ except Exception: ++ raise e ++ ++ host_devices = ','.join(disks[hostname]) ++ session.xenapi.host.call_plugin( ++ host_ref, LVM_PLUGIN, 'create_physical_volume', { ++ 'devices': host_devices, ++ 'force': str(force) ++ } ++ ) ++ ++ session.xenapi.host.call_plugin( ++ host_ref, LVM_PLUGIN, 'create_volume_group', { ++ 'vg_name': volume_group, ++ 'devices': host_devices ++ } ++ ) ++ ++ if thin: ++ session.xenapi.host.call_plugin( ++ host_ref, LVM_PLUGIN, 'create_thin_pool', { ++ 'vg_name': volume_group, ++ 'lv_name': THIN_POOL ++ } ++ ) ++ ++ # Create SR. ++ master_ref = session.xenapi.pool.get_all_records().values()[0]['master'] ++ ++ device_config = { ++ 'redundancy': redundancy, ++ 'provisioning': 'thin' if thin else 'thick', ++ 'group-name': '{}/{}'.format(volume_group, THIN_POOL) if thin else volume_group, ++ 'hosts': ','.join(hostnames), ++ 'monitor-db-quorum': str(len(hostnames) > 2) ++ } ++ sr_ref = session.xenapi.SR.create( ++ master_ref, device_config, '0', name, description, 'linstor', '', True, {} ++ ) ++ return session.xenapi.SR.get_uuid(sr_ref) ++ ++ ++def get_drbd_volumes(volume_group=None): ++ drbd_volumes = {} ++ (ret, stdout, stderr) = util.doexec(['drbdsetup', 'show', '--json']) ++ if ret: ++ raise Exception('Failed to get JSON object: {}'.format(stderr)) ++ ++ config = json.loads(stdout) ++ for resource in config: ++ for volume in resource['_this_host']['volumes']: ++ backing_disk = volume['backing-disk'] ++ match = BACKING_DISK_RE.match(backing_disk) ++ if not match: ++ continue ++ ++ cur_volume_group = match.groups()[0] ++ if volume_group and cur_volume_group != volume_group: ++ continue ++ ++ minor = int(volume['device_minor']) ++ if cur_volume_group in drbd_volumes: ++ drbd_volumes[cur_volume_group].append(minor) ++ else: ++ drbd_volumes[cur_volume_group] = [minor] ++ return drbd_volumes ++ ++ ++def force_destroy_drbd_volume(minor): ++ (ret, stdout, stderr) = util.doexec(['drbdsetup', 'detach', minor, '--force']) ++ if ret: ++ raise Exception('Failed to detach volume: {}'.format(stderr)) ++ (ret, stdout, stderr) = util.doexec(['drbdsetup', 'del-minor', minor]) ++ if ret: ++ raise Exception('Failed to destroy volume: {}'.format(stderr)) ++ + # ------------------------------------------------------------------------------ + + +@@ -169,8 +271,8 @@ def destroy(session, args): + linstor.destroy() + return str(True) + except Exception as e: +- stop_service('linstor-controller') +- stop_service('var-lib-linstor.service') ++ util.stop_service('linstor-controller') ++ util.stop_service('var-lib-linstor.service') + util.SMlog('linstor-manager:destroy error: {}'.format(e)) + return str(False) + +@@ -615,6 +717,57 @@ def remove_host(session, args): + return str('True') + + ++def create_sr(session, args): ++ try: ++ name = args['name'] ++ description = args.get('description') or '' ++ disks = json.loads(args['disks']) ++ volume_group = args['volume_group'] ++ redundancy = int(args['redundancy']) ++ thin = distutils.util.strtobool(args.get('thin') or '0') ++ force = distutils.util.strtobool(args.get('force') or '0') ++ return json.dumps(exec_create_sr( ++ session, name, description, disks, volume_group, redundancy, thin, force ++ )) ++ except Exception as e: ++ util.SMlog('linstor-manager:create_sr error: {}'.format(e)) ++ raise ++ ++ ++def list_drbd_volumes(session, args): ++ try: ++ volume_group = args.get('volume_group') ++ return json.dumps(get_drbd_volumes(volume_group)) ++ except Exception as e: ++ util.SMlog('linstor-manager:list_drbd_volumes error: {}'.format(e)) ++ raise ++ ++ ++def destroy_drbd_volume(session, args): ++ try: ++ minor = args.get('minor') ++ if not minor: ++ raise Exception('Cannot destroy DRBD volume without minor.') ++ force_destroy_drbd_volume(minor) ++ return str(True) ++ except Exception as e: ++ util.SMlog('linstor-manager:destroy_drbd_volume error: {}'.format(e)) ++ return str(False) ++ ++ ++def destroy_drbd_volumes(session, args): ++ try: ++ volume_group = args.get('volume_group') ++ if not volume_group: ++ raise Exception('Cannot destroy DRBD volumes without volume group.') ++ for minor in get_drbd_volumes(volume_group).get(volume_group, []): ++ force_destroy_drbd_volume(str(minor)) ++ return str(True) ++ except Exception as e: ++ util.SMlog('linstor-manager:destroy_drbd_volumes error: {}'.format(e)) ++ return str(False) ++ ++ + if __name__ == '__main__': + XenAPIPlugin.dispatch({ + 'prepareSr': prepare_sr, +@@ -636,5 +789,9 @@ if __name__ == '__main__': + 'lsofResource': lsof_resource, + 'hasControllerRunning': has_controller_running, + 'addHost': add_host, +- 'removeHost': remove_host ++ 'removeHost': remove_host, ++ 'createSr': create_sr, ++ 'listDrbdVolumes': list_drbd_volumes, ++ 'destroyDrbdVolume': destroy_drbd_volume, ++ 'destroyDrbdVolumes': destroy_drbd_volumes + }) +-- +2.45.2 + diff --git a/SOURCES/0059-fix-LinstorSR-always-set-vdi_path-in-generate_config.patch b/SOURCES/0059-fix-LinstorSR-always-set-vdi_path-in-generate_config.patch new file mode 100644 index 00000000..b91ccf3f --- /dev/null +++ b/SOURCES/0059-fix-LinstorSR-always-set-vdi_path-in-generate_config.patch @@ -0,0 +1,31 @@ +From 8ac154aad2da2216e2e741f7cb8990d36e563412 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Tue, 26 Apr 2022 11:20:08 +0200 +Subject: [PATCH 059/175] fix(LinstorSR): always set vdi_path in + generate_config + +If the volume of a generated config is not related to HTTP/NBD +and if we already have a path to the resource, the VDI path is never +written to the config. So the config can't be used to attach the VDI... + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index e2d3d78..1855e3d 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -1970,7 +1970,7 @@ class LinstorVDI(VDI.VDI): + if not available: + raise xs_errors.XenError('VDIUnavailable') + +- resp['vdi_path'] = self.path ++ resp['vdi_path'] = self.path + else: + # Axiom: DRBD device is present on at least one host. + resp['vdi_path'] = '/dev/http-nbd/' + volume_name +-- +2.45.2 + diff --git a/SOURCES/0060-fix-minidrbdcluster-supports-new-properties-like-for.patch b/SOURCES/0060-fix-minidrbdcluster-supports-new-properties-like-for.patch new file mode 100644 index 00000000..ac97ceb7 --- /dev/null +++ b/SOURCES/0060-fix-minidrbdcluster-supports-new-properties-like-for.patch @@ -0,0 +1,37 @@ +From fe078eb130b76a11d3079b7aa9adf7dbaafa3597 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Fri, 13 May 2022 14:35:57 +0200 +Subject: [PATCH 060/175] fix(minidrbdcluster): supports new properties like + `force-io-failures` + +Signed-off-by: Ronan Abhamon +--- + scripts/minidrbdcluster | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/scripts/minidrbdcluster b/scripts/minidrbdcluster +index a04b6c1..fb4de09 100755 +--- a/scripts/minidrbdcluster ++++ b/scripts/minidrbdcluster +@@ -11,15 +11,15 @@ DRBDADM_OPEN_FAILED_RE = re.compile( + ) + MAY_PROMOT_RE = re.compile( + '(?:exists|change) resource name:((?:\\w|-)+) ' +- '(?:\\w+\\:\\w+ )*may_promote:(yes|no) promotion_score:(\\d+)' ++ '(?:(?:\\w|-)+\\:(?:\\w|-)+ )*may_promote:(yes|no) promotion_score:(\\d+)' + ) + PEER_ROLE_RE = re.compile( + '(?:exists|change) connection name:((?:\\w|-)+) peer-node-id:(?:\\d+) ' +- 'conn-name:(\\w+) (?:\\w+\\:\\w+ )*role:(Primary|Secondary|Unknown)' ++ 'conn-name:((?:\\w|-)+) (?:(?:\\w|-)+\\:(?:\\w|-)+ )*role:(Primary|Secondary|Unknown)' + ) + HAVE_QUORUM_RE = re.compile( + '(?:exists|change) device name:((?:\\w|-)+) ' +- '(?:\\w+\\:\\w+ )*quorum:(yes|no)' ++ '(?:(?:\\w|-)+\\:(?:\\w|-)+ )*quorum:(yes|no)' + ) + + +-- +2.45.2 + diff --git a/SOURCES/0061-fix-LinstorSR-enabled-disable-minidrbcluster-with-fi.patch b/SOURCES/0061-fix-LinstorSR-enabled-disable-minidrbcluster-with-fi.patch new file mode 100644 index 00000000..7a863ddd --- /dev/null +++ b/SOURCES/0061-fix-LinstorSR-enabled-disable-minidrbcluster-with-fi.patch @@ -0,0 +1,84 @@ +From 405e400377002bc9d47a21214d711649c8ed221e Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Wed, 18 May 2022 17:28:33 +0200 +Subject: [PATCH 061/175] fix(LinstorSR): enabled/disable minidrbcluster with + fixed order + +Ensure we disable minidrbdcluster during SR destruction on all hosts +with a deterministic execution to ensure linstor-controller is never restarted +on another host. It was possible before this patch because the host of the minidrbcluster +that was running the controller could be stopped before the others. Now the primary service +is stopped last. + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 38 +++++++++++++++++++++++++++++++------- + 1 file changed, 31 insertions(+), 7 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 1855e3d..57280e3 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -751,7 +751,9 @@ class LinstorSR(SR.SR): + ) + + try: +- self._update_minidrbdcluster_on_all_hosts(enabled=False) ++ self._update_minidrbdcluster_on_all_hosts( ++ controller_node_name=node_name, enabled=False ++ ) + + args = { + 'groupName': self._group_name, +@@ -761,7 +763,9 @@ class LinstorSR(SR.SR): + ) + except Exception as e: + try: +- self._update_minidrbdcluster_on_all_hosts(enabled=True) ++ self._update_minidrbdcluster_on_all_hosts( ++ controller_node_name=node_name, enabled=True ++ ) + except Exception as e2: + util.SMlog( + 'Failed to restart minidrbdcluster after destroy fail: {}' +@@ -941,12 +945,32 @@ class LinstorSR(SR.SR): + 'SRUnavailable' + ) + +- def _update_minidrbdcluster_on_all_hosts(self, enabled): +- master = util.get_master_ref(self.session) +- self._update_minidrbdcluster(master, enabled) ++ def _update_minidrbdcluster_on_all_hosts( ++ self, enabled, controller_node_name=None ++ ): ++ controller_host = None ++ secondary_hosts = [] + +- for slave in util.get_all_slaves(self.session): +- self._update_minidrbdcluster(slave, enabled) ++ hosts = self.session.xenapi.host.get_all_records() ++ for host_ref, host_rec in hosts.iteritems(): ++ if controller_node_name == host_rec['hostname']: ++ controller_host = host_ref ++ else: ++ secondary_hosts.append(host_ref) ++ ++ if enabled and controller_host: ++ # If enabled is true, we try to start the controller on the desired ++ # node name first. ++ self._update_minidrbdcluster(controller_host, enabled) ++ ++ for host in secondary_hosts: ++ self._update_minidrbdcluster(host, enabled) ++ ++ if not enabled and controller_host: ++ # If enabled is false, we disable the minidrbdcluster service of ++ # the controller host last. Why? Otherwise the linstor-controller ++ # of other nodes can be started, and we don't want that. ++ self._update_minidrbdcluster(controller_host, enabled) + + # -------------------------------------------------------------------------- + # Metadata. +-- +2.45.2 + diff --git a/SOURCES/0062-fix-linstor-manager-change-linstor-satellite-start-b.patch b/SOURCES/0062-fix-linstor-manager-change-linstor-satellite-start-b.patch new file mode 100644 index 00000000..6a986181 --- /dev/null +++ b/SOURCES/0062-fix-linstor-manager-change-linstor-satellite-start-b.patch @@ -0,0 +1,41 @@ +From bf1f15e728645d9383158312fd1d5ec24844262a Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Tue, 31 May 2022 14:01:45 +0200 +Subject: [PATCH 062/175] fix(linstor-manager): change linstor satellite start + behavior + +Ensure we don't have an invalid cache used by a satellite: +- We found an issue with a new added disk which used a volume group name + formerly involved by another disk. To avoid this kind of problem, we + always restart the satellite. + +Signed-off-by: Ronan Abhamon +--- + drivers/linstor-manager | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/drivers/linstor-manager b/drivers/linstor-manager +index 7893ebc..c6d622f 100755 +--- a/drivers/linstor-manager ++++ b/drivers/linstor-manager +@@ -61,7 +61,16 @@ def update_all_ports(open): + + + def update_linstor_satellite_service(start): +- util.enable_and_start_service('linstor-satellite', start) ++ service = 'linstor-satellite' ++ ++ # Stop services in all cases first. ++ # Ensure we don't have an invalid cache used by a satellite. ++ # (We found an issue with a new added disk which used a volume group name ++ # formerly involved by another disk. To avoid this kind of problem, we ++ # always restart the satellite.) ++ util.enable_and_start_service(service, False) ++ if start: ++ util.enable_and_start_service(service, True) + + + def update_minidrbdcluster_service(start): +-- +2.45.2 + diff --git a/SOURCES/0063-Fix-is_open-call-for-LinstorSR.patch b/SOURCES/0063-Fix-is_open-call-for-LinstorSR.patch new file mode 100644 index 00000000..ddf608a0 --- /dev/null +++ b/SOURCES/0063-Fix-is_open-call-for-LinstorSR.patch @@ -0,0 +1,106 @@ +From 4eb1c5526a4d6ac8583ba125321a7747bd6d1680 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Thu, 2 Jun 2022 09:04:28 +0200 +Subject: [PATCH 063/175] Fix is_open call for LinstorSR + +1. Ensure LinstorSR driver is imported in `_is_open` definition to register it in the driver list. +Otherwise this function always fails with a SRUnknownType exception. + +2. Fetch the dconf of the target SR to retrieve VDI path, i.e. we can't use fake params like +other drivers, we must have a real LINSTOR connection to read in the DB the volume location. + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 10 +++++++++- + drivers/on_slave.py | 17 ++++++++++++++++- + tests/test_on_slave.py | 10 +++++++++- + 3 files changed, 34 insertions(+), 3 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 57280e3..e5f6f85 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -445,7 +445,11 @@ class LinstorSR(SR.SR): + def load(self, *args, **kwargs): + if not self._has_session: + if self.srcmd.cmd in ( +- 'vdi_attach_from_config', 'vdi_detach_from_config' ++ 'vdi_attach_from_config', ++ 'vdi_detach_from_config', ++ # When on-slave (is_open) is executed we have an ++ # empty command. ++ None + ): + def create_linstor(uri, attempt_count=30): + self._linstor = LinstorVolumeManager( +@@ -482,6 +486,10 @@ class LinstorSR(SR.SR): + controller_uri, self._group_name, logger=util.SMlog + ) + ++ if self.srcmd.cmd is None: ++ # Only useful on on-slave plugin (is_open). ++ self._vhdutil = LinstorVhdUtil(self.session, self._linstor) ++ + return wrapped_method(self, *args, **kwargs) + + if not self._is_master: +diff --git a/drivers/on_slave.py b/drivers/on_slave.py +index 3c7bd34..bbef4f7 100755 +--- a/drivers/on_slave.py ++++ b/drivers/on_slave.py +@@ -78,6 +78,7 @@ def _is_open(session, args): + import EXTSR + import LargeBlockSR + import GlusterFSSR ++ import LinstorSR + import LVHDSR + import MooseFSSR + import NFSSR +@@ -108,8 +109,22 @@ def _is_open(session, args): + } + cmd.params = {"command": None} + ++ sr_uuid = srRec["uuid"] ++ ++ # Another ugly piece of code to load a real Linstor SR, otherwise ++ # we can't fetch the VDI path. ++ if srType == 'linstor': ++ host_ref = util.get_this_host_ref(session) ++ sr_ref = session.xenapi.SR.get_by_uuid(sr_uuid) ++ ++ pbd = util.find_my_pbd(session, host_ref, sr_ref) ++ if pbd is None: ++ raise util.SMException('Failed to find Linstor PBD') ++ ++ cmd.dconf = session.xenapi.PBD.get_device_config(pbd) ++ + driver = SR.driver(srType) +- sr = driver(cmd, srRec["uuid"]) ++ sr = driver(cmd, sr_uuid) + vdi = sr.vdi(vdiUuid) + tapdisk = blktap2.Tapdisk.find_by_path(vdi.path) + util.SMlog("Tapdisk for %s: %s" % (vdi.path, tapdisk)) +diff --git a/tests/test_on_slave.py b/tests/test_on_slave.py +index 54ebcd3..4c12d90 100644 +--- a/tests/test_on_slave.py ++++ b/tests/test_on_slave.py +@@ -13,7 +13,15 @@ import on_slave + + class Test_on_slave_is_open(unittest.TestCase): + +- MOCK_IMPORTS = ['SRCommand', 'SR', 'NFSSR', 'EXTSR', 'LVHDSR', 'blktap2'] ++ MOCK_IMPORTS = [ ++ 'SRCommand', ++ 'SR', ++ 'NFSSR', ++ 'EXTSR', ++ 'LVHDSR', ++ 'LinstorSR', ++ 'blktap2' ++ ] + + def fake_import(self, name, *args): + print 'Asked to import {}'.format(name) +-- +2.45.2 + diff --git a/SOURCES/0064-fix-linstorvhdutil-fix-boolean-params-of-check-call.patch b/SOURCES/0064-fix-linstorvhdutil-fix-boolean-params-of-check-call.patch new file mode 100644 index 00000000..d3fa44bb --- /dev/null +++ b/SOURCES/0064-fix-linstorvhdutil-fix-boolean-params-of-check-call.patch @@ -0,0 +1,50 @@ +From 90fdca84eb567c2b9bf85be90d9d1fadc9eab195 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Thu, 2 Jun 2022 09:28:32 +0200 +Subject: [PATCH 064/175] fix(linstorvhdutil): fix boolean params of `check` + call + +`ignoreMissingFooter` and `fast` must be string types to be used with XAPI plugin API. + +Signed-off-by: Ronan Abhamon +--- + drivers/linstor-manager | 6 ++++-- + drivers/linstorvhdutil.py | 5 ++++- + 2 files changed, 8 insertions(+), 3 deletions(-) + +diff --git a/drivers/linstor-manager b/drivers/linstor-manager +index c6d622f..63c0e3e 100755 +--- a/drivers/linstor-manager ++++ b/drivers/linstor-manager +@@ -289,8 +289,10 @@ def destroy(session, args): + def check(session, args): + try: + device_path = args['devicePath'] +- ignore_missing_footer = args['ignoreMissingFooter'] +- fast = args['fast'] ++ ignore_missing_footer = distutils.util.strtobool( ++ args['ignoreMissingFooter'] ++ ) ++ fast = distutils.util.strtobool(args['fast']) + return str(vhdutil.check(device_path, ignore_missing_footer, fast)) + except Exception as e: + util.SMlog('linstor-manager:check error: {}'.format(e)) +diff --git a/drivers/linstorvhdutil.py b/drivers/linstorvhdutil.py +index 9ba0ac3..f3d9870 100644 +--- a/drivers/linstorvhdutil.py ++++ b/drivers/linstorvhdutil.py +@@ -111,7 +111,10 @@ class LinstorVhdUtil: + # -------------------------------------------------------------------------- + + def check(self, vdi_uuid, ignore_missing_footer=False, fast=False): +- kwargs = {'ignoreMissingFooter': ignore_missing_footer, 'fast': fast} ++ kwargs = { ++ 'ignoreMissingFooter': str(ignore_missing_footer), ++ 'fast': str(fast) ++ } + return self._check(vdi_uuid, **kwargs) + + @linstorhostcall(vhdutil.check, 'check') +-- +2.45.2 + diff --git a/SOURCES/0065-feat-linstor-manager-robustify-exec_create_sr.patch b/SOURCES/0065-feat-linstor-manager-robustify-exec_create_sr.patch new file mode 100644 index 00000000..0e163dea --- /dev/null +++ b/SOURCES/0065-feat-linstor-manager-robustify-exec_create_sr.patch @@ -0,0 +1,206 @@ +From c5ae69bbb54ff636d33aebced1d45f2ad85c0a5f Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Thu, 30 Jun 2022 17:09:51 +0200 +Subject: [PATCH 065/175] feat(linstor-manager): robustify exec_create_sr + +- Use lvm.py XCP-ng xapi plugins instead of lvm (old name) +- Check arguments to create the SR +- Fix param types given to SR.create +- lsof_resource use verbose output if there is a lock or problem +- Remove useless `force` param on remove_host + +Signed-off-by: Ronan Abhamon +--- + drivers/linstor-manager | 112 ++++++++++++++++++++++++++++------------ + 1 file changed, 78 insertions(+), 34 deletions(-) + +diff --git a/drivers/linstor-manager b/drivers/linstor-manager +index 63c0e3e..2930a9e 100755 +--- a/drivers/linstor-manager ++++ b/drivers/linstor-manager +@@ -36,7 +36,7 @@ import util + import vhdutil + + BACKING_DISK_RE = re.compile('^/dev/([^/]+)/(?:[^/]+)$') +-LVM_PLUGIN = 'lvm' ++LVM_PLUGIN = 'lvm.py' + THIN_POOL = 'thin_pool' + + FIREWALL_PORT_SCRIPT = '/etc/xapi.d/plugins/firewall-port' +@@ -77,17 +77,16 @@ def update_minidrbdcluster_service(start): + util.enable_and_start_service('minidrbdcluster', start) + + +-def exec_create_sr(session, name, description, disks, volume_group, redundancy, thin, force): +- disks = json.loads(disks) ++def exec_create_sr(session, name, description, disks, volume_group, redundancy, provisioning, force): + disk_hostnames = disks.keys() ++ thin = provisioning == 'thin' + + # Create volumes. + hosts = session.xenapi.host.get_all_records() + hostnames = [] + for host_ref, host_record in hosts.items(): + hostname = host_record['hostname'] +- if hostname not in disk_hostnames: +- continue ++ hostnames.append(hostname) + + if force: + try: +@@ -109,10 +108,24 @@ def exec_create_sr(session, name, description, disks, volume_group, redundancy, + except Exception: + raise e + +- host_devices = ','.join(disks[hostname]) ++ if hostname not in disk_hostnames or not disks[hostname]: ++ if force or session.xenapi.host.call_plugin( ++ host_ref, LVM_PLUGIN, 'list_volume_groups', { ++ 'vg_name': volume_group ++ } ++ ) == '{}': ++ continue ++ raise Exception('Volume group should not exist on `{}`, you must remove it manually'.format(hostname)) ++ ++ host_disks = disks[hostname] ++ if type(host_disks) is list: ++ host_disks = ','.join(disks[hostname]) ++ else: ++ raise Exception('Disk value of `{}` must be a disk list'.format(hostname)) ++ + session.xenapi.host.call_plugin( + host_ref, LVM_PLUGIN, 'create_physical_volume', { +- 'devices': host_devices, ++ 'devices': host_disks, + 'force': str(force) + } + ) +@@ -120,7 +133,7 @@ def exec_create_sr(session, name, description, disks, volume_group, redundancy, + session.xenapi.host.call_plugin( + host_ref, LVM_PLUGIN, 'create_volume_group', { + 'vg_name': volume_group, +- 'devices': host_devices ++ 'devices': host_disks + } + ) + +@@ -132,20 +145,20 @@ def exec_create_sr(session, name, description, disks, volume_group, redundancy, + } + ) + +- # Create SR. +- master_ref = session.xenapi.pool.get_all_records().values()[0]['master'] +- +- device_config = { +- 'redundancy': redundancy, +- 'provisioning': 'thin' if thin else 'thick', +- 'group-name': '{}/{}'.format(volume_group, THIN_POOL) if thin else volume_group, +- 'hosts': ','.join(hostnames), +- 'monitor-db-quorum': str(len(hostnames) > 2) +- } +- sr_ref = session.xenapi.SR.create( +- master_ref, device_config, '0', name, description, 'linstor', '', True, {} +- ) +- return session.xenapi.SR.get_uuid(sr_ref) ++ # Create SR. ++ master_ref = session.xenapi.pool.get_all_records().values()[0]['master'] ++ ++ device_config = { ++ 'redundancy': str(redundancy), ++ 'provisioning': 'thin' if thin else 'thick', ++ 'group-name': '{}/{}'.format(volume_group, THIN_POOL) if thin else volume_group, ++ 'hosts': ','.join(hostnames), ++ 'monitor-db-quorum': str(len(hostnames) > 2) ++ } ++ sr_ref = session.xenapi.SR.create( ++ master_ref, device_config, '0', name, description, 'linstor', '', True, {} ++ ) ++ return session.xenapi.SR.get_uuid(sr_ref) + + + def get_drbd_volumes(volume_group=None): +@@ -435,13 +448,13 @@ def lock_vdi(session, args): + def lsof_resource(session, args): + try: + drbd_path = args['drbdPath'] +- (ret, stdout, stderr) = util.doexec(['lsof', drbd_path]) ++ (ret, stdout, stderr) = util.doexec(['lsof', '-V', drbd_path]) + if ret == 0: + return 'DRBD resource `{}` is open: {}'.format( +- drbd_path, stdout ++ drbd_path, stdout.rstrip() + ) + return '`lsof` on DRBD resource `{}` returned {}: {}'.format( +- drbd_path, ret, stderr ++ drbd_path, ret, stdout.rstrip() + ) + except Exception as e: + util.SMlog('linstor-manager:lsof_drbd error: {}'.format(e)) +@@ -645,7 +658,6 @@ def add_host(session, args): + + def remove_host(session, args): + group_name = args['groupName'] +- force = args.get('force') or False + + # 1. Find SRs and PBDs. + srs = dict() +@@ -730,16 +742,48 @@ def remove_host(session, args): + + def create_sr(session, args): + try: +- name = args['name'] ++ # Use a complex parsing contrary to the other functions because ++ # this helper is a public method and is not easy to use. ++ name = args.get('name') ++ if not name: ++ raise Exception('`name` is empty') ++ + description = args.get('description') or '' +- disks = json.loads(args['disks']) +- volume_group = args['volume_group'] +- redundancy = int(args['redundancy']) +- thin = distutils.util.strtobool(args.get('thin') or '0') ++ ++ disks = args.get('disks') ++ if not disks: ++ raise Exception('`disks` is empty') ++ try: ++ disks = json.loads(disks) ++ except Exception as e: ++ raise Exception('failed to decode `disks`: {}'.format(e)) ++ if type(disks) is not dict: ++ raise Exception('`disks` must be a JSON object') ++ ++ volume_group = args.get('volume_group') ++ if not volume_group: ++ raise Exception('`volume_group` is empty') ++ ++ redundancy = args.get('redundancy') ++ if not redundancy: ++ raise Exception('`redundancy` is empty') ++ ++ try: ++ redundancy = int(redundancy) ++ except Exception: ++ raise Exception('`redundancy` is not a number') ++ ++ provisioning = args.get('provisioning') ++ if not provisioning: ++ provisioning = 'thin' ++ elif provisioning != 'thin' and provisioning != 'thick': ++ raise Exception('unsupported provisioning') ++ + force = distutils.util.strtobool(args.get('force') or '0') +- return json.dumps(exec_create_sr( +- session, name, description, disks, volume_group, redundancy, thin, force +- )) ++ ++ return exec_create_sr( ++ session, name, description, disks, volume_group, redundancy, provisioning, force ++ ) + except Exception as e: + util.SMlog('linstor-manager:create_sr error: {}'.format(e)) + raise +-- +2.45.2 + diff --git a/SOURCES/0066-fix-cleanup-print-LINSTOR-VDI-UUID-if-error-during-i.patch b/SOURCES/0066-fix-cleanup-print-LINSTOR-VDI-UUID-if-error-during-i.patch new file mode 100644 index 00000000..02896845 --- /dev/null +++ b/SOURCES/0066-fix-cleanup-print-LINSTOR-VDI-UUID-if-error-during-i.patch @@ -0,0 +1,27 @@ +From 6f4c788286657aac1bfdc9bbf42a9cedc774f913 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Fri, 8 Jul 2022 14:52:25 +0200 +Subject: [PATCH 066/175] fix(cleanup): print LINSTOR VDI UUID if error during + info loading (not SR UUID) + +Signed-off-by: Ronan Abhamon +--- + drivers/cleanup.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/cleanup.py b/drivers/cleanup.py +index 9e3a5b0..7eeeee7 100755 +--- a/drivers/cleanup.py ++++ b/drivers/cleanup.py +@@ -2974,7 +2974,7 @@ class LinstorSR(SR): + except Exception as e: + Util.log( + ' [VDI {}: failed to load VDI info]: {}' +- .format(self.uuid, e) ++ .format(vdi_uuid, e) + ) + info = vhdutil.VHDInfo(vdi_uuid) + info.error = 1 +-- +2.45.2 + diff --git a/SOURCES/0067-feat-cleanup-raise-and-dump-DRBD-openers-in-case-of-.patch b/SOURCES/0067-feat-cleanup-raise-and-dump-DRBD-openers-in-case-of-.patch new file mode 100644 index 00000000..252450c2 --- /dev/null +++ b/SOURCES/0067-feat-cleanup-raise-and-dump-DRBD-openers-in-case-of-.patch @@ -0,0 +1,146 @@ +From 6172013641736dd476ad311873b95446da5ffd62 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Thu, 21 Jul 2022 11:39:20 +0200 +Subject: [PATCH 067/175] feat(cleanup): raise and dump DRBD openers in case of + bad coalesce + +Signed-off-by: Ronan Abhamon +--- + drivers/cleanup.py | 24 ++++++-------------- + drivers/linstor-manager | 40 ++++++++++++++++++++++++++++++++- + drivers/linstorvolumemanager.py | 24 ++++++++++++++++++++ + 3 files changed, 70 insertions(+), 18 deletions(-) + +diff --git a/drivers/cleanup.py b/drivers/cleanup.py +index 7eeeee7..0a586a6 100755 +--- a/drivers/cleanup.py ++++ b/drivers/cleanup.py +@@ -3079,27 +3079,17 @@ class LinstorSR(SR): + + def _checkSlaves(self, vdi): + try: +- states = self._linstor.get_usage_states(vdi.uuid) +- for node_name, state in states.items(): +- self._checkSlave(node_name, vdi, state) ++ all_openers = self._linstor.get_volume_openers(vdi.uuid) ++ for openers in all_openers.itervalues(): ++ for opener in openers.values(): ++ if opener['process-name'] != 'tapdisk': ++ raise util.SMException( ++ 'VDI {} is in use: {}'.format(vdi.uuid, all_openers) ++ ) + except LinstorVolumeManagerError as e: + if e.code != LinstorVolumeManagerError.ERR_VOLUME_NOT_EXISTS: + raise + +- @staticmethod +- def _checkSlave(node_name, vdi, state): +- # If state is None, LINSTOR doesn't know the host state +- # (bad connection?). +- if state is None: +- raise util.SMException( +- 'Unknown state for VDI {} on {}'.format(vdi.uuid, node_name) +- ) +- +- if state: +- raise util.SMException( +- 'VDI {} is in use on {}'.format(vdi.uuid, node_name) +- ) +- + + ################################################################################ + # +diff --git a/drivers/linstor-manager b/drivers/linstor-manager +index 2930a9e..81789e7 100755 +--- a/drivers/linstor-manager ++++ b/drivers/linstor-manager +@@ -823,6 +823,43 @@ def destroy_drbd_volumes(session, args): + return str(False) + + ++def get_drbd_openers(session, args): ++ try: ++ resource_name = args.get('resourceName') ++ volume = args.get('volume') ++ if not resource_name or volume is None: ++ raise Exception('Cannot get DRBD openers without resource name and/or volume.') ++ ++ path = '/sys/kernel/debug/drbd/resources/{}/volumes/{}/openers'.format( ++ resource_name, volume ++ ) ++ ++ with open(path, 'r') as openers: ++ # Not a big cost, so read all lines directly. ++ lines = openers.readlines() ++ ++ result = {} ++ ++ opener_re = re.compile('(.*)\\s+([0-9]+)\\s+([0-9]+)') ++ for line in lines: ++ match = opener_re.match(line) ++ assert match ++ ++ groups = match.groups() ++ process_name = groups[0] ++ pid = groups[1] ++ open_duration_ms = groups[2] ++ result[pid] = { ++ 'process-name': process_name, ++ 'open-duration': open_duration_ms ++ } ++ ++ return json.dumps(result) ++ except Exception as e: ++ util.SMlog('linstor-manager:get_drbd_openers error: {}'.format(e)) ++ raise ++ ++ + if __name__ == '__main__': + XenAPIPlugin.dispatch({ + 'prepareSr': prepare_sr, +@@ -848,5 +885,6 @@ if __name__ == '__main__': + 'createSr': create_sr, + 'listDrbdVolumes': list_drbd_volumes, + 'destroyDrbdVolume': destroy_drbd_volume, +- 'destroyDrbdVolumes': destroy_drbd_volumes ++ 'destroyDrbdVolumes': destroy_drbd_volumes, ++ 'getDrbdOpeners': get_drbd_openers + }) +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 430e080..d17845b 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -1048,6 +1048,30 @@ class LinstorVolumeManager(object): + + return states + ++ def get_volume_openers(self, volume_uuid): ++ """ ++ Get openers of a volume. ++ :param str volume_uuid: The volume uuid to monitor. ++ :return: A dictionnary that contains openers. ++ :rtype: dict(str, obj) ++ """ ++ ++ PLUGIN_CMD = 'getDrbdOpeners' ++ ++ openers = {} ++ ++ session = util.get_localAPI_session() ++ hosts = session.xenapi.host.get_all_records() ++ for host_ref, host_record in hosts.items(): ++ openers[host_record['hostname']] = json.loads( ++ session.xenapi.host.call_plugin(host_ref, PLUGIN, PLUGIN_CMD, { ++ 'resourceName': self.get_volume_name(volume_uuid), ++ 'volume': '0' ++ }) ++ ) ++ ++ return openers ++ + def get_volumes_with_name(self): + """ + Give a volume dictionnary that contains names actually owned. +-- +2.45.2 + diff --git a/SOURCES/0068-feat-linstorvhdutil-trace-DRBD-openers-in-case-of-ER.patch b/SOURCES/0068-feat-linstorvhdutil-trace-DRBD-openers-in-case-of-ER.patch new file mode 100644 index 00000000..eb30f6a7 --- /dev/null +++ b/SOURCES/0068-feat-linstorvhdutil-trace-DRBD-openers-in-case-of-ER.patch @@ -0,0 +1,135 @@ +From 9f3cefdcfd8e285c1fd04a05250951cd760586e4 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Fri, 22 Jul 2022 10:26:20 +0200 +Subject: [PATCH 068/175] feat(linstorvhdutil): trace DRBD openers in case of + EROFS errors + +Signed-off-by: Ronan Abhamon +--- + drivers/linstor-manager | 8 +++++++ + drivers/linstorvhdutil.py | 48 +++++++++++++++++++++++++++++++-------- + 2 files changed, 47 insertions(+), 9 deletions(-) + +diff --git a/drivers/linstor-manager b/drivers/linstor-manager +index 81789e7..9022499 100755 +--- a/drivers/linstor-manager ++++ b/drivers/linstor-manager +@@ -868,6 +868,13 @@ if __name__ == '__main__': + 'attach': attach, + 'detach': detach, + 'destroy': destroy, ++ ++ # vhdutil wrappers called by linstorvhdutil. ++ # Note: When a VHD is open in RO mode (so for all vhdutil getters), ++ # the LVM layer is used directly to bypass DRBD verifications. ++ # In this case there can't be EROFS errors. ++ # Note 2: We assume linstorvhdutil executes remote calls on diskful ++ # DRBDs, otherwise we still have EROFS errors... + 'check': check, + 'getVHDInfo': get_vhd_info, + 'hasParent': has_parent, +@@ -877,6 +884,7 @@ if __name__ == '__main__': + 'getDepth': get_depth, + 'getKeyHash': get_key_hash, + 'getBlockBitmap': get_block_bitmap, ++ + 'lockVdi': lock_vdi, + 'lsofResource': lsof_resource, + 'hasControllerRunning': has_controller_running, +diff --git a/drivers/linstorvhdutil.py b/drivers/linstorvhdutil.py +index f3d9870..d6a21c2 100644 +--- a/drivers/linstorvhdutil.py ++++ b/drivers/linstorvhdutil.py +@@ -26,6 +26,36 @@ import xs_errors + MANAGER_PLUGIN = 'linstor-manager' + + ++def call_vhd_util(linstor, func, device_path, *args, **kwargs): ++ try: ++ return func(device_path, *args, **kwargs) ++ except util.CommandException as e: ++ # Raise if we don't have a lock on the volume on another host. ++ if e.code != errno.EROFS: ++ raise ++ ++ # Volume is locked on a host, find openers. ++ e_with_openers = None ++ try: ++ volume_uuid = linstor.get_volume_uuid_from_device_path( ++ device_path ++ ) ++ e_with_openers = util.CommandException( ++ e.code, ++ e.cmd, ++ e.reason + ' (openers: {})'.format( ++ linstor.get_volume_openers(volume_uuid) ++ ) ++ ) ++ except Exception as illformed_e: ++ raise util.CommandException( ++ e.code, ++ e.cmd, ++ e.reason + ' (unable to get openers: {})'.format(illformed_e) ++ ) ++ raise e_with_openers # pylint: disable = E0702 ++ ++ + def linstorhostcall(local_method, remote_method): + def decorated(func): + def wrapper(*args, **kwargs): +@@ -46,7 +76,7 @@ def linstorhostcall(local_method, remote_method): + + try: + if not in_use or socket.gethostname() in node_names: +- return local_method(device_path, *args[2:], **kwargs) ++ return call_vhd_util(self._linstor, local_method, device_path, *args[2:], **kwargs) + except util.CommandException as e: + # EMEDIUMTYPE constant (124) is not available in python2. + if e.code != errno.EROFS and e.code != 124: +@@ -177,35 +207,35 @@ class LinstorVhdUtil: + + @linstormodifier() + def create(self, path, size, static, msize=0): +- return vhdutil.create(path, size, static, msize) ++ return call_vhd_util(self._linstor, vhdutil.create, path, size, static, msize) + + @linstormodifier() + def set_size_virt_fast(self, path, size): +- return vhdutil.setSizeVirtFast(path, size) ++ return call_vhd_util(self._linstor, vhdutil.setSizeVirtFast, path, size) + + @linstormodifier() + def set_size_phys(self, path, size, debug=True): +- return vhdutil.setSizePhys(path, size, debug) ++ return call_vhd_util(self._linstor, vhdutil.setSizePhys, path, size, debug) + + @linstormodifier() + def set_parent(self, path, parentPath, parentRaw): +- return vhdutil.setParent(path, parentPath, parentRaw) ++ return call_vhd_util(self._linstor, vhdutil.setParent, path, parentPath, parentRaw) + + @linstormodifier() + def set_hidden(self, path, hidden=True): +- return vhdutil.setHidden(path, hidden) ++ return call_vhd_util(self._linstor, vhdutil.setHidden, path, hidden) + + @linstormodifier() + def set_key(self, path, key_hash): +- return vhdutil.setKey(path, key_hash) ++ return call_vhd_util(self._linstor, vhdutil.setKey, path, key_hash) + + @linstormodifier() + def kill_data(self, path): +- return vhdutil.killData(path) ++ return call_vhd_util(self._linstor, vhdutil.killData, path) + + @linstormodifier() + def snapshot(self, path, parent, parentRaw, msize=0, checkEmpty=True): +- return vhdutil.snapshot(path, parent, parentRaw, msize, checkEmpty) ++ return call_vhd_util(self._linstor, vhdutil.snapshot, path, parent, parentRaw, msize, checkEmpty) + + # -------------------------------------------------------------------------- + # Helpers. +-- +2.45.2 + diff --git a/SOURCES/0069-fix-linstorvolumemanager-compute-correctly-size-in-a.patch b/SOURCES/0069-fix-linstorvolumemanager-compute-correctly-size-in-a.patch new file mode 100644 index 00000000..d04a89a1 --- /dev/null +++ b/SOURCES/0069-fix-linstorvolumemanager-compute-correctly-size-in-a.patch @@ -0,0 +1,98 @@ +From 23eca6c7c8e050d284eecc71ae7115a61bf3ab80 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Fri, 29 Jul 2022 17:25:48 +0200 +Subject: [PATCH 069/175] fix(linstorvolumemanager): compute correctly size in + allocated_volume_size + +Remove replication count in computation. + +Signed-off-by: Ronan Abhamon +--- + drivers/linstorvolumemanager.py | 59 +++++++++++++-------------------- + 1 file changed, 23 insertions(+), 36 deletions(-) + +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index d17845b..3806cc9 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -481,28 +481,6 @@ class LinstorVolumeManager(object): + size = current_size + return (size or 0) * 1024 + +- @property +- def total_volume_size(self): +- """ +- Give the sum of all created volumes. The place count is used. +- :return: The physical required size to use the volumes. +- :rtype: int +- """ +- +- size = 0 +- for resource in self._get_resource_cache().resources: +- for volume in resource.volumes: +- # We ignore diskless pools of the form "DfltDisklessStorPool". +- if volume.storage_pool_name == self._group_name: +- current_size = volume.usable_size +- if current_size < 0: +- raise LinstorVolumeManagerError( +- 'Failed to get usable size of `{}` on `{}`' +- .format(resource.name, volume.storage_pool_name) +- ) +- size += current_size +- return size * 1024 +- + @property + def allocated_volume_size(self): + """ +@@ -514,25 +492,34 @@ class LinstorVolumeManager(object): + :rtype: int + """ + +- size = 0 ++ # Paths: /res_name/vol_number/size ++ sizes = {} ++ + for resource in self._get_resource_cache().resources: +- volume_size = None ++ if resource.name not in sizes: ++ current = sizes[resource.name] = {} ++ else: ++ current = sizes[resource.name] ++ + for volume in resource.volumes: + # We ignore diskless pools of the form "DfltDisklessStorPool". +- if volume.storage_pool_name == self._group_name: +- current_size = volume.allocated_size +- if current_size < 0: +- raise LinstorVolumeManagerError( +- 'Failed to get allocated size of `{}` on `{}`' +- .format(resource.name, volume.storage_pool_name) +- ) ++ if volume.storage_pool_name != self._group_name: ++ continue ++ ++ current_size = volume.allocated_size ++ if current_size < 0: ++ raise LinstorVolumeManagerError( ++ 'Failed to get allocated size of `{}` on `{}`' ++ .format(resource.name, volume.storage_pool_name) ++ ) ++ current[volume.number] = max(current_size, current.get(volume.number) or 0) + +- if volume_size is None or current_size > volume_size: +- volume_size = current_size +- if volume_size is not None: +- size += volume_size ++ total_size = 0 ++ for volumes in sizes.itervalues(): ++ for size in volumes.itervalues(): ++ total_size += size + +- return size * 1024 ++ return total_size * 1024 + + @property + def metadata(self): +-- +2.45.2 + diff --git a/SOURCES/0070-feat-LinstorSR-use-DRBD-openers-instead-of-lsof-to-l.patch b/SOURCES/0070-feat-LinstorSR-use-DRBD-openers-instead-of-lsof-to-l.patch new file mode 100644 index 00000000..cc663ce2 --- /dev/null +++ b/SOURCES/0070-feat-LinstorSR-use-DRBD-openers-instead-of-lsof-to-l.patch @@ -0,0 +1,327 @@ +From 667d63a0ccd29d6f29da828d898f245b3047d90b Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Tue, 9 Aug 2022 11:07:57 +0200 +Subject: [PATCH 070/175] feat(LinstorSR): use DRBD openers instead of lsof to + log in blktap2 + +Signed-off-by: Ronan Abhamon +--- + drivers/blktap2.py | 4 +- + drivers/linstor-manager | 48 +-------- + drivers/linstorvolumemanager.py | 176 +++++++++++++++++--------------- + 3 files changed, 100 insertions(+), 128 deletions(-) + +diff --git a/drivers/blktap2.py b/drivers/blktap2.py +index 70e74c6..719a152 100755 +--- a/drivers/blktap2.py ++++ b/drivers/blktap2.py +@@ -36,7 +36,7 @@ import json + import xs_errors + import XenAPI + import scsiutil +-from linstorvolumemanager import log_lsof_drbd ++from linstorvolumemanager import log_drbd_openers + from syslog import openlog, syslog + from stat import * # S_ISBLK(), ... + import nfs +@@ -832,7 +832,7 @@ class Tapdisk(object): + time.sleep(1) + continue + if err == errno.EROFS: +- log_lsof_drbd(path) ++ log_drbd_openers(path) + break + try: + tapdisk = cls.__from_blktap(blktap) +diff --git a/drivers/linstor-manager b/drivers/linstor-manager +index 9022499..4d0ba29 100755 +--- a/drivers/linstor-manager ++++ b/drivers/linstor-manager +@@ -27,7 +27,7 @@ import XenAPI + import XenAPIPlugin + + from linstorjournaler import LinstorJournaler +-from linstorvolumemanager import get_controller_uri, LinstorVolumeManager ++from linstorvolumemanager import get_controller_uri, get_local_volume_openers, LinstorVolumeManager + from lock import Lock + import json + import LinstorSR +@@ -445,22 +445,6 @@ def lock_vdi(session, args): + return str(False) + + +-def lsof_resource(session, args): +- try: +- drbd_path = args['drbdPath'] +- (ret, stdout, stderr) = util.doexec(['lsof', '-V', drbd_path]) +- if ret == 0: +- return 'DRBD resource `{}` is open: {}'.format( +- drbd_path, stdout.rstrip() +- ) +- return '`lsof` on DRBD resource `{}` returned {}: {}'.format( +- drbd_path, ret, stdout.rstrip() +- ) +- except Exception as e: +- util.SMlog('linstor-manager:lsof_drbd error: {}'.format(e)) +- raise +- +- + def has_controller_running(session, args): + (ret, stdout, stderr) = util.doexec([ + 'systemctl', 'is-active', '--quiet', 'linstor-controller' +@@ -827,34 +811,7 @@ def get_drbd_openers(session, args): + try: + resource_name = args.get('resourceName') + volume = args.get('volume') +- if not resource_name or volume is None: +- raise Exception('Cannot get DRBD openers without resource name and/or volume.') +- +- path = '/sys/kernel/debug/drbd/resources/{}/volumes/{}/openers'.format( +- resource_name, volume +- ) +- +- with open(path, 'r') as openers: +- # Not a big cost, so read all lines directly. +- lines = openers.readlines() +- +- result = {} +- +- opener_re = re.compile('(.*)\\s+([0-9]+)\\s+([0-9]+)') +- for line in lines: +- match = opener_re.match(line) +- assert match +- +- groups = match.groups() +- process_name = groups[0] +- pid = groups[1] +- open_duration_ms = groups[2] +- result[pid] = { +- 'process-name': process_name, +- 'open-duration': open_duration_ms +- } +- +- return json.dumps(result) ++ return get_local_volume_openers(resource_name, volume) + except Exception as e: + util.SMlog('linstor-manager:get_drbd_openers error: {}'.format(e)) + raise +@@ -886,7 +843,6 @@ if __name__ == '__main__': + 'getBlockBitmap': get_block_bitmap, + + 'lockVdi': lock_vdi, +- 'lsofResource': lsof_resource, + 'hasControllerRunning': has_controller_running, + 'addHost': add_host, + 'removeHost': remove_host, +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 3806cc9..6f4c590 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -45,81 +45,56 @@ DRBD_BY_RES_PATH = '/dev/drbd/by-res/' + PLUGIN = 'linstor-manager' + + +-# Check if a path is a DRBD resource and log the process name/pid +-# that opened it. +-def log_lsof_drbd(path): +- PLUGIN_CMD = 'lsofResource' ++# ============================================================================== + +- # Ignore if it's not a symlink to DRBD resource. +- if not path.startswith(DRBD_BY_RES_PATH): +- return ++def get_local_volume_openers(resource_name, volume): ++ if not resource_name or volume is None: ++ raise Exception('Cannot get DRBD openers without resource name and/or volume.') + +- # Compute resource name. +- res_name_end = path.find('/', len(DRBD_BY_RES_PATH)) +- if res_name_end == -1: +- return +- res_name = path[len(DRBD_BY_RES_PATH):res_name_end] ++ path = '/sys/kernel/debug/drbd/resources/{}/volumes/{}/openers'.format( ++ resource_name, volume ++ ) + +- try: +- # Ensure path is a DRBD. +- drbd_path = os.path.realpath(path) +- stats = os.stat(drbd_path) +- if not stat.S_ISBLK(stats.st_mode) or os.major(stats.st_rdev) != 147: +- return ++ with open(path, 'r') as openers: ++ # Not a big cost, so read all lines directly. ++ lines = openers.readlines() + +- # Find where the device is open. +- (ret, stdout, stderr) = util.doexec(['drbdadm', 'status', res_name]) +- if ret != 0: +- util.SMlog('Failed to execute `drbdadm status` on `{}`: {}'.format( +- res_name, stderr +- )) +- return ++ result = {} + +- # Is it a local device? +- if stdout.startswith('{} role:Primary'.format(res_name)): +- (ret, stdout, stderr) = util.doexec(['lsof', drbd_path]) +- if ret == 0: +- util.SMlog( +- 'DRBD resource `{}` is open on local host: {}' +- .format(path, stdout) +- ) +- else: +- util.SMlog( +- '`lsof` on local DRBD resource `{}` returned {}: {}' +- .format(path, ret, stderr) +- ) +- return ++ opener_re = re.compile('(.*)\\s+([0-9]+)\\s+([0-9]+)') ++ for line in lines: ++ match = opener_re.match(line) ++ assert match + +- # Is it a remote device? +- res = REG_DRBDADM_PRIMARY.search(stdout) +- if not res: +- util.SMlog( +- 'Cannot find where is open DRBD resource `{}`' +- .format(path) +- ) +- return +- node_name = res.groups()[0] ++ groups = match.groups() ++ process_name = groups[0] ++ pid = groups[1] ++ open_duration_ms = groups[2] ++ result[pid] = { ++ 'process-name': process_name, ++ 'open-duration': open_duration_ms ++ } + +- session = util.get_localAPI_session() +- hosts = session.xenapi.host.get_all_records() +- for host_ref, host_record in hosts.items(): +- if node_name != host_record['hostname']: +- continue ++ return json.dumps(result) + +- ret = session.xenapi.host.call_plugin( +- host_ref, PLUGIN, PLUGIN_CMD, {'drbdPath': drbd_path}, +- ) +- util.SMlog('DRBD resource `{}` status on host `{}`: {}'.format( +- path, host_ref, ret +- )) +- return +- util.SMlog('Cannot find primary host of DRBD resource {}'.format(path)) +- except Exception as e: +- util.SMlog( +- 'Got exception while trying to determine where DRBD resource ' + +- '`{}` is open: {}'.format(path, e) ++def get_all_volume_openers(resource_name, volume): ++ PLUGIN_CMD = 'getDrbdOpeners' ++ ++ volume = str(volume) ++ openers = {} ++ ++ session = util.get_localAPI_session() ++ hosts = session.xenapi.host.get_all_records() ++ for host_ref, host_record in hosts.items(): ++ openers[host_record['hostname']] = json.loads( ++ session.xenapi.host.call_plugin(host_ref, PLUGIN, PLUGIN_CMD, { ++ 'resourceName': resource_name, ++ 'volume': volume ++ }) + ) + ++ return openers ++ + + # ============================================================================== + +@@ -1042,22 +1017,8 @@ class LinstorVolumeManager(object): + :return: A dictionnary that contains openers. + :rtype: dict(str, obj) + """ ++ return get_all_volume_openers(self.get_volume_name(volume_uuid), '0') + +- PLUGIN_CMD = 'getDrbdOpeners' +- +- openers = {} +- +- session = util.get_localAPI_session() +- hosts = session.xenapi.host.get_all_records() +- for host_ref, host_record in hosts.items(): +- openers[host_record['hostname']] = json.loads( +- session.xenapi.host.call_plugin(host_ref, PLUGIN, PLUGIN_CMD, { +- 'resourceName': self.get_volume_name(volume_uuid), +- 'volume': '0' +- }) +- ) +- +- return openers + + def get_volumes_with_name(self): + """ +@@ -2755,3 +2716,58 @@ class LinstorVolumeManager(object): + 'Failed to umount volume {} on {}: {}' + .format(volume_path, mountpoint, e) + ) ++ ++ ++# ============================================================================== ++ ++# Check if a path is a DRBD resource and log the process name/pid ++# that opened it. ++def log_drbd_openers(path): ++ # Ignore if it's not a symlink to DRBD resource. ++ if not path.startswith(DRBD_BY_RES_PATH): ++ return ++ ++ # Compute resource name. ++ res_name_end = path.find('/', len(DRBD_BY_RES_PATH)) ++ if res_name_end == -1: ++ return ++ res_name = path[len(DRBD_BY_RES_PATH):res_name_end] ++ ++ volume_end = path.rfind('/') ++ if volume_end == res_name_end: ++ return ++ volume = path[volume_end + 1:] ++ ++ try: ++ # Ensure path is a DRBD. ++ drbd_path = os.path.realpath(path) ++ stats = os.stat(drbd_path) ++ if not stat.S_ISBLK(stats.st_mode) or os.major(stats.st_rdev) != 147: ++ return ++ ++ # Find where the device is open. ++ (ret, stdout, stderr) = util.doexec(['drbdadm', 'status', res_name]) ++ if ret != 0: ++ util.SMlog('Failed to execute `drbdadm status` on `{}`: {}'.format( ++ res_name, stderr ++ )) ++ return ++ ++ # Is it a local device? ++ if stdout.startswith('{} role:Primary'.format(res_name)): ++ util.SMlog( ++ 'DRBD resource `{}` is open on local host: {}' ++ .format(path, get_local_volume_openers(res_name, volume)) ++ ) ++ return ++ ++ # Is it a remote device? ++ util.SMlog( ++ 'DRBD resource `{}` is open on hosts: {}' ++ .format(path, get_all_volume_openers(res_name, volume)) ++ ) ++ except Exception as e: ++ util.SMlog( ++ 'Got exception while trying to determine where DRBD resource ' + ++ '`{}` is open: {}'.format(path, e) ++ ) +-- +2.45.2 + diff --git a/SOURCES/0071-feat-LinstorSR-support-cProfile-to-trace-calls-when-.patch b/SOURCES/0071-feat-LinstorSR-support-cProfile-to-trace-calls-when-.patch new file mode 100644 index 00000000..03ad7ede --- /dev/null +++ b/SOURCES/0071-feat-LinstorSR-support-cProfile-to-trace-calls-when-.patch @@ -0,0 +1,93 @@ +From bcb84677d8cbc5ebd67cfb83499b0c12cf6e692b Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Thu, 25 Aug 2022 12:11:18 +0200 +Subject: [PATCH 071/175] feat(LinstorSR): support cProfile to trace calls when + a command is executed + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 11 ++++++++++- + drivers/util.py | 42 ++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 52 insertions(+), 1 deletion(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index e5f6f85..00554d7 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -69,6 +69,9 @@ FORK_LOG_DAEMON = '/opt/xensource/libexec/fork-log-daemon' + # - The other hearbeat volumes must be diskful and limited to a maximum of 3. + USE_HTTP_NBD_SERVERS = True + ++# Useful flag to trace calls using cProfile. ++TRACE_PERFS = False ++ + # ============================================================================== + + # TODO: Supports 'VDI_INTRODUCE', 'VDI_RESET_ON_BOOT/2', 'SR_TRIM', +@@ -2779,6 +2782,12 @@ class LinstorVDI(VDI.VDI): + + + if __name__ == '__main__': +- SRCommand.run(LinstorSR, DRIVER_INFO) ++ def run(): ++ SRCommand.run(LinstorSR, DRIVER_INFO) ++ ++ if not TRACE_PERFS: ++ run() ++ else: ++ util.make_profile('LinstorSR', run) + else: + SR.registerSR(LinstorSR) +diff --git a/drivers/util.py b/drivers/util.py +index 7c52703..fe8e13d 100755 +--- a/drivers/util.py ++++ b/drivers/util.py +@@ -1862,3 +1862,45 @@ def check_pid_exists(pid): + return False + else: + return True ++ ++ ++def make_profile(name, function): ++ """ ++ Helper to execute cProfile using unique log file. ++ """ ++ ++ import cProfile ++ import itertools ++ import os.path ++ import time ++ ++ assert name ++ assert function ++ ++ FOLDER = '/tmp/sm-perfs/' ++ makedirs(FOLDER) ++ ++ filename = time.strftime('{}_%Y%m%d_%H%M%S.prof'.format(name)) ++ ++ def gen_path(path): ++ yield path ++ root, ext = os.path.splitext(path) ++ for i in itertools.count(start=1, step=1): ++ yield root + '.{}.'.format(i) + ext ++ ++ for profile_path in gen_path(FOLDER + filename): ++ try: ++ file = open_atomic(profile_path, 'w') ++ file.close() ++ break ++ except OSError as e: ++ if e.errno == errno.EEXIST: ++ pass ++ else: ++ raise ++ ++ try: ++ SMlog('* Start profiling of {} ({}) *'.format(name, filename)) ++ cProfile.runctx('function()', None, locals(), profile_path) ++ finally: ++ SMlog('* End profiling of {} ({}) *'.format(name, filename)) +-- +2.45.2 + diff --git a/SOURCES/0072-fix-LinstorJournaler-reset-namespace-when-get-is-cal.patch b/SOURCES/0072-fix-LinstorJournaler-reset-namespace-when-get-is-cal.patch new file mode 100644 index 00000000..00d7c071 --- /dev/null +++ b/SOURCES/0072-fix-LinstorJournaler-reset-namespace-when-get-is-cal.patch @@ -0,0 +1,26 @@ +From 899eef77b37161b19a2dfb074220220af6b2f9e4 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Wed, 24 Aug 2022 17:09:11 +0200 +Subject: [PATCH 072/175] fix(LinstorJournaler): reset namespace when `get` is + called + +Otherwise, we can be in the wrong namespace and the key to find will be inaccessible. +--- + drivers/linstorjournaler.py | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/linstorjournaler.py b/drivers/linstorjournaler.py +index 3993f60..1e85ec9 100755 +--- a/drivers/linstorjournaler.py ++++ b/drivers/linstorjournaler.py +@@ -107,6 +107,7 @@ class LinstorJournaler: + ) + + def get(self, type, identifier): ++ self._reset_namespace() + return self._journal.get(self._get_key(type, identifier)) + + def get_all(self, type): +-- +2.45.2 + diff --git a/SOURCES/0073-fix-linstorvhdutil-fix-coalesce-with-VM-running-unde.patch b/SOURCES/0073-fix-linstorvhdutil-fix-coalesce-with-VM-running-unde.patch new file mode 100644 index 00000000..7af8c8d5 --- /dev/null +++ b/SOURCES/0073-fix-linstorvhdutil-fix-coalesce-with-VM-running-unde.patch @@ -0,0 +1,554 @@ +From 6d61c34f334684920d6138ef7a56b8a1dcf00c15 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Thu, 25 Aug 2022 10:54:56 +0200 +Subject: [PATCH 073/175] fix(linstorvhdutil): fix coalesce with VM running + under specific scenario: + +When a VM is running, we can't coalesce without this patch with a long chain +of VHDs because a parent can be in use on another host, and so a EROFS +can be emitted by vhd-util. + +So to fix this problem we run vhd-util on the remote host instead of the master +in case of failure in the cleanup algorithm. + +Impacted vhd-util functions: coalesce, getParent, repair. +--- + drivers/LinstorSR.py | 12 +- + drivers/cleanup.py | 22 +++- + drivers/linstor-manager | 37 ++++++ + drivers/linstorvhdutil.py | 269 ++++++++++++++++++++++++++------------ + drivers/vhdutil.py | 5 +- + 5 files changed, 251 insertions(+), 94 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 00554d7..47ac3c8 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -163,7 +163,9 @@ def attach_thin(session, journaler, linstor, sr_uuid, vdi_uuid): + # If the virtual VHD size is lower than the LINSTOR volume size, + # there is nothing to do. + vhd_size = compute_volume_size( +- LinstorVhdUtil(session, linstor).get_size_virt(vdi_uuid), ++ # TODO: Replace pylint comment with this feature when possible: ++ # https://github.com/PyCQA/pylint/pull/2926 ++ LinstorVhdUtil(session, linstor).get_size_virt(vdi_uuid), # pylint: disable = E1120 + image_type + ) + +@@ -207,7 +209,9 @@ def detach_thin(session, linstor, sr_uuid, vdi_uuid): + + device_path = linstor.get_device_path(vdi_uuid) + new_volume_size = LinstorVolumeManager.round_up_volume_size( +- LinstorVhdUtil(session, linstor).get_size_phys(device_path) ++ # TODO: Replace pylint comment with this feature when possible: ++ # https://github.com/PyCQA/pylint/pull/2926 ++ LinstorVhdUtil(session, linstor).get_size_phys(device_path) # pylint: disable = E1120 + ) + + volume_info = linstor.get_volume_info(vdi_uuid) +@@ -1231,8 +1235,10 @@ class LinstorSR(SR.SR): + self.vdis[vdi_uuid] = vdi + + if vdi.vdi_type == vhdutil.VDI_TYPE_VHD: ++ # TODO: Replace pylint comment with this feature when possible: ++ # https://github.com/PyCQA/pylint/pull/2926 + vdi.sm_config_override['key_hash'] = \ +- self._vhdutil.get_key_hash(vdi_uuid) ++ self._vhdutil.get_key_hash(vdi_uuid) # pylint: disable = E1120 + + # 4.c. Update CBT status of disks either just added + # or already in XAPI. +diff --git a/drivers/cleanup.py b/drivers/cleanup.py +index 0a586a6..7329363 100755 +--- a/drivers/cleanup.py ++++ b/drivers/cleanup.py +@@ -840,12 +840,14 @@ class VDI(object): + xapi.message.create(msg_name, "3", "SR", vdi.sr.uuid, msg_body) + _reportCoalesceError = staticmethod(_reportCoalesceError) + ++ def coalesce(self): ++ vhdutil.coalesce(self.path) ++ + def _doCoalesceVHD(vdi): + try: +- + startTime = time.time() + vhdSize = vdi.getSizeVHD() +- vhdutil.coalesce(vdi.path) ++ vdi.coalesce() + endTime = time.time() + vdi.sr.recordStorageSpeed(startTime, endTime, vhdSize) + except util.CommandException, ce: +@@ -1437,6 +1439,9 @@ class LinstorVDI(VDI): + ) + return super(LinstorVDI, self).pause(failfast) + ++ def coalesce(self): ++ self.sr._vhdutil.force_coalesce(self.path) ++ + def _relinkSkip(self): + abortFlag = IPCFlag(self.sr.uuid) + for child in self.children: +@@ -1461,6 +1466,19 @@ class LinstorVDI(VDI): + blktap2.VDI.tap_unpause(session, sr_uuid, vdi_uuid) + self.children = [] + ++ def _setParent(self, parent): ++ self.sr._vhdutil.force_parent(self.path, parent.path) ++ self.parent = parent ++ self.parentUuid = parent.uuid ++ parent.children.append(self) ++ try: ++ self.setConfig(self.DB_VHD_PARENT, self.parentUuid) ++ Util.log("Updated the vhd-parent field for child %s with %s" % \ ++ (self.uuid, self.parentUuid)) ++ except: ++ Util.log("Failed to update %s with vhd-parent field %s" % \ ++ (self.uuid, self.parentUuid)) ++ + def _setHidden(self, hidden=True): + HIDDEN_TAG = 'hidden' + +diff --git a/drivers/linstor-manager b/drivers/linstor-manager +index 4d0ba29..5485b90 100755 +--- a/drivers/linstor-manager ++++ b/drivers/linstor-manager +@@ -416,6 +416,37 @@ def get_block_bitmap(session, args): + raise + + ++def set_parent(session, args): ++ try: ++ device_path = args['devicePath'] ++ parent_path = args['parentPath'] ++ vhdutil.setParent(device_path, parent_path, False) ++ return '' ++ except Exception as e: ++ util.SMlog('linstor-manager:set_parent error: {}'.format(e)) ++ raise ++ ++ ++def coalesce(session, args): ++ try: ++ device_path = args['devicePath'] ++ vhdutil.coalesce(device_path) ++ return '' ++ except Exception as e: ++ util.SMlog('linstor-manager:coalesce error: {}'.format(e)) ++ raise ++ ++ ++def repair(session, args): ++ try: ++ device_path = args['devicePath'] ++ vhdutil.repair(device_path) ++ return '' ++ except Exception as e: ++ util.SMlog('linstor-manager:repair error: {}'.format(e)) ++ raise ++ ++ + def lock_vdi(session, args): + lock = None + try: +@@ -842,6 +873,12 @@ if __name__ == '__main__': + 'getKeyHash': get_key_hash, + 'getBlockBitmap': get_block_bitmap, + ++ # Called by cleanup.py to coalesce when a primary ++ # is opened on a non-local host. ++ 'setParent': set_parent, ++ 'coalesce': coalesce, ++ 'repair': repair, ++ + 'lockVdi': lock_vdi, + 'hasControllerRunning': has_controller_running, + 'addHost': add_host, +diff --git a/drivers/linstorvhdutil.py b/drivers/linstorvhdutil.py +index d6a21c2..4d031e1 100644 +--- a/drivers/linstorvhdutil.py ++++ b/drivers/linstorvhdutil.py +@@ -25,39 +25,30 @@ import xs_errors + + MANAGER_PLUGIN = 'linstor-manager' + ++# EMEDIUMTYPE constant (124) is not available in python2. ++EMEDIUMTYPE = 124 + +-def call_vhd_util(linstor, func, device_path, *args, **kwargs): +- try: +- return func(device_path, *args, **kwargs) +- except util.CommandException as e: +- # Raise if we don't have a lock on the volume on another host. +- if e.code != errno.EROFS: +- raise +- +- # Volume is locked on a host, find openers. +- e_with_openers = None ++ ++def call_vhd_util_on_host(session, host_ref, method, device_path, args): + try: +- volume_uuid = linstor.get_volume_uuid_from_device_path( +- device_path ++ response = session.xenapi.host.call_plugin( ++ host_ref, MANAGER_PLUGIN, method, args + ) +- e_with_openers = util.CommandException( +- e.code, +- e.cmd, +- e.reason + ' (openers: {})'.format( +- linstor.get_volume_openers(volume_uuid) +- ) +- ) +- except Exception as illformed_e: +- raise util.CommandException( +- e.code, +- e.cmd, +- e.reason + ' (unable to get openers: {})'.format(illformed_e) +- ) +- raise e_with_openers # pylint: disable = E0702 ++ except Exception as e: ++ util.SMlog('call-plugin ({} with {}) exception: {}'.format( ++ method, args, e ++ )) ++ raise ++ ++ util.SMlog('call-plugin ({} with {}) returned: {}'.format( ++ method, args, response ++ )) ++ ++ return response + + + def linstorhostcall(local_method, remote_method): +- def decorated(func): ++ def decorated(response_parser): + def wrapper(*args, **kwargs): + self = args[0] + vdi_uuid = args[1] +@@ -76,45 +67,27 @@ def linstorhostcall(local_method, remote_method): + + try: + if not in_use or socket.gethostname() in node_names: +- return call_vhd_util(self._linstor, local_method, device_path, *args[2:], **kwargs) ++ return self._call_local_vhd_util(local_method, device_path, *args[2:], **kwargs) + except util.CommandException as e: +- # EMEDIUMTYPE constant (124) is not available in python2. +- if e.code != errno.EROFS and e.code != 124: ++ if e.code != errno.EROFS and e.code != EMEDIUMTYPE: + raise + + # B. Execute the plugin on master or slave. +- def exec_remote_method(): ++ remote_args = { ++ 'devicePath': device_path, ++ 'groupName': self._linstor.group_name ++ } ++ remote_args.update(**kwargs) ++ remote_args = {str(key): str(value) for key, value in remote_args.iteritems()} ++ ++ def remote_call(): + host_ref = self._get_readonly_host( + vdi_uuid, device_path, node_names + ) +- args = { +- 'devicePath': device_path, +- 'groupName': self._linstor.group_name +- } +- args.update(**kwargs) +- +- try: +- response = self._session.xenapi.host.call_plugin( +- host_ref, MANAGER_PLUGIN, remote_method, args +- ) +- except Exception as e: +- util.SMlog('call-plugin ({} with {}) exception: {}'.format( +- remote_method, args, e +- )) +- raise ++ return call_vhd_util_on_host(self._session, host_ref, remote_method, device_path, remote_args) ++ response = util.retry(remote_call, 5, 2) + +- util.SMlog('call-plugin ({} with {}) returned: {}'.format( +- remote_method, args, response +- )) +- if response == 'False': +- raise xs_errors.XenError( +- 'VDIUnavailable', +- opterr='Plugin {} failed'.format(MANAGER_PLUGIN) +- ) +- kwargs['response'] = response +- +- util.retry(exec_remote_method, 5, 3) +- return func(*args, **kwargs) ++ return response_parser(self, vdi_uuid, response) + return wrapper + return decorated + +@@ -137,7 +110,7 @@ class LinstorVhdUtil: + self._linstor = linstor + + # -------------------------------------------------------------------------- +- # Getters. ++ # Getters: read locally and try on another host in case of failure. + # -------------------------------------------------------------------------- + + def check(self, vdi_uuid, ignore_missing_footer=False, fast=False): +@@ -153,11 +126,13 @@ class LinstorVhdUtil: + + def get_vhd_info(self, vdi_uuid, include_parent=True): + kwargs = {'includeParent': str(include_parent)} +- return self._get_vhd_info(vdi_uuid, self._extract_uuid, **kwargs) ++ # TODO: Replace pylint comment with this feature when possible: ++ # https://github.com/PyCQA/pylint/pull/2926 ++ return self._get_vhd_info(vdi_uuid, self._extract_uuid, **kwargs) # pylint: disable = E1123 + + @linstorhostcall(vhdutil.getVHDInfo, 'getVHDInfo') +- def _get_vhd_info(self, vdi_uuid, *args, **kwargs): +- obj = json.loads(kwargs['response']) ++ def _get_vhd_info(self, vdi_uuid, response): ++ obj = json.loads(response) + + vhd_info = vhdutil.VHDInfo(vdi_uuid) + vhd_info.sizeVirt = obj['sizeVirt'] +@@ -171,71 +146,91 @@ class LinstorVhdUtil: + return vhd_info + + @linstorhostcall(vhdutil.hasParent, 'hasParent') +- def has_parent(self, vdi_uuid, **kwargs): +- return distutils.util.strtobool(kwargs['response']) ++ def has_parent(self, vdi_uuid, response): ++ return distutils.util.strtobool(response) + + def get_parent(self, vdi_uuid): + return self._get_parent(vdi_uuid, self._extract_uuid) + + @linstorhostcall(vhdutil.getParent, 'getParent') +- def _get_parent(self, vdi_uuid, *args, **kwargs): +- return kwargs['response'] ++ def _get_parent(self, vdi_uuid, response): ++ return response + + @linstorhostcall(vhdutil.getSizeVirt, 'getSizeVirt') +- def get_size_virt(self, vdi_uuid, **kwargs): +- return int(kwargs['response']) ++ def get_size_virt(self, vdi_uuid, response): ++ return int(response) + + @linstorhostcall(vhdutil.getSizePhys, 'getSizePhys') +- def get_size_phys(self, vdi_uuid, **kwargs): +- return int(kwargs['response']) ++ def get_size_phys(self, vdi_uuid, response): ++ return int(response) + + @linstorhostcall(vhdutil.getDepth, 'getDepth') +- def get_depth(self, vdi_uuid, **kwargs): +- return int(kwargs['response']) ++ def get_depth(self, vdi_uuid, response): ++ return int(response) + + @linstorhostcall(vhdutil.getKeyHash, 'getKeyHash') +- def get_key_hash(self, vdi_uuid, **kwargs): +- return kwargs['response'] or None ++ def get_key_hash(self, vdi_uuid, response): ++ return response or None + + @linstorhostcall(vhdutil.getBlockBitmap, 'getBlockBitmap') +- def get_block_bitmap(self, vdi_uuid, **kwargs): +- return base64.b64decode(kwargs['response']) ++ def get_block_bitmap(self, vdi_uuid, response): ++ return base64.b64decode(response) + + # -------------------------------------------------------------------------- +- # Setters. ++ # Setters: only used locally. + # -------------------------------------------------------------------------- + + @linstormodifier() + def create(self, path, size, static, msize=0): +- return call_vhd_util(self._linstor, vhdutil.create, path, size, static, msize) ++ return self._call_local_vhd_util(vhdutil.create, path, size, static, msize) + + @linstormodifier() + def set_size_virt_fast(self, path, size): +- return call_vhd_util(self._linstor, vhdutil.setSizeVirtFast, path, size) ++ return self._call_local_vhd_util(vhdutil.setSizeVirtFast, path, size) + + @linstormodifier() + def set_size_phys(self, path, size, debug=True): +- return call_vhd_util(self._linstor, vhdutil.setSizePhys, path, size, debug) ++ return self._call_local_vhd_util(vhdutil.setSizePhys, path, size, debug) + + @linstormodifier() +- def set_parent(self, path, parentPath, parentRaw): +- return call_vhd_util(self._linstor, vhdutil.setParent, path, parentPath, parentRaw) ++ def set_parent(self, path, parentPath, parentRaw=False): ++ return self._call_local_vhd_util(vhdutil.setParent, path, parentPath, parentRaw) + + @linstormodifier() + def set_hidden(self, path, hidden=True): +- return call_vhd_util(self._linstor, vhdutil.setHidden, path, hidden) ++ return self._call_local_vhd_util(vhdutil.setHidden, path, hidden) + + @linstormodifier() + def set_key(self, path, key_hash): +- return call_vhd_util(self._linstor, vhdutil.setKey, path, key_hash) ++ return self._call_local_vhd_util(vhdutil.setKey, path, key_hash) + + @linstormodifier() + def kill_data(self, path): +- return call_vhd_util(self._linstor, vhdutil.killData, path) ++ return self._call_local_vhd_util(vhdutil.killData, path) + + @linstormodifier() + def snapshot(self, path, parent, parentRaw, msize=0, checkEmpty=True): +- return call_vhd_util(self._linstor, vhdutil.snapshot, path, parent, parentRaw, msize, checkEmpty) ++ return self._call_local_vhd_util(vhdutil.snapshot, path, parent, parentRaw, msize, checkEmpty) ++ ++ # -------------------------------------------------------------------------- ++ # Remote setters: write locally and try on another host in case of failure. ++ # -------------------------------------------------------------------------- ++ ++ @linstormodifier() ++ def force_parent(self, path, parentPath, parentRaw=False): ++ kwargs = { ++ 'parentPath': str(parentPath), ++ 'parentRaw': parentRaw ++ } ++ return self._call_vhd_util(vhdutil.setParent, 'setParent', path, **kwargs) ++ ++ @linstormodifier() ++ def force_coalesce(self, path): ++ return self._call_vhd_util(vhdutil.coalesce, 'coalesce', path) ++ ++ @linstormodifier() ++ def force_repair(self, path): ++ return self._call_vhd_util(vhdutil.repair, 'repair', path) + + # -------------------------------------------------------------------------- + # Helpers. +@@ -273,3 +268,105 @@ class LinstorVhdUtil: + opterr='Unable to find a valid host from VDI: {} (path={})' + .format(vdi_uuid, device_path) + ) ++ ++ # -------------------------------------------------------------------------- ++ ++ def _call_local_vhd_util(self, local_method, device_path, *args, **kwargs): ++ try: ++ def local_call(): ++ return local_method(device_path, *args, **kwargs) ++ return util.retry(local_call, 5, 2) ++ except util.CommandException as e: ++ if e.code != errno.EROFS and e.code != EMEDIUMTYPE: ++ raise ++ ++ # Volume is locked on a host, find openers. ++ e_with_openers = None ++ try: ++ volume_uuid = self._linstor.get_volume_uuid_from_device_path( ++ device_path ++ ) ++ e_with_openers = util.CommandException( ++ e.code, ++ e.cmd, ++ e.reason + ' (openers: {})'.format( ++ self._linstor.get_volume_openers(volume_uuid) ++ ) ++ ) ++ except Exception as illformed_e: ++ raise util.CommandException( ++ e.code, ++ e.cmd, ++ e.reason + ' (unable to get openers: {})'.format(illformed_e) ++ ) ++ raise e_with_openers # pylint: disable = E0702 ++ ++ def _call_vhd_util(self, local_method, remote_method, device_path, *args, **kwargs): ++ # A. Try to write locally... ++ try: ++ def local_call(): ++ return local_method(device_path, *args, **kwargs) ++ return util.retry(local_call, 5, 2) ++ except util.CommandException as e: ++ if e.code != errno.EROFS and e.code != EMEDIUMTYPE: ++ raise ++ ++ # B. Execute the command on another host. ++ # B.1. Get host list. ++ try: ++ hosts = self._session.xenapi.host.get_all_records() ++ except Exception as e: ++ raise xs_errors.XenError( ++ 'VDIUnavailable', ++ opterr='Unable to get host list to run vhd-util command `{}` (path={}): {}' ++ .format(remote_method, device_path, e) ++ ) ++ ++ # B.2. Prepare remote args. ++ remote_args = { ++ 'devicePath': device_path, ++ 'groupName': self._linstor.group_name ++ } ++ remote_args.update(**kwargs) ++ remote_args = {str(key): str(value) for key, value in remote_args.iteritems()} ++ ++ volume_uuid = self._linstor.get_volume_uuid_from_device_path( ++ device_path ++ ) ++ ++ # B.3. Call! ++ def remote_call(): ++ try: ++ all_openers = self._linstor.get_volume_openers(volume_uuid) ++ except Exception as e: ++ raise xs_errors.XenError( ++ 'VDIUnavailable', ++ opterr='Unable to get DRBD openers to run vhd-util command `{}` (path={}): {}' ++ .format(remote_method, device_path, e) ++ ) ++ ++ no_host_found = True ++ for hostname, openers in all_openers.iteritems(): ++ if not openers: ++ continue ++ ++ try: ++ host_ref = next(ref for ref, rec in hosts.iteritems() if rec['hostname'] == hostname) ++ except StopIteration: ++ continue ++ ++ no_host_found = False ++ try: ++ return call_vhd_util_on_host(self._session, host_ref, remote_method, device_path, remote_args) ++ except Exception: ++ pass ++ ++ if no_host_found: ++ return local_method(device_path, *args, **kwargs) ++ ++ raise xs_errors.XenError( ++ 'VDIUnavailable', ++ opterr='No valid host found to run vhd-util command `{}` (path={}): {}' ++ .format(remote_method, device_path, e) ++ ) ++ return util.retry(remote_call, 5, 2) +diff --git a/drivers/vhdutil.py b/drivers/vhdutil.py +index 0a8fe91..d75edb1 100755 +--- a/drivers/vhdutil.py ++++ b/drivers/vhdutil.py +@@ -97,9 +97,8 @@ def calcOverheadFull(virtual_size): + def fullSizeVHD(virtual_size): + return virtual_size + calcOverheadFull(virtual_size) + +-def ioretry(cmd): +- return util.ioretry(lambda: util.pread2(cmd), +- errlist = [errno.EIO, errno.EROFS, errno.EAGAIN]) ++def ioretry(cmd, errlist=[errno.EIO, errno.EAGAIN]): ++ return util.ioretry(lambda: util.pread2(cmd), errlist) + + def getVHDInfo(path, extractUuidFunction, includeParent = True): + """Get the VHD info. The parent info may optionally be omitted: vhd-util +-- +2.45.2 + diff --git a/SOURCES/0074-fix-linstorvolumemanager-_get_volumes_info-doesn-t-r.patch b/SOURCES/0074-fix-linstorvolumemanager-_get_volumes_info-doesn-t-r.patch new file mode 100644 index 00000000..acc6a5e5 --- /dev/null +++ b/SOURCES/0074-fix-linstorvolumemanager-_get_volumes_info-doesn-t-r.patch @@ -0,0 +1,50 @@ +From 7308c3894a4ce77e6b21543add154e5877e91ca1 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Mon, 5 Sep 2022 15:09:17 +0200 +Subject: [PATCH 074/175] fix(linstorvolumemanager): `_get_volumes_info` + doesn't raise with offline host + +Ensure this method doesn't raise an exception when a host is offline. +Otherwise we can't use properly the HA when a host is unreachable and it's a +problem to restart VMs on a valid host. + +Signed-off-by: Ronan Abhamon +--- + drivers/linstorvolumemanager.py | 21 ++++++++++++--------- + 1 file changed, 12 insertions(+), 9 deletions(-) + +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 6f4c590..a1bc151 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -1789,15 +1789,18 @@ class LinstorVolumeManager(object): + max(current.allocated_size, allocated_size) or \ + allocated_size + +- if volume.usable_size < 0: +- raise LinstorVolumeManagerError( +- 'Failed to get usable size of `{}` on `{}`' +- .format(resource.name, volume.storage_pool_name) +- ) +- virtual_size = volume.usable_size +- +- current.virtual_size = current.virtual_size and \ +- min(current.virtual_size, virtual_size) or virtual_size ++ usable_size = volume.usable_size ++ if usable_size > 0 and ( ++ usable_size < current.virtual_size or ++ not current.virtual_size ++ ): ++ current.virtual_size = usable_size ++ ++ if current.virtual_size <= 0: ++ raise LinstorVolumeManagerError( ++ 'Failed to get usable size of `{}` on `{}`' ++ .format(resource.name, volume.storage_pool_name) ++ ) + + for current in all_volume_info.values(): + current.allocated_size *= 1024 +-- +2.45.2 + diff --git a/SOURCES/0075-fix-linstorvolumemanager-remove-double-prefix-on-kv-.patch b/SOURCES/0075-fix-linstorvolumemanager-remove-double-prefix-on-kv-.patch new file mode 100644 index 00000000..78156439 --- /dev/null +++ b/SOURCES/0075-fix-linstorvolumemanager-remove-double-prefix-on-kv-.patch @@ -0,0 +1,40 @@ +From 2f6b96a0f585003ef9804cc098c074a0e3098210 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Mon, 12 Sep 2022 15:56:09 +0200 +Subject: [PATCH 075/175] fix(linstorvolumemanager): remove double prefix on kv + group name + +- Before this patch, when the kv store was created/accessed, a double "xcp-sr-" prefix was used. +- This change is not compatible with existing LINSTOR SR instances! + +Signed-off-by: Ronan Abhamon +--- + drivers/linstorvolumemanager.py | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index a1bc151..3ee5d24 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -2195,7 +2195,7 @@ class LinstorVolumeManager(object): + + def _create_linstor_kv(self, namespace): + return linstor.KV( +- self._get_store_name(), ++ self._group_name, + uri=self._linstor.controller_host(), + namespace=namespace + ) +@@ -2205,9 +2205,6 @@ class LinstorVolumeManager(object): + properties.namespace = self._build_volume_namespace(volume_uuid) + return properties + +- def _get_store_name(self): +- return 'xcp-sr-{}'.format(self._group_name) +- + @classmethod + def _build_sr_namespace(cls): + return '/{}/'.format(cls.NAMESPACE_SR) +-- +2.45.2 + diff --git a/SOURCES/0076-feat-LinstorSR-add-linstor-kv-dump-helper-to-print-k.patch b/SOURCES/0076-feat-LinstorSR-add-linstor-kv-dump-helper-to-print-k.patch new file mode 100644 index 00000000..d7a9b5e5 --- /dev/null +++ b/SOURCES/0076-feat-LinstorSR-add-linstor-kv-dump-helper-to-print-k.patch @@ -0,0 +1,72 @@ +From 1e50208fdab9c0e695b85220d92f36f88eafca13 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Mon, 12 Sep 2022 17:54:57 +0200 +Subject: [PATCH 076/175] feat(LinstorSR): add linstor-kv-dump helper to print + kv store + +Signed-off-by: Ronan Abhamon +--- + Makefile | 1 + + scripts/linstor-kv-dump | 38 ++++++++++++++++++++++++++++++++++++++ + 2 files changed, 39 insertions(+) + create mode 100755 scripts/linstor-kv-dump + +diff --git a/Makefile b/Makefile +index af1011a..aa71f80 100755 +--- a/Makefile ++++ b/Makefile +@@ -240,6 +240,7 @@ install: precheck + install -m 755 drivers/fcoelib.py $(SM_STAGING)$(SM_DEST) + mkdir -p $(SM_STAGING)$(LIBEXEC) + install -m 755 scripts/fork-log-daemon $(SM_STAGING)$(LIBEXEC) ++ install -m 755 scripts/linstor-kv-dump $(SM_STAGING)$(BIN_DEST) + install -m 755 scripts/local-device-change $(SM_STAGING)$(LIBEXEC) + install -m 755 scripts/check-device-sharing $(SM_STAGING)$(LIBEXEC) + install -m 755 scripts/usb_change $(SM_STAGING)$(LIBEXEC) +diff --git a/scripts/linstor-kv-dump b/scripts/linstor-kv-dump +new file mode 100755 +index 0000000..93598d7 +--- /dev/null ++++ b/scripts/linstor-kv-dump +@@ -0,0 +1,38 @@ ++#!/usr/bin/env python ++# ++# Copyright (C) 2022 Vates SAS ++# ++# This program is free software: you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation, either version 3 of the License, or ++# (at your option) any later version. ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++import argparse ++import json ++import linstor ++ ++def dump_kv(controller_uri, group_name, namespace): ++ kv = linstor.KV( ++ group_name, ++ uri=controller_uri, ++ namespace=namespace ++ ) ++ print(json.dumps(kv, sort_keys=True, indent=2)) ++ ++def main(): ++ parser = argparse.ArgumentParser() ++ parser.add_argument('-u', '--uri', required=True) ++ parser.add_argument('-g', '--group-name', required=True) ++ parser.add_argument('-n', '--namespace', default='/') ++ args = parser.parse_args() ++ dump_kv(args.uri, args.group_name, args.namespace) ++ ++if __name__ == '__main__': ++ main() +-- +2.45.2 + diff --git a/SOURCES/0077-fix-LinstorSR-disable-VHD-key-hash-usage-to-limit-ex.patch b/SOURCES/0077-fix-LinstorSR-disable-VHD-key-hash-usage-to-limit-ex.patch new file mode 100644 index 00000000..611e1d02 --- /dev/null +++ b/SOURCES/0077-fix-LinstorSR-disable-VHD-key-hash-usage-to-limit-ex.patch @@ -0,0 +1,37 @@ +From bb194e0947f30a3615931342f07e21c8214f9a1e Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Wed, 14 Sep 2022 10:17:18 +0200 +Subject: [PATCH 077/175] fix(LinstorSR): disable VHD key hash usage to limit + exec time + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 47ac3c8..374d6cb 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -72,6 +72,9 @@ USE_HTTP_NBD_SERVERS = True + # Useful flag to trace calls using cProfile. + TRACE_PERFS = False + ++# Enable/Disable VHD key hash support. ++USE_KEY_HASH = False ++ + # ============================================================================== + + # TODO: Supports 'VDI_INTRODUCE', 'VDI_RESET_ON_BOOT/2', 'SR_TRIM', +@@ -1234,7 +1237,7 @@ class LinstorSR(SR.SR): + vdi = self.vdi(vdi_uuid) + self.vdis[vdi_uuid] = vdi + +- if vdi.vdi_type == vhdutil.VDI_TYPE_VHD: ++ if USE_KEY_HASH and vdi.vdi_type == vhdutil.VDI_TYPE_VHD: + # TODO: Replace pylint comment with this feature when possible: + # https://github.com/PyCQA/pylint/pull/2926 + vdi.sm_config_override['key_hash'] = \ +-- +2.45.2 + diff --git a/SOURCES/0078-fix-minidrbdcluster-ensure-SIGINT-is-handled-correct.patch b/SOURCES/0078-fix-minidrbdcluster-ensure-SIGINT-is-handled-correct.patch new file mode 100644 index 00000000..97f66fb7 --- /dev/null +++ b/SOURCES/0078-fix-minidrbdcluster-ensure-SIGINT-is-handled-correct.patch @@ -0,0 +1,99 @@ +From 11ed73c197e19281f402a8b7f16e54885a57a682 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Thu, 15 Sep 2022 11:34:25 +0200 +Subject: [PATCH 078/175] fix(minidrbdcluster): ensure SIGINT is handled + correctly + +This patch is here to make sure no LINSTOR controller survives when +systemd asks to minidrbdcluster to stop with `SIGINT`. + +- Remove `os.system`, it's totally unsafe, all signals are ignored with it. +- Use `subprocess.Popen` instead and catch correctly signal exceptions, it works + because `wait` call doesn't hide the signals. +- Ensure `SIGINT` is only sent to the main process, not to the subprocesses. +- Ensure `SIGKILL` is NEVER sent to minidrbdcluster. + +Signed-off-by: Ronan Abhamon +--- + scripts/minidrbdcluster | 35 ++++++++++++++++++++++++--------- + systemd/minidrbdcluster.service | 1 + + 2 files changed, 27 insertions(+), 9 deletions(-) + +diff --git a/scripts/minidrbdcluster b/scripts/minidrbdcluster +index fb4de09..4cdc59e 100755 +--- a/scripts/minidrbdcluster ++++ b/scripts/minidrbdcluster +@@ -1,7 +1,6 @@ + #! /usr/bin/env python2 + + import configparser +-import os + import re + import signal + import subprocess +@@ -35,24 +34,42 @@ def sig_handler(sig, frame): + ) + + ++def preexec_subprocess(): ++ signal.signal(signal.SIGINT, signal.SIG_IGN) ++ ++ ++def exec_subprocess(args): ++ proc = subprocess.Popen(args, preexec_fn=preexec_subprocess) ++ raise_sigint = False ++ while True: ++ try: ++ proc.wait() ++ break ++ except KeyboardInterrupt: ++ raise_sigint = True ++ except: # noqa: E722 ++ pass ++ ++ if raise_sigint: ++ raise KeyboardInterrupt ++ ++ return proc.returncode ++ ++ + def call_systemd(operation, service): + verbose = operation in ('start', 'stop') + if verbose: + print('Trying to %s %s' % (operation, service)) +- r = os.system('systemctl %s %s' % (operation, service)) ++ ret = exec_subprocess(['systemctl', operation, service]) + if verbose: + print('%s for %s %s' % ( +- 'success' if r == 0 else 'failure', operation, service ++ 'success' if ret == 0 else 'failure', operation, service + )) +- return r == 0 ++ return ret == 0 + + + def ensure_systemd_started(service): +- args = ['systemctl', 'is-active', '--quiet', service] +- +- proc = subprocess.Popen(args) +- proc.wait() +- if not proc.returncode: ++ if not exec_subprocess(['systemctl', 'is-active', '--quiet', service]): + return True # Already active. + + return call_systemd('start', service) +diff --git a/systemd/minidrbdcluster.service b/systemd/minidrbdcluster.service +index 3de6ac4..1ddf91f 100644 +--- a/systemd/minidrbdcluster.service ++++ b/systemd/minidrbdcluster.service +@@ -10,6 +10,7 @@ Environment=PYTHONUNBUFFERED=1 + ExecStart=/opt/xensource/libexec/minidrbdcluster + KillMode=process + KillSignal=SIGINT ++SendSIGKILL=no + StandardOutput=journal + StandardError=journal + SyslogIdentifier=minidrbdcluster +-- +2.45.2 + diff --git a/SOURCES/0079-feat-minidrbdcluster-stop-resource-services-at-start.patch b/SOURCES/0079-feat-minidrbdcluster-stop-resource-services-at-start.patch new file mode 100644 index 00000000..524632ba --- /dev/null +++ b/SOURCES/0079-feat-minidrbdcluster-stop-resource-services-at-start.patch @@ -0,0 +1,135 @@ +From 17cad633307433667bccdb8374daee25ec5c92bc Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Thu, 15 Sep 2022 11:49:34 +0200 +Subject: [PATCH 079/175] feat(minidrbdcluster): stop resource services at + startup + +- Ensure all services are stopped when minidrbcluster is started. +- Clean code to parse only once the systemd unit string. +- Log unhandled exceptions. + +Signed-off-by: Ronan Abhamon +--- + scripts/minidrbdcluster | 50 ++++++++++++++++++++++++++--------------- + 1 file changed, 32 insertions(+), 18 deletions(-) + +diff --git a/scripts/minidrbdcluster b/scripts/minidrbdcluster +index 4cdc59e..eae7cbf 100755 +--- a/scripts/minidrbdcluster ++++ b/scripts/minidrbdcluster +@@ -83,8 +83,7 @@ def show_status(services, status): + print('%s is %s' % (res_name, status[res_name])) + + +-def clean_up(services): +- print('exiting:') ++def stop_services(services): + for systemd_unit in reversed(services): + call_systemd('stop', systemd_unit) + +@@ -98,18 +97,17 @@ def get_systemd_units(systemd_units_str): + return systemd_units + + +-def process(events2, resources, services, status): ++def process(events2, resources, running_services, status): + line = events2.stdout.readline() + m = MAY_PROMOT_RE.match(line) + if m: + res_name, may_promote, promotion_score = m.groups() + if res_name in resources and may_promote == 'yes': +- systemd_units_str = resources[res_name]['systemd-units'] +- for systemd_unit in get_systemd_units(systemd_units_str): ++ for systemd_unit in resources[res_name]['systemd-units']: + if not ensure_systemd_started(systemd_unit): + break +- if systemd_unit not in services: +- services.append(systemd_unit) ++ if systemd_unit not in running_services: ++ running_services.append(systemd_unit) + m = PEER_ROLE_RE.match(line) + if m: + res_name, conn_name, role = m.groups() +@@ -119,15 +117,14 @@ def process(events2, resources, services, status): + if m: + res_name, have_quorum = m.groups() + if res_name in resources and have_quorum == 'no': +- systemd_units_str = resources[res_name]['systemd-units'] +- systemd_units = get_systemd_units(systemd_units_str) +- to_stop = [x for x in systemd_units if x in services] ++ systemd_units = resources[res_name]['systemd-units'] ++ to_stop = [x for x in systemd_units if x in running_services] + if to_stop: + print('Lost quorum on %s' % (res_name)) + for systemd_unit in reversed(to_stop): + r = call_systemd('stop', systemd_unit) + if r: +- services.remove(systemd_unit) ++ running_services.remove(systemd_unit) + + + def active_drbd_volume(res_name): +@@ -152,8 +149,7 @@ def active_drbd_volume(res_name): + + + def main(): +- services = [] +- status = dict() ++ # 1. Load minidrbdcluster config. + config = configparser.ConfigParser() + config.read('/etc/minidrbdcluster.ini') + resources = config._sections +@@ -162,12 +158,28 @@ def main(): + 'No resources to watch, maybe /etc/minidrbdcluster.ini missing' + ) + print('Managing DRBD resources: %s' % (' '.join(resources))) +- for res_name in resources: ++ ++ # 2. Prepare resources. ++ status = dict() ++ all_services = [] # Contains common services between each DRBD volumes. ++ for res_name, resource in resources.iteritems(): + status[res_name] = dict() + active_drbd_volume(res_name) ++ systemd_units = get_systemd_units(resource['systemd-units']) ++ resource['systemd-units'] = systemd_units ++ ++ for systemd_unit in systemd_units: ++ if systemd_unit not in all_services: ++ all_services.append(systemd_unit) + ++ # 3. Ensure all services are stopped. ++ stop_services(all_services) ++ ++ # 4. Run! + signal.signal(signal.SIGHUP, sig_handler) + ++ running_services = [] ++ + print('Starting process...') + events2 = subprocess.Popen( + ['drbdsetup', 'events2'], stdout=subprocess.PIPE +@@ -175,14 +187,16 @@ def main(): + run = True + while run: + try: +- process(events2, resources, services, status) ++ process(events2, resources, running_services, status) + except KeyboardInterrupt: + run = False + except SigHupException: +- show_status(services, status) +- +- clean_up(services) ++ show_status(running_services, status) ++ except Exception: ++ print('Unhandled exception: %s' % str(e)) + ++ print('Exiting...') ++ stop_services(running_services) + + if __name__ == '__main__': + main() +-- +2.45.2 + diff --git a/SOURCES/0080-feat-linstor-manager-add-new-healthCheck-function-to.patch b/SOURCES/0080-feat-linstor-manager-add-new-healthCheck-function-to.patch new file mode 100644 index 00000000..0ec8bb48 --- /dev/null +++ b/SOURCES/0080-feat-linstor-manager-add-new-healthCheck-function-to.patch @@ -0,0 +1,361 @@ +From c91ef97914fedfb63cbe16aa90c97bc502b4c637 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Fri, 23 Sep 2022 17:45:08 +0200 +Subject: [PATCH 080/175] feat(linstor-manager): add new `healthCheck` function + to monitor pool (#26) + +Print a JSON output to monitor state of LINSTOR SRs: + - Display nodes, storage pool and resources + - Print human readable warns and errors + +Usage example: + +``` +xe host-call-plugin host-uuid=c96ec4dd-28ac-4df4-b73c-4371bd202728 plugin=linstor-manager fn=healthCheck args:groupName=linstor_group +{ + "errors": [], + "warns": [], + "controller-uri": "linstor://172.16.210.14", + "storage-pools": { + "r620-s1": [ + { + "free-size": 999125155840, + "storage-pool-name": "xcp-sr-linstor_group", + "capacity": 1000203091968, + "uuid": "994a5c45-ba52-4f17-8e46-74c7dec0a1e7" + } + ], + "r620-s3": [ + { + "free-size": 999125155840, + "storage-pool-name": "xcp-sr-linstor_group", + "capacity": 1000203091968, + "uuid": "ad78adad-a9f6-4513-9f96-e8eb8fe716dc" + } + ], + "r620-s2": [ + { + "free-size": 999125155840, + "storage-pool-name": "xcp-sr-linstor_group", + "capacity": 1000203091968, + "uuid": "f76048f9-8821-484b-9a51-670a49df7a6e" + } + ] + }, + "nodes": { + "r620-s1": "ONLINE", + "r620-s3": "ONLINE", + "r620-s2": "ONLINE" + }, + "resources": { + "xcp-persistent-database": { + "r620-s1": { + "tie-breaker": false, + "in-use": true, + "volumes": [ + { + "storage-pool-name": "xcp-sr-linstor_group", + "uuid": "1a436f23-eb81-4a8f-8ab6-de317282b5d5", + "device-path": "/dev/drbd1000", + "number": 0, + "disk-state": "UpToDate", + "allocated-size": 1077936128, + "usable-size": 1073741824 + } + ], + "diskful": true + }, + "r620-s3": { + "tie-breaker": false, + "in-use": false, + "volumes": [ + { + "storage-pool-name": "xcp-sr-linstor_group", + "uuid": "31a05bd1-20b6-471a-86b9-bbcdccfaab96", + "device-path": "/dev/drbd1000", + "number": 0, + "disk-state": "UpToDate", + "allocated-size": 1077936128, + "usable-size": 1073741824 + } + ], + "diskful": true + }, + "r620-s2": { + "tie-breaker": false, + "in-use": false, + "volumes": [ + { + "storage-pool-name": "xcp-sr-linstor_group", + "uuid": "0420f252-9762-4063-bdd4-732e40373ffb", + "device-path": "/dev/drbd1000", + "number": 0, + "disk-state": "UpToDate", + "allocated-size": 1077936128, + "usable-size": 1073741824 + } + ], + "diskful": true + } + } + } +} +``` + +Signed-off-by: Ronan Abhamon +--- + drivers/linstor-manager | 116 +++++++++++++++++++++++++++++++- + drivers/linstorvolumemanager.py | 105 +++++++++++++++++++++++++++++ + 2 files changed, 220 insertions(+), 1 deletion(-) + +diff --git a/drivers/linstor-manager b/drivers/linstor-manager +index 5485b90..7abc105 100755 +--- a/drivers/linstor-manager ++++ b/drivers/linstor-manager +@@ -848,6 +848,119 @@ def get_drbd_openers(session, args): + raise + + ++def health_check(session, args): ++ group_name = args['groupName'] ++ ++ result = { ++ 'controller-uri': '', ++ 'nodes': {}, ++ 'storage-pools': {}, ++ 'warnings': [], ++ 'errors': [] ++ } ++ ++ def format_result(): ++ return json.dumps(result) ++ ++ # 1. Get controller. ++ try: ++ controller_uri = get_controller_uri() ++ ++ result['controller-uri'] = controller_uri ++ try: ++ if controller_uri == 'linstor://localhost': ++ # Replace `localhost` with IP to give a better info for users. ++ result['controller-uri'] = 'linstor://' + util.get_this_host_address(session) ++ except Exception: ++ # Ignore error: can be a XAPI restart or something else. ++ pass ++ ++ linstor = LinstorVolumeManager( ++ controller_uri, ++ group_name, ++ logger=util.SMlog ++ ) ++ except Exception as e: ++ # Probably a network issue, or offline controller. ++ result['errors'].append('Cannot join SR: `{}`.'.format(e)) ++ return format_result() ++ ++ try: ++ # 2. Check node statuses. ++ nodes = linstor.get_nodes_info() ++ result['nodes'] = nodes ++ for node_name, status in nodes.items(): ++ if status != 'ONLINE': ++ result['warnings'].append('Node `{}` is {}.'.format(node_name, status)) ++ ++ # 3. Check storage pool statuses. ++ storage_pools_per_node = linstor.get_storage_pools_info() ++ result['storage-pools'] = storage_pools_per_node ++ for node_name, storage_pools in storage_pools_per_node.items(): ++ for storage_pool in storage_pools: ++ free_size = storage_pool['free-size'] ++ capacity = storage_pool['capacity'] ++ if free_size < 0 or capacity <= 0: ++ result['errors'].append( ++ 'Cannot get free size and/or capacity of storage pool `{}`.' ++ .format(storage_pool['uuid']) ++ ) ++ elif free_size > capacity: ++ result['errors'].append( ++ 'Free size of storage pool `{}` is greater than capacity.' ++ .format(storage_pool['uuid']) ++ ) ++ else: ++ remaining_percent = free_size / float(capacity) * 100.0 ++ threshold = 10.0 ++ if remaining_percent < threshold: ++ result['warnings'].append( ++ 'Remaining size of storage pool `{}` is below {}% of its capacity.' ++ .format(storage_pool['uuid'], threshold) ++ ) ++ ++ # 4. Check resource statuses. ++ all_resources = linstor.get_resources_info() ++ result['resources'] = all_resources ++ ++ for resource_name, resource_by_node in all_resources.items(): ++ for node_name, resource in resource_by_node.items(): ++ for volume_index, volume in enumerate(resource['volumes']): ++ disk_state = volume['disk-state'] ++ if disk_state in ['UpToDate', 'Created', 'Attached']: ++ continue ++ if disk_state == 'DUnknown': ++ result['warnings'].append( ++ 'Unknown state for volume `{}` at index {} for resource `{}` on node `{}`' ++ .format(volume['device-path'], volume_index, resource_name, node_name) ++ ) ++ continue ++ if disk_state in ['Inconsistent', 'Failed', 'To: Creating', 'To: Attachable', 'To: Attaching']: ++ result['errors'].append( ++ 'Invalid state `{}` for volume `{}` at index {} for resource `{}` on node `{}`' ++ .format(disk_state, volume['device-path'], volume_index, resource_name, node_name) ++ ) ++ continue ++ if disk_state == 'Diskless': ++ if resource['diskful']: ++ result['errors'].append( ++ 'Unintentional diskless state detected for volume `{}` at index {} for resource `{}` on node `{}`' ++ .format(volume['device-path'], volume_index, resource_name, node_name) ++ ) ++ elif resource['tie-breaker']: ++ volume['disk-state'] = 'TieBreaker' ++ continue ++ result['warnings'].append( ++ 'Unhandled state `{}` for volume `{}` at index {} for resource `{}` on node `{}`' ++ .format(disk_state, volume['device-path'], volume_index, resource_name, node_name) ++ ) ++ ++ except Exception as e: ++ result['errors'].append('Unexpected error: `{}`'.format(e)) ++ ++ return format_result() ++ ++ + if __name__ == '__main__': + XenAPIPlugin.dispatch({ + 'prepareSr': prepare_sr, +@@ -887,5 +1000,6 @@ if __name__ == '__main__': + 'listDrbdVolumes': list_drbd_volumes, + 'destroyDrbdVolume': destroy_drbd_volume, + 'destroyDrbdVolumes': destroy_drbd_volumes, +- 'getDrbdOpeners': get_drbd_openers ++ 'getDrbdOpeners': get_drbd_openers, ++ 'healthCheck': health_check + }) +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 3ee5d24..efe5d53 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -1402,6 +1402,111 @@ class LinstorVolumeManager(object): + 'Failed to destroy node `{}`: {}'.format(node_name, error_str) + ) + ++ def get_nodes_info(self): ++ """ ++ Get all nodes + statuses, used or not by the pool. ++ :rtype: dict(str, dict) ++ """ ++ try: ++ nodes = {} ++ for node in self._linstor.node_list_raise().nodes: ++ nodes[node.name] = node.connection_status ++ return nodes ++ except Exception as e: ++ raise LinstorVolumeManagerError( ++ 'Failed to get all nodes: `{}`'.format(e) ++ ) ++ ++ def get_storage_pools_info(self): ++ """ ++ Give all storage pools of current group name. ++ :rtype: dict(str, list) ++ """ ++ storage_pools = {} ++ for pool in self._get_storage_pools(force=True): ++ if pool.node_name not in storage_pools: ++ storage_pools[pool.node_name] = [] ++ ++ size = -1 ++ capacity = -1 ++ ++ space = pool.free_space ++ if space: ++ size = space.free_capacity ++ if size < 0: ++ size = -1 ++ else: ++ size *= 1024 ++ capacity = space.total_capacity ++ if capacity <= 0: ++ capacity = -1 ++ else: ++ capacity *= 1024 ++ ++ storage_pools[pool.node_name].append({ ++ 'storage-pool-name': pool.name, ++ 'uuid': pool.uuid, ++ 'free-size': size, ++ 'capacity': capacity ++ }) ++ ++ return storage_pools ++ ++ def get_resources_info(self): ++ """ ++ Give all resources of current group name. ++ :rtype: dict(str, list) ++ """ ++ resources = {} ++ resource_list = self._linstor.resource_list_raise() ++ for resource in resource_list.resources: ++ if resource.name not in resources: ++ resources[resource.name] = {} ++ ++ resources[resource.name][resource.node_name] = { ++ 'volumes': [], ++ 'diskful': linstor.consts.FLAG_DISKLESS not in resource.flags, ++ 'tie-breaker': linstor.consts.FLAG_TIE_BREAKER in resource.flags ++ } ++ ++ for volume in resource.volumes: ++ # We ignore diskless pools of the form "DfltDisklessStorPool". ++ if volume.storage_pool_name != self._group_name: ++ continue ++ ++ usable_size = volume.usable_size ++ if usable_size < 0: ++ usable_size = -1 ++ else: ++ usable_size *= 1024 ++ ++ allocated_size = volume.allocated_size ++ if allocated_size < 0: ++ allocated_size = -1 ++ else: ++ allocated_size *= 1024 ++ ++ resources[resource.name][resource.node_name]['volumes'].append({ ++ 'storage-pool-name': volume.storage_pool_name, ++ 'uuid': volume.uuid, ++ 'number': volume.number, ++ 'device-path': volume.device_path, ++ 'usable-size': usable_size, ++ 'allocated-size': allocated_size ++ }) ++ ++ for resource_state in resource_list.resource_states: ++ resource = resources[resource_state.rsc_name][resource_state.node_name] ++ resource['in-use'] = resource_state.in_use ++ ++ volumes = resource['volumes'] ++ for volume_state in resource_state.volume_states: ++ volume = next((x for x in volumes if x['number'] == volume_state.number), None) ++ if volume: ++ volume['disk-state'] = volume_state.disk_state ++ ++ return resources ++ + @classmethod + def create_sr( + cls, group_name, node_names, ips, redundancy, +-- +2.45.2 + diff --git a/SOURCES/0081-fix-LinstorSR-fix-xha-conf-parsing-return-host-ip-no.patch b/SOURCES/0081-fix-LinstorSR-fix-xha-conf-parsing-return-host-ip-no.patch new file mode 100644 index 00000000..c81f32e4 --- /dev/null +++ b/SOURCES/0081-fix-LinstorSR-fix-xha-conf-parsing-return-host-ip-no.patch @@ -0,0 +1,54 @@ +From f3a1300f1fd9b0cb8d258c10bd3c65feb4d97e7b Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Tue, 4 Oct 2022 11:01:33 +0200 +Subject: [PATCH 081/175] fix(LinstorSR): fix xha conf parsing => return host + ip, not the UUID + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 374d6cb..d32771f 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -277,7 +277,7 @@ def get_ips_from_xha_config_file(): + return IPS_XHA_CACHE + + ips = dict() +- host_ip = None ++ host_id = None + try: + # Ensure there is no dirty read problem. + # For example if the HA is reloaded. +@@ -287,7 +287,7 @@ def get_ips_from_xha_config_file(): + period=1 + ) + except: +- return (host_ip, ips) ++ return (None, ips) + + def parse_host_nodes(ips, node): + current_id = None +@@ -322,14 +322,14 @@ def get_ips_from_xha_config_file(): + if node.tag == 'common-config': + parse_common_config(ips, node) + elif node.tag == 'local-config': +- host_ip = parse_local_config(ips, node) ++ host_id = parse_local_config(ips, node) + else: + continue + +- if ips and host_ip: ++ if ips and host_id: + break + +- return (host_ip, ips) ++ return (host_id and ips.get(host_id), ips) + + + def activate_lvm_group(group_name): +-- +2.45.2 + diff --git a/SOURCES/0082-fix-LinstorSR-start-correctly-HA-servers-HTTP-NBD-af.patch b/SOURCES/0082-fix-LinstorSR-start-correctly-HA-servers-HTTP-NBD-af.patch new file mode 100644 index 00000000..3d9c6a93 --- /dev/null +++ b/SOURCES/0082-fix-LinstorSR-start-correctly-HA-servers-HTTP-NBD-af.patch @@ -0,0 +1,44 @@ +From 1b0ff0601d1f660f2df376bf9d29875adfa69df2 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Tue, 4 Oct 2022 18:48:09 +0200 +Subject: [PATCH 082/175] fix(LinstorSR): start correctly HA servers (HTTP/NBD) + after reboot + +Use a timeout call after a reboot to get a XAPI session because +it can be impossible to initialize the connection at startup +or if the current host has been ejected (in this case the call can +block indefinitely). + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index d32771f..ae25385 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -2513,7 +2513,10 @@ class LinstorVDI(VDI.VDI): + port = '8077' + + try: +- session = util.get_localAPI_session() ++ # Use a timeout call because XAPI may be unusable on startup ++ # or if the host has been ejected. So in this case the call can ++ # block indefinitely. ++ session = util.timeout_call(5, util.get_localAPI_session) + host_ip = util.get_this_host_address(session) + except: + # Fallback using the XHA file if session not available. +@@ -2583,7 +2586,7 @@ class LinstorVDI(VDI.VDI): + port = '8077' + + try: +- session = util.get_localAPI_session() ++ session = util.timeout_call(5, util.get_localAPI_session) + ips = util.get_host_addresses(session) + except Exception as e: + _, ips = get_ips_from_xha_config_file() +-- +2.45.2 + diff --git a/SOURCES/0083-fix-linstorvolumemanager-use-an-array-to-store-diskf.patch b/SOURCES/0083-fix-linstorvolumemanager-use-an-array-to-store-diskf.patch new file mode 100644 index 00000000..868fa2e1 --- /dev/null +++ b/SOURCES/0083-fix-linstorvolumemanager-use-an-array-to-store-diskf.patch @@ -0,0 +1,78 @@ +From df9f3e905f8b10746fb2aa3938212c898d7f1c13 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Wed, 5 Oct 2022 10:45:50 +0200 +Subject: [PATCH 083/175] fix(linstorvolumemanager): use an array to store + diskful volumes info + +Otherwise the `is_diskful` attr only reflects the info of one host +after a call to `get_volume_info`... And we therefore lose this +information concerning the others. + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 4 +++- + drivers/linstorvolumemanager.py | 9 +++++---- + 2 files changed, 8 insertions(+), 5 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index ae25385..b855807 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -39,6 +39,7 @@ import os + import re + import scsiutil + import signal ++import socket + import SR + import SRCommand + import subprocess +@@ -2729,7 +2730,8 @@ class LinstorVDI(VDI.VDI): + .format(self.uuid, e) + ) + +- must_get_device_path = volume_info.is_diskful ++ hostname = socket.gethostname() ++ must_get_device_path = hostname in volume_info.diskful + + drbd_path = None + if must_get_device_path or self.sr._is_master: +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index efe5d53..e577f63 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -307,19 +307,19 @@ class LinstorVolumeManager(object): + 'allocated_size', # Allocated size, place count is not used. + 'virtual_size', # Total virtual available size of this volume + # (i.e. the user size at creation). +- 'is_diskful' ++ 'diskful' # Array of nodes that have a diskful volume. + ) + + def __init__(self, name): + self.name = name + self.allocated_size = 0 + self.virtual_size = 0 +- self.is_diskful = False ++ self.diskful = [] + + def __repr__(self): + return 'VolumeInfo("{}", {}, {}, {})'.format( + self.name, self.allocated_size, self.virtual_size, +- 'diskful' if self.is_diskful else 'diskless' ++ self.diskful + ) + + # -------------------------------------------------------------------------- +@@ -1878,7 +1878,8 @@ class LinstorVolumeManager(object): + else: + current = all_volume_info[resource.name] + +- current.is_diskful = linstor.consts.FLAG_DISKLESS not in resource.flags ++ if linstor.consts.FLAG_DISKLESS not in resource.flags: ++ current.diskful.append(resource.node_name) + + for volume in resource.volumes: + # We ignore diskless pools of the form "DfltDisklessStorPool". +-- +2.45.2 + diff --git a/SOURCES/0084-feat-linstorvolumemanager-support-snaps-when-a-host-.patch b/SOURCES/0084-feat-linstorvolumemanager-support-snaps-when-a-host-.patch new file mode 100644 index 00000000..d75fae2d --- /dev/null +++ b/SOURCES/0084-feat-linstorvolumemanager-support-snaps-when-a-host-.patch @@ -0,0 +1,33 @@ +From 68c6961c4b1640fc69804686a72503f30bf82012 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Thu, 6 Oct 2022 17:54:10 +0200 +Subject: [PATCH 084/175] feat(linstorvolumemanager): support snaps when a host + is offline + +- Don't create diskless volumes during clone, delay it. + +Signed-off-by: Ronan Abhamon +--- + drivers/linstorvolumemanager.py | 6 ------ + 1 file changed, 6 deletions(-) + +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index e577f63..09aad42 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -1199,12 +1199,6 @@ class LinstorVolumeManager(object): + rsc_name=clone_volume_name, + storage_pool=self._group_name + )) +- for node_name in diskless_node_names: +- resources.append(linstor.ResourceData( +- node_name=node_name, +- rsc_name=clone_volume_name, +- diskless=True +- )) + + # 5. Create resources! + def clean(): +-- +2.45.2 + diff --git a/SOURCES/0085-fix-linstorvolumemanager-support-offline-hosts-when-.patch b/SOURCES/0085-fix-linstorvolumemanager-support-offline-hosts-when-.patch new file mode 100644 index 00000000..e14afad8 --- /dev/null +++ b/SOURCES/0085-fix-linstorvolumemanager-support-offline-hosts-when-.patch @@ -0,0 +1,115 @@ +From 7ab08a324346a2aa6b8ae42c08f7becd6647ddd5 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Fri, 7 Oct 2022 17:18:37 +0200 +Subject: [PATCH 085/175] fix(linstorvolumemanager): support offline hosts when + plugins are called + +- Robustify plugin calls +- Add a timeout on session getter + +Signed-off-by: Ronan Abhamon +--- + drivers/linstorvolumemanager.py | 69 +++++++++++++++++++++++++-------- + 1 file changed, 52 insertions(+), 17 deletions(-) + +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 09aad42..58c0238 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -83,15 +83,30 @@ def get_all_volume_openers(resource_name, volume): + volume = str(volume) + openers = {} + +- session = util.get_localAPI_session() ++ # Make sure this call never stucks because this function can be called ++ # during HA init and in this case we can wait forever. ++ session = util.timeout_call(10, util.get_localAPI_session) ++ + hosts = session.xenapi.host.get_all_records() + for host_ref, host_record in hosts.items(): +- openers[host_record['hostname']] = json.loads( +- session.xenapi.host.call_plugin(host_ref, PLUGIN, PLUGIN_CMD, { +- 'resourceName': resource_name, +- 'volume': volume +- }) +- ) ++ node_name = host_record['hostname'] ++ try: ++ if not session.xenapi.host_metrics.get_record( ++ host_record['metrics'] ++ )['live']: ++ # Ensure we call plugin on online hosts only. ++ continue ++ ++ openers[node_name] = json.loads( ++ session.xenapi.host.call_plugin(host_ref, PLUGIN, PLUGIN_CMD, { ++ 'resourceName': resource_name, ++ 'volume': volume ++ }) ++ ) ++ except Exception as e: ++ util.SMlog('Failed to get openers of `{}` on `{}`: {}'.format( ++ resource_name, node_name, e ++ )) + + return openers + +@@ -162,12 +177,20 @@ def _get_controller_uri(): + # replicated volume. `drbdadm status xcp-persistent-database` returns + # 3 connections by default. + try: +- session = util.get_localAPI_session() ++ session = util.timeout_call(10, util.get_localAPI_session) ++ + for host_ref, host_record in session.xenapi.host.get_all_records().items(): +- if distutils.util.strtobool( +- session.xenapi.host.call_plugin(host_ref, PLUGIN, PLUGIN_CMD, {}) +- ): +- return 'linstor://' + host_record['address'] ++ node_name = host_record['hostname'] ++ try: ++ if distutils.util.strtobool( ++ session.xenapi.host.call_plugin(host_ref, PLUGIN, PLUGIN_CMD, {}) ++ ): ++ return 'linstor://' + host_record['address'] ++ except Exception as e: ++ # Can throw and exception if a host is offline. So catch it. ++ util.SMlog('Unable to search controller on `{}`: {}'.format( ++ node_name, e ++ )) + except: + # Not found, maybe we are trying to create the SR... + pass +@@ -200,12 +223,24 @@ def get_controller_node_name(): + if res: + return res.groups()[0] + +- session = util.get_localAPI_session() ++ session = util.timeout_call(5, util.get_localAPI_session) ++ + for host_ref, host_record in session.xenapi.host.get_all_records().items(): +- if distutils.util.strtobool( +- session.xenapi.host.call_plugin(host_ref, PLUGIN, PLUGIN_CMD, {}) +- ): +- return host_record['hostname'] ++ node_name = host_record['hostname'] ++ try: ++ if not session.xenapi.host_metrics.get_record( ++ host_record['metrics'] ++ )['live']: ++ continue ++ ++ if distutils.util.strtobool(session.xenapi.host.call_plugin( ++ host_ref, PLUGIN, PLUGIN_CMD, {} ++ )): ++ return node_name ++ except Exception as e: ++ util.SMlog('Failed to call plugin to get controller on `{}`: {}'.format( ++ node_name, e ++ )) + + # ============================================================================== + +-- +2.45.2 + diff --git a/SOURCES/0086-fix-linstorvolumemanager-define-_base_group_name-mem.patch b/SOURCES/0086-fix-linstorvolumemanager-define-_base_group_name-mem.patch new file mode 100644 index 00000000..3f7b075a --- /dev/null +++ b/SOURCES/0086-fix-linstorvolumemanager-define-_base_group_name-mem.patch @@ -0,0 +1,34 @@ +From 7c499761b11550c592ef22e52343effee91e6015 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Fri, 7 Oct 2022 17:45:26 +0200 +Subject: [PATCH 086/175] fix(linstorvolumemanager): define _base_group_name + member at SR creation + +Signed-off-by: Ronan Abhamon +--- + drivers/linstorvolumemanager.py | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 58c0238..d19effb 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -1622,6 +1622,7 @@ class LinstorVolumeManager(object): + ) + + driver_pool_name = group_name ++ base_group_name = group_name + group_name = cls._build_group_name(group_name) + pools = lin.storage_pool_list_raise(filter_by_stor_pools=[group_name]) + pools = pools.storage_pools +@@ -1784,6 +1785,7 @@ class LinstorVolumeManager(object): + instance._linstor = lin + instance._logger = logger + instance._redundancy = redundancy ++ instance._base_group_name = base_group_name + instance._group_name = group_name + instance._volumes = set() + instance._storage_pools_time = 0 +-- +2.45.2 + diff --git a/SOURCES/0087-feat-linstorvhdutil-modify-logic-of-local-vhdutil-ca.patch b/SOURCES/0087-feat-linstorvhdutil-modify-logic-of-local-vhdutil-ca.patch new file mode 100644 index 00000000..62ee0a3c --- /dev/null +++ b/SOURCES/0087-feat-linstorvhdutil-modify-logic-of-local-vhdutil-ca.patch @@ -0,0 +1,148 @@ +From 36c1c5d109eda8fd2451b58f2c1b1eca4ba6d570 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Mon, 10 Oct 2022 14:33:24 +0200 +Subject: [PATCH 087/175] feat(linstorvhdutil): modify logic of local vhdutil + calls + +- Always log openers when we can't call vhdutil locally +- Remove "raise" lines after a local fail, always retry command calls on a remote + +Signed-off-by: Ronan Abhamon +--- + drivers/linstorvhdutil.py | 72 ++++++++++++++++++++++++--------------- + 1 file changed, 44 insertions(+), 28 deletions(-) + +diff --git a/drivers/linstorvhdutil.py b/drivers/linstorvhdutil.py +index 4d031e1..2687cad 100644 +--- a/drivers/linstorvhdutil.py ++++ b/drivers/linstorvhdutil.py +@@ -65,12 +65,17 @@ def linstorhostcall(local_method, remote_method): + (node_names, in_use) = \ + self._linstor.find_up_to_date_diskful_nodes(vdi_uuid) + ++ local_e = None + try: + if not in_use or socket.gethostname() in node_names: +- return self._call_local_vhd_util(local_method, device_path, *args[2:], **kwargs) +- except util.CommandException as e: +- if e.code != errno.EROFS and e.code != EMEDIUMTYPE: +- raise ++ # Don't call `_call_local_vhd_util`, we don't want to ++ # trace failed calls now using opener files. It can be ++ # normal to have an exception. ++ def local_call(): ++ return local_method(device_path, *args[2:], **kwargs) ++ return util.retry(local_call, 5, 2) ++ except util.CommandException as local_e: ++ self._handle_local_vhd_util_error(local_e) + + # B. Execute the plugin on master or slave. + remote_args = { +@@ -80,12 +85,13 @@ def linstorhostcall(local_method, remote_method): + remote_args.update(**kwargs) + remote_args = {str(key): str(value) for key, value in remote_args.iteritems()} + +- def remote_call(): +- host_ref = self._get_readonly_host( +- vdi_uuid, device_path, node_names +- ) +- return call_vhd_util_on_host(self._session, host_ref, remote_method, device_path, remote_args) +- response = util.retry(remote_call, 5, 2) ++ try: ++ def remote_call(): ++ host_ref = self._get_readonly_host(vdi_uuid, device_path, node_names) ++ return call_vhd_util_on_host(self._session, host_ref, remote_method, device_path, remote_args) ++ response = util.retry(remote_call, 5, 2) ++ except Exception as remote_e: ++ self._raise_openers_exception(device_path, local_e or remote_e) + + return response_parser(self, vdi_uuid, response) + return wrapper +@@ -271,22 +277,13 @@ class LinstorVhdUtil: + + # -------------------------------------------------------------------------- + +- def _call_local_vhd_util(self, local_method, device_path, *args, **kwargs): +- try: +- def local_call(): +- return local_method(device_path, *args, **kwargs) +- return util.retry(local_call, 5, 2) +- except util.CommandException as e: +- if e.code != errno.EROFS and e.code != EMEDIUMTYPE: +- raise +- +- # Volume is locked on a host, find openers. ++ def _raise_openers_exception(self, device_path, e): + e_with_openers = None + try: + volume_uuid = self._linstor.get_volume_uuid_from_device_path( + device_path + ) +- e_with_openers = util.CommandException( ++ e_wrapper = util.CommandException( + e.code, + e.cmd, + e.reason + ' (openers: {})'.format( +@@ -294,12 +291,29 @@ class LinstorVhdUtil: + ) + ) + except Exception as illformed_e: +- raise util.CommandException( ++ e_wrapper = util.CommandException( + e.code, + e.cmd, + e.reason + ' (unable to get openers: {})'.format(illformed_e) + ) +- raise e_with_openers # pylint: disable = E0702 ++ util.SMlog('raise opener exception: {} ({})'.format(e_wrapper, e_wrapper.reason)) ++ raise e_wrapper # pylint: disable = E0702 ++ ++ @staticmethod ++ def _handle_local_vhd_util_error(e): ++ if e.code != errno.EROFS and e.code != EMEDIUMTYPE: ++ util.SMlog('failed to execute locally vhd-util (sys {})'.format(e.code)) ++ ++ def _call_local_vhd_util(self, local_method, device_path, *args, **kwargs): ++ try: ++ def local_call(): ++ return local_method(device_path, *args, **kwargs) ++ return util.retry(local_call, 5, 2) ++ except util.CommandException as e: ++ self._handle_local_vhd_util_error(e) ++ ++ # Volume is locked on a host, find openers. ++ self._raise_openers_exception(device_path, e) + + def _call_vhd_util(self, local_method, remote_method, device_path, *args, **kwargs): + # A. Try to write locally... +@@ -308,8 +322,7 @@ class LinstorVhdUtil: + return local_method(device_path, *args, **kwargs) + return util.retry(local_call, 5, 2) + except util.CommandException as e: +- if e.code != errno.EROFS and e.code != EMEDIUMTYPE: +- raise ++ self._handle_local_vhd_util_error(e) + + # B. Execute the command on another host. + # B.1. Get host list. +@@ -362,11 +375,14 @@ class LinstorVhdUtil: + pass + + if no_host_found: +- return local_method(device_path, *args, **kwargs) ++ try: ++ return local_method(device_path, *args, **kwargs) ++ except Exception as e: ++ self._raise_openers_exception(device_path, e) + + raise xs_errors.XenError( + 'VDIUnavailable', +- opterr='No valid host found to run vhd-util command `{}` (path={}): {}' +- .format(remote_method, device_path, e) ++ opterr='No valid host found to run vhd-util command `{}` (path=`{}`, openers=`{}`): {}' ++ .format(remote_method, device_path, openers, e) + ) + return util.retry(remote_call, 5, 2) +-- +2.45.2 + diff --git a/SOURCES/0088-fix-linstorvolumemanager-robustify-failed-snapshots.patch b/SOURCES/0088-fix-linstorvolumemanager-robustify-failed-snapshots.patch new file mode 100644 index 00000000..6135e063 --- /dev/null +++ b/SOURCES/0088-fix-linstorvolumemanager-robustify-failed-snapshots.patch @@ -0,0 +1,53 @@ +From e0d0c13e2621849ebeab9c9059020b4ff229bbc8 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Mon, 17 Oct 2022 18:14:16 +0200 +Subject: [PATCH 088/175] fix(linstorvolumemanager): robustify failed snapshots + +- Ensure we can always rename a failed snap, so we must check if + we have metadata in the KV-store. Otherwise an error is triggered + because we are trying to copy a None object. +- If we can't delete a volume, rename it with a DELETED_ suffix, + it's mandatory in specific cases to rollback snapshot transactions. + +Signed-off-by: Ronan Abhamon +--- + drivers/linstorvolumemanager.py | 16 +++++++++++++++- + 1 file changed, 15 insertions(+), 1 deletion(-) + +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index d19effb..44b247e 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -951,7 +951,11 @@ class LinstorVolumeManager(object): + volume_properties[self.PROP_UPDATING_UUID_SRC] = volume_uuid + + # 4. Copy the properties. +- volume_properties[self.PROP_METADATA] = metadata ++ # Note: On new volumes, during clone for example, the metadata ++ # may be missing. So we must test it to avoid this error: ++ # "None has to be a str/unicode, but is " ++ if metadata: ++ volume_properties[self.PROP_METADATA] = metadata + volume_properties[self.PROP_VOLUME_NAME] = volume_name + + # 5. Ok! +@@ -2289,6 +2293,16 @@ class LinstorVolumeManager(object): + 'Cannot clean volume {}: {}'.format(volume_uuid, e) + ) + ++ # The volume can't be removed, maybe it's still in use, ++ # in this case rename it with the "DELETED_" prefix. ++ # This prefix is mandatory if it exists a snap transaction to ++ # rollback because the original VDI UUID can try to be renamed ++ # with the UUID we are trying to delete... ++ if not volume_uuid.startswith('DELETED_'): ++ self.update_volume_uuid( ++ volume_uuid, 'DELETED_' + volume_uuid, force=True ++ ) ++ + for dest_uuid, src_uuid in updating_uuid_volumes.items(): + dest_namespace = self._build_volume_namespace(dest_uuid) + +-- +2.45.2 + diff --git a/SOURCES/0089-fix-linstorvolumemanager-use-a-namespace-for-volumes.patch b/SOURCES/0089-fix-linstorvolumemanager-use-a-namespace-for-volumes.patch new file mode 100644 index 00000000..a8506af4 --- /dev/null +++ b/SOURCES/0089-fix-linstorvolumemanager-use-a-namespace-for-volumes.patch @@ -0,0 +1,29 @@ +From 123cd37a6540f5e0863e542460ebf30f3334556f Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Tue, 8 Nov 2022 17:31:45 +0100 +Subject: [PATCH 089/175] fix(linstorvolumemanager): use a namespace for + volumes + +- This change is not compatible with existing LINSTOR SR instances! + +Signed-off-by: Ronan Abhamon +--- + drivers/linstorvolumemanager.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 44b247e..8c253d4 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -308,7 +308,7 @@ class LinstorVolumeManager(object): + + # Property namespaces. + NAMESPACE_SR = 'xcp/sr' +- NAMESPACE_VOLUME = 'volume' ++ NAMESPACE_VOLUME = 'xcp/volume' + + # Regex to match properties. + REG_PROP = '^([^/]+)/{}$' +-- +2.45.2 + diff --git a/SOURCES/0090-feat-linstor-kv-dump-rename-to-linstor-kv-tool-add-r.patch b/SOURCES/0090-feat-linstor-kv-dump-rename-to-linstor-kv-tool-add-r.patch new file mode 100644 index 00000000..705fd681 --- /dev/null +++ b/SOURCES/0090-feat-linstor-kv-dump-rename-to-linstor-kv-tool-add-r.patch @@ -0,0 +1,97 @@ +From 3c684d34002733bba72bcbf650c16accf65ea50e Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Mon, 14 Nov 2022 17:18:48 +0100 +Subject: [PATCH 090/175] feat(linstor-kv-dump): rename to linstor-kv-tool + + add remove volume helpers + +--- + Makefile | 2 +- + scripts/{linstor-kv-dump => linstor-kv-tool} | 42 +++++++++++++++++++- + 2 files changed, 42 insertions(+), 2 deletions(-) + rename scripts/{linstor-kv-dump => linstor-kv-tool} (51%) + +diff --git a/Makefile b/Makefile +index aa71f80..42058c8 100755 +--- a/Makefile ++++ b/Makefile +@@ -240,7 +240,7 @@ install: precheck + install -m 755 drivers/fcoelib.py $(SM_STAGING)$(SM_DEST) + mkdir -p $(SM_STAGING)$(LIBEXEC) + install -m 755 scripts/fork-log-daemon $(SM_STAGING)$(LIBEXEC) +- install -m 755 scripts/linstor-kv-dump $(SM_STAGING)$(BIN_DEST) ++ install -m 755 scripts/linstor-kv-tool $(SM_STAGING)$(BIN_DEST) + install -m 755 scripts/local-device-change $(SM_STAGING)$(LIBEXEC) + install -m 755 scripts/check-device-sharing $(SM_STAGING)$(LIBEXEC) + install -m 755 scripts/usb_change $(SM_STAGING)$(LIBEXEC) +diff --git a/scripts/linstor-kv-dump b/scripts/linstor-kv-tool +similarity index 51% +rename from scripts/linstor-kv-dump +rename to scripts/linstor-kv-tool +index 93598d7..128d899 100755 +--- a/scripts/linstor-kv-dump ++++ b/scripts/linstor-kv-tool +@@ -18,6 +18,7 @@ import argparse + import json + import linstor + ++ + def dump_kv(controller_uri, group_name, namespace): + kv = linstor.KV( + group_name, +@@ -26,13 +27,52 @@ def dump_kv(controller_uri, group_name, namespace): + ) + print(json.dumps(kv, sort_keys=True, indent=2)) + ++ ++def remove_volume(controller_uri, group_name, vdi_name): ++ assert vdi_name ++ kv = linstor.KV( ++ group_name, ++ uri=controller_uri, ++ namespace='/xcp/volume/{}'.format(vdi_name) ++ ) ++ ++ for key, value in list(kv.items()): ++ del kv[key] ++ ++ ++def remove_all_volumes(controller_uri, group_name): ++ kv = linstor.KV( ++ group_name, ++ uri=controller_uri, ++ namespace='/' ++ ) ++ ++ for key, value in list(kv.items()): ++ if key.startswith('xcp/volume/'): ++ size = key.rindex('/') ++ kv.namespace = key[:size] ++ del kv[key[size + 1:]] ++ ++ + def main(): + parser = argparse.ArgumentParser() + parser.add_argument('-u', '--uri', required=True) + parser.add_argument('-g', '--group-name', required=True) + parser.add_argument('-n', '--namespace', default='/') ++ ++ action = parser.add_mutually_exclusive_group(required=True) ++ action.add_argument('--dump-volumes', action='store_true') ++ action.add_argument('--remove-volume', metavar='VDI_UUID') ++ action.add_argument('--remove-all-volumes', action='store_true') ++ + args = parser.parse_args() +- dump_kv(args.uri, args.group_name, args.namespace) ++ if args.dump_volumes: ++ dump_kv(args.uri, args.group_name, args.namespace) ++ elif args.remove_volume: ++ remove_volume(args.uri, args.group_name, args.remove_volume) ++ elif args.remove_all_volumes: ++ remove_all_volumes(args.uri, args.group_name) ++ + + if __name__ == '__main__': + main() +-- +2.45.2 + diff --git a/SOURCES/0091-fix-LinstorSR-handle-correctly-localhost-during-star.patch b/SOURCES/0091-fix-LinstorSR-handle-correctly-localhost-during-star.patch new file mode 100644 index 00000000..e5929b46 --- /dev/null +++ b/SOURCES/0091-fix-LinstorSR-handle-correctly-localhost-during-star.patch @@ -0,0 +1,75 @@ +From 8e014b9cc6319c9caed73a9a80a2aff9808c3d79 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Wed, 16 Nov 2022 12:12:12 +0100 +Subject: [PATCH 091/175] fix(LinstorSR): handle correctly localhost during + start/stop of minidrbdcluster + +Otherwise another controller can be started during `xe sr-destroy` call. +And in this case we can get an exception during the umount/remount of /var/lib/linstor +to destroy the persistent database because a controller uses it. + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 31 +++++++++++++++++++++++++++---- + 1 file changed, 27 insertions(+), 4 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index b855807..ba28452 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -967,25 +967,48 @@ class LinstorSR(SR.SR): + def _update_minidrbdcluster_on_all_hosts( + self, enabled, controller_node_name=None + ): ++ if controller_node_name == 'localhost': ++ controller_node_name = self.session.xenapi.host.get_record( ++ util.get_this_host_ref(self.session) ++ )['hostname'] ++ assert controller_node_name ++ assert controller_node_name != 'localhost' ++ + controller_host = None + secondary_hosts = [] + + hosts = self.session.xenapi.host.get_all_records() + for host_ref, host_rec in hosts.iteritems(): +- if controller_node_name == host_rec['hostname']: ++ hostname = host_rec['hostname'] ++ if controller_node_name == hostname: + controller_host = host_ref + else: +- secondary_hosts.append(host_ref) ++ secondary_hosts.append((host_ref, hostname)) ++ ++ action_name = 'Starting' if enabled else 'Stopping' ++ if controller_node_name and not controller_host: ++ util.SMlog('Failed to find controller host: `{}`'.format( ++ controller_node_name ++ )) + + if enabled and controller_host: ++ util.SMlog('{} minidrbdcluster on controller host `{}`...'.format( ++ action_name, controller_node_name ++ )) + # If enabled is true, we try to start the controller on the desired + # node name first. + self._update_minidrbdcluster(controller_host, enabled) + +- for host in secondary_hosts: +- self._update_minidrbdcluster(host, enabled) ++ for host_ref, hostname in secondary_hosts: ++ util.SMlog('{} minidrbdcluster on host {}...'.format( ++ action_name, hostname ++ )) ++ self._update_minidrbdcluster(host_ref, enabled) + + if not enabled and controller_host: ++ util.SMlog('{} minidrbdcluster on controller host `{}`...'.format( ++ action_name, controller_node_name ++ )) + # If enabled is false, we disable the minidrbdcluster service of + # the controller host last. Why? Otherwise the linstor-controller + # of other nodes can be started, and we don't want that. +-- +2.45.2 + diff --git a/SOURCES/0092-fix-cleanup.py-call-repair-on-another-host-when-EROF.patch b/SOURCES/0092-fix-cleanup.py-call-repair-on-another-host-when-EROF.patch new file mode 100644 index 00000000..bc9d1f39 --- /dev/null +++ b/SOURCES/0092-fix-cleanup.py-call-repair-on-another-host-when-EROF.patch @@ -0,0 +1,62 @@ +From 848edaa1638986bae64f5c5763591b84b0a7e9f6 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Thu, 17 Nov 2022 15:43:25 +0100 +Subject: [PATCH 092/175] fix(cleanup.py): call repair on another host when + EROFS is returned (DRBD) + +Signed-off-by: Ronan Abhamon +--- + drivers/cleanup.py | 20 ++++++++++++++++++-- + 1 file changed, 18 insertions(+), 2 deletions(-) + +diff --git a/drivers/cleanup.py b/drivers/cleanup.py +index 7329363..f6c4346 100755 +--- a/drivers/cleanup.py ++++ b/drivers/cleanup.py +@@ -726,6 +726,12 @@ class VDI(object): + lock.Lock.cleanupAll(self.uuid) + self._clear() + ++ def getParent(self): ++ return vhdutil.getParent(self.path, lambda x: x.strip()) ++ ++ def repair(self, parent): ++ vhdutil.repair(parent) ++ + def __str__(self): + strHidden = "" + if self.hidden: +@@ -876,11 +882,11 @@ class VDI(object): + # Try a repair and reraise the exception + parent = "" + try: +- parent = vhdutil.getParent(self.path, lambda x: x.strip()) ++ parent = self.getParent() + # Repair error is logged and ignored. Error reraised later + util.SMlog('Coalesce failed on %s, attempting repair on ' \ + 'parent %s' % (self.uuid, parent)) +- vhdutil.repair(parent) ++ self.repair(parent) + except Exception, e: + util.SMlog('(error ignored) Failed to repair parent %s ' \ + 'after failed coalesce on %s, err: %s' % +@@ -1442,6 +1448,16 @@ class LinstorVDI(VDI): + def coalesce(self): + self.sr._vhdutil.force_coalesce(self.path) + ++ def getParent(self): ++ return self.sr._vhdutil.get_parent( ++ self.sr._linstor.get_volume_uuid_from_device_path(self.path) ++ ) ++ ++ def repair(self, parent_uuid): ++ self.sr._vhdutil.force_repair( ++ self.sr._linstor.get_device_path(parent_uuid) ++ ) ++ + def _relinkSkip(self): + abortFlag = IPCFlag(self.sr.uuid) + for child in self.children: +-- +2.45.2 + diff --git a/SOURCES/0093-fix-LinstorSR-avoid-introduction-of-DELETED-volumes.patch b/SOURCES/0093-fix-LinstorSR-avoid-introduction-of-DELETED-volumes.patch new file mode 100644 index 00000000..89041442 --- /dev/null +++ b/SOURCES/0093-fix-LinstorSR-avoid-introduction-of-DELETED-volumes.patch @@ -0,0 +1,27 @@ +From 52b2b554440c15f8297c8d34ce19557cd2483a02 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Thu, 17 Nov 2022 15:46:02 +0100 +Subject: [PATCH 093/175] fix(LinstorSR): avoid introduction of DELETED volumes + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index ba28452..9e5b3cd 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -1170,6 +1170,9 @@ class LinstorSR(SR.SR): + ) + continue + ++ if vdi_uuid.startswith('DELETED_'): ++ continue ++ + util.SMlog( + 'Trying to introduce VDI {} as it is present in ' + 'LINSTOR and not in XAPI...' +-- +2.45.2 + diff --git a/SOURCES/0094-feat-linstor-kv-tool-remove-all-volumes-supports-jou.patch b/SOURCES/0094-feat-linstor-kv-tool-remove-all-volumes-supports-jou.patch new file mode 100644 index 00000000..32e732cd --- /dev/null +++ b/SOURCES/0094-feat-linstor-kv-tool-remove-all-volumes-supports-jou.patch @@ -0,0 +1,30 @@ +From 6f5f234f5883430143f7c30a2584c25118b17cbc Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Fri, 18 Nov 2022 10:40:58 +0100 +Subject: [PATCH 094/175] feat(linstor-kv-tool): remove-all-volumes supports + journals now + +Not yet supported for remove-volume, not sure about the consequences +for the moment. + +Signed-off-by: Ronan Abhamon +--- + scripts/linstor-kv-tool | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/scripts/linstor-kv-tool b/scripts/linstor-kv-tool +index 128d899..c907027 100755 +--- a/scripts/linstor-kv-tool ++++ b/scripts/linstor-kv-tool +@@ -48,7 +48,7 @@ def remove_all_volumes(controller_uri, group_name): + ) + + for key, value in list(kv.items()): +- if key.startswith('xcp/volume/'): ++ if key.startswith('xcp/volume/') or key.startswith('xcp/sr/journal/'): + size = key.rindex('/') + kv.namespace = key[:size] + del kv[key[size + 1:]] +-- +2.45.2 + diff --git a/SOURCES/0095-fix-linstorvhdutil-due-to-bad-refactoring-check-call.patch b/SOURCES/0095-fix-linstorvhdutil-due-to-bad-refactoring-check-call.patch new file mode 100644 index 00000000..9be46457 --- /dev/null +++ b/SOURCES/0095-fix-linstorvhdutil-due-to-bad-refactoring-check-call.patch @@ -0,0 +1,33 @@ +From 14a8891b866962415750050e6649f7ebb2a2fe78 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Wed, 23 Nov 2022 15:26:51 +0100 +Subject: [PATCH 095/175] fix(linstorvhdutil): due to bad refactoring, check + call was broken + +Signed-off-by: Ronan Abhamon +--- + drivers/linstorvhdutil.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/linstorvhdutil.py b/drivers/linstorvhdutil.py +index 2687cad..a883ca4 100644 +--- a/drivers/linstorvhdutil.py ++++ b/drivers/linstorvhdutil.py +@@ -124,11 +124,11 @@ class LinstorVhdUtil: + 'ignoreMissingFooter': str(ignore_missing_footer), + 'fast': str(fast) + } +- return self._check(vdi_uuid, **kwargs) ++ return self._check(vdi_uuid, **kwargs) # pylint: disable = E1123 + + @linstorhostcall(vhdutil.check, 'check') +- def _check(self, vdi_uuid, **kwargs): +- return distutils.util.strtobool(kwargs['response']) ++ def _check(self, vdi_uuid, response): ++ return distutils.util.strtobool(response) + + def get_vhd_info(self, vdi_uuid, include_parent=True): + kwargs = {'includeParent': str(include_parent)} +-- +2.45.2 + diff --git a/SOURCES/0096-feat-linstorvhdutil-ensure-we-use-VHD-parent-to-find.patch b/SOURCES/0096-feat-linstorvhdutil-ensure-we-use-VHD-parent-to-find.patch new file mode 100644 index 00000000..e25546c1 --- /dev/null +++ b/SOURCES/0096-feat-linstorvhdutil-ensure-we-use-VHD-parent-to-find.patch @@ -0,0 +1,69 @@ +From acdceeddc7b867d4cbaf1e692faafbbac5deb2f8 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Wed, 23 Nov 2022 15:28:23 +0100 +Subject: [PATCH 096/175] feat(linstorvhdutil): ensure we use VHD parent to + find host where to coalesce + +Signed-off-by: Ronan Abhamon +--- + drivers/linstorvhdutil.py | 20 +++++++++++++++----- + 1 file changed, 15 insertions(+), 5 deletions(-) + +diff --git a/drivers/linstorvhdutil.py b/drivers/linstorvhdutil.py +index a883ca4..c2e9665 100644 +--- a/drivers/linstorvhdutil.py ++++ b/drivers/linstorvhdutil.py +@@ -228,15 +228,15 @@ class LinstorVhdUtil: + 'parentPath': str(parentPath), + 'parentRaw': parentRaw + } +- return self._call_vhd_util(vhdutil.setParent, 'setParent', path, **kwargs) ++ return self._call_vhd_util(vhdutil.setParent, 'setParent', path, use_parent=False, **kwargs) + + @linstormodifier() + def force_coalesce(self, path): +- return self._call_vhd_util(vhdutil.coalesce, 'coalesce', path) ++ return self._call_vhd_util(vhdutil.coalesce, 'coalesce', path, use_parent=True) + + @linstormodifier() + def force_repair(self, path): +- return self._call_vhd_util(vhdutil.repair, 'repair', path) ++ return self._call_vhd_util(vhdutil.repair, 'repair', path, use_parent=False) + + # -------------------------------------------------------------------------- + # Helpers. +@@ -315,7 +315,12 @@ class LinstorVhdUtil: + # Volume is locked on a host, find openers. + self._raise_openers_exception(device_path, e) + +- def _call_vhd_util(self, local_method, remote_method, device_path, *args, **kwargs): ++ def _call_vhd_util(self, local_method, remote_method, device_path, use_parent, *args, **kwargs): ++ # Note: `use_parent` exists to know if the VHD parent is used by the local/remote method. ++ # Normally in case of failure, if the parent is unused we try to execute the method on ++ # another host using the DRBD opener list. In the other case, if the parent is required, ++ # we must check where this last one is open instead of the child. ++ + # A. Try to write locally... + try: + def local_call(): +@@ -346,11 +351,16 @@ class LinstorVhdUtil: + volume_uuid = self._linstor.get_volume_uuid_from_device_path( + device_path + ) ++ parent_volume_uuid = None ++ if use_parent: ++ parent_volume_uuid = self.get_parent(volume_uuid) ++ ++ openers_uuid = parent_volume_uuid if use_parent else volume_uuid + + # B.3. Call! + def remote_call(): + try: +- all_openers = self._linstor.get_volume_openers(volume_uuid) ++ all_openers = self._linstor.get_volume_openers(openers_uuid) + except Exception as e: + raise xs_errors.XenError( + 'VDIUnavailable', +-- +2.45.2 + diff --git a/SOURCES/0097-feat-linstorvolumemanager-force-DRBD-demote-after-fa.patch b/SOURCES/0097-feat-linstorvolumemanager-force-DRBD-demote-after-fa.patch new file mode 100644 index 00000000..b915c962 --- /dev/null +++ b/SOURCES/0097-feat-linstorvolumemanager-force-DRBD-demote-after-fa.patch @@ -0,0 +1,239 @@ +From 73954dd1f6b34d6d95188a27a96355c6362f8188 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Mon, 5 Dec 2022 18:40:11 +0100 +Subject: [PATCH 097/175] feat(linstorvolumemanager): force DRBD demote after + failed volume creation/clone + +Signed-off-by: Ronan Abhamon +--- + drivers/linstor-manager | 13 ++++ + drivers/linstorvolumemanager.py | 101 ++++++++++++++++++++++++-------- + 2 files changed, 91 insertions(+), 23 deletions(-) + +diff --git a/drivers/linstor-manager b/drivers/linstor-manager +index 7abc105..5c4c5c9 100755 +--- a/drivers/linstor-manager ++++ b/drivers/linstor-manager +@@ -804,6 +804,18 @@ def create_sr(session, args): + raise + + ++def demote_drbd_resource(session, args): ++ try: ++ resource_name = args['resource_name'] ++ (ret, stdout, stderr) = util.doexec(['drbdsetup', 'secondary', resource_name]) ++ if ret: ++ raise Exception('Failed to demote resource: {}'.format(stderr)) ++ return str(True) ++ except Exception as e: ++ util.SMlog('linstor-manager:demote_drbd_resource error: {}'.format(e)) ++ return str(False) ++ ++ + def list_drbd_volumes(session, args): + try: + volume_group = args.get('volume_group') +@@ -998,6 +1010,7 @@ if __name__ == '__main__': + 'removeHost': remove_host, + 'createSr': create_sr, + 'listDrbdVolumes': list_drbd_volumes, ++ 'demoteDrbdResource': demote_drbd_resource, + 'destroyDrbdVolume': destroy_drbd_volume, + 'destroyDrbdVolumes': destroy_drbd_volumes, + 'getDrbdOpeners': get_drbd_openers, +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 8c253d4..2e2feb2 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -242,6 +242,29 @@ def get_controller_node_name(): + node_name, e + )) + ++ ++def demote_drbd_resource(node_name, resource_name): ++ PLUGIN_CMD = 'demoteDrbdResource' ++ ++ session = util.timeout_call(5, util.get_localAPI_session) ++ ++ for host_ref, host_record in session.xenapi.host.get_all_records().items(): ++ if host_record['hostname'] != node_name: ++ continue ++ ++ try: ++ session.xenapi.host.call_plugin( ++ host_ref, PLUGIN, PLUGIN_CMD, {'resource_name': resource_name} ++ ) ++ except Exception as e: ++ util.SMlog('Failed to demote resource `{}` on `{}`: {}'.format( ++ resource_name, node_name, e ++ )) ++ raise Exception( ++ 'Can\'t demote resource `{}`, unable to find node `{}`' ++ .format(resource_name, node_name) ++ ) ++ + # ============================================================================== + + class LinstorVolumeManagerError(Exception): +@@ -615,6 +638,7 @@ class LinstorVolumeManager(object): + no_diskless=no_diskless + ) + ++ # Volume created! Now try to find the device path. + try: + self._logger( + 'Find device path of LINSTOR volume {}...'.format(volume_uuid) +@@ -627,8 +651,10 @@ class LinstorVolumeManager(object): + 'LINSTOR volume {} created!'.format(volume_uuid) + ) + return device_path +- except Exception: +- self._force_destroy_volume(volume_uuid) ++ except Exception as e: ++ # There is an issue to find the path. ++ # At this point the volume has just been created, so force flag can be used. ++ self._destroy_volume(volume_uuid, force=True) + raise + + def mark_volume_as_persistent(self, volume_uuid): +@@ -1242,7 +1268,7 @@ class LinstorVolumeManager(object): + # 5. Create resources! + def clean(): + try: +- self._destroy_volume(clone_uuid) ++ self._destroy_volume(clone_uuid, force=True) + except Exception as e: + self._logger( + 'Unable to destroy volume {} after shallow clone fail: {}' +@@ -1250,12 +1276,16 @@ class LinstorVolumeManager(object): + ) + + def create(): +- try: +- volume_properties = self._create_volume_with_properties( +- clone_uuid, clone_volume_name, size, +- place_resources=False +- ) ++ # Note: placed outside try/except block because we create only definition first. ++ # There is no reason to call `clean` before the real resource creation. ++ volume_properties = self._create_volume_with_properties( ++ clone_uuid, clone_volume_name, size, ++ place_resources=False ++ ) + ++ # After this point, `clean` can be called for any fail because the clone UUID ++ # is really unique. No risk to remove existing data. ++ try: + result = self._linstor.resource_create(resources) + error_str = self._get_error_str(result) + if error_str: +@@ -1298,6 +1328,7 @@ class LinstorVolumeManager(object): + resource_names = self._fetch_resource_names() + for volume_uuid, volume_name in self.get_volumes_with_name().items(): + if not volume_name or volume_name not in resource_names: ++ # Don't force, we can be sure of what's happening. + self.destroy_volume(volume_uuid) + + def destroy(self): +@@ -2064,7 +2095,7 @@ class LinstorVolumeManager(object): + # B.2. Create volume! + def clean(): + try: +- self._destroy_volume(volume_uuid) ++ self._destroy_volume(volume_uuid, force=True) + except Exception as e: + self._logger( + 'Unable to destroy volume {} after creation fail: {}' +@@ -2136,7 +2167,7 @@ class LinstorVolumeManager(object): + # It can only happen if the same volume uuid is used in the same + # call in another host. + if e.code != LinstorVolumeManagerError.ERR_VOLUME_EXISTS: +- self._force_destroy_volume(volume_uuid) ++ self._destroy_volume(volume_uuid, force=True) + raise + + def _find_device_path(self, volume_uuid, volume_name): +@@ -2184,22 +2215,52 @@ class LinstorVolumeManager(object): + # Contains a path of the /dev/drbd form. + return resources[0].volumes[0].device_path + +- def _destroy_resource(self, resource_name): +- self._mark_resource_cache_as_dirty() ++ def _destroy_resource(self, resource_name, force=False): + result = self._linstor.resource_dfn_delete(resource_name) + error_str = self._get_error_str(result) +- if error_str: ++ if not error_str: ++ self._mark_resource_cache_as_dirty() ++ return ++ ++ if not force: ++ self._mark_resource_cache_as_dirty() + raise LinstorVolumeManagerError( +- 'Could not destroy resource `{}` from SR `{}`: {}' ++ 'Could not destroy resource `{}` from SR `{}`: {}' + .format(resource_name, self._group_name, error_str) + ) + +- def _destroy_volume(self, volume_uuid): ++ # If force is used, ensure there is no opener. ++ all_openers = get_all_volume_openers(resource_name, '0') ++ for openers in all_openers.itervalues(): ++ if openers: ++ self._mark_resource_cache_as_dirty() ++ raise LinstorVolumeManagerError( ++ 'Could not force destroy resource `{}` from SR `{}`: {} (openers=`{}`)' ++ .format(resource_name, self._group_name, error_str, all_openers) ++ ) ++ ++ # Maybe the resource is blocked in primary mode. DRBD/LINSTOR issue? ++ resource_states = filter( ++ lambda resource_state: resource_state.name == resource_name, ++ self._get_resource_cache().resource_states ++ ) ++ ++ # Mark only after computation of states. ++ self._mark_resource_cache_as_dirty() ++ ++ for resource_state in resource_states: ++ volume_state = resource_state.volume_states[0] ++ if resource_state.in_use: ++ demote_drbd_resource(resource_state.node_name, resource_name) ++ break ++ self._destroy_resource(resource_name) ++ ++ def _destroy_volume(self, volume_uuid, force=False): + volume_properties = self._get_volume_properties(volume_uuid) + try: + volume_name = volume_properties.get(self.PROP_VOLUME_NAME) + if volume_name in self._fetch_resource_names(): +- self._destroy_resource(volume_name) ++ self._destroy_resource(volume_name, force) + + # Assume this call is atomic. + volume_properties.clear() +@@ -2208,12 +2269,6 @@ class LinstorVolumeManager(object): + 'Cannot destroy volume `{}`: {}'.format(volume_uuid, e) + ) + +- def _force_destroy_volume(self, volume_uuid): +- try: +- self._destroy_volume(volume_uuid) +- except Exception as e: +- self._logger('Ignore fail: {}'.format(e)) +- + def _build_volumes(self, repair): + properties = self._kv_cache + resource_names = self._fetch_resource_names() +@@ -2283,7 +2338,7 @@ class LinstorVolumeManager(object): + # Little optimization, don't call `self._destroy_volume`, + # we already have resource name list. + if volume_name in resource_names: +- self._destroy_resource(volume_name) ++ self._destroy_resource(volume_name, force=True) + + # Assume this call is atomic. + properties.clear() +-- +2.45.2 + diff --git a/SOURCES/0098-fix-linstorvhdutil-ensure-we-retry-creation-in-all-s.patch b/SOURCES/0098-fix-linstorvhdutil-ensure-we-retry-creation-in-all-s.patch new file mode 100644 index 00000000..130a165d --- /dev/null +++ b/SOURCES/0098-fix-linstorvhdutil-ensure-we-retry-creation-in-all-s.patch @@ -0,0 +1,121 @@ +From a12dfe920174e4d88b5239702f5a15d44e06c6c8 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Tue, 6 Dec 2022 11:22:15 +0100 +Subject: [PATCH 098/175] fix(linstorvhdutil): ensure we retry creation in all + situations + +Without this patch, a basic resource creation is never restarted +after a failure. The classic situation is when a DRBD error is raised like +`Failed to adjust DRBD resource`. This problem is rare but it exists. + +Signed-off-by: Ronan Abhamon +--- + drivers/linstorvolumemanager.py | 74 ++++++++++++++++----------------- + 1 file changed, 35 insertions(+), 39 deletions(-) + +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 2e2feb2..81cce80 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -2044,9 +2044,25 @@ class LinstorVolumeManager(object): + self, volume_uuid, volume_name, size, place_resources, + no_diskless=False + ): ++ if no_diskless and not place_resources: ++ raise LinstorVolumeManagerError( ++ 'Could not create volume `{}` from SR `{}`: it\'s impossible ' ++ .format(volume_uuid, self._group_name) + ++ 'to force no diskless without placing resources' ++ ) ++ + size = self.round_up_volume_size(size) + self._mark_resource_cache_as_dirty() + ++ resources = [] ++ if no_diskless: ++ for node_name in self._get_node_names(): ++ resources.append(linstor.ResourceData( ++ node_name=node_name, ++ rsc_name=volume_name, ++ storage_pool=self._group_name ++ )) ++ + def create_definition(): + self._check_volume_creation_errors( + self._linstor.resource_group_spawn( +@@ -2060,39 +2076,6 @@ class LinstorVolumeManager(object): + ) + self._increase_volume_peer_slots(self._linstor, volume_name) + +- # A. Basic case when we use the default redundancy of the group. +- if not no_diskless: +- create_definition() +- if place_resources: +- self._check_volume_creation_errors( +- self._linstor.resource_auto_place( +- rsc_name=volume_name, +- place_count=self._redundancy, +- diskless_on_remaining=not no_diskless +- ), +- volume_uuid, +- self._group_name +- ) +- return +- +- # B. Complex case. +- if not place_resources: +- raise LinstorVolumeManagerError( +- 'Could not create volume `{}` from SR `{}`: it\'s impossible ' +- .format(volume_uuid, self._group_name) + +- 'to force no diskless without placing resources' +- ) +- +- # B.1. Create resource list. +- resources = [] +- for node_name in self._get_node_names(): +- resources.append(linstor.ResourceData( +- node_name=node_name, +- rsc_name=volume_name, +- storage_pool=self._group_name +- )) +- +- # B.2. Create volume! + def clean(): + try: + self._destroy_volume(volume_uuid, force=True) +@@ -2105,13 +2088,26 @@ class LinstorVolumeManager(object): + def create(): + try: + create_definition() +- result = self._linstor.resource_create(resources) +- error_str = self._get_error_str(result) +- if error_str: +- raise LinstorVolumeManagerError( +- 'Could not create volume `{}` from SR `{}`: {}'.format( +- volume_uuid, self._group_name, error_str ++ if no_diskless: ++ # Create a physical resource on each node. ++ result = self._linstor.resource_create(resources) ++ error_str = self._get_error_str(result) ++ if error_str: ++ raise LinstorVolumeManagerError( ++ 'Could not create volume `{}` from SR `{}`: {}'.format( ++ volume_uuid, self._group_name, error_str ++ ) + ) ++ elif place_resources: ++ # Basic case when we use the default redundancy of the group. ++ self._check_volume_creation_errors( ++ self._linstor.resource_auto_place( ++ rsc_name=volume_name, ++ place_count=self._redundancy, ++ diskless_on_remaining=not no_diskless ++ ), ++ volume_uuid, ++ self._group_name + ) + except LinstorVolumeManagerError as e: + if e.code != LinstorVolumeManagerError.ERR_VOLUME_EXISTS: +-- +2.45.2 + diff --git a/SOURCES/0099-fix-linstorvhdutil-don-t-retry-local-vhdutil-call-wh.patch b/SOURCES/0099-fix-linstorvhdutil-don-t-retry-local-vhdutil-call-wh.patch new file mode 100644 index 00000000..a4cabc5b --- /dev/null +++ b/SOURCES/0099-fix-linstorvhdutil-don-t-retry-local-vhdutil-call-wh.patch @@ -0,0 +1,158 @@ +From 4f1241af4c7e21308654fb4518fdf75b80012da6 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Wed, 7 Dec 2022 17:56:39 +0100 +Subject: [PATCH 099/175] fix(linstorvhdutil): don't retry local vhdutil call + when EROFS is detected + +Signed-off-by: Ronan Abhamon +--- + drivers/linstorvhdutil.py | 79 ++++++++++++++++++++++++--------------- + 1 file changed, 48 insertions(+), 31 deletions(-) + +diff --git a/drivers/linstorvhdutil.py b/drivers/linstorvhdutil.py +index c2e9665..63d59ab 100644 +--- a/drivers/linstorvhdutil.py ++++ b/drivers/linstorvhdutil.py +@@ -47,6 +47,14 @@ def call_vhd_util_on_host(session, host_ref, method, device_path, args): + return response + + ++class ErofsLinstorCallException(Exception): ++ def __init__(self, cmd_err): ++ self.cmd_err = cmd_err ++ ++ def __str__(self): ++ return str(self.cmd_err) ++ ++ + def linstorhostcall(local_method, remote_method): + def decorated(response_parser): + def wrapper(*args, **kwargs): +@@ -68,14 +76,17 @@ def linstorhostcall(local_method, remote_method): + local_e = None + try: + if not in_use or socket.gethostname() in node_names: +- # Don't call `_call_local_vhd_util`, we don't want to +- # trace failed calls now using opener files. It can be +- # normal to have an exception. +- def local_call(): +- return local_method(device_path, *args[2:], **kwargs) +- return util.retry(local_call, 5, 2) +- except util.CommandException as local_e: +- self._handle_local_vhd_util_error(local_e) ++ return self._call_local_vhd_util(local_method, device_path, *args[2:], **kwargs) ++ except ErofsLinstorCallException as e: ++ local_e = e.cmd_err ++ except Exception as e: ++ local_e = e ++ ++ util.SMlog( ++ 'unable to execute `{}` locally, retry using a readable host... (cause: {})'.format( ++ remote_method, local_e if local_e else 'local diskless + in use or not up to date' ++ ) ++ ) + + # B. Execute the plugin on master or slave. + remote_args = { +@@ -188,35 +199,35 @@ class LinstorVhdUtil: + + @linstormodifier() + def create(self, path, size, static, msize=0): +- return self._call_local_vhd_util(vhdutil.create, path, size, static, msize) ++ return self._call_local_vhd_util_or_fail(vhdutil.create, path, size, static, msize) + + @linstormodifier() + def set_size_virt_fast(self, path, size): +- return self._call_local_vhd_util(vhdutil.setSizeVirtFast, path, size) ++ return self._call_local_vhd_util_or_fail(vhdutil.setSizeVirtFast, path, size) + + @linstormodifier() + def set_size_phys(self, path, size, debug=True): +- return self._call_local_vhd_util(vhdutil.setSizePhys, path, size, debug) ++ return self._call_local_vhd_util_or_fail(vhdutil.setSizePhys, path, size, debug) + + @linstormodifier() + def set_parent(self, path, parentPath, parentRaw=False): +- return self._call_local_vhd_util(vhdutil.setParent, path, parentPath, parentRaw) ++ return self._call_local_vhd_util_or_fail(vhdutil.setParent, path, parentPath, parentRaw) + + @linstormodifier() + def set_hidden(self, path, hidden=True): +- return self._call_local_vhd_util(vhdutil.setHidden, path, hidden) ++ return self._call_local_vhd_util_or_fail(vhdutil.setHidden, path, hidden) + + @linstormodifier() + def set_key(self, path, key_hash): +- return self._call_local_vhd_util(vhdutil.setKey, path, key_hash) ++ return self._call_local_vhd_util_or_fail(vhdutil.setKey, path, key_hash) + + @linstormodifier() + def kill_data(self, path): +- return self._call_local_vhd_util(vhdutil.killData, path) ++ return self._call_local_vhd_util_or_fail(vhdutil.killData, path) + + @linstormodifier() + def snapshot(self, path, parent, parentRaw, msize=0, checkEmpty=True): +- return self._call_local_vhd_util(vhdutil.snapshot, path, parent, parentRaw, msize, checkEmpty) ++ return self._call_local_vhd_util_or_fail(vhdutil.snapshot, path, parent, parentRaw, msize, checkEmpty) + + # -------------------------------------------------------------------------- + # Remote setters: write locally and try on another host in case of failure. +@@ -299,21 +310,27 @@ class LinstorVhdUtil: + util.SMlog('raise opener exception: {} ({})'.format(e_wrapper, e_wrapper.reason)) + raise e_wrapper # pylint: disable = E0702 + +- @staticmethod +- def _handle_local_vhd_util_error(e): +- if e.code != errno.EROFS and e.code != EMEDIUMTYPE: +- util.SMlog('failed to execute locally vhd-util (sys {})'.format(e.code)) +- + def _call_local_vhd_util(self, local_method, device_path, *args, **kwargs): + try: + def local_call(): +- return local_method(device_path, *args, **kwargs) +- return util.retry(local_call, 5, 2) ++ try: ++ return local_method(device_path, *args, **kwargs) ++ except util.CommandException as e: ++ if e.code == errno.EROFS or e.code == EMEDIUMTYPE: ++ raise ErofsLinstorCallException(e) # Break retry calls. ++ raise e ++ # Retry only locally if it's not an EROFS exception. ++ return util.retry(local_call, 5, 2, exceptions=[util.CommandException]) + except util.CommandException as e: +- self._handle_local_vhd_util_error(e) ++ util.SMlog('failed to execute locally vhd-util (sys {})'.format(e.code)) ++ raise e + +- # Volume is locked on a host, find openers. +- self._raise_openers_exception(device_path, e) ++ def _call_local_vhd_util_or_fail(self, local_method, device_path, *args, **kwargs): ++ try: ++ return self._call_local_vhd_util(local_method, device_path, *args, **kwargs) ++ except ErofsLinstorCallException as e: ++ # Volume is locked on a host, find openers. ++ self._raise_openers_exception(device_path, e) + + def _call_vhd_util(self, local_method, remote_method, device_path, use_parent, *args, **kwargs): + # Note: `use_parent` exists to know if the VHD parent is used by the local/remote method. +@@ -323,11 +340,11 @@ class LinstorVhdUtil: + + # A. Try to write locally... + try: +- def local_call(): +- return local_method(device_path, *args, **kwargs) +- return util.retry(local_call, 5, 2) +- except util.CommandException as e: +- self._handle_local_vhd_util_error(e) ++ return self._call_local_vhd_util(local_method, device_path, *args, **kwargs) ++ except Exception: ++ pass ++ ++ util.SMlog('unable to execute `{}` locally, retry using a writable host...'.format(remote_method)) + + # B. Execute the command on another host. + # B.1. Get host list. +-- +2.45.2 + diff --git a/SOURCES/0100-feat-fork-log-daemon-ignore-SIGTERM.patch b/SOURCES/0100-feat-fork-log-daemon-ignore-SIGTERM.patch new file mode 100644 index 00000000..a6cbebdf --- /dev/null +++ b/SOURCES/0100-feat-fork-log-daemon-ignore-SIGTERM.patch @@ -0,0 +1,35 @@ +From 4b4e082a5e9fea8e1fb5ec158b1ca77f4e812665 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Thu, 15 Dec 2022 14:36:04 +0100 +Subject: [PATCH 100/175] feat(fork-log-daemon): ignore SIGTERM + +Without this patch, the output logs of the fork-log-daemon child +are never displayed when SIGTERM is sent to the PGID. + +Signed-off-by: Ronan Abhamon +--- + scripts/fork-log-daemon | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/scripts/fork-log-daemon b/scripts/fork-log-daemon +index eb0f0b0..665a60b 100755 +--- a/scripts/fork-log-daemon ++++ b/scripts/fork-log-daemon +@@ -1,12 +1,14 @@ + #!/usr/bin/env python + + import select ++import signal + import subprocess + import sys + import syslog + + def main(): + process = subprocess.Popen(sys.argv[1:], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) ++ signal.signal(signal.SIGTERM, signal.SIG_IGN) + write_to_stdout = True + + while process.poll() is None: +-- +2.45.2 + diff --git a/SOURCES/0101-feat-LinstorSR-wait-for-http-disk-server-startup.patch b/SOURCES/0101-feat-LinstorSR-wait-for-http-disk-server-startup.patch new file mode 100644 index 00000000..e8ff0753 --- /dev/null +++ b/SOURCES/0101-feat-LinstorSR-wait-for-http-disk-server-startup.patch @@ -0,0 +1,116 @@ +From 8ad803a9c30e925ac23baca07093e50021b613b0 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Fri, 16 Dec 2022 16:52:50 +0100 +Subject: [PATCH 101/175] feat(LinstorSR): wait for http-disk-server startup + +Avoid a race condition with NBD server. +We must be sure the HTTP server is reachable before the NBD server execution, +otherwise the HA activation may fail. + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 35 +++++++++++++++++------------------ + 1 file changed, 17 insertions(+), 18 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 9e5b3cd..f336534 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -2527,13 +2527,10 @@ class LinstorVDI(VDI.VDI): + + @staticmethod + def _start_persistent_http_server(volume_name): +- null = None + pid_path = None + http_server = None + + try: +- null = open(os.devnull, 'w') +- + if volume_name == 'xcp-persistent-ha-statefile': + port = '8076' + else: +@@ -2566,8 +2563,8 @@ class LinstorVDI(VDI.VDI): + util.SMlog('Starting {} on port {}...'.format(arguments[0], port)) + http_server = subprocess.Popen( + [FORK_LOG_DAEMON] + arguments, +- stdout=null, +- stderr=null, ++ stdout=subprocess.PIPE, ++ stderr=subprocess.STDOUT, + # Ensure we use another group id to kill this process without + # touch the current one. + preexec_fn=os.setsid +@@ -2576,6 +2573,17 @@ class LinstorVDI(VDI.VDI): + pid_path = '/run/http-server-{}.pid'.format(volume_name) + with open(pid_path, 'w') as pid_file: + pid_file.write(str(http_server.pid)) ++ ++ def is_ready(): ++ while http_server.poll() is None: ++ if http_server.stdout.readline().rstrip() == 'Server ready!': ++ return True ++ return False ++ try: ++ if not util.timeout_call(10, is_ready): ++ raise Exception('Failed to wait HTTP server startup, bad output') ++ except util.TimeoutException: ++ raise Exception('Failed to wait for HTTP server startup during given delay') + except Exception as e: + if pid_path: + try: +@@ -2594,19 +2602,13 @@ class LinstorVDI(VDI.VDI): + 'VDIUnavailable', + opterr='Failed to start http-server: {}'.format(e) + ) +- finally: +- if null: +- null.close() + + def _start_persistent_nbd_server(self, volume_name): +- null = None + pid_path = None + nbd_path = None + nbd_server = None + + try: +- null = open(os.devnull, 'w') +- + if volume_name == 'xcp-persistent-ha-statefile': + port = '8076' + else: +@@ -2643,6 +2645,10 @@ class LinstorVDI(VDI.VDI): + preexec_fn=os.setsid + ) + ++ pid_path = '/run/nbd-server-{}.pid'.format(volume_name) ++ with open(pid_path, 'w') as pid_file: ++ pid_file.write(str(nbd_server.pid)) ++ + reg_nbd_path = re.compile("^NBD `(/dev/nbd[0-9]+)` is now attached.$") + def get_nbd_path(): + while nbd_server.poll() is None: +@@ -2658,10 +2664,6 @@ class LinstorVDI(VDI.VDI): + except util.TimeoutException: + raise Exception('Unable to read NBD path') + +- pid_path = '/run/nbd-server-{}.pid'.format(volume_name) +- with open(pid_path, 'w') as pid_file: +- pid_file.write(str(nbd_server.pid)) +- + util.SMlog('Create symlink: {} -> {}'.format(self.path, nbd_path)) + os.symlink(nbd_path, self.path) + except Exception as e: +@@ -2688,9 +2690,6 @@ class LinstorVDI(VDI.VDI): + 'VDIUnavailable', + opterr='Failed to start nbd-server: {}'.format(e) + ) +- finally: +- if null: +- null.close() + + @classmethod + def _kill_persistent_server(self, type, volume_name, sig): +-- +2.45.2 + diff --git a/SOURCES/0102-fix-LinstorSR-handle-inflate-resize-actions-correctl.patch b/SOURCES/0102-fix-LinstorSR-handle-inflate-resize-actions-correctl.patch new file mode 100644 index 00000000..7671b154 --- /dev/null +++ b/SOURCES/0102-fix-LinstorSR-handle-inflate-resize-actions-correctl.patch @@ -0,0 +1,134 @@ +From fead430aa4d86c1e1e38740b168cc03ecd66a5e9 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Mon, 16 Jan 2023 17:58:51 +0100 +Subject: [PATCH 102/175] fix(LinstorSR): handle inflate + resize actions + correctly + +- Ensure LINSTOR set the expected new volume size when inflate is executed, + otherwise we log and we use the returned size. +- Repair deflate calls in case of journal entry, cache is not usable. +- Logs VHD and DRBD volume size in create/resize methods. +- Ensure resize is only executed on master. +- Use utilisation size instead of capacity in journal entries. + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 49 +++++++++++++++++++++++++++++++------------- + 1 file changed, 35 insertions(+), 14 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index f336534..72ec9de 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -234,7 +234,7 @@ def inflate(journaler, linstor, vdi_uuid, vdi_path, new_size, old_size): + return + + util.SMlog( +- 'Inflate {} (new VHD size={}, previous={})' ++ 'Inflate {} (size={}, previous={})' + .format(vdi_uuid, new_size, old_size) + ) + +@@ -243,8 +243,15 @@ def inflate(journaler, linstor, vdi_uuid, vdi_path, new_size, old_size): + ) + linstor.resize_volume(vdi_uuid, new_size) + ++ result_size = linstor.get_volume_size(vdi_uuid) ++ if result_size < new_size: ++ util.SMlog( ++ 'WARNING: Cannot inflate volume to {}B, result size: {}B' ++ .format(new_size, result_size) ++ ) ++ + if not util.zeroOut( +- vdi_path, new_size - vhdutil.VHD_FOOTER_SIZE, ++ vdi_path, result_size - vhdutil.VHD_FOOTER_SIZE, + vhdutil.VHD_FOOTER_SIZE + ): + raise xs_errors.XenError( +@@ -252,7 +259,7 @@ def inflate(journaler, linstor, vdi_uuid, vdi_path, new_size, old_size): + opterr='Failed to zero out VHD footer {}'.format(vdi_path) + ) + +- LinstorVhdUtil(None, linstor).set_size_phys(vdi_path, new_size, False) ++ LinstorVhdUtil(None, linstor).set_size_phys(vdi_path, result_size, False) + journaler.remove(LinstorJournaler.INFLATE, vdi_uuid) + + +@@ -1399,7 +1406,12 @@ class LinstorSR(SR.SR): + util.SMlog('Cannot deflate missing VDI {}'.format(vdi_uuid)) + return + +- current_size = self._all_volume_info_cache.get(self.uuid).virtual_size ++ assert not self._all_volume_info_cache ++ volume_info = self._linstor.get_volume_info(vdi_uuid) ++ ++ current_size = volume_info.virtual_size ++ assert current_size > 0 ++ + util.zeroOut( + vdi.path, + current_size - vhdutil.VHD_FOOTER_SIZE, +@@ -1695,11 +1707,11 @@ class LinstorVDI(VDI.VDI): + + # 2. Compute size and check space available. + size = vhdutil.validate_and_round_vhd_size(long(size)) +- util.SMlog('LinstorVDI.create: type={}, size={}'.format( +- self.vdi_type, size +- )) +- + volume_size = compute_volume_size(size, self.vdi_type) ++ util.SMlog( ++ 'LinstorVDI.create: type={}, vhd-size={}, volume-size={}' ++ .format(self.vdi_type, size, volume_size) ++ ) + self.sr._ensure_space_available(volume_size) + + # 3. Set sm_config attribute of VDI parent class. +@@ -1917,9 +1929,23 @@ class LinstorVDI(VDI.VDI): + + def resize(self, sr_uuid, vdi_uuid, size): + util.SMlog('LinstorVDI.resize for {}'.format(self.uuid)) ++ if not self.sr._is_master: ++ raise xs_errors.XenError( ++ 'VDISize', ++ opterr='resize on slave not allowed' ++ ) ++ + if self.hidden: + raise xs_errors.XenError('VDIUnavailable', opterr='hidden VDI') + ++ # Compute the virtual VHD and DRBD volume size. ++ size = vhdutil.validate_and_round_vhd_size(long(size)) ++ volume_size = compute_volume_size(size, self.vdi_type) ++ util.SMlog( ++ 'LinstorVDI.resize: type={}, vhd-size={}, volume-size={}' ++ .format(self.vdi_type, size, volume_size) ++ ) ++ + if size < self.size: + util.SMlog( + 'vdi_resize: shrinking not supported: ' +@@ -1927,18 +1953,13 @@ class LinstorVDI(VDI.VDI): + ) + raise xs_errors.XenError('VDISize', opterr='shrinking not allowed') + +- # Compute the virtual VHD size. +- size = vhdutil.validate_and_round_vhd_size(long(size)) +- + if size == self.size: + return VDI.VDI.get_params(self) + +- # Compute the LINSTOR volume size. +- new_volume_size = compute_volume_size(size, self.vdi_type) + if self.vdi_type == vhdutil.VDI_TYPE_RAW: + old_volume_size = self.size + else: +- old_volume_size = self.capacity ++ old_volume_size = self.utilisation + if self.sr._provisioning == 'thin': + # VDI is currently deflated, so keep it deflated. + new_volume_size = old_volume_size +-- +2.45.2 + diff --git a/SOURCES/0103-fix-linstor-manager-add-a-static-iptables-rule-for-D.patch b/SOURCES/0103-fix-linstor-manager-add-a-static-iptables-rule-for-D.patch new file mode 100644 index 00000000..cd1f364c --- /dev/null +++ b/SOURCES/0103-fix-linstor-manager-add-a-static-iptables-rule-for-D.patch @@ -0,0 +1,125 @@ +From 296db208f06e16c78b8b0252581e6cd8426f3876 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Tue, 17 Jan 2023 11:55:00 +0100 +Subject: [PATCH 103/175] fix(linstor-manager): add a static iptables rule for + DRBD volumes + +Using the XAPI iptables firewall may drop DRBD packets when the connection +tracking subsystem runs out of entries temporarily. + +Instead, use a static rule completely independent of the connection tracking +module, it allow packets to pass even when the connection tracking table +ran full temporarily. + +Signed-off-by: Ronan Abhamon +--- + drivers/linstor-manager | 48 ++++++++++++++++++++++++++++++++--------- + 1 file changed, 38 insertions(+), 10 deletions(-) + +diff --git a/drivers/linstor-manager b/drivers/linstor-manager +index 5c4c5c9..6ee435c 100755 +--- a/drivers/linstor-manager ++++ b/drivers/linstor-manager +@@ -40,11 +40,12 @@ LVM_PLUGIN = 'lvm.py' + THIN_POOL = 'thin_pool' + + FIREWALL_PORT_SCRIPT = '/etc/xapi.d/plugins/firewall-port' +-LINSTOR_PORTS = [3366, 3370, 3376, 3377, '7000:8000', 8076, 8077] ++LINSTOR_PORTS = [3366, 3370, 3376, 3377, 8076, 8077] ++DRBD_PORTS = '7000:8000' + + +-def update_port(port, open): +- fn = 'open' if open else 'close' ++def update_linstor_port(port, open_ports): ++ fn = 'open' if open_ports else 'close' + args = ( + FIREWALL_PORT_SCRIPT, fn, str(port), 'tcp' + ) +@@ -55,9 +56,36 @@ def update_port(port, open): + raise Exception('Failed to {} port: {} {}'.format(fn, out, err)) + + +-def update_all_ports(open): ++def has_iptables_rule(rule): ++ (ret, stdout, stderr) = util.doexec(['iptables', '-C'] + rule) ++ return not ret ++ ++ ++def update_drbd_ports(open_ports): ++ # We want to use a static rule regarding DRBD volumes, ++ # so we can't use the XAPI firewall port script, we have to manually ++ # check for existing rules before updating iptables service. ++ rule = ['INPUT', '-p', 'tcp', '--dport', DRBD_PORTS, '-j', 'ACCEPT'] ++ if open_ports == has_iptables_rule(rule): ++ return ++ if open_ports: ++ rule.insert(1, '1') ++ (ret, stdout, stderr) = util.doexec(['iptables', '-I'] + rule) ++ if ret: ++ raise Exception('Failed to add DRBD rule: {}'.format(stderr)) ++ else: ++ (ret, stdout, stderr) = util.doexec(['iptables', '-D'] + rule) ++ if ret: ++ raise Exception('Failed to remove DRBD rule: {}'.format(stderr)) ++ (ret, stdout, stderr) = util.doexec(['service', 'iptables', 'save']) ++ if ret: ++ raise Exception('Failed to save DRBD rule: {}'.format(stderr)) ++ ++ ++def update_all_ports(open_ports): + for port in LINSTOR_PORTS: +- update_port(port, open) ++ update_linstor_port(port, open_ports) ++ update_drbd_ports(open_ports) + + + def update_linstor_satellite_service(start): +@@ -202,7 +230,7 @@ def prepare_sr(session, args): + try: + LinstorSR.activate_lvm_group(args['groupName']) + +- update_all_ports(open=True) ++ update_all_ports(open_ports=True) + # We don't want to enable and start minidrbdcluster daemon during + # SR creation. + update_minidrbdcluster_service(start=False) +@@ -217,7 +245,7 @@ def release_sr(session, args): + try: + update_linstor_satellite_service(start=False) + update_minidrbdcluster_service(start=False) +- update_all_ports(open=False) ++ update_all_ports(open_ports=False) + return str(True) + except Exception as e: + util.SMlog('linstor-manager:release_sr error: {}'.format(e)) +@@ -533,7 +561,7 @@ def add_host(session, args): + + try: + # 4. Enable services. +- update_all_ports(open=True) ++ update_all_ports(open_ports=True) + update_minidrbdcluster_service(start=True) + update_linstor_satellite_service(start=True) + +@@ -664,7 +692,7 @@ def add_host(session, args): + if stop_services and not linstor.has_node(node_name): + update_linstor_satellite_service(start=False) + update_minidrbdcluster_service(start=False) +- update_all_ports(open=False) ++ update_all_ports(open_ports=False) + except Exception: + pass + +@@ -747,7 +775,7 @@ def remove_host(session, args): + try: + update_linstor_satellite_service(start=False) + update_minidrbdcluster_service(start=False) +- update_all_ports(open=False) ++ update_all_ports(open_ports=False) + except Exception as e: + util.SMlog('Error while stopping services: {}'.format(e)) + pass +-- +2.45.2 + diff --git a/SOURCES/0104-feat-LinstorSR-sync-with-last-http-nbd-transfer-vers.patch b/SOURCES/0104-feat-LinstorSR-sync-with-last-http-nbd-transfer-vers.patch new file mode 100644 index 00000000..6dbfdc08 --- /dev/null +++ b/SOURCES/0104-feat-LinstorSR-sync-with-last-http-nbd-transfer-vers.patch @@ -0,0 +1,122 @@ +From fd510146ef0d8873a12d6cbbb04340b7526a045f Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Fri, 3 Feb 2023 16:38:49 +0100 +Subject: [PATCH 104/175] feat(LinstorSR): sync with last http-nbd-transfer + version + +- Increase auto promote timeout of heartbeat VDI to reduce CPU usage +- Modify server regexes +- Force device size parameter of NBD servers + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 25 +++++++++++++++++++++---- + drivers/linstorvolumemanager.py | 19 +++++++++++++++++++ + 2 files changed, 40 insertions(+), 4 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 72ec9de..31f4505 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -1761,6 +1761,13 @@ class LinstorVDI(VDI.VDI): + METADATA_OF_POOL_TAG: '' + } + self._linstor.set_volume_metadata(self.uuid, volume_metadata) ++ ++ # Set the open timeout to 1min to reduce CPU usage ++ # in http-disk-server when a secondary server tries to open ++ # an already opened volume. ++ if self.ty == 'ha_statefile' or self.ty == 'redo_log': ++ self._linstor.set_auto_promote_timeout(self.uuid, 600) ++ + self._linstor.mark_volume_as_persistent(self.uuid) + except util.CommandException as e: + failed = True +@@ -2595,9 +2602,11 @@ class LinstorVDI(VDI.VDI): + with open(pid_path, 'w') as pid_file: + pid_file.write(str(http_server.pid)) + ++ reg_server_ready = re.compile("Server ready!$") + def is_ready(): + while http_server.poll() is None: +- if http_server.stdout.readline().rstrip() == 'Server ready!': ++ line = http_server.stdout.readline() ++ if reg_server_ready.search(line): + return True + return False + try: +@@ -2630,10 +2639,16 @@ class LinstorVDI(VDI.VDI): + nbd_server = None + + try: ++ # We use a precomputed device size. ++ # So if the XAPI is modified, we must update these values! + if volume_name == 'xcp-persistent-ha-statefile': ++ # See: https://github.com/xapi-project/xen-api/blob/703479fa448a8d7141954bb6e8964d8e25c4ac2e/ocaml/xapi/xha_statefile.ml#L32-L37 + port = '8076' ++ device_size = 4 * 1024 * 1024 + else: ++ # See: https://github.com/xapi-project/xen-api/blob/703479fa448a8d7141954bb6e8964d8e25c4ac2e/ocaml/database/redo_log.ml#L41-L44 + port = '8077' ++ device_size = 256 * 1024 * 1024 + + try: + session = util.timeout_call(5, util.get_localAPI_session) +@@ -2653,7 +2668,9 @@ class LinstorVDI(VDI.VDI): + '--nbd-name', + volume_name, + '--urls', +- ','.join(map(lambda ip: 'http://' + ip + ':' + port, ips)) ++ ','.join(map(lambda ip: 'http://' + ip + ':' + port, ips)), ++ '--device-size', ++ str(device_size) + ] + + util.SMlog('Starting {} using port {}...'.format(arguments[0], port)) +@@ -2670,11 +2687,11 @@ class LinstorVDI(VDI.VDI): + with open(pid_path, 'w') as pid_file: + pid_file.write(str(nbd_server.pid)) + +- reg_nbd_path = re.compile("^NBD `(/dev/nbd[0-9]+)` is now attached.$") ++ reg_nbd_path = re.compile("NBD `(/dev/nbd[0-9]+)` is now attached.$") + def get_nbd_path(): + while nbd_server.poll() is None: + line = nbd_server.stdout.readline() +- match = reg_nbd_path.match(line) ++ match = reg_nbd_path.search(line) + if match: + return match.group(1) + # Use a timeout to never block the smapi if there is a problem. +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 81cce80..e0f39e7 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -851,6 +851,25 @@ class LinstorVolumeManager(object): + ) + return size * 1024 + ++ ++ def set_auto_promote_timeout(self, volume_uuid, timeout): ++ """ ++ Define the blocking time of open calls when a DRBD ++ is already open on another host. ++ :param str volume_uuid: The volume uuid to modify. ++ """ ++ ++ volume_name = self.get_volume_name(volume_uuid) ++ result = self._linstor.resource_dfn_modify(volume_name, { ++ 'DrbdOptions/Resource/auto-promote-timeout': timeout ++ }) ++ error_str = self._get_error_str(result) ++ if error_str: ++ raise LinstorVolumeManagerError( ++ 'Could not change the auto promote timeout of `{}`: {}' ++ .format(volume_uuid, error_str) ++ ) ++ + def get_volume_info(self, volume_uuid): + """ + Get the volume info of a particular volume. +-- +2.45.2 + diff --git a/SOURCES/0105-fix-LinstorSR-don-t-check-VDI-metadata-while-listing.patch b/SOURCES/0105-fix-LinstorSR-don-t-check-VDI-metadata-while-listing.patch new file mode 100644 index 00000000..efe634c6 --- /dev/null +++ b/SOURCES/0105-fix-LinstorSR-don-t-check-VDI-metadata-while-listing.patch @@ -0,0 +1,38 @@ +From eea21b1624629f2c14815f39be8637c0561aa712 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Mon, 13 Feb 2023 17:24:16 +0100 +Subject: [PATCH 105/175] fix(LinstorSR): don't check VDI metadata while + listing VDIs if it's deleted + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 31f4505..41ece82 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -1169,6 +1169,9 @@ class LinstorSR(SR.SR): + if not introduce: + continue + ++ if vdi_uuid.startswith('DELETED_'): ++ continue ++ + volume_metadata = volumes_metadata.get(vdi_uuid) + if not volume_metadata: + util.SMlog( +@@ -1177,9 +1180,6 @@ class LinstorSR(SR.SR): + ) + continue + +- if vdi_uuid.startswith('DELETED_'): +- continue +- + util.SMlog( + 'Trying to introduce VDI {} as it is present in ' + 'LINSTOR and not in XAPI...' +-- +2.45.2 + diff --git a/SOURCES/0106-fix-LinstorSR-don-t-check-metadata-when-destroying-s.patch b/SOURCES/0106-fix-LinstorSR-don-t-check-metadata-when-destroying-s.patch new file mode 100644 index 00000000..4e07dbb3 --- /dev/null +++ b/SOURCES/0106-fix-LinstorSR-don-t-check-metadata-when-destroying-s.patch @@ -0,0 +1,35 @@ +From 57d6cc396c16026a9f3c8198cec90e53b23ae864 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Mon, 13 Feb 2023 17:27:43 +0100 +Subject: [PATCH 106/175] fix(LinstorSR): don't check metadata when destroying + snap in undo_clone + +Remove useless check in the snap rollback helper when there is an error +during the second `_create_snapshot` call (when VDI.clone command is executed). + +There is no reason to verify the metadata, this code is +present in the LVM driver, but is useless here. + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 41ece82..94cf1b7 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -1496,10 +1496,6 @@ class LinstorSR(SR.SR): + # Remove the child nodes. + if snap_uuid and snap_uuid in volume_names: + util.SMlog('Destroying snap {}...'.format(snap_uuid)) +- snap_metadata = self._linstor.get_volume_metadata(snap_uuid) +- +- if snap_metadata.get(VDI_TYPE_TAG) != vhdutil.VDI_TYPE_VHD: +- raise util.SMException('Clone {} not VHD'.format(snap_uuid)) + + try: + self._linstor.destroy_volume(snap_uuid) +-- +2.45.2 + diff --git a/SOURCES/0107-fix-linstorvhdutil-handle-correctly-generic-exceptio.patch b/SOURCES/0107-fix-linstorvhdutil-handle-correctly-generic-exceptio.patch new file mode 100644 index 00000000..76f8439a --- /dev/null +++ b/SOURCES/0107-fix-linstorvhdutil-handle-correctly-generic-exceptio.patch @@ -0,0 +1,63 @@ +From 063e62e873ef74d24518898b08ca9113f2b3c02c Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Wed, 15 Feb 2023 11:34:54 +0100 +Subject: [PATCH 107/175] fix(linstorvhdutil): handle correctly generic + exceptions in _raise_openers_exception + +Signed-off-by: Ronan Abhamon +--- + drivers/linstorvhdutil.py | 21 +++++++++++---------- + 1 file changed, 11 insertions(+), 10 deletions(-) + +diff --git a/drivers/linstorvhdutil.py b/drivers/linstorvhdutil.py +index 63d59ab..05225e8 100644 +--- a/drivers/linstorvhdutil.py ++++ b/drivers/linstorvhdutil.py +@@ -289,25 +289,26 @@ class LinstorVhdUtil: + # -------------------------------------------------------------------------- + + def _raise_openers_exception(self, device_path, e): ++ if isinstance(e, util.CommandException): ++ e_str = 'cmd: `{}`, code: `{}`, reason: `{}`'.format(e.cmd, e.code, e.reason) ++ else: ++ e_str = str(e) ++ + e_with_openers = None + try: + volume_uuid = self._linstor.get_volume_uuid_from_device_path( + device_path + ) +- e_wrapper = util.CommandException( +- e.code, +- e.cmd, +- e.reason + ' (openers: {})'.format( ++ e_wrapper = Exception( ++ e_str + ' (openers: {})'.format( + self._linstor.get_volume_openers(volume_uuid) + ) + ) + except Exception as illformed_e: +- e_wrapper = util.CommandException( +- e.code, +- e.cmd, +- e.reason + ' (unable to get openers: {})'.format(illformed_e) ++ e_wrapper = Exception( ++ e_str + ' (unable to get openers: {})'.format(illformed_e) + ) +- util.SMlog('raise opener exception: {} ({})'.format(e_wrapper, e_wrapper.reason)) ++ util.SMlog('raise opener exception: {}'.format(e_wrapper)) + raise e_wrapper # pylint: disable = E0702 + + def _call_local_vhd_util(self, local_method, device_path, *args, **kwargs): +@@ -330,7 +331,7 @@ class LinstorVhdUtil: + return self._call_local_vhd_util(local_method, device_path, *args, **kwargs) + except ErofsLinstorCallException as e: + # Volume is locked on a host, find openers. +- self._raise_openers_exception(device_path, e) ++ self._raise_openers_exception(device_path, e.cmd_err) + + def _call_vhd_util(self, local_method, remote_method, device_path, use_parent, *args, **kwargs): + # Note: `use_parent` exists to know if the VHD parent is used by the local/remote method. +-- +2.45.2 + diff --git a/SOURCES/0108-fix-minidrbdcluster-robustify-to-unmount-correctly-L.patch b/SOURCES/0108-fix-minidrbdcluster-robustify-to-unmount-correctly-L.patch new file mode 100644 index 00000000..56da4392 --- /dev/null +++ b/SOURCES/0108-fix-minidrbdcluster-robustify-to-unmount-correctly-L.patch @@ -0,0 +1,89 @@ +From cc5aeb3a19df3dba03761339684bc73abb984d76 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Thu, 16 Feb 2023 14:24:07 +0100 +Subject: [PATCH 108/175] fix(minidrbdcluster): robustify to unmount correctly + LINSTOR DB + +There is a small delay during which the database may not be unmounted +because there are still processes using it. So must retry in this case. +It's caused by the termination of the LINSTOR controller. + +Signed-off-by: Ronan Abhamon +--- + Makefile | 1 + + etc/systemd/system/var-lib-linstor.service | 2 +- + scripts/safe-umount | 39 ++++++++++++++++++++++ + 3 files changed, 41 insertions(+), 1 deletion(-) + create mode 100755 scripts/safe-umount + +diff --git a/Makefile b/Makefile +index 42058c8..72d7be3 100755 +--- a/Makefile ++++ b/Makefile +@@ -241,6 +241,7 @@ install: precheck + mkdir -p $(SM_STAGING)$(LIBEXEC) + install -m 755 scripts/fork-log-daemon $(SM_STAGING)$(LIBEXEC) + install -m 755 scripts/linstor-kv-tool $(SM_STAGING)$(BIN_DEST) ++ install -m 755 scripts/safe-umount $(SM_STAGING)$(LIBEXEC) + install -m 755 scripts/local-device-change $(SM_STAGING)$(LIBEXEC) + install -m 755 scripts/check-device-sharing $(SM_STAGING)$(LIBEXEC) + install -m 755 scripts/usb_change $(SM_STAGING)$(LIBEXEC) +diff --git a/etc/systemd/system/var-lib-linstor.service b/etc/systemd/system/var-lib-linstor.service +index d230d04..e9deb90 100644 +--- a/etc/systemd/system/var-lib-linstor.service ++++ b/etc/systemd/system/var-lib-linstor.service +@@ -17,5 +17,5 @@ Description=Mount filesystem for the LINSTOR controller + [Service] + Type=oneshot + ExecStart=/bin/mount -w /dev/drbd/by-res/xcp-persistent-database/0 /var/lib/linstor +-ExecStop=/bin/umount /var/lib/linstor ++ExecStop=/opt/xensource/libexec/safe-umount /var/lib/linstor + RemainAfterExit=true +diff --git a/scripts/safe-umount b/scripts/safe-umount +new file mode 100755 +index 0000000..9c1dcc4 +--- /dev/null ++++ b/scripts/safe-umount +@@ -0,0 +1,39 @@ ++#!/usr/bin/env python2 ++ ++import argparse ++import subprocess ++import sys ++import time ++ ++ ++def safe_umount(path): ++ retry_count = 10 ++ not_mounted_str = 'umount: {}: not mounted'.format(path) ++ ++ last_code = 0 ++ while retry_count: ++ proc = subprocess.Popen(['mountpoint', '-q', path]) ++ proc.wait() ++ if proc.returncode: ++ return 0 ++ ++ proc = subprocess.Popen(['umount', path], stderr=subprocess.PIPE) ++ (stdout, stderr) = proc.communicate() ++ if not proc.returncode: ++ return 0 ++ ++ error = stderr.strip() ++ if error == not_mounted_str: ++ return 0 ++ ++ retry_count -= 1 ++ last_code = proc.returncode ++ time.sleep(0.500) ++ return last_code ++ ++ ++if __name__ == '__main__': ++ parser = argparse.ArgumentParser() ++ parser.add_argument('path') ++ args = parser.parse_args() ++ sys.exit(safe_umount(args.path)) +-- +2.45.2 + diff --git a/SOURCES/0109-fix-minidrbdcluster-handle-correctly-KeyboardInterru.patch b/SOURCES/0109-fix-minidrbdcluster-handle-correctly-KeyboardInterru.patch new file mode 100644 index 00000000..376b2a10 --- /dev/null +++ b/SOURCES/0109-fix-minidrbdcluster-handle-correctly-KeyboardInterru.patch @@ -0,0 +1,37 @@ +From 7b89b35c98e8493a02a98d562f388deaf5a49085 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Mon, 20 Feb 2023 19:30:18 +0100 +Subject: [PATCH 109/175] fix(minidrbdcluster): handle correctly + KeyboardInterrupt with systemd units + +It's necessary to always add systemd services in the running list before +trying to start a service, because if a KeyboardInterrupt is sent, we can have +a running LINSTOR controller not present in the list, and then we can no longer +unmount /var/lib/linstor because the controller is never stopped... + +Signed-off-by: Ronan Abhamon +--- + scripts/minidrbdcluster | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/scripts/minidrbdcluster b/scripts/minidrbdcluster +index eae7cbf..03d6b01 100755 +--- a/scripts/minidrbdcluster ++++ b/scripts/minidrbdcluster +@@ -104,10 +104,11 @@ def process(events2, resources, running_services, status): + res_name, may_promote, promotion_score = m.groups() + if res_name in resources and may_promote == 'yes': + for systemd_unit in resources[res_name]['systemd-units']: +- if not ensure_systemd_started(systemd_unit): +- break + if systemd_unit not in running_services: + running_services.append(systemd_unit) ++ if not ensure_systemd_started(systemd_unit): ++ running_services.pop() ++ break + m = PEER_ROLE_RE.match(line) + if m: + res_name, conn_name, role = m.groups() +-- +2.45.2 + diff --git a/SOURCES/0110-feat-LinstorSR-use-drbd-reactor-instead-of-minidrbdc.patch b/SOURCES/0110-feat-LinstorSR-use-drbd-reactor-instead-of-minidrbdc.patch new file mode 100644 index 00000000..abfd50c9 --- /dev/null +++ b/SOURCES/0110-feat-LinstorSR-use-drbd-reactor-instead-of-minidrbdc.patch @@ -0,0 +1,621 @@ +From cc3f40a89621d1d4cf2978f2805f03f403d706b6 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Fri, 24 Feb 2023 14:28:29 +0100 +Subject: [PATCH 110/175] feat(LinstorSR): use drbd-reactor instead of + minidrbdcluster + +Signed-off-by: Ronan Abhamon +--- + Makefile | 7 -- + drivers/LinstorSR.py | 37 +++--- + drivers/linstor-manager | 67 +++++++++-- + drivers/linstorvolumemanager.py | 4 +- + etc/minidrbdcluster.ini | 14 --- + scripts/minidrbdcluster | 203 -------------------------------- + systemd/minidrbdcluster.service | 19 --- + 7 files changed, 76 insertions(+), 275 deletions(-) + delete mode 100644 etc/minidrbdcluster.ini + delete mode 100755 scripts/minidrbdcluster + delete mode 100644 systemd/minidrbdcluster.service + +diff --git a/Makefile b/Makefile +index 72d7be3..bc3e97f 100755 +--- a/Makefile ++++ b/Makefile +@@ -100,7 +100,6 @@ 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/ +-MINI_DRBD_CLUSTER_CONF_DIR := /etc/ + + SM_STAGING := $(DESTDIR) + SM_STAMP := $(MY_OBJ_DIR)/.staging_stamp +@@ -156,7 +155,6 @@ install: precheck + mkdir -p $(SM_STAGING)$(MPATH_CUSTOM_CONF_DIR) + mkdir -p $(SM_STAGING)$(MODPROBE_DIR) + mkdir -p $(SM_STAGING)$(LOGROTATE_DIR) +- mkdir -p $(SM_STAGING)$(MINI_DRBD_CLUSTER_CONF_DIR) + mkdir -p $(SM_STAGING)$(DEBUG_DEST) + mkdir -p $(SM_STAGING)$(BIN_DEST) + mkdir -p $(SM_STAGING)$(MASTER_SCRIPT_DEST) +@@ -184,8 +182,6 @@ install: precheck + $(SM_STAGING)/$(SYSTEMD_CONF_DIR)/linstor-satellite.service.d/ + install -m 644 etc/systemd/system/var-lib-linstor.service \ + $(SM_STAGING)/$(SYSTEMD_CONF_DIR) +- install -m 644 etc/minidrbdcluster.ini \ +- $(SM_STAGING)/$(MINI_DRBD_CLUSTER_CONF_DIR) + install -m 644 etc/make-dummy-sr.service \ + $(SM_STAGING)/$(SYSTEMD_SERVICE_DIR) + install -m 644 systemd/xs-sm.service \ +@@ -204,8 +200,6 @@ install: precheck + $(SM_STAGING)/$(SYSTEMD_SERVICE_DIR) + install -m 644 systemd/linstor-monitor.service \ + $(SM_STAGING)/$(SYSTEMD_SERVICE_DIR) +- install -m 644 systemd/minidrbdcluster.service \ +- $(SM_STAGING)/$(SYSTEMD_SERVICE_DIR) + for i in $(UDEV_RULES); do \ + install -m 644 udev/$$i.rules \ + $(SM_STAGING)$(UDEV_RULES_DIR); done +@@ -258,7 +252,6 @@ install: precheck + install -m 755 scripts/xe-getlunidentifier $(SM_STAGING)$(BIN_DEST) + install -m 755 scripts/make-dummy-sr $(SM_STAGING)$(LIBEXEC) + install -m 755 scripts/storage-init $(SM_STAGING)$(LIBEXEC) +- install -m 755 scripts/minidrbdcluster $(SM_STAGING)$(LIBEXEC) + + .PHONY: clean + clean: +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 94cf1b7..a3da28e 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -461,6 +461,10 @@ class LinstorSR(SR.SR): + return method(self, *args, **kwargs) + + def load(self, *args, **kwargs): ++ # Activate all LVMs to make drbd-reactor happy. ++ if self.srcmd.cmd == 'sr_attach': ++ activate_lvm_group(self._group_name) ++ + if not self._has_session: + if self.srcmd.cmd in ( + 'vdi_attach_from_config', +@@ -707,7 +711,7 @@ class LinstorSR(SR.SR): + ) + + # Ensure ports are opened and LINSTOR satellites +- # are activated. In the same time the minidrbdcluster instances ++ # are activated. In the same time the drbd-reactor instances + # must be stopped. + self._prepare_sr_on_all_hosts(self._group_name, enabled=True) + +@@ -730,9 +734,9 @@ class LinstorSR(SR.SR): + + try: + util.SMlog( +- "Finishing SR creation, enable minidrbdcluster on all hosts..." ++ "Finishing SR creation, enable drbd-reactor on all hosts..." + ) +- self._update_minidrbdcluster_on_all_hosts(enabled=True) ++ self._update_drbd_reactor_on_all_hosts(enabled=True) + except Exception as e: + try: + self._linstor.destroy() +@@ -777,7 +781,7 @@ class LinstorSR(SR.SR): + ) + + try: +- self._update_minidrbdcluster_on_all_hosts( ++ self._update_drbd_reactor_on_all_hosts( + controller_node_name=node_name, enabled=False + ) + +@@ -789,12 +793,12 @@ class LinstorSR(SR.SR): + ) + except Exception as e: + try: +- self._update_minidrbdcluster_on_all_hosts( ++ self._update_drbd_reactor_on_all_hosts( + controller_node_name=node_name, enabled=True + ) + except Exception as e2: + util.SMlog( +- 'Failed to restart minidrbdcluster after destroy fail: {}' ++ 'Failed to restart drbd-reactor after destroy fail: {}' + .format(e2) + ) + util.SMlog('Failed to delete LINSTOR SR: {}'.format(e)) +@@ -838,7 +842,6 @@ class LinstorSR(SR.SR): + 'SRUnavailable', + opterr='no such group: {}'.format(self._group_name) + ) +- activate_lvm_group(self._group_name) + + @_locked_load + def detach(self, uuid): +@@ -963,15 +966,15 @@ class LinstorSR(SR.SR): + for slave in util.get_all_slaves(self.session): + self._prepare_sr(slave, group_name, enabled) + +- def _update_minidrbdcluster(self, host, enabled): ++ def _update_drbd_reactor(self, host, enabled): + self._exec_manager_command( + host, +- 'updateMinidrbdcluster', ++ 'updateDrbdReactor', + {'enabled': str(enabled)}, + 'SRUnavailable' + ) + +- def _update_minidrbdcluster_on_all_hosts( ++ def _update_drbd_reactor_on_all_hosts( + self, enabled, controller_node_name=None + ): + if controller_node_name == 'localhost': +@@ -999,27 +1002,27 @@ class LinstorSR(SR.SR): + )) + + if enabled and controller_host: +- util.SMlog('{} minidrbdcluster on controller host `{}`...'.format( ++ util.SMlog('{} drbd-reactor on controller host `{}`...'.format( + action_name, controller_node_name + )) + # If enabled is true, we try to start the controller on the desired + # node name first. +- self._update_minidrbdcluster(controller_host, enabled) ++ self._update_drbd_reactor(controller_host, enabled) + + for host_ref, hostname in secondary_hosts: +- util.SMlog('{} minidrbdcluster on host {}...'.format( ++ util.SMlog('{} drbd-reactor on host {}...'.format( + action_name, hostname + )) +- self._update_minidrbdcluster(host_ref, enabled) ++ self._update_drbd_reactor(host_ref, enabled) + + if not enabled and controller_host: +- util.SMlog('{} minidrbdcluster on controller host `{}`...'.format( ++ util.SMlog('{} drbd-reactor on controller host `{}`...'.format( + action_name, controller_node_name + )) +- # If enabled is false, we disable the minidrbdcluster service of ++ # If enabled is false, we disable the drbd-reactor service of + # the controller host last. Why? Otherwise the linstor-controller + # of other nodes can be started, and we don't want that. +- self._update_minidrbdcluster(controller_host, enabled) ++ self._update_drbd_reactor(controller_host, enabled) + + # -------------------------------------------------------------------------- + # Metadata. +diff --git a/drivers/linstor-manager b/drivers/linstor-manager +index 6ee435c..7e34b5f 100755 +--- a/drivers/linstor-manager ++++ b/drivers/linstor-manager +@@ -22,6 +22,7 @@ sys.path[0] = '/opt/xensource/sm/' + + import base64 + import distutils.util ++import os + import socket + import XenAPI + import XenAPIPlugin +@@ -43,6 +44,19 @@ FIREWALL_PORT_SCRIPT = '/etc/xapi.d/plugins/firewall-port' + LINSTOR_PORTS = [3366, 3370, 3376, 3377, 8076, 8077] + DRBD_PORTS = '7000:8000' + ++DRBD_REACTOR_CONF = '/etc/drbd-reactor.d/sm-linstor.toml' ++ ++DRBD_REACTOR_CONF_CONTENT = """[[promoter]] ++ ++[promoter.resources.xcp-persistent-database] ++start = [ "var-lib-linstor.service", "linstor-controller.service" ] ++""" ++ ++DRBD_REACTOR_DEPS = [ ++ '/run/systemd/system/linstor-controller.service.d/reactor.conf', ++ '/run/systemd/system/var-lib-linstor.service.d/reactor.conf' ++] ++ + + def update_linstor_port(port, open_ports): + fn = 'open' if open_ports else 'close' +@@ -101,8 +115,35 @@ def update_linstor_satellite_service(start): + util.enable_and_start_service(service, True) + + +-def update_minidrbdcluster_service(start): +- util.enable_and_start_service('minidrbdcluster', start) ++def update_drbd_reactor_service(start): ++ if start: ++ util.atomicFileWrite(DRBD_REACTOR_CONF, None, DRBD_REACTOR_CONF_CONTENT) ++ else: ++ try: ++ os.remove(DRBD_REACTOR_CONF) ++ except Exception: ++ pass ++ ++ util.stop_service('drbd-reactor') ++ ++ try: ++ util.stop_service('drbd-promote@xcp\x2dpersistent\x2ddatabase.service') ++ except Exception as e: ++ if str(e).rstrip().endswith(' not loaded.'): ++ pass ++ raise e ++ ++ util.stop_service('linstor-controller') ++ util.stop_service('var-lib-linstor.service') ++ ++ for dep in DRBD_REACTOR_DEPS: ++ try: ++ os.remove(dep) ++ except Exception: ++ pass ++ ++ util.doexec(['systemctl', 'daemon-reload']) ++ util.enable_and_start_service('drbd-reactor', start) + + + def exec_create_sr(session, name, description, disks, volume_group, redundancy, provisioning, force): +@@ -231,9 +272,9 @@ def prepare_sr(session, args): + LinstorSR.activate_lvm_group(args['groupName']) + + update_all_ports(open_ports=True) +- # We don't want to enable and start minidrbdcluster daemon during ++ # We don't want to enable and start drbd-reactor daemon during + # SR creation. +- update_minidrbdcluster_service(start=False) ++ update_drbd_reactor_service(start=False) + update_linstor_satellite_service(start=True) + return str(True) + except Exception as e: +@@ -244,7 +285,7 @@ def prepare_sr(session, args): + def release_sr(session, args): + try: + update_linstor_satellite_service(start=False) +- update_minidrbdcluster_service(start=False) ++ update_drbd_reactor_service(start=False) + update_all_ports(open_ports=False) + return str(True) + except Exception as e: +@@ -252,14 +293,14 @@ def release_sr(session, args): + return str(False) + + +-def update_minidrbdcluster(session, args): ++def update_drbd_reactor(session, args): + try: + enabled = distutils.util.strtobool(args['enabled']) +- update_minidrbdcluster_service(start=enabled) ++ update_drbd_reactor_service(start=enabled) + return str(True) + except Exception as e: + util.SMlog( +- 'linstor-manager:update_minidrbdcluster error: {}'.format(e) ++ 'linstor-manager:update_drbd_reactor error: {}'.format(e) + ) + return str(False) + +@@ -308,7 +349,7 @@ def destroy(session, args): + try: + group_name = args['groupName'] + +- # When destroy is called, there are no running minidrbdcluster daemons. ++ # When destroy is called, there are no running drbd-reactor daemons. + # So the controllers are stopped too, we must start an instance. + util.restart_service('var-lib-linstor.service') + util.restart_service('linstor-controller') +@@ -562,7 +603,7 @@ def add_host(session, args): + try: + # 4. Enable services. + update_all_ports(open_ports=True) +- update_minidrbdcluster_service(start=True) ++ update_drbd_reactor_service(start=True) + update_linstor_satellite_service(start=True) + + # 5. Try to create local node. +@@ -691,7 +732,7 @@ def add_host(session, args): + # If we failed to remove the node, we don't stop services. + if stop_services and not linstor.has_node(node_name): + update_linstor_satellite_service(start=False) +- update_minidrbdcluster_service(start=False) ++ update_drbd_reactor_service(start=False) + update_all_ports(open_ports=False) + except Exception: + pass +@@ -774,7 +815,7 @@ def remove_host(session, args): + # 3. Stop services. + try: + update_linstor_satellite_service(start=False) +- update_minidrbdcluster_service(start=False) ++ update_drbd_reactor_service(start=False) + update_all_ports(open_ports=False) + except Exception as e: + util.SMlog('Error while stopping services: {}'.format(e)) +@@ -1005,7 +1046,7 @@ if __name__ == '__main__': + XenAPIPlugin.dispatch({ + 'prepareSr': prepare_sr, + 'releaseSr': release_sr, +- 'updateMinidrbdcluster': update_minidrbdcluster, ++ 'updateDrbdReactor': update_drbd_reactor, + 'attach': attach, + 'detach': detach, + 'destroy': destroy, +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index e0f39e7..4662043 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -1622,7 +1622,7 @@ class LinstorVolumeManager(object): + ) + finally: + # Controller must be stopped and volume unmounted because +- # it is the role of the minidrbdcluster daemon to do the right ++ # it is the role of the drbd-reactor daemon to do the right + # actions. + cls._start_controller(start=False) + cls._mount_volume( +@@ -2625,7 +2625,7 @@ class LinstorVolumeManager(object): + ) + + # We must modify the quorum. Otherwise we can't use correctly the +- # minidrbdcluster daemon. ++ # drbd-reactor daemon. + if auto_quorum: + result = lin.resource_dfn_modify(DATABASE_VOLUME_NAME, { + 'DrbdOptions/auto-quorum': 'disabled', +diff --git a/etc/minidrbdcluster.ini b/etc/minidrbdcluster.ini +deleted file mode 100644 +index 9e52342..0000000 +--- a/etc/minidrbdcluster.ini ++++ /dev/null +@@ -1,14 +0,0 @@ +-# minidrbdcluster keeps a service running on one of the nodes. +-# Quorum must be enabled in the DRBD resource! +-# +-# The section names are the names of DRBD resources. Within a +-# section name the systemd-units to activate on one of the nodes. +- +-[xcp-persistent-database] +-systemd-units=var-lib-linstor.service,linstor-controller.service +- +-[xcp-persistent-ha-statefile] +-systemd-units= +- +-[xcp-persistent-redo-log] +-systemd-units= +diff --git a/scripts/minidrbdcluster b/scripts/minidrbdcluster +deleted file mode 100755 +index 03d6b01..0000000 +--- a/scripts/minidrbdcluster ++++ /dev/null +@@ -1,203 +0,0 @@ +-#! /usr/bin/env python2 +- +-import configparser +-import re +-import signal +-import subprocess +- +-DRBDADM_OPEN_FAILED_RE = re.compile( +- 'open\\((.*)\\) failed: No such file or directory' +-) +-MAY_PROMOT_RE = re.compile( +- '(?:exists|change) resource name:((?:\\w|-)+) ' +- '(?:(?:\\w|-)+\\:(?:\\w|-)+ )*may_promote:(yes|no) promotion_score:(\\d+)' +-) +-PEER_ROLE_RE = re.compile( +- '(?:exists|change) connection name:((?:\\w|-)+) peer-node-id:(?:\\d+) ' +- 'conn-name:((?:\\w|-)+) (?:(?:\\w|-)+\\:(?:\\w|-)+ )*role:(Primary|Secondary|Unknown)' +-) +-HAVE_QUORUM_RE = re.compile( +- '(?:exists|change) device name:((?:\\w|-)+) ' +- '(?:(?:\\w|-)+\\:(?:\\w|-)+ )*quorum:(yes|no)' +-) +- +- +-class SigHupException(Exception): +- pass +- +- +-def sig_handler(sig, frame): +- raise SigHupException( +- 'Received signal ' + str(sig) + +- ' on line ' + str(frame.f_lineno) + +- ' in ' + frame.f_code.co_filename +- ) +- +- +-def preexec_subprocess(): +- signal.signal(signal.SIGINT, signal.SIG_IGN) +- +- +-def exec_subprocess(args): +- proc = subprocess.Popen(args, preexec_fn=preexec_subprocess) +- raise_sigint = False +- while True: +- try: +- proc.wait() +- break +- except KeyboardInterrupt: +- raise_sigint = True +- except: # noqa: E722 +- pass +- +- if raise_sigint: +- raise KeyboardInterrupt +- +- return proc.returncode +- +- +-def call_systemd(operation, service): +- verbose = operation in ('start', 'stop') +- if verbose: +- print('Trying to %s %s' % (operation, service)) +- ret = exec_subprocess(['systemctl', operation, service]) +- if verbose: +- print('%s for %s %s' % ( +- 'success' if ret == 0 else 'failure', operation, service +- )) +- return ret == 0 +- +- +-def ensure_systemd_started(service): +- if not exec_subprocess(['systemctl', 'is-active', '--quiet', service]): +- return True # Already active. +- +- return call_systemd('start', service) +- +- +-def show_status(services, status): +- print('status:') +- for systemd_unit in services: +- call_systemd('status', systemd_unit) +- for res_name in status: +- print('%s is %s' % (res_name, status[res_name])) +- +- +-def stop_services(services): +- for systemd_unit in reversed(services): +- call_systemd('stop', systemd_unit) +- +- +-def get_systemd_units(systemd_units_str): +- systemd_units = [] +- for systemd_unit in systemd_units_str.split(','): +- systemd_unit = systemd_unit.strip() +- if systemd_unit: +- systemd_units.append(systemd_unit) +- return systemd_units +- +- +-def process(events2, resources, running_services, status): +- line = events2.stdout.readline() +- m = MAY_PROMOT_RE.match(line) +- if m: +- res_name, may_promote, promotion_score = m.groups() +- if res_name in resources and may_promote == 'yes': +- for systemd_unit in resources[res_name]['systemd-units']: +- if systemd_unit not in running_services: +- running_services.append(systemd_unit) +- if not ensure_systemd_started(systemd_unit): +- running_services.pop() +- break +- m = PEER_ROLE_RE.match(line) +- if m: +- res_name, conn_name, role = m.groups() +- if res_name in status: +- status[res_name][conn_name] = role +- m = HAVE_QUORUM_RE.match(line) +- if m: +- res_name, have_quorum = m.groups() +- if res_name in resources and have_quorum == 'no': +- systemd_units = resources[res_name]['systemd-units'] +- to_stop = [x for x in systemd_units if x in running_services] +- if to_stop: +- print('Lost quorum on %s' % (res_name)) +- for systemd_unit in reversed(to_stop): +- r = call_systemd('stop', systemd_unit) +- if r: +- running_services.remove(systemd_unit) +- +- +-def active_drbd_volume(res_name): +- retry = True +- args = ['drbdadm', 'adjust', res_name] +- while True: +- proc = subprocess.Popen(args, stderr=subprocess.PIPE) +- (stdout, stderr) = proc.communicate() +- if not proc.returncode: +- return # Success. \o/ +- +- if not retry: +- break +- +- m = DRBDADM_OPEN_FAILED_RE.match(stderr) +- if m and subprocess.call(['lvchange', '-ay', m.groups()[0]]) == 0: +- retry = False +- else: +- break +- +- print('Failed to execute `{}`: {}'.format(args, stderr)) +- +- +-def main(): +- # 1. Load minidrbdcluster config. +- config = configparser.ConfigParser() +- config.read('/etc/minidrbdcluster.ini') +- resources = config._sections +- if not resources: +- raise Exception( +- 'No resources to watch, maybe /etc/minidrbdcluster.ini missing' +- ) +- print('Managing DRBD resources: %s' % (' '.join(resources))) +- +- # 2. Prepare resources. +- status = dict() +- all_services = [] # Contains common services between each DRBD volumes. +- for res_name, resource in resources.iteritems(): +- status[res_name] = dict() +- active_drbd_volume(res_name) +- systemd_units = get_systemd_units(resource['systemd-units']) +- resource['systemd-units'] = systemd_units +- +- for systemd_unit in systemd_units: +- if systemd_unit not in all_services: +- all_services.append(systemd_unit) +- +- # 3. Ensure all services are stopped. +- stop_services(all_services) +- +- # 4. Run! +- signal.signal(signal.SIGHUP, sig_handler) +- +- running_services = [] +- +- print('Starting process...') +- events2 = subprocess.Popen( +- ['drbdsetup', 'events2'], stdout=subprocess.PIPE +- ) +- run = True +- while run: +- try: +- process(events2, resources, running_services, status) +- except KeyboardInterrupt: +- run = False +- except SigHupException: +- show_status(running_services, status) +- except Exception: +- print('Unhandled exception: %s' % str(e)) +- +- print('Exiting...') +- stop_services(running_services) +- +-if __name__ == '__main__': +- main() +diff --git a/systemd/minidrbdcluster.service b/systemd/minidrbdcluster.service +deleted file mode 100644 +index 1ddf91f..0000000 +--- a/systemd/minidrbdcluster.service ++++ /dev/null +@@ -1,19 +0,0 @@ +-[Unit] +-Description=Minimalistic high-availability cluster resource manager +-Before=xs-sm.service +-Wants=network-online.target +-After=network-online.target +- +-[Service] +-Type=simple +-Environment=PYTHONUNBUFFERED=1 +-ExecStart=/opt/xensource/libexec/minidrbdcluster +-KillMode=process +-KillSignal=SIGINT +-SendSIGKILL=no +-StandardOutput=journal +-StandardError=journal +-SyslogIdentifier=minidrbdcluster +- +-[Install] +-WantedBy=multi-user.target +-- +2.45.2 + diff --git a/SOURCES/0111-fix-LinstorSR-ensure-vhdutil-calls-are-correctly-exe.patch b/SOURCES/0111-fix-LinstorSR-ensure-vhdutil-calls-are-correctly-exe.patch new file mode 100644 index 00000000..3c8ed6ed --- /dev/null +++ b/SOURCES/0111-fix-LinstorSR-ensure-vhdutil-calls-are-correctly-exe.patch @@ -0,0 +1,147 @@ +From 3e81ea7348e1c5cb03737274a3b3064b7e540723 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Wed, 1 Mar 2023 10:56:43 +0100 +Subject: [PATCH 111/175] fix(LinstorSR): ensure vhdutil calls are correctly + executed on pools with > 3 hosts + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 20 +++++++------------- + drivers/linstorvhdutil.py | 19 ++++++++++++++++--- + drivers/linstorvolumemanager.py | 8 ++++---- + 3 files changed, 27 insertions(+), 20 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index a3da28e..10e0f54 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -1884,9 +1884,12 @@ class LinstorVDI(VDI.VDI): + return self._attach_using_http_nbd() + + if not util.pathexists(self.path): +- raise xs_errors.XenError( +- 'VDIUnavailable', opterr='Could not find: {}'.format(self.path) +- ) ++ # Ensure we have a path... ++ self._linstor.get_device_path(vdi_uuid) ++ if not util.pathexists(self.path): ++ raise xs_errors.XenError( ++ 'VDIUnavailable', opterr='Could not find: {}'.format(self.path) ++ ) + + self.attached = True + return VDI.VDI.attach(self, self.sr.uuid, self.uuid) +@@ -2137,16 +2140,7 @@ class LinstorVDI(VDI.VDI): + self.size = volume_info.virtual_size + self.parent = '' + else: +- try: +- vhd_info = self.sr._vhdutil.get_vhd_info(self.uuid) +- except util.CommandException as e: +- if e.code != errno.ENOENT: +- raise +- # Path doesn't exist. Probably a diskless without local path. +- # Force creation and retry. +- self._linstor.get_device_path(self.uuid) +- vhd_info = self.sr._vhdutil.get_vhd_info(self.uuid) +- ++ vhd_info = self.sr._vhdutil.get_vhd_info(self.uuid) + self.hidden = vhd_info.hidden + self.size = vhd_info.sizeVirt + self.parent = vhd_info.parentUuid +diff --git a/drivers/linstorvhdutil.py b/drivers/linstorvhdutil.py +index 05225e8..c1b817d 100644 +--- a/drivers/linstorvhdutil.py ++++ b/drivers/linstorvhdutil.py +@@ -47,7 +47,7 @@ def call_vhd_util_on_host(session, host_ref, method, device_path, args): + return response + + +-class ErofsLinstorCallException(Exception): ++class LinstorCallException(Exception): + def __init__(self, cmd_err): + self.cmd_err = cmd_err + +@@ -55,6 +55,14 @@ class ErofsLinstorCallException(Exception): + return str(self.cmd_err) + + ++class ErofsLinstorCallException(LinstorCallException): ++ pass ++ ++ ++class NoPathLinstorCallException(LinstorCallException): ++ pass ++ ++ + def linstorhostcall(local_method, remote_method): + def decorated(response_parser): + def wrapper(*args, **kwargs): +@@ -70,12 +78,12 @@ def linstorhostcall(local_method, remote_method): + + # Try to read locally if the device is not in use or if the device + # is up to date and not diskless. +- (node_names, in_use) = \ ++ (node_names, in_use_by) = \ + self._linstor.find_up_to_date_diskful_nodes(vdi_uuid) + + local_e = None + try: +- if not in_use or socket.gethostname() in node_names: ++ if not in_use_by or socket.gethostname() in node_names: + return self._call_local_vhd_util(local_method, device_path, *args[2:], **kwargs) + except ErofsLinstorCallException as e: + local_e = e.cmd_err +@@ -88,6 +96,9 @@ def linstorhostcall(local_method, remote_method): + ) + ) + ++ if in_use_by: ++ node_names = {in_use_by} ++ + # B. Execute the plugin on master or slave. + remote_args = { + 'devicePath': device_path, +@@ -319,6 +330,8 @@ class LinstorVhdUtil: + except util.CommandException as e: + if e.code == errno.EROFS or e.code == EMEDIUMTYPE: + raise ErofsLinstorCallException(e) # Break retry calls. ++ if e.code == errno.ENOENT: ++ raise NoPathLinstorCallException(e) + raise e + # Retry only locally if it's not an EROFS exception. + return util.retry(local_call, 5, 2, exceptions=[util.CommandException]) +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 4662043..5ab83c4 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -1410,12 +1410,12 @@ class LinstorVolumeManager(object): + The disk must be up to data to be used. + :param str volume_uuid: The volume to use. + :return: The available nodes. +- :rtype: tuple(set(str), bool) ++ :rtype: tuple(set(str), str) + """ + + volume_name = self.get_volume_name(volume_uuid) + +- in_use = False ++ in_use_by = None + node_names = set() + + resource_states = filter( +@@ -1428,9 +1428,9 @@ class LinstorVolumeManager(object): + if volume_state.disk_state == 'UpToDate': + node_names.add(resource_state.node_name) + if resource_state.in_use: +- in_use = True ++ in_use_by = resource_state.node_name + +- return (node_names, in_use) ++ return (node_names, in_use_by) + + def invalidate_resource_cache(self): + """ +-- +2.45.2 + diff --git a/SOURCES/0112-fix-LinstorSR-replace-bad-param-in-detach_thin-impl.patch b/SOURCES/0112-fix-LinstorSR-replace-bad-param-in-detach_thin-impl.patch new file mode 100644 index 00000000..d1fd82b9 --- /dev/null +++ b/SOURCES/0112-fix-LinstorSR-replace-bad-param-in-detach_thin-impl.patch @@ -0,0 +1,28 @@ +From 7213113e00cb6520e43fe829f241ce5c8624b0ac Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Thu, 9 Mar 2023 17:06:59 +0100 +Subject: [PATCH 112/175] fix(LinstorSR): replace bad param in detach_thin impl + +To get the physical size, the volume UUID must be used, not the path. + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 10e0f54..c42f07d 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -215,7 +215,7 @@ def detach_thin(session, linstor, sr_uuid, vdi_uuid): + new_volume_size = LinstorVolumeManager.round_up_volume_size( + # TODO: Replace pylint comment with this feature when possible: + # https://github.com/PyCQA/pylint/pull/2926 +- LinstorVhdUtil(session, linstor).get_size_phys(device_path) # pylint: disable = E1120 ++ LinstorVhdUtil(session, linstor).get_size_phys(vdi_uuid) # pylint: disable = E1120 + ) + + volume_info = linstor.get_volume_info(vdi_uuid) +-- +2.45.2 + diff --git a/SOURCES/0113-fix-linstorvolumemanager-remove-usage-of-realpath.patch b/SOURCES/0113-fix-linstorvolumemanager-remove-usage-of-realpath.patch new file mode 100644 index 00000000..e9dcbb73 --- /dev/null +++ b/SOURCES/0113-fix-linstorvolumemanager-remove-usage-of-realpath.patch @@ -0,0 +1,56 @@ +From a1fc2e8fad3bbc7b026da58a12f9b02443064276 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Fri, 10 Mar 2023 18:11:10 +0100 +Subject: [PATCH 113/175] fix(linstorvolumemanager): remove usage of realpath + +Because a diskless DRBD path not always exist, get_volume_name_from_device_path can fail. +It's easy to reproduce using > 4 hosts and with a call to linstorvhdutil.get_vhd_info: +This problem can occur if the parent of a VHD is not on the same machine and if this parent doesn't have a DRBD path locally. + +Signed-off-by: Ronan Abhamon +--- + drivers/linstorvolumemanager.py | 23 ++++++----------------- + 1 file changed, 6 insertions(+), 17 deletions(-) + +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 5ab83c4..8befb33 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -914,28 +914,17 @@ class LinstorVolumeManager(object): + + def get_volume_name_from_device_path(self, device_path): + """ +- Get the volume name of a device_path on the current host. ++ Get the volume name of a device_path. + :param str device_path: The dev path to find the volume name. +- :return: The volume name of the local device path. ++ :return: The volume name of the device path. + :rtype: str + """ + +- node_name = socket.gethostname() +- +- resources = filter( +- lambda resource: resource.node_name == node_name, +- self._get_resource_cache().resources +- ) +- +- real_device_path = os.path.realpath(device_path) +- for resource in resources: +- if resource.volumes[0].device_path == real_device_path: +- return resource.name ++ assert device_path.startswith(DRBD_BY_RES_PATH) + +- raise LinstorVolumeManagerError( +- 'Unable to find volume name from dev path `{}`' +- .format(device_path) +- ) ++ res_name_end = device_path.find('/', len(DRBD_BY_RES_PATH)) ++ assert res_name_end != -1 ++ return device_path[len(DRBD_BY_RES_PATH):res_name_end] + + def update_volume_uuid(self, volume_uuid, new_volume_uuid, force=False): + """ +-- +2.45.2 + diff --git a/SOURCES/0114-fix-linstorvhdutil-avoid-parent-path-resolution.patch b/SOURCES/0114-fix-linstorvhdutil-avoid-parent-path-resolution.patch new file mode 100644 index 00000000..41fe7f68 --- /dev/null +++ b/SOURCES/0114-fix-linstorvhdutil-avoid-parent-path-resolution.patch @@ -0,0 +1,111 @@ +From 04ac5c5f64864623255983e707aa389be51e202b Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Thu, 16 Mar 2023 18:54:46 +0100 +Subject: [PATCH 114/175] fix(linstorvhdutil): avoid parent path resolution + +When many hosts are used (>= 4), we can fail to get +VHD info (with parent option) because the local parent VDI +path can be absent (no DRBD diskless path). So it's necessary +to deactivate parent resolution: +- vhdutil has been patched to support that +- vhdutil returns a relative path now when "-u" option is used + +Signed-off-by: Ronan Abhamon +--- + drivers/linstor-manager | 2 +- + drivers/linstorvhdutil.py | 9 ++++++--- + drivers/linstorvolumemanager.py | 13 ++++++++++--- + drivers/vhdutil.py | 5 ++++- + 4 files changed, 21 insertions(+), 8 deletions(-) + +diff --git a/drivers/linstor-manager b/drivers/linstor-manager +index 7e34b5f..9e96aac 100755 +--- a/drivers/linstor-manager ++++ b/drivers/linstor-manager +@@ -400,7 +400,7 @@ def get_vhd_info(session, args): + ) + + vhd_info = vhdutil.getVHDInfo( +- device_path, extract_uuid, include_parent ++ device_path, extract_uuid, include_parent, False + ) + return json.dumps(vhd_info.__dict__) + except Exception as e: +diff --git a/drivers/linstorvhdutil.py b/drivers/linstorvhdutil.py +index c1b817d..8b6985d 100644 +--- a/drivers/linstorvhdutil.py ++++ b/drivers/linstorvhdutil.py +@@ -143,8 +143,8 @@ class LinstorVhdUtil: + + def check(self, vdi_uuid, ignore_missing_footer=False, fast=False): + kwargs = { +- 'ignoreMissingFooter': str(ignore_missing_footer), +- 'fast': str(fast) ++ 'ignoreMissingFooter': ignore_missing_footer, ++ 'fast': fast + } + return self._check(vdi_uuid, **kwargs) # pylint: disable = E1123 + +@@ -153,7 +153,10 @@ class LinstorVhdUtil: + return distutils.util.strtobool(response) + + def get_vhd_info(self, vdi_uuid, include_parent=True): +- kwargs = {'includeParent': str(include_parent)} ++ kwargs = { ++ 'includeParent': include_parent, ++ 'resolveParent': False ++ } + # TODO: Replace pylint comment with this feature when possible: + # https://github.com/PyCQA/pylint/pull/2926 + return self._get_vhd_info(vdi_uuid, self._extract_uuid, **kwargs) # pylint: disable = E1123 +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 8befb33..91db3d8 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -920,11 +920,18 @@ class LinstorVolumeManager(object): + :rtype: str + """ + +- assert device_path.startswith(DRBD_BY_RES_PATH) ++ # Assume that we have a path like this: ++ # - "/dev/drbd/by-res/xcp-volume-/0" ++ # - "../xcp-volume-/0" ++ if device_path.startswith(DRBD_BY_RES_PATH): ++ prefix_len = len(DRBD_BY_RES_PATH) ++ else: ++ assert device_path.startswith('../') ++ prefix_len = 3 + +- res_name_end = device_path.find('/', len(DRBD_BY_RES_PATH)) ++ res_name_end = device_path.find('/', prefix_len) + assert res_name_end != -1 +- return device_path[len(DRBD_BY_RES_PATH):res_name_end] ++ return device_path[prefix_len:res_name_end] + + def update_volume_uuid(self, volume_uuid, new_volume_uuid, force=False): + """ +diff --git a/drivers/vhdutil.py b/drivers/vhdutil.py +index d75edb1..48337f8 100755 +--- a/drivers/vhdutil.py ++++ b/drivers/vhdutil.py +@@ -100,13 +100,16 @@ def fullSizeVHD(virtual_size): + def ioretry(cmd, errlist=[errno.EIO, errno.EAGAIN]): + return util.ioretry(lambda: util.pread2(cmd), errlist) + +-def getVHDInfo(path, extractUuidFunction, includeParent = True): ++def getVHDInfo(path, extractUuidFunction, includeParent=True, resolveParent=True): + """Get the VHD info. The parent info may optionally be omitted: vhd-util + tries to verify the parent by opening it, which results in error if the VHD + resides on an inactive LV""" + opts = "-vsf" + if includeParent: + opts += "p" ++ if not resolveParent: ++ opts += "u" ++ + cmd = [VHD_UTIL, "query", OPT_LOG_ERR, opts, "-n", path] + ret = ioretry(cmd) + fields = ret.strip().split('\n') +-- +2.45.2 + diff --git a/SOURCES/0115-fix-LinstorSR-create-parent-path-during-attach.patch b/SOURCES/0115-fix-LinstorSR-create-parent-path-during-attach.patch new file mode 100644 index 00000000..d6f93956 --- /dev/null +++ b/SOURCES/0115-fix-LinstorSR-create-parent-path-during-attach.patch @@ -0,0 +1,41 @@ +From 126e4d7f73c6623faad921d711400edc60bbc953 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Fri, 17 Mar 2023 12:06:08 +0100 +Subject: [PATCH 115/175] fix(LinstorSR): create parent path during attach + +It's necessary to force DRBD diskless path creation when +a VDI is attached. Otherwise the attach can fail on pool with +>= 4 hosts. + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index c42f07d..48feec7 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -1883,13 +1883,14 @@ class LinstorVDI(VDI.VDI): + ): + return self._attach_using_http_nbd() + +- if not util.pathexists(self.path): +- # Ensure we have a path... +- self._linstor.get_device_path(vdi_uuid) +- if not util.pathexists(self.path): ++ # Ensure we have a path... ++ while vdi_uuid: ++ path = self._linstor.get_device_path(vdi_uuid) ++ if not util.pathexists(path): + raise xs_errors.XenError( +- 'VDIUnavailable', opterr='Could not find: {}'.format(self.path) ++ 'VDIUnavailable', opterr='Could not find: {}'.format(path) + ) ++ vdi_uuid = self.sr._vhdutil.get_vhd_info(vdi_uuid).parentUuid + + self.attached = True + return VDI.VDI.attach(self, self.sr.uuid, self.uuid) +-- +2.45.2 + diff --git a/SOURCES/0116-fix-LinstorSR-retry-if-we-can-t-build-volume-cache.patch b/SOURCES/0116-fix-LinstorSR-retry-if-we-can-t-build-volume-cache.patch new file mode 100644 index 00000000..942fe8ae --- /dev/null +++ b/SOURCES/0116-fix-LinstorSR-retry-if-we-can-t-build-volume-cache.patch @@ -0,0 +1,33 @@ +From 5d6f7147e4254b8cdf5d171246570cf880d5ba3d Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Mon, 3 Apr 2023 10:03:57 +0200 +Subject: [PATCH 116/175] fix(LinstorSR): retry if we can't build volume cache + +Otherwise after SR creation, the master PBD can be unplugged. +See: https://xcp-ng.org/forum/post/60726 + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 48feec7..324033a 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -1553,7 +1553,11 @@ class LinstorSR(SR.SR): + def _create_linstor_cache(self): + self._all_volume_metadata_cache = \ + self._linstor.get_volumes_with_metadata() +- self._all_volume_info_cache = self._linstor.get_volumes_with_info() ++ self._all_volume_info_cache = util.retry( ++ self._linstor.get_volumes_with_info, ++ maxretry=10, ++ period=1 ++ ) + + def _destroy_linstor_cache(self): + self._all_volume_info_cache = None +-- +2.45.2 + diff --git a/SOURCES/0117-fix-linstorvolumemanager-reduce-peer-slots-param-to-.patch b/SOURCES/0117-fix-linstorvolumemanager-reduce-peer-slots-param-to-.patch new file mode 100644 index 00000000..a3c21aac --- /dev/null +++ b/SOURCES/0117-fix-linstorvolumemanager-reduce-peer-slots-param-to-.patch @@ -0,0 +1,57 @@ +From ba333e163a620b32f3f50d318b92cbdf4b36c56e Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Tue, 25 Apr 2023 10:46:00 +0200 +Subject: [PATCH 117/175] fix(linstorvolumemanager): reduce peer-slots param to + 3 + +Because we use 3 backing disks at most, it's useless to increase the default linstor limit (8). +Diskless is a resource that does not count in the peer-slots param. + +Note: this change is important to reduce the RAM usage, see => +https://linbit.com/drbd-user-guide/drbd-guide-9_0-en/#s-meta-data-size +Signed-off-by: Ronan Abhamon +--- + drivers/linstorvolumemanager.py | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 91db3d8..6f20c02 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -2089,7 +2089,7 @@ class LinstorVolumeManager(object): + volume_uuid, + self._group_name + ) +- self._increase_volume_peer_slots(self._linstor, volume_name) ++ self._configure_volume_peer_slots(self._linstor, volume_name) + + def clean(): + try: +@@ -2475,12 +2475,12 @@ class LinstorVolumeManager(object): + ) + + @classmethod +- def _increase_volume_peer_slots(cls, lin, volume_name): +- result = lin.resource_dfn_modify(volume_name, {}, peer_slots=31) ++ def _configure_volume_peer_slots(cls, lin, volume_name): ++ result = lin.resource_dfn_modify(volume_name, {}, peer_slots=3) + error_str = cls._get_error_str(result) + if error_str: + raise LinstorVolumeManagerError( +- 'Could not increase volume peer slots of {}: {}' ++ 'Could not configure volume peer slots of {}: {}' + .format(volume_name, error_str) + ) + +@@ -2581,7 +2581,7 @@ class LinstorVolumeManager(object): + vlm_sizes=['{}B'.format(size)], + definitions_only=True + ), DATABASE_VOLUME_NAME, group_name) +- cls._increase_volume_peer_slots(lin, DATABASE_VOLUME_NAME) ++ cls._configure_volume_peer_slots(lin, DATABASE_VOLUME_NAME) + + # Create real resources on the first nodes. + resources = [] +-- +2.45.2 + diff --git a/SOURCES/0118-fix-LinstorSR-attach-a-valid-XAPI-session-is_open-is.patch b/SOURCES/0118-fix-LinstorSR-attach-a-valid-XAPI-session-is_open-is.patch new file mode 100644 index 00000000..e4b78363 --- /dev/null +++ b/SOURCES/0118-fix-LinstorSR-attach-a-valid-XAPI-session-is_open-is.patch @@ -0,0 +1,31 @@ +From 43241b09b329987a0407e0d7c50f7d7f5ed67d4c Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Tue, 25 Apr 2023 11:20:55 +0200 +Subject: [PATCH 118/175] fix(LinstorSR): attach a valid XAPI session is_open + is called + +Signed-off-by: Ronan Abhamon +--- + drivers/on_slave.py | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/drivers/on_slave.py b/drivers/on_slave.py +index bbef4f7..a197660 100755 +--- a/drivers/on_slave.py ++++ b/drivers/on_slave.py +@@ -125,6 +125,12 @@ def _is_open(session, args): + + driver = SR.driver(srType) + sr = driver(cmd, sr_uuid) ++ ++ # session_ref param is required to have a valid session when SR object is created. ++ # It's not the case here, so attach the current session object to make LinstorSR happy. ++ if srType == 'linstor': ++ sr.session = session ++ + vdi = sr.vdi(vdiUuid) + tapdisk = blktap2.Tapdisk.find_by_path(vdi.path) + util.SMlog("Tapdisk for %s: %s" % (vdi.path, tapdisk)) +-- +2.45.2 + diff --git a/SOURCES/0119-fix-LinstorSR-ensure-we-always-have-a-DRBD-path-to-s.patch b/SOURCES/0119-fix-LinstorSR-ensure-we-always-have-a-DRBD-path-to-s.patch new file mode 100644 index 00000000..ecb0af90 --- /dev/null +++ b/SOURCES/0119-fix-LinstorSR-ensure-we-always-have-a-DRBD-path-to-s.patch @@ -0,0 +1,28 @@ +From bea8bbb3a20b59fd8e4ecaedd5dc74c9e72ffe9b Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Fri, 28 Apr 2023 10:43:27 +0200 +Subject: [PATCH 119/175] fix(LinstorSR): ensure we always have a DRBD path to + snap + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 324033a..8c0b007 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -2392,6 +2392,9 @@ class LinstorVDI(VDI.VDI): + elif depth >= vhdutil.MAX_CHAIN_SIZE: + raise xs_errors.XenError('SnapshotChainTooLong') + ++ # Ensure we have a valid path if we don't have a local diskful. ++ self.sr._linstor.get_device_path(self.uuid) ++ + volume_path = self.path + if not util.pathexists(volume_path): + raise xs_errors.XenError( +-- +2.45.2 + diff --git a/SOURCES/0120-fix-LinstorSR-remove-hosts-ips-param.patch b/SOURCES/0120-fix-LinstorSR-remove-hosts-ips-param.patch new file mode 100644 index 00000000..6760e251 --- /dev/null +++ b/SOURCES/0120-fix-LinstorSR-remove-hosts-ips-param.patch @@ -0,0 +1,168 @@ +From 964e328f78b4d337fc2f3b3d57d2db21847012f7 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Tue, 30 May 2023 11:19:13 +0200 +Subject: [PATCH 120/175] fix(LinstorSR): remove hosts/ips param + +--- + drivers/LinstorSR.py | 47 +++++---------------------------- + drivers/linstorvolumemanager.py | 11 +++----- + 2 files changed, 11 insertions(+), 47 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 8c0b007..7a9cbac 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -100,8 +100,6 @@ CAPABILITIES = [ + + CONFIGURATION = [ + ['group-name', 'LVM group name'], +- ['hosts', 'host names to use'], +- ['ips', 'ips to use (optional, defaults to management networks)'], + ['redundancy', 'replication count'], + ['provisioning', '"thin" or "thick" are accepted (optional, defaults to thin)'], + ['monitor-db-quorum', 'disable controller when only one host is online (optional, defaults to true)'] +@@ -353,7 +351,6 @@ def activate_lvm_group(group_name): + # Usage example: + # xe sr-create type=linstor name-label=linstor-sr + # host-uuid=d2deba7a-c5ad-4de1-9a20-5c8df3343e93 +-# device-config:hosts=node-linstor1,node-linstor2,node-linstor3 + # device-config:group-name=vg_loop device-config:redundancy=2 + + +@@ -385,8 +382,6 @@ class LinstorSR(SR.SR): + ) + + # Check parameters. +- if 'hosts' not in self.dconf or not self.dconf['hosts']: +- raise xs_errors.XenError('LinstorConfigHostsMissing') + if 'group-name' not in self.dconf or not self.dconf['group-name']: + raise xs_errors.XenError('LinstorConfigGroupNameMissing') + if 'redundancy' not in self.dconf or not self.dconf['redundancy']: +@@ -431,12 +426,6 @@ class LinstorSR(SR.SR): + self.lock = Lock(vhdutil.LOCK_TYPE_SR, self.uuid) + self.sr_vditype = SR.DEFAULT_TAP + +- self._hosts = list(set(self.dconf['hosts'].split(','))) +- if 'ips' not in self.dconf or not self.dconf['ips']: +- self._ips = None +- else: +- self._ips = self.dconf['ips'].split(',') +- + if self.cmd == 'sr_create': + self._redundancy = int(self.dconf['redundancy']) or 1 + self._linstor = None # Ensure that LINSTOR attribute exists. +@@ -647,7 +636,8 @@ class LinstorSR(SR.SR): + def create(self, uuid, size): + util.SMlog('LinstorSR.create for {}'.format(self.uuid)) + +- if self._redundancy > len(self._hosts): ++ host_adresses = util.get_host_addresses(self.session) ++ if self._redundancy > len(host_adresses): + raise xs_errors.XenError( + 'LinstorSRCreate', + opterr='Redundancy greater than host count' +@@ -676,39 +666,17 @@ class LinstorSR(SR.SR): + ) + + online_hosts = util.get_online_hosts(self.session) +- if len(online_hosts) < len(self._hosts): ++ if len(online_hosts) < len(host_adresses): + raise xs_errors.XenError( + 'LinstorSRCreate', + opterr='Not enough online hosts' + ) + + ips = {} +- if not self._ips: +- for host in online_hosts: +- record = self.session.xenapi.host.get_record(host) +- hostname = record['hostname'] +- if hostname in self._hosts: +- ips[hostname] = record['address'] +- elif len(self._ips) != len(self._hosts): +- raise xs_errors.XenError( +- 'LinstorSRCreate', +- opterr='ips must be equal to host count' +- ) +- else: +- for host in online_hosts: +- record = self.session.xenapi.host.get_record(host) +- hostname = record['hostname'] +- try: +- index = self._hosts.index(hostname) +- ips[hostname] = self._ips[index] +- except ValueError as e: +- pass +- +- if len(ips) != len(self._hosts): +- raise xs_errors.XenError( +- 'LinstorSRCreate', +- opterr='Not enough online hosts' +- ) ++ for host_ref in online_hosts: ++ record = self.session.xenapi.host.get_record(host_ref) ++ hostname = record['hostname'] ++ ips[hostname] = record['address'] + + # Ensure ports are opened and LINSTOR satellites + # are activated. In the same time the drbd-reactor instances +@@ -720,7 +688,6 @@ class LinstorSR(SR.SR): + try: + self._linstor = LinstorVolumeManager.create_sr( + self._group_name, +- self._hosts, + ips, + self._redundancy, + thin_provisioning=self._provisioning == 'thin', +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 6f20c02..464ab2c 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -1588,14 +1588,13 @@ class LinstorVolumeManager(object): + + @classmethod + def create_sr( +- cls, group_name, node_names, ips, redundancy, ++ cls, group_name, ips, redundancy, + thin_provisioning, auto_quorum, + logger=default_logger.__func__ + ): + """ + Create a new SR on the given nodes. + :param str group_name: The SR group_name to use. +- :param list[str] node_names: String list of nodes. + :param set(str) ips: Node ips. + :param int redundancy: How many copy of volumes should we store? + :param bool thin_provisioning: Use thin or thick provisioning. +@@ -1609,7 +1608,6 @@ class LinstorVolumeManager(object): + cls._start_controller(start=True) + sr = cls._create_sr( + group_name, +- node_names, + ips, + redundancy, + thin_provisioning, +@@ -1630,7 +1628,7 @@ class LinstorVolumeManager(object): + + @classmethod + def _create_sr( +- cls, group_name, node_names, ips, redundancy, ++ cls, group_name, ips, redundancy, + thin_provisioning, auto_quorum, + logger=default_logger.__func__ + ): +@@ -1639,9 +1637,8 @@ class LinstorVolumeManager(object): + + lin = cls._create_linstor_instance(uri, keep_uri_unmodified=True) + +- for node_name in node_names: +- ip = ips[node_name] +- ++ node_names = ips.keys() ++ for node_name, ip in ips.iteritems(): + while True: + # Try to create node. + result = lin.node_create( +-- +2.45.2 + diff --git a/SOURCES/0121-fix-LinstorSR-compute-correctly-SR-size-using-pool-c.patch b/SOURCES/0121-fix-LinstorSR-compute-correctly-SR-size-using-pool-c.patch new file mode 100644 index 00000000..bfd7ed95 --- /dev/null +++ b/SOURCES/0121-fix-LinstorSR-compute-correctly-SR-size-using-pool-c.patch @@ -0,0 +1,93 @@ +From fad043f547a38223fc3a52400db70cf3b0ec2243 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Thu, 1 Jun 2023 17:40:37 +0200 +Subject: [PATCH 121/175] fix(LinstorSR): compute correctly SR size using pool + count + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 4 +-- + drivers/linstorvolumemanager.py | 45 +++++++++++++++++---------------- + 2 files changed, 25 insertions(+), 24 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 7a9cbac..f6c4356 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -1065,8 +1065,8 @@ class LinstorSR(SR.SR): + def _update_physical_size(self): + # We use the size of the smallest disk, this is an approximation that + # ensures the displayed physical size is reachable by the user. +- self.physical_size = \ +- self._linstor.min_physical_size * len(self._hosts) / \ ++ (min_physical_size, pool_count) = self._linstor.get_min_physical_size() ++ self.physical_size = min_physical_size * pool_count / \ + self._linstor.redundancy + + self.physical_utilisation = self._linstor.allocated_volume_size +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 464ab2c..ee637ae 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -492,28 +492,6 @@ class LinstorVolumeManager(object): + """ + return self._compute_size('free_capacity') + +- @property +- def min_physical_size(self): +- """ +- Give the minimum physical size of the SR. +- I.e. the size of the smallest disk. +- :return: The physical min size. +- :rtype: int +- """ +- size = None +- for pool in self._get_storage_pools(force=True): +- space = pool.free_space +- if space: +- current_size = space.total_capacity +- if current_size < 0: +- raise LinstorVolumeManagerError( +- 'Failed to get pool total_capacity attr of `{}`' +- .format(pool.node_name) +- ) +- if size is None or current_size < size: +- size = current_size +- return (size or 0) * 1024 +- + @property + def allocated_volume_size(self): + """ +@@ -554,6 +532,29 @@ class LinstorVolumeManager(object): + + return total_size * 1024 + ++ def get_min_physical_size(self): ++ """ ++ Give the minimum physical size of the SR. ++ I.e. the size of the smallest disk + the number of pools. ++ :return: The physical min size. ++ :rtype: tuple(int, int) ++ """ ++ size = None ++ pool_count = 0 ++ for pool in self._get_storage_pools(force=True): ++ space = pool.free_space ++ if space: ++ pool_count += 1 ++ current_size = space.total_capacity ++ if current_size < 0: ++ raise LinstorVolumeManagerError( ++ 'Failed to get pool total_capacity attr of `{}`' ++ .format(pool.node_name) ++ ) ++ if size is None or current_size < size: ++ size = current_size ++ return (pool_count, (size or 0) * 1024) ++ + @property + def metadata(self): + """ +-- +2.45.2 + diff --git a/SOURCES/0122-fix-blktap2-ensure-we-can-import-this-module-when-LI.patch b/SOURCES/0122-fix-blktap2-ensure-we-can-import-this-module-when-LI.patch new file mode 100644 index 00000000..22025024 --- /dev/null +++ b/SOURCES/0122-fix-blktap2-ensure-we-can-import-this-module-when-LI.patch @@ -0,0 +1,48 @@ +From a4b69f4d89c45a4a7f90eff858bc59214832f321 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Tue, 6 Jun 2023 11:50:54 +0200 +Subject: [PATCH 122/175] fix(blktap2): ensure we can import this module when + LINSTOR is not installed + +Signed-off-by: Ronan Abhamon +--- + drivers/blktap2.py | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/drivers/blktap2.py b/drivers/blktap2.py +index 719a152..2a37efb 100755 +--- a/drivers/blktap2.py ++++ b/drivers/blktap2.py +@@ -36,7 +36,6 @@ import json + import xs_errors + import XenAPI + import scsiutil +-from linstorvolumemanager import log_drbd_openers + from syslog import openlog, syslog + from stat import * # S_ISBLK(), ... + import nfs +@@ -51,6 +50,12 @@ from xmlrpclib import ServerProxy, Transport + from socket import socket, AF_UNIX, SOCK_STREAM + from httplib import HTTP, HTTPConnection + ++try: ++ from linstorvolumemanager import log_drbd_openers ++ LINSTOR_AVAILABLE = True ++except ImportError: ++ LINSTOR_AVAILABLE = False ++ + PLUGIN_TAP_PAUSE = "tapdisk-pause" + + SOCKPATH = "/var/xapi/xcp-rrdd" +@@ -831,7 +836,7 @@ class Tapdisk(object): + retry_open += 1 + time.sleep(1) + continue +- if err == errno.EROFS: ++ if LINSTOR_AVAILABLE and err == errno.EROFS: + log_drbd_openers(path) + break + try: +-- +2.45.2 + diff --git a/SOURCES/0123-fix-LinstorSR-ensure-volume-cache-can-be-recreated.patch b/SOURCES/0123-fix-LinstorSR-ensure-volume-cache-can-be-recreated.patch new file mode 100644 index 00000000..5dcf86d1 --- /dev/null +++ b/SOURCES/0123-fix-LinstorSR-ensure-volume-cache-can-be-recreated.patch @@ -0,0 +1,112 @@ +From 87042f09234e5887abc071ea581d052c7451948f Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Wed, 21 Jun 2023 14:10:18 +0200 +Subject: [PATCH 123/175] fix(LinstorSR): ensure volume cache can be recreated + +After SR creation we may fail to load volumes with this exception: +"Failed to get usable size of..." and so we can't plug the master PBD. + +Regardless of the retry timeout, the only solution to fetch the usable +size of the DB is to recreate the connection to the LINSTOR API. + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 64 +++++++++++++++++++++++++++----------------- + 1 file changed, 40 insertions(+), 24 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index f6c4356..0bccc16 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -523,28 +523,7 @@ class LinstorSR(SR.SR): + + if self.srcmd.cmd != 'sr_create' and self.srcmd.cmd != 'sr_detach': + try: +- controller_uri = get_controller_uri() +- +- self._journaler = LinstorJournaler( +- controller_uri, self._group_name, logger=util.SMlog +- ) +- +- # Try to open SR if exists. +- # We can repair only if we are on the master AND if +- # we are trying to execute an exclusive operation. +- # Otherwise we could try to delete a VDI being created or +- # during a snapshot. An exclusive op is the guarantee that +- # the SR is locked. +- self._linstor = LinstorVolumeManager( +- controller_uri, +- self._group_name, +- repair=( +- self._is_master and +- self.srcmd.cmd in self.ops_exclusive +- ), +- logger=util.SMlog +- ) +- self._vhdutil = LinstorVhdUtil(self.session, self._linstor) ++ self._reconnect() + except Exception as e: + raise xs_errors.XenError('SRUnavailable', opterr=str(e)) + +@@ -1518,12 +1497,25 @@ class LinstorSR(SR.SR): + # -------------------------------------------------------------------------- + + def _create_linstor_cache(self): ++ # TODO: use a nonlocal with python3. ++ class context: ++ reconnect = False ++ ++ def create_cache(): ++ try: ++ if context.reconnect: ++ self._reconnect() ++ return self._linstor.get_volumes_with_info() ++ except Exception as e: ++ context.reconnect = True ++ raise e ++ + self._all_volume_metadata_cache = \ + self._linstor.get_volumes_with_metadata() + self._all_volume_info_cache = util.retry( +- self._linstor.get_volumes_with_info, ++ create_cache, + maxretry=10, +- period=1 ++ period=3 + ) + + def _destroy_linstor_cache(self): +@@ -1534,6 +1526,30 @@ class LinstorSR(SR.SR): + # Misc. + # -------------------------------------------------------------------------- + ++ def _reconnect(self): ++ controller_uri = get_controller_uri() ++ ++ self._journaler = LinstorJournaler( ++ controller_uri, self._group_name, logger=util.SMlog ++ ) ++ ++ # Try to open SR if exists. ++ # We can repair only if we are on the master AND if ++ # we are trying to execute an exclusive operation. ++ # Otherwise we could try to delete a VDI being created or ++ # during a snapshot. An exclusive op is the guarantee that ++ # the SR is locked. ++ self._linstor = LinstorVolumeManager( ++ controller_uri, ++ self._group_name, ++ repair=( ++ self._is_master and ++ self.srcmd.cmd in self.ops_exclusive ++ ), ++ logger=util.SMlog ++ ) ++ self._vhdutil = LinstorVhdUtil(self.session, self._linstor) ++ + def _ensure_space_available(self, amount_needed): + space_available = self._linstor.max_volume_size_allowed + if (space_available < amount_needed): +-- +2.45.2 + diff --git a/SOURCES/0124-fix-linstor-manager-remove-dead-useless-code-in-add-.patch b/SOURCES/0124-fix-linstor-manager-remove-dead-useless-code-in-add-.patch new file mode 100644 index 00000000..e5393015 --- /dev/null +++ b/SOURCES/0124-fix-linstor-manager-remove-dead-useless-code-in-add-.patch @@ -0,0 +1,209 @@ +From 60d3410e1b96cb2f41f03b96c4079721aab4dd50 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Thu, 20 Jul 2023 10:46:33 +0200 +Subject: [PATCH 124/175] fix(linstor-manager): remove dead/useless code in + add/remove_host helpers + +Signed-off-by: Ronan Abhamon +--- + drivers/linstor-manager | 128 +++++----------------------------------- + 1 file changed, 15 insertions(+), 113 deletions(-) + +diff --git a/drivers/linstor-manager b/drivers/linstor-manager +index 9e96aac..45201ee 100755 +--- a/drivers/linstor-manager ++++ b/drivers/linstor-manager +@@ -555,7 +555,7 @@ def has_controller_running(session, args): + def add_host(session, args): + group_name = args['groupName'] + +- # 1. Find SR and PBDs. ++ # 1. Find all LINSTOR SRs and PBDs. + srs = dict() + for sr_ref, sr in session.xenapi.SR.get_all_records().items(): + if sr.get('type') == 'linstor': +@@ -597,7 +597,6 @@ def add_host(session, args): + node_name = socket.gethostname() + has_node = linstor.has_node(node_name) + +- pbd_id = 0 + new_pbd_ref = None + + try: +@@ -610,66 +609,30 @@ def add_host(session, args): + if not has_node: + linstor.create_node(node_name, util.get_this_host_address(session)) + +- # 6. Recreate PBDs. +- # Use the redundancy given by Linstor instead of smapi config. +- redundancy = linstor.redundancy +- default_device_config = None ++ # 6. Try to create PBD. + this_host = util.get_this_host_ref(session) + create_new_pbd = True + + assert pbds +- pbds = pbds.items() +- for pbd_ref, pbd in pbds: +- device_config = pbd['device_config'] +- +- hosts = filter( +- lambda host: len(host.strip()), +- device_config.get('hosts', []).split(',') +- ) +- hosts.append(node_name) +- hosts = ','.join(list(set(hosts))) ++ for pbd in pbds.values(): ++ if pbd['host'] == this_host: ++ create_new_pbd = False ++ break + ++ device_config = pbd['device_config'] + # Should be the same on all hosts. + provisioning = device_config['provisioning'] + +- if not default_device_config: +- default_device_config = { +- 'group-name': group_name, +- 'redundancy': redundancy, +- 'hosts': hosts, +- 'provisioning': provisioning +- } +- +- if pbd['currently_attached']: +- session.xenapi.PBD.unplug(pbd_ref) +- session.xenapi.PBD.destroy(pbd_ref) +- pbd_id += 1 +- +- host = pbd['host'] +- if host == this_host: +- create_new_pbd = False +- +- pbd_ref = session.xenapi.PBD.create({ +- 'host': host, +- 'SR': sr_ref, +- 'device_config': { +- 'group-name': group_name, +- 'redundancy': redundancy, +- 'hosts': hosts, +- 'provisioning': provisioning +- } +- }) +- try: +- session.xenapi.PBD.plug(pbd_ref) +- except Exception as e: +- util.SMlog('Failed to replug PBD: {}'.format(e)) +- + # 7. Create new PBD. + if create_new_pbd: + new_pbd_ref = session.xenapi.PBD.create({ + 'host': this_host, + 'SR': sr_ref, +- 'device_config': default_device_config ++ 'device_config': { ++ 'group-name': group_name, ++ 'redundancy': linstor.redundancy, ++ 'provisioning': provisioning ++ } + }) + try: + session.xenapi.PBD.plug(new_pbd_ref) +@@ -685,38 +648,6 @@ def add_host(session, args): + except Exception: + pass + +- for pbd_ref, pbd in pbds[:pbd_id]: +- try: +- session.xenapi.PBD.unplug(pbd_ref) +- except Exception: +- pass +- +- try: +- session.xenapi.PBD.destroy(pbd_ref) +- except Exception: +- pass +- +- try: +- device_config = pbd['device_config'] +- session.xenapi.PBD.create({ +- 'host': host, +- 'SR': sr_ref, +- 'device_config': { +- 'group-name': group_name, +- 'redundancy': redundancy, +- 'hosts': device_config['hosts'], +- 'provisioning': device_config['provisioning'] +- } +- }) +- except Exception as pbd_error: +- util.SMlog('Failed to recreate PBD: {}'.format(pbd_error)) +- pass +- +- try: +- session.xenapi.PBD.plug(pbd_ref) +- except Exception: +- pass +- + if new_pbd_ref: + try: + session.xenapi.PBD.unplug(new_pbd_ref) +@@ -743,7 +674,7 @@ def add_host(session, args): + def remove_host(session, args): + group_name = args['groupName'] + +- # 1. Find SRs and PBDs. ++ # 1. Find all LINSTOR SRs and PBDs. + srs = dict() + for sr_ref, sr in session.xenapi.SR.get_all_records().items(): + if sr.get('type') == 'linstor': +@@ -772,45 +703,16 @@ def remove_host(session, args): + if linstor.has_node(node_name): + raise Exception('Failed to remove node! Unknown error.') + +- redundancy = linstor.redundancy + this_host = util.get_this_host_ref(session) + +- # 3. Update PBDs. ++ # 3. Remove PBD. + for pbd_ref, pbd in pbds.items(): + host = pbd['host'] + if host == this_host: + if pbd['currently_attached']: + session.xenapi.PBD.unplug(pbd_ref) + session.xenapi.PBD.destroy(pbd_ref) +- continue +- +- device_config = pbd['device_config'] +- hosts = device_config.get('hosts', []).split(',') +- try: +- hosts.remove(node_name) +- except Exception as e: +- continue +- hosts = ','.join(list(set(hosts))) +- +- if pbd['currently_attached']: +- session.xenapi.PBD.unplug(pbd_ref) +- session.xenapi.PBD.destroy(pbd_ref) +- +- pbd_ref = session.xenapi.PBD.create({ +- 'host': host, +- 'SR': pbd['SR'], +- 'device_config': { +- 'group-name': group_name, +- 'redundancy': redundancy, +- 'hosts': hosts, +- 'provisioning': device_config['provisioning'] +- } +- }) +- +- try: +- session.xenapi.PBD.plug(pbd_ref) +- except Exception as e: +- util.SMlog('Failed to replug PBD: {}'.format(e)) ++ break + + # 3. Stop services. + try: +-- +2.45.2 + diff --git a/SOURCES/0125-fix-LinstorSR-Ensure-we-always-have-a-device-path-du.patch b/SOURCES/0125-fix-LinstorSR-Ensure-we-always-have-a-device-path-du.patch new file mode 100644 index 00000000..eeb5a756 --- /dev/null +++ b/SOURCES/0125-fix-LinstorSR-Ensure-we-always-have-a-device-path-du.patch @@ -0,0 +1,59 @@ +From 6f07d38ac46cc917e837d4e33a46c8036e1228ec Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Tue, 1 Aug 2023 15:16:17 +0200 +Subject: [PATCH 125/175] fix(LinstorSR): Ensure we always have a device path + during leaf-coalesce calls + +So we must not verify that we have a valid DRBD path in the load step, +it can fail on many hosts, instead we must create a diskless path only +during the real coalesce. + +Note: I removed this assert: `assert virtual_size >= volume_size`, +it seems that it's not always true, I suppose the volume size can be +greater than expected due to a bigger allocation in the LVM or DRBD layer. + +Signed-off-by: Ronan Abhamon +--- + drivers/cleanup.py | 12 +++++------- + 1 file changed, 5 insertions(+), 7 deletions(-) + +diff --git a/drivers/cleanup.py b/drivers/cleanup.py +index f6c4346..19d03d9 100755 +--- a/drivers/cleanup.py ++++ b/drivers/cleanup.py +@@ -1394,11 +1394,6 @@ class LinstorVDI(VDI): + + self.fileName = self.sr._linstor.get_volume_name(self.uuid) + self.path = self.sr._linstor.build_device_path(self.fileName) +- if not util.pathexists(self.path): +- raise util.SMException( +- '{} of {} not found' +- .format(self.fileName, self.uuid) +- ) + + if not info: + try: +@@ -3025,8 +3020,6 @@ class LinstorSR(SR): + parent.sizeVirt + meta_overhead + bitmap_overhead + ) + volume_size = self._linstor.get_volume_size(parent.uuid) +- +- assert virtual_size >= volume_size + return virtual_size - volume_size + + def _hasValidDevicePath(self, uuid): +@@ -3047,6 +3040,11 @@ class LinstorSR(SR): + finally: + self.unlock() + ++ def _prepareCoalesceLeaf(self, vdi): ++ # Move diskless path if necessary. We must have an access ++ # to modify locally the volume. ++ self._linstor.get_device_path(vdi.uuid) ++ + def _handleInterruptedCoalesceLeaf(self): + entries = self.journaler.get_all(VDI.JRN_LEAF) + for uuid, parentUuid in entries.iteritems(): +-- +2.45.2 + diff --git a/SOURCES/0126-fix-LinstorSR-always-use-lock.acquire-during-attach-.patch b/SOURCES/0126-fix-LinstorSR-always-use-lock.acquire-during-attach-.patch new file mode 100644 index 00000000..0bd85bee --- /dev/null +++ b/SOURCES/0126-fix-LinstorSR-always-use-lock.acquire-during-attach-.patch @@ -0,0 +1,59 @@ +From a658e5ce04f42e3c20518ba5efdd6ed05d5e0b13 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Wed, 16 Aug 2023 12:04:01 +0200 +Subject: [PATCH 126/175] fix(LinstorSR): always use lock.acquire() during + attach/detach + +We can't use a retry range on the lock because we can trigger a bad situation +in the detach step... When the GC has a lock on the SR and we try to acquire +the same lock in a detach call, and if we can't get this lock after 20 seconds, +the consequences are very bad: +- Many tapdisk instances of the same VDI can be created on two hosts +- The VDI info are not updated correctly +- And this issue is not immediately visible + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 12 ++---------- + 1 file changed, 2 insertions(+), 10 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 0bccc16..98919a4 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -142,14 +142,6 @@ def compute_volume_size(virtual_size, image_type): + return LinstorVolumeManager.round_up_volume_size(virtual_size) + + +-def try_lock(lock): +- for i in range(20): +- if lock.acquireNoblock(): +- return +- time.sleep(1) +- raise util.SRBusyException() +- +- + def attach_thin(session, journaler, linstor, sr_uuid, vdi_uuid): + volume_metadata = linstor.get_volume_metadata(vdi_uuid) + image_type = volume_metadata.get(VDI_TYPE_TAG) +@@ -158,7 +150,7 @@ def attach_thin(session, journaler, linstor, sr_uuid, vdi_uuid): + + lock = Lock(vhdutil.LOCK_TYPE_SR, sr_uuid) + try: +- try_lock(lock) ++ lock.acquire() + + device_path = linstor.get_device_path(vdi_uuid) + +@@ -191,7 +183,7 @@ def detach_thin(session, linstor, sr_uuid, vdi_uuid): + + lock = Lock(vhdutil.LOCK_TYPE_SR, sr_uuid) + try: +- try_lock(lock) ++ lock.acquire() + + vdi_ref = session.xenapi.VDI.get_by_uuid(vdi_uuid) + vbds = session.xenapi.VBD.get_all_records_where( +-- +2.45.2 + diff --git a/SOURCES/0127-fix-LinstorSR-mare-sure-hostnames-are-unique-at-SR-c.patch b/SOURCES/0127-fix-LinstorSR-mare-sure-hostnames-are-unique-at-SR-c.patch new file mode 100644 index 00000000..a998fdc0 --- /dev/null +++ b/SOURCES/0127-fix-LinstorSR-mare-sure-hostnames-are-unique-at-SR-c.patch @@ -0,0 +1,31 @@ +From 864a2275e1ee395834058ce9b433f290bd932420 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Thu, 17 Aug 2023 14:52:13 +0200 +Subject: [PATCH 127/175] fix(LinstorSR): mare sure hostnames are unique at SR + creation + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 98919a4..e512487 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -649,6 +649,12 @@ class LinstorSR(SR.SR): + hostname = record['hostname'] + ips[hostname] = record['address'] + ++ if len(ips) != len(online_hosts): ++ raise xs_errors.XenError( ++ 'LinstorSRCreate', ++ opterr='Multiple hosts with same hostname' ++ ) ++ + # Ensure ports are opened and LINSTOR satellites + # are activated. In the same time the drbd-reactor instances + # must be stopped. +-- +2.45.2 + diff --git a/SOURCES/0128-fix-LinstorSR-ensure-we-can-attach-non-special-stati.patch b/SOURCES/0128-fix-LinstorSR-ensure-we-can-attach-non-special-stati.patch new file mode 100644 index 00000000..0714e161 --- /dev/null +++ b/SOURCES/0128-fix-LinstorSR-ensure-we-can-attach-non-special-stati.patch @@ -0,0 +1,28 @@ +From ecb19cbe25ce76b20f946ab166474766f45c9f08 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Fri, 18 Aug 2023 11:06:56 +0200 +Subject: [PATCH 128/175] fix(LinstorSR): ensure we can attach non-special + static VDIs + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index e512487..1708370 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -461,6 +461,9 @@ class LinstorSR(SR.SR): + logger=util.SMlog, + attempt_count=attempt_count + ) ++ # Only required if we are attaching from config using a non-special VDI. ++ # I.e. not an HA volume. ++ self._vhdutil = LinstorVhdUtil(self.session, self._linstor) + + controller_uri = get_controller_uri() + if controller_uri: +-- +2.45.2 + diff --git a/SOURCES/0129-fix-LinstorSR-ensure-we-can-detach-when-deflate-call.patch b/SOURCES/0129-fix-LinstorSR-ensure-we-can-detach-when-deflate-call.patch new file mode 100644 index 00000000..a8e6384a --- /dev/null +++ b/SOURCES/0129-fix-LinstorSR-ensure-we-can-detach-when-deflate-call.patch @@ -0,0 +1,85 @@ +From b88d2a1cc9e4346e322a6b500159f2a0c5e4bba2 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Thu, 31 Aug 2023 18:00:27 +0200 +Subject: [PATCH 129/175] fix(LinstorSR): ensure we can detach when deflate + call is not possible + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 45 +++++++++++++++++++++++++++++--------------- + 1 file changed, 30 insertions(+), 15 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 1708370..a6ca884 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -175,7 +175,7 @@ def attach_thin(session, journaler, linstor, sr_uuid, vdi_uuid): + lock.release() + + +-def detach_thin(session, linstor, sr_uuid, vdi_uuid): ++def detach_thin_impl(session, linstor, sr_uuid, vdi_uuid): + volume_metadata = linstor.get_volume_metadata(vdi_uuid) + image_type = volume_metadata.get(VDI_TYPE_TAG) + if image_type == vhdutil.VDI_TYPE_RAW: +@@ -185,21 +185,26 @@ def detach_thin(session, linstor, sr_uuid, vdi_uuid): + try: + lock.acquire() + +- vdi_ref = session.xenapi.VDI.get_by_uuid(vdi_uuid) +- vbds = session.xenapi.VBD.get_all_records_where( +- 'field "VDI" = "{}"'.format(vdi_ref) +- ) ++ def check_vbd_count(): ++ vdi_ref = session.xenapi.VDI.get_by_uuid(vdi_uuid) ++ vbds = session.xenapi.VBD.get_all_records_where( ++ 'field "VDI" = "{}"'.format(vdi_ref) ++ ) + +- num_plugged = 0 +- for vbd_rec in vbds.values(): +- if vbd_rec['currently_attached']: +- num_plugged += 1 +- if num_plugged > 1: +- raise xs_errors.XenError( +- 'VDIUnavailable', +- opterr='Cannot deflate VDI {}, already used by ' +- 'at least 2 VBDs'.format(vdi_uuid) +- ) ++ num_plugged = 0 ++ for vbd_rec in vbds.values(): ++ if vbd_rec['currently_attached']: ++ num_plugged += 1 ++ if num_plugged > 1: ++ raise xs_errors.XenError( ++ 'VDIUnavailable', ++ opterr='Cannot deflate VDI {}, already used by ' ++ 'at least 2 VBDs'.format(vdi_uuid) ++ ) ++ ++ # We can have multiple VBDs attached to a VDI during a VM-template clone. ++ # So we use a timeout to ensure that we can detach the volume properly. ++ util.retry(check_vbd_count, maxretry=10, period=1) + + device_path = linstor.get_device_path(vdi_uuid) + new_volume_size = LinstorVolumeManager.round_up_volume_size( +@@ -217,6 +222,16 @@ def detach_thin(session, linstor, sr_uuid, vdi_uuid): + lock.release() + + ++def detach_thin(session, linstor, sr_uuid, vdi_uuid): ++ # This function must always return without errors. ++ # Otherwise it could cause errors in the XAPI regarding the state of the VDI. ++ # It's why we use this `try` block. ++ try: ++ detach_thin_impl(session, linstor, sr_uuid, vdi_uuid) ++ except Exception as e: ++ util.SMlog('Failed to detach properly VDI {}: {}'.format(vdi_uuid, e)) ++ ++ + def inflate(journaler, linstor, vdi_uuid, vdi_path, new_size, old_size): + # Only inflate if the LINSTOR volume capacity is not enough. + new_size = LinstorVolumeManager.round_up_volume_size(new_size) +-- +2.45.2 + diff --git a/SOURCES/0130-fix-LinstorSR-assume-VDI-is-always-a-VHD-when-the-in.patch b/SOURCES/0130-fix-LinstorSR-assume-VDI-is-always-a-VHD-when-the-in.patch new file mode 100644 index 00000000..f4b4addb --- /dev/null +++ b/SOURCES/0130-fix-LinstorSR-assume-VDI-is-always-a-VHD-when-the-in.patch @@ -0,0 +1,34 @@ +From 36c88f1ee37fa5f78f7dcc41b2ed7aaeac680dde Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Thu, 28 Sep 2023 16:00:02 +0200 +Subject: [PATCH 130/175] fix(LinstorSR): assume VDI is always a VHD when the + info is missing during cleanup + +Signed-off-by: Ronan Abhamon +--- + drivers/cleanup.py | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/drivers/cleanup.py b/drivers/cleanup.py +index 19d03d9..5353e9a 100755 +--- a/drivers/cleanup.py ++++ b/drivers/cleanup.py +@@ -2995,11 +2995,11 @@ class LinstorSR(SR): + not list(volumes_metadata[vdi_uuid].items()): + continue # Ignore it, probably deleted. + +- vdi_type = volumes_metadata[vdi_uuid][VDI_TYPE_TAG] +- if vdi_type == vhdutil.VDI_TYPE_VHD: +- info = self._vhdutil.get_vhd_info(vdi_uuid) +- else: ++ vdi_type = volumes_metadata[vdi_uuid].get(VDI_TYPE_TAG) ++ if vdi_type == vhdutil.VDI_TYPE_RAW: + info = None ++ else: ++ info = self._vhdutil.get_vhd_info(vdi_uuid) + except Exception as e: + Util.log( + ' [VDI {}: failed to load VDI info]: {}' +-- +2.45.2 + diff --git a/SOURCES/0131-fix-LinstorSR-remove-SR-lock-during-thin-attach-deta.patch b/SOURCES/0131-fix-LinstorSR-remove-SR-lock-during-thin-attach-deta.patch new file mode 100644 index 00000000..a7157132 --- /dev/null +++ b/SOURCES/0131-fix-LinstorSR-remove-SR-lock-during-thin-attach-deta.patch @@ -0,0 +1,152 @@ +From 5ffe8d608678a31e1f8ece28f5af617d8f623762 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Mon, 2 Oct 2023 16:48:49 +0200 +Subject: [PATCH 131/175] fix(LinstorSR): remove SR lock during thin + attach/detach + +This lock is normally useless and can create a dead lock when thin mode is activated: +- A task try to deactivate a volume during a VM shutdown on a slave (so a VDI A is locked). + Then a new task is created on the master host, we try to get the SR lock on the master. +- In parallel a tap-pause is asked from the master to the slave, the master SR lock is now locked. + The tap-pause request is received on the slave, but we can't lock VDI A because it's already + locked. + +So to resume: a dead lock is only possible if we try to shutdown a VM with a particular VDI +and if we try to snapshot it in the same time. + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 102 +++++++++++++++++++------------------------ + 1 file changed, 45 insertions(+), 57 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index a6ca884..ed41e77 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -148,32 +148,26 @@ def attach_thin(session, journaler, linstor, sr_uuid, vdi_uuid): + if image_type == vhdutil.VDI_TYPE_RAW: + return + +- lock = Lock(vhdutil.LOCK_TYPE_SR, sr_uuid) +- try: +- lock.acquire() ++ device_path = linstor.get_device_path(vdi_uuid) ++ ++ # If the virtual VHD size is lower than the LINSTOR volume size, ++ # there is nothing to do. ++ vhd_size = compute_volume_size( ++ # TODO: Replace pylint comment with this feature when possible: ++ # https://github.com/PyCQA/pylint/pull/2926 ++ LinstorVhdUtil(session, linstor).get_size_virt(vdi_uuid), # pylint: disable = E1120 ++ image_type ++ ) + +- device_path = linstor.get_device_path(vdi_uuid) ++ volume_info = linstor.get_volume_info(vdi_uuid) ++ volume_size = volume_info.virtual_size + +- # If the virtual VHD size is lower than the LINSTOR volume size, +- # there is nothing to do. +- vhd_size = compute_volume_size( +- # TODO: Replace pylint comment with this feature when possible: +- # https://github.com/PyCQA/pylint/pull/2926 +- LinstorVhdUtil(session, linstor).get_size_virt(vdi_uuid), # pylint: disable = E1120 +- image_type ++ if vhd_size > volume_size: ++ inflate( ++ journaler, linstor, vdi_uuid, device_path, ++ vhd_size, volume_size + ) + +- volume_info = linstor.get_volume_info(vdi_uuid) +- volume_size = volume_info.virtual_size +- +- if vhd_size > volume_size: +- inflate( +- journaler, linstor, vdi_uuid, device_path, +- vhd_size, volume_size +- ) +- finally: +- lock.release() +- + + def detach_thin_impl(session, linstor, sr_uuid, vdi_uuid): + volume_metadata = linstor.get_volume_metadata(vdi_uuid) +@@ -181,45 +175,39 @@ def detach_thin_impl(session, linstor, sr_uuid, vdi_uuid): + if image_type == vhdutil.VDI_TYPE_RAW: + return + +- lock = Lock(vhdutil.LOCK_TYPE_SR, sr_uuid) +- try: +- lock.acquire() +- +- def check_vbd_count(): +- vdi_ref = session.xenapi.VDI.get_by_uuid(vdi_uuid) +- vbds = session.xenapi.VBD.get_all_records_where( +- 'field "VDI" = "{}"'.format(vdi_ref) +- ) ++ def check_vbd_count(): ++ vdi_ref = session.xenapi.VDI.get_by_uuid(vdi_uuid) ++ vbds = session.xenapi.VBD.get_all_records_where( ++ 'field "VDI" = "{}"'.format(vdi_ref) ++ ) + +- num_plugged = 0 +- for vbd_rec in vbds.values(): +- if vbd_rec['currently_attached']: +- num_plugged += 1 +- if num_plugged > 1: +- raise xs_errors.XenError( +- 'VDIUnavailable', +- opterr='Cannot deflate VDI {}, already used by ' +- 'at least 2 VBDs'.format(vdi_uuid) +- ) ++ num_plugged = 0 ++ for vbd_rec in vbds.values(): ++ if vbd_rec['currently_attached']: ++ num_plugged += 1 ++ if num_plugged > 1: ++ raise xs_errors.XenError( ++ 'VDIUnavailable', ++ opterr='Cannot deflate VDI {}, already used by ' ++ 'at least 2 VBDs'.format(vdi_uuid) ++ ) + +- # We can have multiple VBDs attached to a VDI during a VM-template clone. +- # So we use a timeout to ensure that we can detach the volume properly. +- util.retry(check_vbd_count, maxretry=10, period=1) ++ # We can have multiple VBDs attached to a VDI during a VM-template clone. ++ # So we use a timeout to ensure that we can detach the volume properly. ++ util.retry(check_vbd_count, maxretry=10, period=1) + +- device_path = linstor.get_device_path(vdi_uuid) +- new_volume_size = LinstorVolumeManager.round_up_volume_size( +- # TODO: Replace pylint comment with this feature when possible: +- # https://github.com/PyCQA/pylint/pull/2926 +- LinstorVhdUtil(session, linstor).get_size_phys(vdi_uuid) # pylint: disable = E1120 +- ) ++ device_path = linstor.get_device_path(vdi_uuid) ++ new_volume_size = LinstorVolumeManager.round_up_volume_size( ++ # TODO: Replace pylint comment with this feature when possible: ++ # https://github.com/PyCQA/pylint/pull/2926 ++ LinstorVhdUtil(session, linstor).get_size_phys(vdi_uuid) # pylint: disable = E1120 ++ ) + +- volume_info = linstor.get_volume_info(vdi_uuid) +- old_volume_size = volume_info.virtual_size +- deflate( +- linstor, vdi_uuid, device_path, new_volume_size, old_volume_size +- ) +- finally: +- lock.release() ++ volume_info = linstor.get_volume_info(vdi_uuid) ++ old_volume_size = volume_info.virtual_size ++ deflate( ++ linstor, vdi_uuid, device_path, new_volume_size, old_volume_size ++ ) + + + def detach_thin(session, linstor, sr_uuid, vdi_uuid): +-- +2.45.2 + diff --git a/SOURCES/0132-fix-LinstorSR-ensure-database-is-mounted-during-scan.patch b/SOURCES/0132-fix-LinstorSR-ensure-database-is-mounted-during-scan.patch new file mode 100644 index 00000000..ddd78b92 --- /dev/null +++ b/SOURCES/0132-fix-LinstorSR-ensure-database-is-mounted-during-scan.patch @@ -0,0 +1,69 @@ +From 5a653534f1bb404003ddb76a09660abf58ce2931 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Tue, 3 Oct 2023 18:42:42 +0200 +Subject: [PATCH 132/175] fix(LinstorSR): ensure database is mounted during + scan + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 15 +++++++++++++++ + drivers/linstorvolumemanager.py | 10 +++++++++- + 2 files changed, 24 insertions(+), 1 deletion(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index ed41e77..ed5998e 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -824,6 +824,21 @@ class LinstorSR(SR.SR): + if self.vdis[vdi_uuid].deleted: + del self.vdis[vdi_uuid] + ++ # Security to prevent VDIs from being forgotten if the controller ++ # is started without a shared and mounted /var/lib/linstor path. ++ try: ++ self._linstor.get_database_path() ++ except Exception: ++ # Failed to get database path, ensure we don't have ++ # VDIs in the XAPI database... ++ if self.session.xenapi.SR.get_VDIs( ++ self.session.xenapi.SR.get_by_uuid(self.uuid) ++ ): ++ raise xs_errors.XenError( ++ 'SRUnavailable', ++ opterr='Database is not mounted' ++ ) ++ + # Update the database before the restart of the GC to avoid + # bad sync in the process if new VDIs have been introduced. + ret = super(LinstorSR, self).scan(self.uuid) +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index ee637ae..f1f3bce 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -884,7 +884,7 @@ class LinstorVolumeManager(object): + + def get_device_path(self, volume_uuid): + """ +- Get the dev path of a volume. ++ Get the dev path of a volume, create a diskless if necessary. + :param str volume_uuid: The volume uuid to get the dev path. + :return: The current device path of the volume. + :rtype: str +@@ -1587,6 +1587,14 @@ class LinstorVolumeManager(object): + + return resources + ++ def get_database_path(self): ++ """ ++ Get the database path. ++ :return: The current database path. ++ :rtype: str ++ """ ++ return self._request_database_path(self._linstor) ++ + @classmethod + def create_sr( + cls, group_name, ips, redundancy, +-- +2.45.2 + diff --git a/SOURCES/0133-fix-LinstorSR-restart-drbd-reactor-in-case-of-failur.patch b/SOURCES/0133-fix-LinstorSR-restart-drbd-reactor-in-case-of-failur.patch new file mode 100644 index 00000000..776a77dc --- /dev/null +++ b/SOURCES/0133-fix-LinstorSR-restart-drbd-reactor-in-case-of-failur.patch @@ -0,0 +1,53 @@ +From 723d0346edcb889ec6999992f1f3f269ad837866 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Wed, 4 Oct 2023 14:30:36 +0200 +Subject: [PATCH 133/175] fix(LinstorSR): restart drbd-reactor in case of + failure + +Otherwise we can have all hosts unusable after a massive reboot: +all the drbd-reactor services are marked as failed, and no controller +is started. + +Signed-off-by: Ronan Abhamon +--- + Makefile | 3 +++ + etc/systemd/system/drbd-reactor.service.d/override.conf | 6 ++++++ + 2 files changed, 9 insertions(+) + create mode 100644 etc/systemd/system/drbd-reactor.service.d/override.conf + +diff --git a/Makefile b/Makefile +index bc3e97f..7f7740c 100755 +--- a/Makefile ++++ b/Makefile +@@ -149,6 +149,7 @@ install: precheck + mkdir -p $(SM_STAGING)$(UDEV_SCRIPTS_DIR) + mkdir -p $(SM_STAGING)$(INIT_DIR) + mkdir -p $(SM_STAGING)$(SYSTEMD_CONF_DIR) ++ mkdir -p $(SM_STAGING)$(SYSTEMD_CONF_DIR)/drbd-reactor.service.d + mkdir -p $(SM_STAGING)$(SYSTEMD_CONF_DIR)/linstor-satellite.service.d + mkdir -p $(SM_STAGING)$(SYSTEMD_SERVICE_DIR) + mkdir -p $(SM_STAGING)$(MPATH_CONF_DIR) +@@ -178,6 +179,8 @@ install: precheck + $(SM_STAGING)/$(SM_DEST) + install -m 644 etc/logrotate.d/$(SMLOG_CONF) \ + $(SM_STAGING)/$(LOGROTATE_DIR) ++ install -m 644 etc/systemd/system/drbd-reactor.service.d/override.conf \ ++ $(SM_STAGING)/$(SYSTEMD_CONF_DIR)/drbd-reactor.service.d/ + install -m 644 etc/systemd/system/linstor-satellite.service.d/override.conf \ + $(SM_STAGING)/$(SYSTEMD_CONF_DIR)/linstor-satellite.service.d/ + install -m 644 etc/systemd/system/var-lib-linstor.service \ +diff --git a/etc/systemd/system/drbd-reactor.service.d/override.conf b/etc/systemd/system/drbd-reactor.service.d/override.conf +new file mode 100644 +index 0000000..2f99a46 +--- /dev/null ++++ b/etc/systemd/system/drbd-reactor.service.d/override.conf +@@ -0,0 +1,6 @@ ++[Service] ++StartLimitInterval=60 ++StartLimitBurst=10 ++ ++Restart=always ++RestartSec=2 +-- +2.45.2 + diff --git a/SOURCES/0134-fix-linstorvolumemanager-retry-in-case-of-failure-du.patch b/SOURCES/0134-fix-linstorvolumemanager-retry-in-case-of-failure-du.patch new file mode 100644 index 00000000..9e4acdff --- /dev/null +++ b/SOURCES/0134-fix-linstorvolumemanager-retry-in-case-of-failure-du.patch @@ -0,0 +1,33 @@ +From 16cf3bd03335cd85ddb928de24531e11cc73475f Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Mon, 9 Oct 2023 10:37:32 +0200 +Subject: [PATCH 134/175] fix(linstorvolumemanager): retry in case of failure + during mkfs call on database + +The device is not always ready after creation. +So we must retry the mkfs call in case of failure. + +Signed-off-by: Ronan Abhamon +--- + drivers/linstorvolumemanager.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index f1f3bce..23e80d9 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -2666,7 +2666,10 @@ class LinstorVolumeManager(object): + ) + + try: +- util.pread2([DATABASE_MKFS, expected_device_path]) ++ util.retry( ++ lambda: util.pread2([DATABASE_MKFS, expected_device_path]), ++ maxretry=5 ++ ) + except Exception as e: + raise LinstorVolumeManagerError( + 'Failed to execute {} on database volume: {}' +-- +2.45.2 + diff --git a/SOURCES/0135-fix-linstorvolumemanager-avoid-diskless-creation-whe.patch b/SOURCES/0135-fix-linstorvolumemanager-avoid-diskless-creation-whe.patch new file mode 100644 index 00000000..9366a370 --- /dev/null +++ b/SOURCES/0135-fix-linstorvolumemanager-avoid-diskless-creation-whe.patch @@ -0,0 +1,146 @@ +From 37265b1466c56548c8480dec4f0e9b47ea52384f Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Tue, 26 Sep 2023 11:48:38 +0200 +Subject: [PATCH 135/175] fix(linstorvolumemanager): avoid diskless creation + when a new resource is added + +Like said in this discussion https://github.com/xcp-ng/sm/pull/34 : +"Instead of using diskless_on_remaing, only place a resource on demand on a node. +If a cluster would ever exceed 20 nodes, having diskless on all of them +might get problematic, as all of them are part of the quorum voting." + +Signed-off-by: Ronan Abhamon +--- + drivers/linstorvolumemanager.py | 51 ++++++--------------------------- + 1 file changed, 9 insertions(+), 42 deletions(-) + +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 23e80d9..49ca83c 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -614,8 +614,7 @@ class LinstorVolumeManager(object): + return volume_uuid in self._volumes + + def create_volume( +- self, volume_uuid, size, persistent=True, volume_name=None, +- no_diskless=False ++ self, volume_uuid, size, persistent=True, volume_name=None + ): + """ + Create a new volume on the SR. +@@ -625,8 +624,6 @@ class LinstorVolumeManager(object): + on the next constructor call LinstorSR(...). + :param str volume_name: If set, this name is used in the LINSTOR + database instead of a generated name. +- :param bool no_diskless: If set, the default group redundancy is not +- used, instead the volume is created on all nodes. + :return: The current device path of the volume. + :rtype: str + """ +@@ -635,8 +632,7 @@ class LinstorVolumeManager(object): + if not volume_name: + volume_name = self.build_volume_name(util.gen_uuid()) + volume_properties = self._create_volume_with_properties( +- volume_uuid, volume_name, size, place_resources=True, +- no_diskless=no_diskless ++ volume_uuid, volume_name, size, place_resources=True + ) + + # Volume created! Now try to find the device path. +@@ -1295,8 +1291,7 @@ class LinstorVolumeManager(object): + # Note: placed outside try/except block because we create only definition first. + # There is no reason to call `clean` before the real resource creation. + volume_properties = self._create_volume_with_properties( +- clone_uuid, clone_volume_name, size, +- place_resources=False ++ clone_uuid, clone_volume_name, size, place_resources=False + ) + + # After this point, `clean` can be called for any fail because the clone UUID +@@ -1758,7 +1753,7 @@ class LinstorVolumeManager(object): + name=group_name, + place_count=redundancy, + storage_pool=group_name, +- diskless_on_remaining=True ++ diskless_on_remaining=False + ) + error_str = cls._get_error_str(result) + if error_str: +@@ -2062,28 +2057,11 @@ class LinstorVolumeManager(object): + return self._storage_pools + + def _create_volume( +- self, volume_uuid, volume_name, size, place_resources, +- no_diskless=False ++ self, volume_uuid, volume_name, size, place_resources + ): +- if no_diskless and not place_resources: +- raise LinstorVolumeManagerError( +- 'Could not create volume `{}` from SR `{}`: it\'s impossible ' +- .format(volume_uuid, self._group_name) + +- 'to force no diskless without placing resources' +- ) +- + size = self.round_up_volume_size(size) + self._mark_resource_cache_as_dirty() + +- resources = [] +- if no_diskless: +- for node_name in self._get_node_names(): +- resources.append(linstor.ResourceData( +- node_name=node_name, +- rsc_name=volume_name, +- storage_pool=self._group_name +- )) +- + def create_definition(): + self._check_volume_creation_errors( + self._linstor.resource_group_spawn( +@@ -2109,23 +2087,13 @@ class LinstorVolumeManager(object): + def create(): + try: + create_definition() +- if no_diskless: +- # Create a physical resource on each node. +- result = self._linstor.resource_create(resources) +- error_str = self._get_error_str(result) +- if error_str: +- raise LinstorVolumeManagerError( +- 'Could not create volume `{}` from SR `{}`: {}'.format( +- volume_uuid, self._group_name, error_str +- ) +- ) +- elif place_resources: ++ if place_resources: + # Basic case when we use the default redundancy of the group. + self._check_volume_creation_errors( + self._linstor.resource_auto_place( + rsc_name=volume_name, + place_count=self._redundancy, +- diskless_on_remaining=not no_diskless ++ diskless_on_remaining=False + ), + volume_uuid, + self._group_name +@@ -2141,8 +2109,7 @@ class LinstorVolumeManager(object): + util.retry(create, maxretry=5) + + def _create_volume_with_properties( +- self, volume_uuid, volume_name, size, place_resources, +- no_diskless=False ++ self, volume_uuid, volume_name, size, place_resources + ): + if self.check_volume_exists(volume_uuid): + raise LinstorVolumeManagerError( +@@ -2171,7 +2138,7 @@ class LinstorVolumeManager(object): + volume_properties[self.PROP_VOLUME_NAME] = volume_name + + self._create_volume( +- volume_uuid, volume_name, size, place_resources, no_diskless ++ volume_uuid, volume_name, size, place_resources + ) + + assert volume_properties.namespace == \ +-- +2.45.2 + diff --git a/SOURCES/0136-fix-LinstorSR-remove-diskless-after-VDI.detach-calls.patch b/SOURCES/0136-fix-LinstorSR-remove-diskless-after-VDI.detach-calls.patch new file mode 100644 index 00000000..639bcc82 --- /dev/null +++ b/SOURCES/0136-fix-LinstorSR-remove-diskless-after-VDI.detach-calls.patch @@ -0,0 +1,91 @@ +From 51e183044653af148b1e2ad0fda99e5ee987c025 Mon Sep 17 00:00:00 2001 +From: Rene Peinthor +Date: Tue, 25 Jul 2023 11:19:39 +0200 +Subject: [PATCH 136/175] fix(LinstorSR): remove diskless after VDI.detach + calls + +Signed-off-by: Rene Peinthor +Co-authored-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 20 ++++++++++++++++++++ + drivers/linstorvolumemanager.py | 26 +++++++++++++++++++++++--- + 2 files changed, 43 insertions(+), 3 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index ed5998e..7b9a8e5 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -1943,6 +1943,26 @@ class LinstorVDI(VDI.VDI): + .format(e) + ) + ++ # We remove only on slaves because the volume can be used by the GC. ++ if self.sr._is_master: ++ return ++ ++ while vdi_uuid: ++ try: ++ path = self._linstor.build_device_path(self._linstor.get_volume_name(vdi_uuid)) ++ parent_vdi_uuid = self.sr._vhdutil.get_vhd_info(vdi_uuid).parentUuid ++ except Exception: ++ break ++ ++ if util.pathexists(path): ++ try: ++ self._linstor.remove_volume_if_diskless(vdi_uuid) ++ except Exception as e: ++ # Ensure we can always detach properly. ++ # I don't want to corrupt the XAPI info. ++ util.SMlog('Failed to clean VDI {} during detach: {}'.format(vdi_uuid, e)) ++ vdi_uuid = parent_vdi_uuid ++ + def resize(self, sr_uuid, vdi_uuid, size): + util.SMlog('LinstorVDI.resize for {}'.format(self.uuid)) + if not self.sr._is_master: +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 49ca83c..0f6fbcf 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -781,6 +781,28 @@ class LinstorVolumeManager(object): + if waiting: + self._logger('No volume locked now!') + ++ def remove_volume_if_diskless(self, volume_uuid): ++ """ ++ Remove disless path from local node. ++ :param str volume_uuid: The volume uuid to remove. ++ """ ++ ++ self._ensure_volume_exists(volume_uuid) ++ ++ volume_properties = self._get_volume_properties(volume_uuid) ++ volume_name = volume_properties.get(self.PROP_VOLUME_NAME) ++ ++ node_name = socket.gethostname() ++ result = self._linstor.resource_delete_if_diskless( ++ node_name=node_name, rsc_name=volume_name ++ ) ++ if not linstor.Linstor.all_api_responses_no_error(result): ++ raise LinstorVolumeManagerError( ++ 'Unable to delete diskless path of `{}` on node `{}`: {}' ++ .format(volume_name, node_name, ', '.join( ++ [str(x) for x in result])) ++ ) ++ + def introduce_volume(self, volume_uuid): + pass # TODO: Implement me. + +@@ -2459,9 +2481,7 @@ class LinstorVolumeManager(object): + + @classmethod + def _activate_device_path(cls, lin, node_name, volume_name): +- result = lin.resource_create([ +- linstor.ResourceData(node_name, volume_name, diskless=True) +- ]) ++ result = lin.resource_make_available(node_name, volume_name, diskful=False) + if linstor.Linstor.all_api_responses_no_error(result): + return + errors = linstor.Linstor.filter_api_call_response_errors(result) +-- +2.45.2 + diff --git a/SOURCES/0137-fix-LinstorSR-robustify-_load_vdi_info-in-cleanup.py.patch b/SOURCES/0137-fix-LinstorSR-robustify-_load_vdi_info-in-cleanup.py.patch new file mode 100644 index 00000000..3dd4d206 --- /dev/null +++ b/SOURCES/0137-fix-LinstorSR-robustify-_load_vdi_info-in-cleanup.py.patch @@ -0,0 +1,99 @@ +From 61c5216457523eecd22684b2e00aff4c0b165907 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Wed, 11 Oct 2023 12:39:56 +0200 +Subject: [PATCH 137/175] fix(LinstorSR): robustify _load_vdi_info in + cleanup.py + +After a failed snapshot like that: +``` +Sep 18 12:02:47 xcp1 SM: [909] ['/usr/bin/vhd-util', 'snapshot', '--debug', '-n', '/dev/drbd/by-res/xcp-volume-bbf05b73-bbad-438e-a194-3470558c8a8d/0', '-p', '/dev/drbd/by-res/xcp-volume-432905e3-57ba-41c7-8517-3331e1907c69/0', '-S', '2097152'] +Sep 18 12:02:49 xcp1 SM: [909] FAILED in util.pread: (rc 30) stdout: '', stderr: '/dev/drbd/by-res/xcp-volume-bbf05b73-bbad-438e-a194-3470558c8a8d/0: failed to create: -30 +Sep 18 12:02:50 xcp1 SM: [909] raise opener exception: cmd: `['/usr/bin/vhd-util', 'snapshot', '--debug', '-n', '/dev/drbd/by-res/xcp-volume-bbf05b73-bbad-438e-a194-3470558c8a8d/0', '-p', '/dev/drbd/by-res/xcp-volume-432905e3-57ba-41c7-8517-3331e1907c69/0', '-S', '2097152']`, code: `30`, reason: `/dev/drbd/by-res/xcp-volume-bbf05b73-bbad-438e-a194-3470558c8a8d/0: failed to create: -30` (openers: {'xcp3': {}, 'xcp2': {}, 'xcp1': {}}) +Sep 18 12:02:50 xcp1 SM: [909] ***** Failed to snapshot!: EXCEPTION , cmd: `['/usr/bin/vhd-util', 'snapshot', '--debug', '-n', '/dev/drbd/by-res/xcp-volume-bbf05b73-bbad-438e-a194-3470558c8a8d/0', '-p', '/dev/drbd/by-res/xcp-volume-432905e3-57ba-41c7-8517-3331e1907c69/0', '-S', '2097152']`, code: `30`, reason: `/dev/drbd/by-res/xcp-volume-bbf05b73-bbad-438e-a194-3470558c8a8d/0: failed to create: -30` (openers: {'xcp3': {}, 'xcp2': {}, 'xcp1': {}}) +Sep 18 12:02:50 xcp1 SM: [909] Cannot destroy VDI 4e1ac2a2-3d57-408f-92a8-ccc03882511f during undo clone: Cannot destroy volume `4e1ac2a2-3d57-408f-92a8-ccc03882511f`: Could not destroy resource `xcp-volume-bbf05b73-bbad-438e-a194-3470558c8a8d` from SR `xcp-sr-linstor_group_thin_device`: Resource 'xcp-volume-bbf05b73-bbad-438e-a194-3470558c8a8d' on node 'xcp2' is still in use. +Sep 18 12:02:50 xcp1 SM: [909] Trying to update volume UUID 4e1ac2a2-3d57-408f-92a8-ccc03882511f to DELETED_4e1ac2a2-3d57-408f-92a8-ccc03882511f... +``` + +The remaining volume can be empty, so we must ignore all volumes with the `DELETED_` prefix. +These are not valid VHDs after all. +And also we must be sure to never set the RAW flag on corrupted VHDs during cleanup. + +Signed-off-by: Ronan Abhamon +--- + drivers/cleanup.py | 46 ++++++++++++++++++++++++++++++++++++++++++---- + 1 file changed, 42 insertions(+), 4 deletions(-) + +diff --git a/drivers/cleanup.py b/drivers/cleanup.py +index 5353e9a..376da3e 100755 +--- a/drivers/cleanup.py ++++ b/drivers/cleanup.py +@@ -2990,16 +2990,31 @@ class LinstorSR(SR): + all_volume_info = self._linstor.get_volumes_with_info() + volumes_metadata = self._linstor.get_volumes_with_metadata() + for vdi_uuid, volume_info in all_volume_info.items(): ++ deleted = False + try: + if not volume_info.name and \ + not list(volumes_metadata[vdi_uuid].items()): + continue # Ignore it, probably deleted. + + vdi_type = volumes_metadata[vdi_uuid].get(VDI_TYPE_TAG) +- if vdi_type == vhdutil.VDI_TYPE_RAW: +- info = None +- else: ++ if vdi_uuid.startswith('DELETED_'): ++ # Assume it's really a RAW volume of a failed snap without VHD header/footer. ++ deleted = True ++ elif vdi_type == vhdutil.VDI_TYPE_VHD: + info = self._vhdutil.get_vhd_info(vdi_uuid) ++ else: ++ # Ensure it's not a VHD... ++ try: ++ info = self._vhdutil.get_vhd_info(vdi_uuid) ++ except: ++ try: ++ self._vhdutil.force_repair( ++ self._linstor.get_device_path(vdi_uuid) ++ ) ++ info = self._vhdutil.get_vhd_info(vdi_uuid) ++ except: ++ info = None ++ + except Exception as e: + Util.log( + ' [VDI {}: failed to load VDI info]: {}' +@@ -3007,7 +3022,30 @@ class LinstorSR(SR): + ) + info = vhdutil.VHDInfo(vdi_uuid) + info.error = 1 +- all_vdi_info[vdi_uuid] = info ++ ++ if not deleted: ++ all_vdi_info[vdi_uuid] = info ++ continue ++ ++ # We must remove this VDI now without adding it in the VDI list. ++ # Otherwise `Relinking` calls and other actions can be launched on it. ++ # We don't want that... ++ assert deleted ++ assert vdi_uuid.startswith('DELETED_') ++ Util.log('Deleting bad VDI {}'.format(vdi_uuid)) ++ ++ self.lock() ++ try: ++ self._linstor.destroy_volume(vdi_uuid) ++ try: ++ self.forgetVDI(vdi_uuid) ++ except: ++ pass ++ except Exception as e: ++ Util.log('Cannot delete bad VDI: {}'.format(e)) ++ finally: ++ self.unlock() ++ + return all_vdi_info + + # TODO: Maybe implement _liveLeafCoalesce/_prepareCoalesceLeaf/ +-- +2.45.2 + diff --git a/SOURCES/0138-fix-LinstorSR-ensure-detach-never-fails-on-plugin-fa.patch b/SOURCES/0138-fix-LinstorSR-ensure-detach-never-fails-on-plugin-fa.patch new file mode 100644 index 00000000..e84d77b5 --- /dev/null +++ b/SOURCES/0138-fix-LinstorSR-ensure-detach-never-fails-on-plugin-fa.patch @@ -0,0 +1,32 @@ +From 7eaa9c4c8f1053c1fed35e0c42d7783b3064fdd2 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Mon, 23 Oct 2023 14:31:27 +0200 +Subject: [PATCH 138/175] fix(LinstorSR): ensure detach never fails on plugin + failure + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 7b9a8e5..d0fc421 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -2241,7 +2241,12 @@ class LinstorVDI(VDI.VDI): + 'srUuid': self.sr.uuid, + 'vdiUuid': self.uuid + } +- self.sr._exec_manager_command(master, fn, args, 'VDIUnavailable') ++ ++ try: ++ self.sr._exec_manager_command(master, fn, args, 'VDIUnavailable') ++ except Exception: ++ if fn != 'detach': ++ raise + + # Reload size attrs after inflate or deflate! + self._load_this() +-- +2.45.2 + diff --git a/SOURCES/0139-fix-LinstorSR-ensure-we-coalesce-only-volumes-with-a.patch b/SOURCES/0139-fix-LinstorSR-ensure-we-coalesce-only-volumes-with-a.patch new file mode 100644 index 00000000..21fdcd24 --- /dev/null +++ b/SOURCES/0139-fix-LinstorSR-ensure-we-coalesce-only-volumes-with-a.patch @@ -0,0 +1,140 @@ +From 4f4326e015f13074ba713c58a8347c7fe6a5db3d Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Mon, 23 Oct 2023 15:52:23 +0200 +Subject: [PATCH 139/175] fix(LinstorSR): ensure we coalesce only volumes with + a valid size + +--- + drivers/cleanup.py | 14 ++++++++++++++ + drivers/linstor-manager | 15 +++++++++++++++ + drivers/linstorvhdutil.py | 21 ++++++++++++++++++--- + 3 files changed, 47 insertions(+), 3 deletions(-) + +diff --git a/drivers/cleanup.py b/drivers/cleanup.py +index 376da3e..4e4620f 100755 +--- a/drivers/cleanup.py ++++ b/drivers/cleanup.py +@@ -1441,6 +1441,20 @@ class LinstorVDI(VDI): + return super(LinstorVDI, self).pause(failfast) + + def coalesce(self): ++ # Note: We raise `SMException` here to skip the current coalesce in case of failure. ++ # Using another exception we can't execute the next coalesce calls. ++ try: ++ drbd_size = self.sr._vhdutil.get_drbd_size(self.uuid) ++ except Exception as e: ++ raise util.SMException( ++ 'VDI {} could not be coalesced because the DRBD block size cannot be read: {}' ++ .format(self.uuid, e)) ++ ++ if self._sizeVHD > drbd_size: ++ raise util.SMException( ++ 'VDI {} could not be coalesced because VHD phys size > DRBD block size ({} > {})' ++ .format(self.uuid, self._sizeVHD, drbd_size)) ++ + self.sr._vhdutil.force_coalesce(self.path) + + def getParent(self): +diff --git a/drivers/linstor-manager b/drivers/linstor-manager +index 45201ee..9e5e1d6 100755 +--- a/drivers/linstor-manager ++++ b/drivers/linstor-manager +@@ -485,6 +485,18 @@ def get_block_bitmap(session, args): + raise + + ++def get_drbd_size(session, args): ++ try: ++ device_path = args['devicePath'] ++ (ret, stdout, stderr) = util.doexec(['blockdev', '--getsize64', device_path]) ++ if ret == 0: ++ return stdout.strip() ++ raise Exception('Failed to get DRBD size: {}'.format(stderr)) ++ except Exception: ++ util.SMlog('linstor-manager:get_drbd_size error: {}'.format(stderr)) ++ raise ++ ++ + def set_parent(session, args): + try: + device_path = args['devicePath'] +@@ -969,6 +981,9 @@ if __name__ == '__main__': + 'getKeyHash': get_key_hash, + 'getBlockBitmap': get_block_bitmap, + ++ # Small helper to get the DRBD blockdev size. ++ 'getDrbdSize': get_drbd_size, ++ + # Called by cleanup.py to coalesce when a primary + # is opened on a non-local host. + 'setParent': set_parent, +diff --git a/drivers/linstorvhdutil.py b/drivers/linstorvhdutil.py +index 8b6985d..5f3ae08 100644 +--- a/drivers/linstorvhdutil.py ++++ b/drivers/linstorvhdutil.py +@@ -38,7 +38,7 @@ def call_vhd_util_on_host(session, host_ref, method, device_path, args): + util.SMlog('call-plugin ({} with {}) exception: {}'.format( + method, args, e + )) +- raise ++ raise util.SMException(str(e)) + + util.SMlog('call-plugin ({} with {}) returned: {}'.format( + method, args, response +@@ -47,7 +47,7 @@ def call_vhd_util_on_host(session, host_ref, method, device_path, args): + return response + + +-class LinstorCallException(Exception): ++class LinstorCallException(util.SMException): + def __init__(self, cmd_err): + self.cmd_err = cmd_err + +@@ -207,6 +207,16 @@ class LinstorVhdUtil: + def get_block_bitmap(self, vdi_uuid, response): + return base64.b64decode(response) + ++ @linstorhostcall('_get_drbd_size', 'getDrbdSize') ++ def get_drbd_size(self, vdi_uuid, response): ++ return int(response) ++ ++ def _get_drbd_size(self, path): ++ (ret, stdout, stderr) = util.doexec(['blockdev', '--getsize64', path]) ++ if ret == 0: ++ return int(stdout.strip()) ++ raise util.SMException('Failed to get DRBD size: {}'.format(stderr)) ++ + # -------------------------------------------------------------------------- + # Setters: only used locally. + # -------------------------------------------------------------------------- +@@ -308,7 +318,6 @@ class LinstorVhdUtil: + else: + e_str = str(e) + +- e_with_openers = None + try: + volume_uuid = self._linstor.get_volume_uuid_from_device_path( + device_path +@@ -326,6 +335,9 @@ class LinstorVhdUtil: + raise e_wrapper # pylint: disable = E0702 + + def _call_local_vhd_util(self, local_method, device_path, *args, **kwargs): ++ if isinstance(local_method, str): ++ local_method = getattr(self, local_method) ++ + try: + def local_call(): + try: +@@ -355,6 +367,9 @@ class LinstorVhdUtil: + # another host using the DRBD opener list. In the other case, if the parent is required, + # we must check where this last one is open instead of the child. + ++ if isinstance(local_method, str): ++ local_method = getattr(self, local_method) ++ + # A. Try to write locally... + try: + return self._call_local_vhd_util(local_method, device_path, *args, **kwargs) +-- +2.45.2 + diff --git a/SOURCES/0140-fix-LinstorSR-don-t-try-to-repair-persistent-volumes.patch b/SOURCES/0140-fix-LinstorSR-don-t-try-to-repair-persistent-volumes.patch new file mode 100644 index 00000000..dbe7cfeb --- /dev/null +++ b/SOURCES/0140-fix-LinstorSR-don-t-try-to-repair-persistent-volumes.patch @@ -0,0 +1,199 @@ +From 1712a2e6e321ba2871d04b2da7d6f5e9ff3080a0 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Tue, 24 Oct 2023 11:57:40 +0200 +Subject: [PATCH 140/175] fix(LinstorSR): don't try to repair persistent + volumes in GC + +Use constants to simplify maintenance. +--- + drivers/LinstorSR.py | 21 ++++++++----- + drivers/cleanup.py | 54 ++++++++++++++++----------------- + drivers/linstorvolumemanager.py | 4 ++- + 3 files changed, 43 insertions(+), 36 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index d0fc421..d0ce079 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -23,6 +23,7 @@ try: + from linstorvolumemanager import get_controller_node_name + from linstorvolumemanager import LinstorVolumeManager + from linstorvolumemanager import LinstorVolumeManagerError ++ from linstorvolumemanager import PERSISTENT_PREFIX + + LINSTOR_AVAILABLE = True + except ImportError: +@@ -76,6 +77,10 @@ TRACE_PERFS = False + # Enable/Disable VHD key hash support. + USE_KEY_HASH = False + ++# Special volumes. ++HA_VOLUME_NAME = PERSISTENT_PREFIX + 'ha-statefile' ++REDO_LOG_VOLUME_NAME = PERSISTENT_PREFIX + 'redo-log' ++ + # ============================================================================== + + # TODO: Supports 'VDI_INTRODUCE', 'VDI_RESET_ON_BOOT/2', 'SR_TRIM', +@@ -1727,9 +1732,9 @@ class LinstorVDI(VDI.VDI): + try: + volume_name = None + if self.ty == 'ha_statefile': +- volume_name = 'xcp-persistent-ha-statefile' ++ volume_name = HA_VOLUME_NAME + elif self.ty == 'redo_log': +- volume_name = 'xcp-persistent-redo-log' ++ volume_name = REDO_LOG_VOLUME_NAME + + self._linstor.create_volume( + self.uuid, volume_size, persistent=False, +@@ -2085,7 +2090,7 @@ class LinstorVDI(VDI.VDI): + # instead. + volume_name = self._linstor.get_volume_name(self.uuid) + if not USE_HTTP_NBD_SERVERS or volume_name not in [ +- 'xcp-persistent-ha-statefile', 'xcp-persistent-redo-log' ++ HA_VOLUME_NAME, REDO_LOG_VOLUME_NAME + ]: + if not self.path or not util.pathexists(self.path): + available = False +@@ -2587,7 +2592,7 @@ class LinstorVDI(VDI.VDI): + http_server = None + + try: +- if volume_name == 'xcp-persistent-ha-statefile': ++ if volume_name == HA_VOLUME_NAME: + port = '8076' + else: + port = '8077' +@@ -2669,7 +2674,7 @@ class LinstorVDI(VDI.VDI): + try: + # We use a precomputed device size. + # So if the XAPI is modified, we must update these values! +- if volume_name == 'xcp-persistent-ha-statefile': ++ if volume_name == HA_VOLUME_NAME: + # See: https://github.com/xapi-project/xen-api/blob/703479fa448a8d7141954bb6e8964d8e25c4ac2e/ocaml/xapi/xha_statefile.ml#L32-L37 + port = '8076' + device_size = 4 * 1024 * 1024 +@@ -2793,7 +2798,7 @@ class LinstorVDI(VDI.VDI): + def _check_http_nbd_volume_name(self): + volume_name = self.path[14:] + if volume_name not in [ +- 'xcp-persistent-ha-statefile', 'xcp-persistent-redo-log' ++ HA_VOLUME_NAME, REDO_LOG_VOLUME_NAME + ]: + raise xs_errors.XenError( + 'VDIUnavailable', +@@ -2862,8 +2867,8 @@ class LinstorVDI(VDI.VDI): + http_service = None + if drbd_path: + assert(drbd_path in ( +- '/dev/drbd/by-res/xcp-persistent-ha-statefile/0', +- '/dev/drbd/by-res/xcp-persistent-redo-log/0' ++ '/dev/drbd/by-res/{}/0'.format(HA_VOLUME_NAME), ++ '/dev/drbd/by-res/{}/0'.format(REDO_LOG_VOLUME_NAME) + )) + self._start_persistent_http_server(volume_name) + +diff --git a/drivers/cleanup.py b/drivers/cleanup.py +index 4e4620f..1f89822 100755 +--- a/drivers/cleanup.py ++++ b/drivers/cleanup.py +@@ -55,6 +55,7 @@ try: + from linstorvolumemanager import get_controller_uri + from linstorvolumemanager import LinstorVolumeManager + from linstorvolumemanager import LinstorVolumeManagerError ++ from linstorvolumemanager import PERSISTENT_PREFIX as LINSTOR_PERSISTENT_PREFIX + + LINSTOR_AVAILABLE = True + except ImportError: +@@ -3004,16 +3005,36 @@ class LinstorSR(SR): + all_volume_info = self._linstor.get_volumes_with_info() + volumes_metadata = self._linstor.get_volumes_with_metadata() + for vdi_uuid, volume_info in all_volume_info.items(): +- deleted = False + try: +- if not volume_info.name and \ +- not list(volumes_metadata[vdi_uuid].items()): ++ volume_metadata = volumes_metadata[vdi_uuid] ++ if not volume_info.name and not list(volume_metadata.items()): + continue # Ignore it, probably deleted. + +- vdi_type = volumes_metadata[vdi_uuid].get(VDI_TYPE_TAG) + if vdi_uuid.startswith('DELETED_'): + # Assume it's really a RAW volume of a failed snap without VHD header/footer. +- deleted = True ++ # We must remove this VDI now without adding it in the VDI list. ++ # Otherwise `Relinking` calls and other actions can be launched on it. ++ # We don't want that... ++ Util.log('Deleting bad VDI {}'.format(vdi_uuid)) ++ ++ self.lock() ++ try: ++ self._linstor.destroy_volume(vdi_uuid) ++ try: ++ self.forgetVDI(vdi_uuid) ++ except: ++ pass ++ except Exception as e: ++ Util.log('Cannot delete bad VDI: {}'.format(e)) ++ finally: ++ self.unlock() ++ continue ++ ++ vdi_type = volume_metadata.get(VDI_TYPE_TAG) ++ volume_name = self._linstor.get_volume_name(vdi_uuid) ++ if volume_name.startswith(LINSTOR_PERSISTENT_PREFIX): ++ # Always RAW! ++ info = None + elif vdi_type == vhdutil.VDI_TYPE_VHD: + info = self._vhdutil.get_vhd_info(vdi_uuid) + else: +@@ -3037,28 +3058,7 @@ class LinstorSR(SR): + info = vhdutil.VHDInfo(vdi_uuid) + info.error = 1 + +- if not deleted: +- all_vdi_info[vdi_uuid] = info +- continue +- +- # We must remove this VDI now without adding it in the VDI list. +- # Otherwise `Relinking` calls and other actions can be launched on it. +- # We don't want that... +- assert deleted +- assert vdi_uuid.startswith('DELETED_') +- Util.log('Deleting bad VDI {}'.format(vdi_uuid)) +- +- self.lock() +- try: +- self._linstor.destroy_volume(vdi_uuid) +- try: +- self.forgetVDI(vdi_uuid) +- except: +- pass +- except Exception as e: +- Util.log('Cannot delete bad VDI: {}'.format(e)) +- finally: +- self.unlock() ++ all_vdi_info[vdi_uuid] = info + + return all_vdi_info + +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 0f6fbcf..47ca4e8 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -30,9 +30,11 @@ import time + import util + import uuid + ++# Persistent prefix to add to RAW persistent volumes. ++PERSISTENT_PREFIX = 'xcp-persistent-' + + # Contains the data of the "/var/lib/linstor" directory. +-DATABASE_VOLUME_NAME = 'xcp-persistent-database' ++DATABASE_VOLUME_NAME = PERSISTENT_PREFIX + 'database' + DATABASE_SIZE = 1 << 30 # 1GB. + DATABASE_PATH = '/var/lib/linstor' + DATABASE_MKFS = 'mkfs.ext4' +-- +2.45.2 + diff --git a/SOURCES/0141-fix-linstorvhdutil-format-correctly-message-if-vhd-u.patch b/SOURCES/0141-fix-linstorvhdutil-format-correctly-message-if-vhd-u.patch new file mode 100644 index 00000000..0c0b0180 --- /dev/null +++ b/SOURCES/0141-fix-linstorvhdutil-format-correctly-message-if-vhd-u.patch @@ -0,0 +1,28 @@ +From 54a4909b24a679c308b96c358aaebe2fa55cd2f8 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Tue, 14 Nov 2023 18:21:53 +0100 +Subject: [PATCH 141/175] fix(linstorvhdutil): format correctly message if + vhd-util cannot be run + +Signed-off-by: Ronan Abhamon +--- + drivers/linstorvhdutil.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/linstorvhdutil.py b/drivers/linstorvhdutil.py +index 5f3ae08..3ce7ab9 100644 +--- a/drivers/linstorvhdutil.py ++++ b/drivers/linstorvhdutil.py +@@ -441,7 +441,7 @@ class LinstorVhdUtil: + + raise xs_errors.XenError( + 'VDIUnavailable', +- opterr='No valid host found to run vhd-util command `{}` (path=`{}`, openers=`{}`): {}' +- .format(remote_method, device_path, openers, e) ++ opterr='No valid host found to run vhd-util command `{}` (path=`{}`, openers=`{}`)' ++ .format(remote_method, device_path, openers) + ) + return util.retry(remote_call, 5, 2) +-- +2.45.2 + diff --git a/SOURCES/0142-fix-LinstorSR-wait-during-attach-to-open-DRBD-path.patch b/SOURCES/0142-fix-LinstorSR-wait-during-attach-to-open-DRBD-path.patch new file mode 100644 index 00000000..05bb68fb --- /dev/null +++ b/SOURCES/0142-fix-LinstorSR-wait-during-attach-to-open-DRBD-path.patch @@ -0,0 +1,46 @@ +From 2db4a62b837c295deee9098b0cf6c0fb8547af2a Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Tue, 24 Oct 2023 23:07:23 +0200 +Subject: [PATCH 142/175] fix(LinstorSR): wait during attach to open DRBD path + +ENODATA and other errors like EROFS can be raised when +a new DRBD path is created on the fly. So ensure to block before tapdisk starts. + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index d0ce079..3063abf 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -1901,6 +1901,25 @@ class LinstorVDI(VDI.VDI): + raise xs_errors.XenError( + 'VDIUnavailable', opterr='Could not find: {}'.format(path) + ) ++ ++ # Diskless path can be created on the fly, ensure we can open it. ++ def check_volume_usable(): ++ while True: ++ try: ++ with open(path, 'r+'): ++ pass ++ except IOError as e: ++ if e.errno == errno.ENODATA: ++ time.sleep(2) ++ continue ++ if e.errno == errno.EROFS: ++ util.SMlog('Volume not attachable because RO. Openers: {}'.format( ++ self.sr._linstor.get_volume_openers(vdi_uuid) ++ )) ++ raise ++ break ++ util.retry(check_volume_usable, 15, 2) ++ + vdi_uuid = self.sr._vhdutil.get_vhd_info(vdi_uuid).parentUuid + + self.attached = True +-- +2.45.2 + diff --git a/SOURCES/0143-fix-LinstorSR-support-different-volume-sizes-in-clea.patch b/SOURCES/0143-fix-LinstorSR-support-different-volume-sizes-in-clea.patch new file mode 100644 index 00000000..6181427f --- /dev/null +++ b/SOURCES/0143-fix-LinstorSR-support-different-volume-sizes-in-clea.patch @@ -0,0 +1,517 @@ +From 97dfc6b7552ecf5891826107972bd4b8fcb4f2a4 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Tue, 14 Nov 2023 18:08:26 +0100 +Subject: [PATCH 143/175] fix(LinstorSR): support different volume sizes in + cleanup.py + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 97 +++++------------------------ + drivers/cleanup.py | 128 +++++++++++++++++++++++++++++++------- + drivers/linstorvhdutil.py | 75 ++++++++++++++++++++++ + 3 files changed, 194 insertions(+), 106 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 3063abf..6802f49 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -134,19 +134,6 @@ OPS_EXCLUSIVE = [ + # ============================================================================== + + +-def compute_volume_size(virtual_size, image_type): +- if image_type == vhdutil.VDI_TYPE_VHD: +- # All LINSTOR VDIs have the metadata area preallocated for +- # the maximum possible virtual size (for fast online VDI.resize). +- meta_overhead = vhdutil.calcOverheadEmpty(LinstorVDI.MAX_SIZE) +- bitmap_overhead = vhdutil.calcOverheadBitmap(virtual_size) +- virtual_size += meta_overhead + bitmap_overhead +- elif image_type != vhdutil.VDI_TYPE_RAW: +- raise Exception('Invalid image type: {}'.format(image_type)) +- +- return LinstorVolumeManager.round_up_volume_size(virtual_size) +- +- + def attach_thin(session, journaler, linstor, sr_uuid, vdi_uuid): + volume_metadata = linstor.get_volume_metadata(vdi_uuid) + image_type = volume_metadata.get(VDI_TYPE_TAG) +@@ -157,7 +144,7 @@ def attach_thin(session, journaler, linstor, sr_uuid, vdi_uuid): + + # If the virtual VHD size is lower than the LINSTOR volume size, + # there is nothing to do. +- vhd_size = compute_volume_size( ++ vhd_size = LinstorVhdUtil.compute_volume_size( + # TODO: Replace pylint comment with this feature when possible: + # https://github.com/PyCQA/pylint/pull/2926 + LinstorVhdUtil(session, linstor).get_size_virt(vdi_uuid), # pylint: disable = E1120 +@@ -168,9 +155,8 @@ def attach_thin(session, journaler, linstor, sr_uuid, vdi_uuid): + volume_size = volume_info.virtual_size + + if vhd_size > volume_size: +- inflate( +- journaler, linstor, vdi_uuid, device_path, +- vhd_size, volume_size ++ LinstorVhdUtil(session, linstor).inflate( ++ journaler, vdi_uuid, device_path, vhd_size, volume_size + ) + + +@@ -202,17 +188,16 @@ def detach_thin_impl(session, linstor, sr_uuid, vdi_uuid): + util.retry(check_vbd_count, maxretry=10, period=1) + + device_path = linstor.get_device_path(vdi_uuid) ++ vhdutil_inst = LinstorVhdUtil(session, linstor) + new_volume_size = LinstorVolumeManager.round_up_volume_size( + # TODO: Replace pylint comment with this feature when possible: + # https://github.com/PyCQA/pylint/pull/2926 +- LinstorVhdUtil(session, linstor).get_size_phys(vdi_uuid) # pylint: disable = E1120 ++ vhdutil_inst.get_size_phys(vdi_uuid) # pylint: disable = E1120 + ) + + volume_info = linstor.get_volume_info(vdi_uuid) + old_volume_size = volume_info.virtual_size +- deflate( +- linstor, vdi_uuid, device_path, new_volume_size, old_volume_size +- ) ++ vhdutil_inst.deflate(vdi_uuid, device_path, new_volume_size, old_volume_size) + + + def detach_thin(session, linstor, sr_uuid, vdi_uuid): +@@ -225,56 +210,6 @@ def detach_thin(session, linstor, sr_uuid, vdi_uuid): + util.SMlog('Failed to detach properly VDI {}: {}'.format(vdi_uuid, e)) + + +-def inflate(journaler, linstor, vdi_uuid, vdi_path, new_size, old_size): +- # Only inflate if the LINSTOR volume capacity is not enough. +- new_size = LinstorVolumeManager.round_up_volume_size(new_size) +- if new_size <= old_size: +- return +- +- util.SMlog( +- 'Inflate {} (size={}, previous={})' +- .format(vdi_uuid, new_size, old_size) +- ) +- +- journaler.create( +- LinstorJournaler.INFLATE, vdi_uuid, old_size +- ) +- linstor.resize_volume(vdi_uuid, new_size) +- +- result_size = linstor.get_volume_size(vdi_uuid) +- if result_size < new_size: +- util.SMlog( +- 'WARNING: Cannot inflate volume to {}B, result size: {}B' +- .format(new_size, result_size) +- ) +- +- if not util.zeroOut( +- vdi_path, result_size - vhdutil.VHD_FOOTER_SIZE, +- vhdutil.VHD_FOOTER_SIZE +- ): +- raise xs_errors.XenError( +- 'EIO', +- opterr='Failed to zero out VHD footer {}'.format(vdi_path) +- ) +- +- LinstorVhdUtil(None, linstor).set_size_phys(vdi_path, result_size, False) +- journaler.remove(LinstorJournaler.INFLATE, vdi_uuid) +- +- +-def deflate(linstor, vdi_uuid, vdi_path, new_size, old_size): +- new_size = LinstorVolumeManager.round_up_volume_size(new_size) +- if new_size >= old_size: +- return +- +- util.SMlog( +- 'Deflate {} (new size={}, previous={})' +- .format(vdi_uuid, new_size, old_size) +- ) +- +- LinstorVhdUtil(None, linstor).set_size_phys(vdi_path, new_size) +- # TODO: Change the LINSTOR volume size using linstor.resize_volume. +- +- + IPS_XHA_CACHE = None + + +@@ -1390,7 +1325,7 @@ class LinstorSR(SR.SR): + current_size - vhdutil.VHD_FOOTER_SIZE, + vhdutil.VHD_FOOTER_SIZE + ) +- deflate(self._linstor, vdi_uuid, vdi.path, old_size, current_size) ++ self._vhdutil.deflate(vdi_uuid, vdi.path, old_size, current_size) + + def _handle_interrupted_clone( + self, vdi_uuid, clone_info, force_undo=False +@@ -1502,9 +1437,9 @@ class LinstorSR(SR.SR): + # Inflate to the right size. + if base_type == vhdutil.VDI_TYPE_VHD: + vdi = self.vdi(vdi_uuid) +- volume_size = compute_volume_size(vdi.size, vdi.vdi_type) +- inflate( +- self._journaler, self._linstor, vdi_uuid, vdi.path, ++ volume_size = LinstorVhdUtil.compute_volume_size(vdi.size, vdi.vdi_type) ++ self._vhdutil.inflate( ++ self._journaler, vdi_uuid, vdi.path, + volume_size, vdi.capacity + ) + self.vdis[vdi_uuid] = vdi +@@ -1619,8 +1554,6 @@ class LinstorVDI(VDI.VDI): + TYPE_RAW = 'raw' + TYPE_VHD = 'vhd' + +- MAX_SIZE = 2 * 1024 * 1024 * 1024 * 1024 # Max VHD size. +- + # Metadata size given to the "S" param of vhd-util create. + # "-S size (MB) for metadata preallocation". + # Increase the performance when resize is called. +@@ -1717,7 +1650,7 @@ class LinstorVDI(VDI.VDI): + + # 2. Compute size and check space available. + size = vhdutil.validate_and_round_vhd_size(long(size)) +- volume_size = compute_volume_size(size, self.vdi_type) ++ volume_size = LinstorVhdUtil.compute_volume_size(size, self.vdi_type) + util.SMlog( + 'LinstorVDI.create: type={}, vhd-size={}, volume-size={}' + .format(self.vdi_type, size, volume_size) +@@ -1869,7 +1802,7 @@ class LinstorVDI(VDI.VDI): + if ( + self.vdi_type == vhdutil.VDI_TYPE_RAW or + not writable or +- self.capacity >= compute_volume_size(self.size, self.vdi_type) ++ self.capacity >= LinstorVhdUtil.compute_volume_size(self.size, self.vdi_type) + ): + need_inflate = False + +@@ -1938,7 +1871,7 @@ class LinstorVDI(VDI.VDI): + + # The VDI is already deflated if the VHD image size + metadata is + # equal to the LINSTOR volume size. +- volume_size = compute_volume_size(self.size, self.vdi_type) ++ volume_size = LinstorVhdUtil.compute_volume_size(self.size, self.vdi_type) + already_deflated = self.capacity <= volume_size + + if already_deflated: +@@ -2000,7 +1933,7 @@ class LinstorVDI(VDI.VDI): + + # Compute the virtual VHD and DRBD volume size. + size = vhdutil.validate_and_round_vhd_size(long(size)) +- volume_size = compute_volume_size(size, self.vdi_type) ++ volume_size = LinstorVhdUtil.compute_volume_size(size, self.vdi_type) + util.SMlog( + 'LinstorVDI.resize: type={}, vhd-size={}, volume-size={}' + .format(self.vdi_type, size, volume_size) +@@ -2033,7 +1966,7 @@ class LinstorVDI(VDI.VDI): + self._linstor.resize(self.uuid, new_volume_size) + else: + if new_volume_size != old_volume_size: +- inflate( ++ self.sr._vhdutil.inflate( + self.sr._journaler, self._linstor, self.uuid, self.path, + new_volume_size, old_volume_size + ) +diff --git a/drivers/cleanup.py b/drivers/cleanup.py +index 1f89822..d2fb884 100755 +--- a/drivers/cleanup.py ++++ b/drivers/cleanup.py +@@ -1383,8 +1383,6 @@ class LVHDVDI(VDI): + class LinstorVDI(VDI): + """Object representing a VDI in a LINSTOR SR""" + +- MAX_SIZE = 2 * 1024 * 1024 * 1024 * 1024 # Max VHD size. +- + VOLUME_LOCK_TIMEOUT = 30 + + def load(self, info=None): +@@ -1408,8 +1406,41 @@ class LinstorVDI(VDI): + self.parentUuid = info.parentUuid + self.sizeVirt = info.sizeVirt + self._sizeVHD = info.sizePhys ++ self.drbd_size = self.sr._vhdutil.get_drbd_size(self.uuid) + self.hidden = info.hidden + self.scanError = False ++ self.vdi_type = vhdutil.VDI_TYPE_VHD ++ ++ def getDriverName(self): ++ if self.raw: ++ return self.DRIVER_NAME_RAW ++ return self.DRIVER_NAME_VHD ++ ++ def inflate(self, size): ++ if self.raw: ++ return ++ self.sr.lock() ++ try: ++ self.sr._vhdutil.inflate(self.sr.journaler, self.uuid, self.path, size, self.drbd_size) ++ finally: ++ self.sr.unlock() ++ self.drbd_size = self.sr._vhdutil.get_drbd_size(self.uuid) ++ self._sizeVHD = self.sr._vhdutil.get_size_phys(self.uuid) ++ ++ def deflate(self): ++ if self.raw: ++ return ++ self.sr.lock() ++ try: ++ self.sr._vhdutil.deflate(self.uuid, self.path, self._sizeVHD, self.drbd_size) ++ finally: ++ self.sr.unlock() ++ self.drbd_size = self.sr._vhdutil.get_drbd_size(self.uuid) ++ self._sizeVHD = self.sr._vhdutil.get_size_phys(self.uuid) ++ ++ def inflateFully(self): ++ if not self.raw: ++ self.inflate(LinstorVhdUtil.compute_volume_size(self.sizeVirt, self.vdi_type)) + + def rename(self, uuid): + Util.log('Renaming {} -> {} (path={})'.format( +@@ -1432,7 +1463,7 @@ class LinstorVDI(VDI): + VDI.delete(self) + + def validate(self, fast=False): +- if not self.sr._vhdutil.check(self.uuid, fast=fast): ++ if not self.raw and not self.sr._vhdutil.check(self.uuid, fast=fast): + raise util.SMException('VHD {} corrupted'.format(self)) + + def pause(self, failfast=False): +@@ -1444,18 +1475,6 @@ class LinstorVDI(VDI): + def coalesce(self): + # Note: We raise `SMException` here to skip the current coalesce in case of failure. + # Using another exception we can't execute the next coalesce calls. +- try: +- drbd_size = self.sr._vhdutil.get_drbd_size(self.uuid) +- except Exception as e: +- raise util.SMException( +- 'VDI {} could not be coalesced because the DRBD block size cannot be read: {}' +- .format(self.uuid, e)) +- +- if self._sizeVHD > drbd_size: +- raise util.SMException( +- 'VDI {} could not be coalesced because VHD phys size > DRBD block size ({} > {})' +- .format(self.uuid, self._sizeVHD, drbd_size)) +- + self.sr._vhdutil.force_coalesce(self.path) + + def getParent(self): +@@ -1505,6 +1524,22 @@ class LinstorVDI(VDI): + Util.log("Failed to update %s with vhd-parent field %s" % \ + (self.uuid, self.parentUuid)) + ++ def _doCoalesce(self): ++ try: ++ self._activateChain() ++ self.parent.validate() ++ self._inflateParentForCoalesce() ++ VDI._doCoalesce(self) ++ finally: ++ self.parent._sizeVHD = self.sr._vhdutil.get_size_phys(self.parent.uuid) ++ self.parent.deflate() ++ ++ def _activateChain(self): ++ vdi = self ++ while vdi: ++ p = self.sr._linstor.get_device_path(vdi.uuid) ++ vdi = vdi.parent ++ + def _setHidden(self, hidden=True): + HIDDEN_TAG = 'hidden' + +@@ -1516,9 +1551,52 @@ class LinstorVDI(VDI): + else: + VDI._setHidden(self, hidden) + ++ def _setSizeVirt(self, size): ++ jfile = self.uuid + '-jvhd' ++ self.sr._linstor.create_volume( ++ jfile, vhdutil.MAX_VHD_JOURNAL_SIZE, persistent=False, volume_name=jfile ++ ) ++ try: ++ self.inflate(LinstorVhdUtil.compute_volume_size(size, self.vdi_type)) ++ self.sr._vhdutil.set_size_virt(size, jfile) ++ finally: ++ try: ++ self.sr._linstor.destroy_volume(jfile) ++ except Exception: ++ # We can ignore it, in any case this volume is not persistent. ++ pass ++ + def _queryVHDBlocks(self): + return self.sr._vhdutil.get_block_bitmap(self.uuid) + ++ def _inflateParentForCoalesce(self): ++ if self.parent.raw: ++ return ++ inc = self._calcExtraSpaceForCoalescing() ++ if inc > 0: ++ self.parent.inflate(self.parent.drbd_size + inc) ++ ++ def _calcExtraSpaceForCoalescing(self): ++ if self.parent.raw: ++ return 0 ++ size_coalesced = LinstorVhdUtil.compute_volume_size( ++ self._getCoalescedSizeData(), self.vdi_type ++ ) ++ Util.log("Coalesced size = %s" % Util.num2str(size_coalesced)) ++ return size_coalesced - self.parent.drbd_size ++ ++ def _calcExtraSpaceForLeafCoalescing(self): ++ assert self.drbd_size > 0 ++ assert self._sizeVHD > 0 ++ deflate_diff = self.drbd_size - LinstorVolumeManager.round_up_volume_size(self._sizeVHD) ++ assert deflate_diff >= 0 ++ return self._calcExtraSpaceForCoalescing() - deflate_diff ++ ++ def _calcExtraSpaceForSnapshotCoalescing(self): ++ assert self._sizeVHD > 0 ++ return self._calcExtraSpaceForCoalescing() + \ ++ LinstorVolumeManager.round_up_volume_size(self._sizeVHD) ++ + ################################################################################ + # + # SR +@@ -3062,17 +3140,19 @@ class LinstorSR(SR): + + return all_vdi_info + +- # TODO: Maybe implement _liveLeafCoalesce/_prepareCoalesceLeaf/ +- # _finishCoalesceLeaf/_updateSlavesOnResize like LVM plugin. ++ def _prepareCoalesceLeaf(self, vdi): ++ vdi._activateChain() ++ vdi.deflate() ++ vdi._inflateParentForCoalesce() ++ ++ def _finishCoalesceLeaf(self, parent): ++ if not parent.isSnapshot() or parent.isAttachedRW(): ++ parent.inflateFully() ++ else: ++ parent.deflate() + + def _calcExtraSpaceNeeded(self, child, parent): +- meta_overhead = vhdutil.calcOverheadEmpty(LinstorVDI.MAX_SIZE) +- bitmap_overhead = vhdutil.calcOverheadBitmap(parent.sizeVirt) +- virtual_size = LinstorVolumeManager.round_up_volume_size( +- parent.sizeVirt + meta_overhead + bitmap_overhead +- ) +- volume_size = self._linstor.get_volume_size(parent.uuid) +- return virtual_size - volume_size ++ return self._linstor.compute_volume_size(parent.sizeVirt, parent.vdi_type) - parent.drbd_size + + def _hasValidDevicePath(self, uuid): + try: +diff --git a/drivers/linstorvhdutil.py b/drivers/linstorvhdutil.py +index 3ce7ab9..239a10a 100644 +--- a/drivers/linstorvhdutil.py ++++ b/drivers/linstorvhdutil.py +@@ -14,6 +14,8 @@ + # You should have received a copy of the GNU General Public License + # along with this program. If not, see . + ++from linstorjournaler import LinstorJournaler ++from linstorvolumemanager import LinstorVolumeManager + import base64 + import distutils.util + import errno +@@ -133,6 +135,8 @@ def linstormodifier(): + + + class LinstorVhdUtil: ++ MAX_SIZE = 2 * 1024 * 1024 * 1024 * 1024 # Max VHD size. ++ + def __init__(self, session, linstor): + self._session = session + self._linstor = linstor +@@ -225,6 +229,10 @@ class LinstorVhdUtil: + def create(self, path, size, static, msize=0): + return self._call_local_vhd_util_or_fail(vhdutil.create, path, size, static, msize) + ++ @linstormodifier() ++ def set_size_virt(self, path, size, jfile): ++ return self._call_local_vhd_util_or_fail(vhdutil.setSizeVirt, path, size, jfile) ++ + @linstormodifier() + def set_size_virt_fast(self, path, size): + return self._call_local_vhd_util_or_fail(vhdutil.setSizeVirtFast, path, size) +@@ -253,6 +261,56 @@ class LinstorVhdUtil: + def snapshot(self, path, parent, parentRaw, msize=0, checkEmpty=True): + return self._call_local_vhd_util_or_fail(vhdutil.snapshot, path, parent, parentRaw, msize, checkEmpty) + ++ def inflate(self, journaler, vdi_uuid, vdi_path, new_size, old_size): ++ # Only inflate if the LINSTOR volume capacity is not enough. ++ new_size = LinstorVolumeManager.round_up_volume_size(new_size) ++ if new_size <= old_size: ++ return ++ ++ util.SMlog( ++ 'Inflate {} (size={}, previous={})' ++ .format(vdi_uuid, new_size, old_size) ++ ) ++ ++ journaler.create( ++ LinstorJournaler.INFLATE, vdi_uuid, old_size ++ ) ++ self._linstor.resize_volume(vdi_uuid, new_size) ++ ++ # TODO: Replace pylint comment with this feature when possible: ++ # https://github.com/PyCQA/pylint/pull/2926 ++ result_size = self.get_drbd_size(vdi_uuid) # pylint: disable = E1120 ++ if result_size < new_size: ++ util.SMlog( ++ 'WARNING: Cannot inflate volume to {}B, result size: {}B' ++ .format(new_size, result_size) ++ ) ++ ++ if not util.zeroOut( ++ vdi_path, result_size - vhdutil.VHD_FOOTER_SIZE, ++ vhdutil.VHD_FOOTER_SIZE ++ ): ++ raise xs_errors.XenError( ++ 'EIO', ++ opterr='Failed to zero out VHD footer {}'.format(vdi_path) ++ ) ++ ++ self.set_size_phys(vdi_path, result_size, False) ++ journaler.remove(LinstorJournaler.INFLATE, vdi_uuid) ++ ++ def deflate(self, vdi_uuid, vdi_path, new_size, old_size): ++ new_size = LinstorVolumeManager.round_up_volume_size(new_size) ++ if new_size >= old_size: ++ return ++ ++ util.SMlog( ++ 'Deflate {} (new size={}, previous={})' ++ .format(vdi_uuid, new_size, old_size) ++ ) ++ ++ self.set_size_phys(vdi_path, new_size) ++ # TODO: Change the LINSTOR volume size using linstor.resize_volume. ++ + # -------------------------------------------------------------------------- + # Remote setters: write locally and try on another host in case of failure. + # -------------------------------------------------------------------------- +@@ -273,6 +331,23 @@ class LinstorVhdUtil: + def force_repair(self, path): + return self._call_vhd_util(vhdutil.repair, 'repair', path, use_parent=False) + ++ # -------------------------------------------------------------------------- ++ # Static helpers. ++ # -------------------------------------------------------------------------- ++ ++ @classmethod ++ def compute_volume_size(cls, virtual_size, image_type): ++ if image_type == vhdutil.VDI_TYPE_VHD: ++ # All LINSTOR VDIs have the metadata area preallocated for ++ # the maximum possible virtual size (for fast online VDI.resize). ++ meta_overhead = vhdutil.calcOverheadEmpty(cls.MAX_SIZE) ++ bitmap_overhead = vhdutil.calcOverheadBitmap(virtual_size) ++ virtual_size += meta_overhead + bitmap_overhead ++ elif image_type != vhdutil.VDI_TYPE_RAW: ++ raise Exception('Invalid image type: {}'.format(image_type)) ++ ++ return LinstorVolumeManager.round_up_volume_size(virtual_size) ++ + # -------------------------------------------------------------------------- + # Helpers. + # -------------------------------------------------------------------------- +-- +2.45.2 + diff --git a/SOURCES/0144-fix-LinstorSR-remove-useless-IPS_XHA_CACHE-var.patch b/SOURCES/0144-fix-LinstorSR-remove-useless-IPS_XHA_CACHE-var.patch new file mode 100644 index 00000000..924e661f --- /dev/null +++ b/SOURCES/0144-fix-LinstorSR-remove-useless-IPS_XHA_CACHE-var.patch @@ -0,0 +1,31 @@ +From 801dad839e5289d0498c1c27f89bbfe1ec21406a Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Mon, 20 Nov 2023 10:52:27 +0100 +Subject: [PATCH 144/175] fix(LinstorSR): remove useless IPS_XHA_CACHE var + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 6 ------ + 1 file changed, 6 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 6802f49..c570925 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -210,13 +210,7 @@ def detach_thin(session, linstor, sr_uuid, vdi_uuid): + util.SMlog('Failed to detach properly VDI {}: {}'.format(vdi_uuid, e)) + + +-IPS_XHA_CACHE = None +- +- + def get_ips_from_xha_config_file(): +- if IPS_XHA_CACHE: +- return IPS_XHA_CACHE +- + ips = dict() + host_id = None + try: +-- +2.45.2 + diff --git a/SOURCES/0145-fix-LinstorSR-ensure-we-can-deflate-on-any-host-afte.patch b/SOURCES/0145-fix-LinstorSR-ensure-we-can-deflate-on-any-host-afte.patch new file mode 100644 index 00000000..037074a5 --- /dev/null +++ b/SOURCES/0145-fix-LinstorSR-ensure-we-can-deflate-on-any-host-afte.patch @@ -0,0 +1,318 @@ +From 9b3174fa7cc145bc6e91fbe0f6beb9bc67de616e Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Tue, 21 Nov 2023 13:50:24 +0100 +Subject: [PATCH 145/175] fix(LinstorSR): ensure we can deflate on any host + after a journal rollback + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 10 +---- + drivers/cleanup.py | 2 +- + drivers/linstor-manager | 24 ++++++++++++ + drivers/linstorvhdutil.py | 82 +++++++++++++++++++++++---------------- + 4 files changed, 76 insertions(+), 42 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index c570925..1d1b51a 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -197,7 +197,7 @@ def detach_thin_impl(session, linstor, sr_uuid, vdi_uuid): + + volume_info = linstor.get_volume_info(vdi_uuid) + old_volume_size = volume_info.virtual_size +- vhdutil_inst.deflate(vdi_uuid, device_path, new_volume_size, old_volume_size) ++ vhdutil_inst.deflate(device_path, new_volume_size, old_volume_size) + + + def detach_thin(session, linstor, sr_uuid, vdi_uuid): +@@ -1313,13 +1313,7 @@ class LinstorSR(SR.SR): + + current_size = volume_info.virtual_size + assert current_size > 0 +- +- util.zeroOut( +- vdi.path, +- current_size - vhdutil.VHD_FOOTER_SIZE, +- vhdutil.VHD_FOOTER_SIZE +- ) +- self._vhdutil.deflate(vdi_uuid, vdi.path, old_size, current_size) ++ self._vhdutil.force_deflate(vdi.path, old_size, current_size, zeroize=True) + + def _handle_interrupted_clone( + self, vdi_uuid, clone_info, force_undo=False +diff --git a/drivers/cleanup.py b/drivers/cleanup.py +index d2fb884..3c2810c 100755 +--- a/drivers/cleanup.py ++++ b/drivers/cleanup.py +@@ -1432,7 +1432,7 @@ class LinstorVDI(VDI): + return + self.sr.lock() + try: +- self.sr._vhdutil.deflate(self.uuid, self.path, self._sizeVHD, self.drbd_size) ++ self.sr._vhdutil.force_deflate(self.path, self._sizeVHD, self.drbd_size, zeroize=False) + finally: + self.sr.unlock() + self.drbd_size = self.sr._vhdutil.get_drbd_size(self.uuid) +diff --git a/drivers/linstor-manager b/drivers/linstor-manager +index 9e5e1d6..7726c1b 100755 +--- a/drivers/linstor-manager ++++ b/drivers/linstor-manager +@@ -28,6 +28,7 @@ import XenAPI + import XenAPIPlugin + + from linstorjournaler import LinstorJournaler ++from linstorvhdutil import LinstorVhdUtil + from linstorvolumemanager import get_controller_uri, get_local_volume_openers, LinstorVolumeManager + from lock import Lock + import json +@@ -528,6 +529,26 @@ def repair(session, args): + raise + + ++def deflate(session, args): ++ try: ++ device_path = args['devicePath'] ++ new_size = int(args['newSize']) ++ old_size = int(args['oldSize']) ++ zeroize = distutils.util.strtobool(args['zeroize']) ++ group_name = args['groupName'] ++ ++ linstor = LinstorVolumeManager( ++ get_controller_uri(), ++ group_name, ++ logger=util.SMlog ++ ) ++ LinstorVhdUtil(session, linstor).deflate(device_path, new_size, old_size, zeroize) ++ return '' ++ except Exception as e: ++ util.SMlog('linstor-manager:deflate error: {}'.format(e)) ++ raise ++ ++ + def lock_vdi(session, args): + lock = None + try: +@@ -990,6 +1011,9 @@ if __name__ == '__main__': + 'coalesce': coalesce, + 'repair': repair, + ++ # Misc writters. ++ 'deflate': deflate, ++ + 'lockVdi': lock_vdi, + 'hasControllerRunning': has_controller_running, + 'addHost': add_host, +diff --git a/drivers/linstorvhdutil.py b/drivers/linstorvhdutil.py +index 239a10a..23d8b6a 100644 +--- a/drivers/linstorvhdutil.py ++++ b/drivers/linstorvhdutil.py +@@ -31,7 +31,7 @@ MANAGER_PLUGIN = 'linstor-manager' + EMEDIUMTYPE = 124 + + +-def call_vhd_util_on_host(session, host_ref, method, device_path, args): ++def call_remote_method(session, host_ref, method, device_path, args): + try: + response = session.xenapi.host.call_plugin( + host_ref, MANAGER_PLUGIN, method, args +@@ -86,7 +86,7 @@ def linstorhostcall(local_method, remote_method): + local_e = None + try: + if not in_use_by or socket.gethostname() in node_names: +- return self._call_local_vhd_util(local_method, device_path, *args[2:], **kwargs) ++ return self._call_local_method(local_method, device_path, *args[2:], **kwargs) + except ErofsLinstorCallException as e: + local_e = e.cmd_err + except Exception as e: +@@ -112,7 +112,7 @@ def linstorhostcall(local_method, remote_method): + try: + def remote_call(): + host_ref = self._get_readonly_host(vdi_uuid, device_path, node_names) +- return call_vhd_util_on_host(self._session, host_ref, remote_method, device_path, remote_args) ++ return call_remote_method(self._session, host_ref, remote_method, device_path, remote_args) + response = util.retry(remote_call, 5, 2) + except Exception as remote_e: + self._raise_openers_exception(device_path, local_e or remote_e) +@@ -227,39 +227,39 @@ class LinstorVhdUtil: + + @linstormodifier() + def create(self, path, size, static, msize=0): +- return self._call_local_vhd_util_or_fail(vhdutil.create, path, size, static, msize) ++ return self._call_local_method_or_fail(vhdutil.create, path, size, static, msize) + + @linstormodifier() + def set_size_virt(self, path, size, jfile): +- return self._call_local_vhd_util_or_fail(vhdutil.setSizeVirt, path, size, jfile) ++ return self._call_local_method_or_fail(vhdutil.setSizeVirt, path, size, jfile) + + @linstormodifier() + def set_size_virt_fast(self, path, size): +- return self._call_local_vhd_util_or_fail(vhdutil.setSizeVirtFast, path, size) ++ return self._call_local_method_or_fail(vhdutil.setSizeVirtFast, path, size) + + @linstormodifier() + def set_size_phys(self, path, size, debug=True): +- return self._call_local_vhd_util_or_fail(vhdutil.setSizePhys, path, size, debug) ++ return self._call_local_method_or_fail(vhdutil.setSizePhys, path, size, debug) + + @linstormodifier() + def set_parent(self, path, parentPath, parentRaw=False): +- return self._call_local_vhd_util_or_fail(vhdutil.setParent, path, parentPath, parentRaw) ++ return self._call_local_method_or_fail(vhdutil.setParent, path, parentPath, parentRaw) + + @linstormodifier() + def set_hidden(self, path, hidden=True): +- return self._call_local_vhd_util_or_fail(vhdutil.setHidden, path, hidden) ++ return self._call_local_method_or_fail(vhdutil.setHidden, path, hidden) + + @linstormodifier() + def set_key(self, path, key_hash): +- return self._call_local_vhd_util_or_fail(vhdutil.setKey, path, key_hash) ++ return self._call_local_method_or_fail(vhdutil.setKey, path, key_hash) + + @linstormodifier() + def kill_data(self, path): +- return self._call_local_vhd_util_or_fail(vhdutil.killData, path) ++ return self._call_local_method_or_fail(vhdutil.killData, path) + + @linstormodifier() + def snapshot(self, path, parent, parentRaw, msize=0, checkEmpty=True): +- return self._call_local_vhd_util_or_fail(vhdutil.snapshot, path, parent, parentRaw, msize, checkEmpty) ++ return self._call_local_method_or_fail(vhdutil.snapshot, path, parent, parentRaw, msize, checkEmpty) + + def inflate(self, journaler, vdi_uuid, vdi_path, new_size, old_size): + # Only inflate if the LINSTOR volume capacity is not enough. +@@ -269,7 +269,7 @@ class LinstorVhdUtil: + + util.SMlog( + 'Inflate {} (size={}, previous={})' +- .format(vdi_uuid, new_size, old_size) ++ .format(vdi_path, new_size, old_size) + ) + + journaler.create( +@@ -286,26 +286,22 @@ class LinstorVhdUtil: + .format(new_size, result_size) + ) + +- if not util.zeroOut( +- vdi_path, result_size - vhdutil.VHD_FOOTER_SIZE, +- vhdutil.VHD_FOOTER_SIZE +- ): +- raise xs_errors.XenError( +- 'EIO', +- opterr='Failed to zero out VHD footer {}'.format(vdi_path) +- ) +- ++ self._zeroize(vdi_path, result_size - vhdutil.VHD_FOOTER_SIZE) + self.set_size_phys(vdi_path, result_size, False) + journaler.remove(LinstorJournaler.INFLATE, vdi_uuid) + +- def deflate(self, vdi_uuid, vdi_path, new_size, old_size): ++ def deflate(self, vdi_path, new_size, old_size, zeroize=False): ++ if zeroize: ++ assert old_size > vhdutil.VHD_FOOTER_SIZE ++ self._zeroize(vdi_path, old_size - vhdutil.VHD_FOOTER_SIZE) ++ + new_size = LinstorVolumeManager.round_up_volume_size(new_size) + if new_size >= old_size: + return + + util.SMlog( + 'Deflate {} (new size={}, previous={})' +- .format(vdi_uuid, new_size, old_size) ++ .format(vdi_path, new_size, old_size) + ) + + self.set_size_phys(vdi_path, new_size) +@@ -321,15 +317,27 @@ class LinstorVhdUtil: + 'parentPath': str(parentPath), + 'parentRaw': parentRaw + } +- return self._call_vhd_util(vhdutil.setParent, 'setParent', path, use_parent=False, **kwargs) ++ return self._call_method(vhdutil.setParent, 'setParent', path, use_parent=False, **kwargs) + + @linstormodifier() + def force_coalesce(self, path): +- return self._call_vhd_util(vhdutil.coalesce, 'coalesce', path, use_parent=True) ++ return self._call_method(vhdutil.coalesce, 'coalesce', path, use_parent=True) + + @linstormodifier() + def force_repair(self, path): +- return self._call_vhd_util(vhdutil.repair, 'repair', path, use_parent=False) ++ return self._call_method(vhdutil.repair, 'repair', path, use_parent=False) ++ ++ @linstormodifier() ++ def force_deflate(self, path, newSize, oldSize, zeroize): ++ kwargs = { ++ 'newSize': newSize, ++ 'oldSize': oldSize, ++ 'zeroize': zeroize ++ } ++ return self._call_method('_force_deflate', 'deflate', path, use_parent=False, **kwargs) ++ ++ def _force_deflate(self, path, newSize, oldSize, zeroize): ++ self.deflate(path, newSize, oldSize, zeroize) + + # -------------------------------------------------------------------------- + # Static helpers. +@@ -409,7 +417,7 @@ class LinstorVhdUtil: + util.SMlog('raise opener exception: {}'.format(e_wrapper)) + raise e_wrapper # pylint: disable = E0702 + +- def _call_local_vhd_util(self, local_method, device_path, *args, **kwargs): ++ def _call_local_method(self, local_method, device_path, *args, **kwargs): + if isinstance(local_method, str): + local_method = getattr(self, local_method) + +@@ -429,14 +437,14 @@ class LinstorVhdUtil: + util.SMlog('failed to execute locally vhd-util (sys {})'.format(e.code)) + raise e + +- def _call_local_vhd_util_or_fail(self, local_method, device_path, *args, **kwargs): ++ def _call_local_method_or_fail(self, local_method, device_path, *args, **kwargs): + try: +- return self._call_local_vhd_util(local_method, device_path, *args, **kwargs) ++ return self._call_local_method(local_method, device_path, *args, **kwargs) + except ErofsLinstorCallException as e: + # Volume is locked on a host, find openers. + self._raise_openers_exception(device_path, e.cmd_err) + +- def _call_vhd_util(self, local_method, remote_method, device_path, use_parent, *args, **kwargs): ++ def _call_method(self, local_method, remote_method, device_path, use_parent, *args, **kwargs): + # Note: `use_parent` exists to know if the VHD parent is used by the local/remote method. + # Normally in case of failure, if the parent is unused we try to execute the method on + # another host using the DRBD opener list. In the other case, if the parent is required, +@@ -447,7 +455,7 @@ class LinstorVhdUtil: + + # A. Try to write locally... + try: +- return self._call_local_vhd_util(local_method, device_path, *args, **kwargs) ++ return self._call_local_method(local_method, device_path, *args, **kwargs) + except Exception: + pass + +@@ -504,7 +512,7 @@ class LinstorVhdUtil: + + no_host_found = False + try: +- return call_vhd_util_on_host(self._session, host_ref, remote_method, device_path, remote_args) ++ return call_remote_method(self._session, host_ref, remote_method, device_path, remote_args) + except Exception: + pass + +@@ -520,3 +528,11 @@ class LinstorVhdUtil: + .format(remote_method, device_path, openers) + ) + return util.retry(remote_call, 5, 2) ++ ++ @staticmethod ++ def _zeroize(path, size): ++ if not util.zeroOut(path, size, vhdutil.VHD_FOOTER_SIZE): ++ raise xs_errors.XenError( ++ 'EIO', ++ opterr='Failed to zero out VHD footer {}'.format(path) ++ ) +-- +2.45.2 + diff --git a/SOURCES/0146-fix-LinstorSR-ensure-we-always-use-real-DRBD-VHD-siz.patch b/SOURCES/0146-fix-LinstorSR-ensure-we-always-use-real-DRBD-VHD-siz.patch new file mode 100644 index 00000000..3f7e6c70 --- /dev/null +++ b/SOURCES/0146-fix-LinstorSR-ensure-we-always-use-real-DRBD-VHD-siz.patch @@ -0,0 +1,149 @@ +From 2a40d7f0b506df2d5761e722c50dfee67fae9eda Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Mon, 27 Nov 2023 12:15:43 +0100 +Subject: [PATCH 146/175] fix(LinstorSR): ensure we always use real DRBD/VHD + sizes in inflate/deflate GC calls + +--- + drivers/cleanup.py | 54 +++++++++++++++++++++++++--------------------- + 1 file changed, 30 insertions(+), 24 deletions(-) + +diff --git a/drivers/cleanup.py b/drivers/cleanup.py +index 3c2810c..8635f48 100755 +--- a/drivers/cleanup.py ++++ b/drivers/cleanup.py +@@ -1405,38 +1405,49 @@ class LinstorVDI(VDI): + + self.parentUuid = info.parentUuid + self.sizeVirt = info.sizeVirt +- self._sizeVHD = info.sizePhys +- self.drbd_size = self.sr._vhdutil.get_drbd_size(self.uuid) ++ self._sizeVHD = -1 ++ self.drbd_size = -1 + self.hidden = info.hidden + self.scanError = False + self.vdi_type = vhdutil.VDI_TYPE_VHD + +- def getDriverName(self): +- if self.raw: +- return self.DRIVER_NAME_RAW +- return self.DRIVER_NAME_VHD ++ def getSizeVHD(self, fetch=False): ++ if self._sizeVHD < 0 or fetch: ++ self._sizeVHD = self.sr._vhdutil.get_size_phys(self.uuid) ++ return self._sizeVHD ++ ++ def getDrbdSize(self, fetch=False): ++ if self.drbd_size < 0 or fetch: ++ self.drbd_size = self.sr._vhdutil.get_drbd_size(self.uuid) ++ return self.drbd_size + + def inflate(self, size): + if self.raw: + return + self.sr.lock() + try: ++ # Ensure we use the real DRBD size and not the cached one. ++ # Why? Because this attribute can be changed if volume is resized by user. ++ self.drbd_size = self.getDrbdSize(fetch=True) + self.sr._vhdutil.inflate(self.sr.journaler, self.uuid, self.path, size, self.drbd_size) + finally: + self.sr.unlock() +- self.drbd_size = self.sr._vhdutil.get_drbd_size(self.uuid) +- self._sizeVHD = self.sr._vhdutil.get_size_phys(self.uuid) ++ self.drbd_size = -1 ++ self._sizeVHD = -1 + + def deflate(self): + if self.raw: + return + self.sr.lock() + try: ++ # Ensure we use the real sizes and not the cached info. ++ self.drbd_size = self.getDrbdSize(fetch=True) ++ self._sizeVHD = self.getSizeVHD(fetch=True) + self.sr._vhdutil.force_deflate(self.path, self._sizeVHD, self.drbd_size, zeroize=False) + finally: + self.sr.unlock() +- self.drbd_size = self.sr._vhdutil.get_drbd_size(self.uuid) +- self._sizeVHD = self.sr._vhdutil.get_size_phys(self.uuid) ++ self.drbd_size = -1 ++ self._sizeVHD = -1 + + def inflateFully(self): + if not self.raw: +@@ -1512,6 +1523,7 @@ class LinstorVDI(VDI): + self.children = [] + + def _setParent(self, parent): ++ self.sr._linstor.get_device_path(self.uuid) + self.sr._vhdutil.force_parent(self.path, parent.path) + self.parent = parent + self.parentUuid = parent.uuid +@@ -1531,7 +1543,6 @@ class LinstorVDI(VDI): + self._inflateParentForCoalesce() + VDI._doCoalesce(self) + finally: +- self.parent._sizeVHD = self.sr._vhdutil.get_size_phys(self.parent.uuid) + self.parent.deflate() + + def _activateChain(self): +@@ -1574,7 +1585,7 @@ class LinstorVDI(VDI): + return + inc = self._calcExtraSpaceForCoalescing() + if inc > 0: +- self.parent.inflate(self.parent.drbd_size + inc) ++ self.parent.inflate(self.parent.getDrbdSize() + inc) + + def _calcExtraSpaceForCoalescing(self): + if self.parent.raw: +@@ -1583,19 +1594,19 @@ class LinstorVDI(VDI): + self._getCoalescedSizeData(), self.vdi_type + ) + Util.log("Coalesced size = %s" % Util.num2str(size_coalesced)) +- return size_coalesced - self.parent.drbd_size ++ return size_coalesced - self.parent.getDrbdSize() + + def _calcExtraSpaceForLeafCoalescing(self): +- assert self.drbd_size > 0 +- assert self._sizeVHD > 0 +- deflate_diff = self.drbd_size - LinstorVolumeManager.round_up_volume_size(self._sizeVHD) ++ assert self.getDrbdSize() > 0 ++ assert self.getSizeVHD() > 0 ++ deflate_diff = self.getDrbdSize() - LinstorVolumeManager.round_up_volume_size(self.getSizeVHD()) + assert deflate_diff >= 0 + return self._calcExtraSpaceForCoalescing() - deflate_diff + + def _calcExtraSpaceForSnapshotCoalescing(self): +- assert self._sizeVHD > 0 ++ assert self.getSizeVHD() > 0 + return self._calcExtraSpaceForCoalescing() + \ +- LinstorVolumeManager.round_up_volume_size(self._sizeVHD) ++ LinstorVolumeManager.round_up_volume_size(self.getSizeVHD()) + + ################################################################################ + # +@@ -3152,7 +3163,7 @@ class LinstorSR(SR): + parent.deflate() + + def _calcExtraSpaceNeeded(self, child, parent): +- return self._linstor.compute_volume_size(parent.sizeVirt, parent.vdi_type) - parent.drbd_size ++ return LinstorVhdUtil.compute_volume_size(parent.sizeVirt, parent.vdi_type) - parent.getDrbdSize() + + def _hasValidDevicePath(self, uuid): + try: +@@ -3172,11 +3183,6 @@ class LinstorSR(SR): + finally: + self.unlock() + +- def _prepareCoalesceLeaf(self, vdi): +- # Move diskless path if necessary. We must have an access +- # to modify locally the volume. +- self._linstor.get_device_path(vdi.uuid) +- + def _handleInterruptedCoalesceLeaf(self): + entries = self.journaler.get_all(VDI.JRN_LEAF) + for uuid, parentUuid in entries.iteritems(): +-- +2.45.2 + diff --git a/SOURCES/0147-feat-linstor-kv-tool-If-no-controller-uri-option-is-.patch b/SOURCES/0147-feat-linstor-kv-tool-If-no-controller-uri-option-is-.patch new file mode 100644 index 00000000..f2dd959e --- /dev/null +++ b/SOURCES/0147-feat-linstor-kv-tool-If-no-controller-uri-option-is-.patch @@ -0,0 +1,56 @@ +From f016b9e1a971a2b6679879619cb9a9cc08828ca5 Mon Sep 17 00:00:00 2001 +From: BenjiReis +Date: Mon, 27 Nov 2023 14:23:57 +0100 +Subject: [PATCH 147/175] feat(linstor-kv-tool): If no controller uri option is + provided fetch it (#48) + +Signed-off-by: BenjiReis +--- + scripts/linstor-kv-tool | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +diff --git a/scripts/linstor-kv-tool b/scripts/linstor-kv-tool +index c907027..b845ec2 100755 +--- a/scripts/linstor-kv-tool ++++ b/scripts/linstor-kv-tool +@@ -13,6 +13,10 @@ + # + # You should have received a copy of the GNU General Public License + # along with this program. If not, see . ++import sys ++sys.path[0] = '/opt/xensource/sm/' ++ ++from linstorvolumemanager import get_controller_uri + + import argparse + import json +@@ -56,7 +60,7 @@ def remove_all_volumes(controller_uri, group_name): + + def main(): + parser = argparse.ArgumentParser() +- parser.add_argument('-u', '--uri', required=True) ++ parser.add_argument('-u', '--uri', required=False) + parser.add_argument('-g', '--group-name', required=True) + parser.add_argument('-n', '--namespace', default='/') + +@@ -66,12 +70,14 @@ def main(): + action.add_argument('--remove-all-volumes', action='store_true') + + args = parser.parse_args() ++ controller_uri = get_controller_uri() if args.uri is None else args.uri ++ + if args.dump_volumes: +- dump_kv(args.uri, args.group_name, args.namespace) ++ dump_kv(controller_uri, args.group_name, args.namespace) + elif args.remove_volume: +- remove_volume(args.uri, args.group_name, args.remove_volume) ++ remove_volume(controller_uri, args.group_name, args.remove_volume) + elif args.remove_all_volumes: +- remove_all_volumes(args.uri, args.group_name) ++ remove_all_volumes(controller_uri, args.group_name) + + + if __name__ == '__main__': +-- +2.45.2 + diff --git a/SOURCES/0148-fix-linstorvolumemanager-robustify-SR-destroy-46.patch b/SOURCES/0148-fix-linstorvolumemanager-robustify-SR-destroy-46.patch new file mode 100644 index 00000000..f5739bd0 --- /dev/null +++ b/SOURCES/0148-fix-linstorvolumemanager-robustify-SR-destroy-46.patch @@ -0,0 +1,210 @@ +From 34ebe2ad9e60d33477d4011cd675636dbd632aa4 Mon Sep 17 00:00:00 2001 +From: BenjiReis +Date: Wed, 29 Nov 2023 15:45:32 +0100 +Subject: [PATCH 148/175] fix(linstorvolumemanager): robustify SR destroy (#46) + +Signed-off-by: Ronan Abhamon +Co-authored-by: BenjiReis +--- + drivers/linstorvolumemanager.py | 118 +++++++++++++++++++++++--------- + 1 file changed, 86 insertions(+), 32 deletions(-) + +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 47ca4e8..d27c84e 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -1372,35 +1372,63 @@ class LinstorVolumeManager(object): + :param bool force: Try to destroy volumes before if true. + """ + ++ # 1. Ensure volume list is empty. No cost. + if self._volumes: + raise LinstorVolumeManagerError( + 'Cannot destroy LINSTOR volume manager: ' + 'It exists remaining volumes' + ) + ++ # 2. Fetch ALL resource names. ++ # This list may therefore contain volumes created outside ++ # the scope of the driver. ++ resource_names = self._fetch_resource_names(ignore_deleted=False) ++ try: ++ resource_names.remove(DATABASE_VOLUME_NAME) ++ except KeyError: ++ # Really strange to reach that point. ++ # Normally we always have the database volume in the list. ++ pass ++ ++ # 3. Ensure the resource name list is entirely empty... ++ if resource_names: ++ raise LinstorVolumeManagerError( ++ 'Cannot destroy LINSTOR volume manager: ' ++ 'It exists remaining volumes (created externally or being deleted)' ++ ) ++ ++ # 4. Destroying... + controller_is_running = self._controller_is_running() + uri = 'linstor://localhost' + try: + if controller_is_running: + self._start_controller(start=False) + +- # 1. Umount LINSTOR database. ++ # 4.1. Umount LINSTOR database. + self._mount_database_volume( + self.build_device_path(DATABASE_VOLUME_NAME), + mount=False, + force=True + ) + +- # 2. Refresh instance. ++ # 4.2. Refresh instance. + self._start_controller(start=True) + self._linstor = self._create_linstor_instance( + uri, keep_uri_unmodified=True + ) + +- # 3. Destroy database volume. ++ # 4.3. Destroy database volume. + self._destroy_resource(DATABASE_VOLUME_NAME) + +- # 4. Destroy group and storage pools. ++ # 4.4. Refresh linstor connection. ++ # Without we get this error: ++ # "Cannot delete resource group 'xcp-sr-linstor_group_thin_device' because it has existing resource definitions.." ++ # Because the deletion of the databse was not seen by Linstor for some reason. ++ # It seems a simple refresh of the Linstor connection make it aware of the deletion. ++ self._linstor.disconnect() ++ self._linstor.connect() ++ ++ # 4.5. Destroy group and storage pools. + self._destroy_resource_group(self._linstor, self._group_name) + for pool in self._get_storage_pools(force=True): + self._destroy_storage_pool( +@@ -1711,10 +1739,18 @@ class LinstorVolumeManager(object): + if lin.resource_group_list_raise( + [group_name] + ).resource_groups: +- raise LinstorVolumeManagerError( +- 'Unable to create SR `{}`: The group name already exists' +- .format(group_name) +- ) ++ if not lin.resource_dfn_list_raise().resource_definitions: ++ backup_path = cls._create_database_backup_path() ++ logger( ++ 'Group name already exists `{}` without LVs. ' ++ 'Ignoring and moving the config files in {}'.format(group_name, backup_path) ++ ) ++ cls._move_files(DATABASE_PATH, backup_path) ++ else: ++ raise LinstorVolumeManagerError( ++ 'Unable to create SR `{}`: The group name already exists' ++ .format(group_name) ++ ) + + if thin_provisioning: + driver_pool_parts = driver_pool_name.split('/') +@@ -1773,18 +1809,31 @@ class LinstorVolumeManager(object): + ) + + # 2.b. Create resource group. +- result = lin.resource_group_create( +- name=group_name, +- place_count=redundancy, +- storage_pool=group_name, +- diskless_on_remaining=False +- ) +- error_str = cls._get_error_str(result) +- if error_str: ++ rg_creation_attempt = 0 ++ while True: ++ result = lin.resource_group_create( ++ name=group_name, ++ place_count=redundancy, ++ storage_pool=group_name, ++ diskless_on_remaining=False ++ ) ++ error_str = cls._get_error_str(result) ++ if not error_str: ++ break ++ ++ errors = cls._filter_errors(result) ++ if cls._check_errors(errors, [linstor.consts.FAIL_EXISTS_RSC_GRP]): ++ rg_creation_attempt += 1 ++ if rg_creation_attempt < 2: ++ try: ++ cls._destroy_resource_group(lin, group_name) ++ except Exception as e: ++ error_str = 'Failed to destroy old and empty RG: {}'.format(e) ++ else: ++ continue ++ + raise LinstorVolumeManagerError( +- 'Could not create RG `{}`: {}'.format( +- group_name, error_str +- ) ++ 'Could not create RG `{}`: {}'.format(group_name, error_str) + ) + + # 2.c. Create volume group. +@@ -1961,12 +2010,14 @@ class LinstorVolumeManager(object): + ) + return result[0].candidates + +- def _fetch_resource_names(self): ++ def _fetch_resource_names(self, ignore_deleted=True): + resource_names = set() + dfns = self._linstor.resource_dfn_list_raise().resource_definitions + for dfn in dfns: +- if dfn.resource_group_name == self._group_name and \ +- linstor.consts.FLAG_DELETE not in dfn.flags: ++ if dfn.resource_group_name == self._group_name and ( ++ ignore_deleted or ++ linstor.consts.FLAG_DELETE not in dfn.flags ++ ): + resource_names.add(dfn.name) + return resource_names + +@@ -2680,19 +2731,10 @@ class LinstorVolumeManager(object): + + @classmethod + def _mount_database_volume(cls, volume_path, mount=True, force=False): +- backup_path = DATABASE_PATH + '-' + str(uuid.uuid4()) +- + try: + # 1. Create a backup config folder. + database_not_empty = bool(os.listdir(DATABASE_PATH)) +- if database_not_empty: +- try: +- os.mkdir(backup_path) +- except Exception as e: +- raise LinstorVolumeManagerError( +- 'Failed to create backup path {} of LINSTOR config: {}' +- .format(backup_path, e) +- ) ++ backup_path = cls._create_database_backup_path() + + # 2. Move the config in the mounted volume. + if database_not_empty: +@@ -2861,6 +2903,18 @@ class LinstorVolumeManager(object): + ) + ) + ++ @staticmethod ++ def _create_database_backup_path(): ++ path = DATABASE_PATH + '-' + str(uuid.uuid4()) ++ try: ++ os.mkdir(path) ++ return path ++ except Exception as e: ++ raise LinstorVolumeManagerError( ++ 'Failed to create backup path {} of LINSTOR config: {}' ++ .format(path, e) ++ ) ++ + @staticmethod + def _get_filtered_properties(properties): + return dict(properties.items()) +-- +2.45.2 + diff --git a/SOURCES/0149-feat-linstor-manager-extend-API-with-createNodeInter.patch b/SOURCES/0149-feat-linstor-manager-extend-API-with-createNodeInter.patch new file mode 100644 index 00000000..00e227d7 --- /dev/null +++ b/SOURCES/0149-feat-linstor-manager-extend-API-with-createNodeInter.patch @@ -0,0 +1,108 @@ +From fd687a38cc2c24f652d2f99314f89e51e3f17a32 Mon Sep 17 00:00:00 2001 +From: BenjiReis +Date: Wed, 29 Nov 2023 16:54:30 +0100 +Subject: [PATCH 149/175] feat(linstor-manager): extend API with + createNodeInterface and setNodePreferredInterface (#47) + +Signed-off-by: BenjiReis +--- + drivers/linstor-manager | 50 ++++++++++++++++++++++++++++++++- + drivers/linstorvolumemanager.py | 16 +++++++++++ + 2 files changed, 65 insertions(+), 1 deletion(-) + +diff --git a/drivers/linstor-manager b/drivers/linstor-manager +index 7726c1b..2469b50 100755 +--- a/drivers/linstor-manager ++++ b/drivers/linstor-manager +@@ -977,6 +977,51 @@ def health_check(session, args): + return format_result() + + ++def create_node_interface(session, args): ++ group_name = args['groupName'] ++ hostname = args['hostname'] ++ name = args['name'] ++ pif_uuid = args['pifUuid'] ++ ++ pif_ref = session.xenapi.PIF.get_by_uuid(pif_uuid) ++ pif = session.xenapi.PIF.get_record(pif_ref) ++ ++ if not pif['currently_attached']: ++ raise XenAPIPlugin.Failure('-1', ['PIF is not plugged']) ++ ++ ip_addr = pif['IP'] if pif['primary_address_type'].lower() == 'ipv4' else pif['IPv6'].split('/')[0] ++ if ip_addr == '': ++ raise XenAPIPlugin.Failure('-1', ['PIF has no IP']) ++ ++ linstor = LinstorVolumeManager( ++ get_controller_uri(), ++ group_name, ++ logger=util.SMlog ++ ) ++ try: ++ linstor.create_node_interface(hostname, name, ip_addr) ++ except Exception as e: ++ raise XenAPIPlugin.Failure('-1', [str(e)]) ++ return str(True) ++ ++ ++def set_node_preferred_interface(session, args): ++ group_name = args['groupName'] ++ hostname = args['hostname'] ++ name = args['name'] ++ ++ linstor = LinstorVolumeManager( ++ get_controller_uri(), ++ group_name, ++ logger=util.SMlog ++ ) ++ try: ++ linstor.set_node_preferred_interface(hostname, name) ++ except Exception as e: ++ raise XenAPIPlugin.Failure('-1', [str(e)]) ++ return str(True) ++ ++ + if __name__ == '__main__': + XenAPIPlugin.dispatch({ + 'prepareSr': prepare_sr, +@@ -1024,5 +1069,8 @@ if __name__ == '__main__': + 'destroyDrbdVolume': destroy_drbd_volume, + 'destroyDrbdVolumes': destroy_drbd_volumes, + 'getDrbdOpeners': get_drbd_openers, +- 'healthCheck': health_check ++ 'healthCheck': health_check, ++ ++ 'createNodeInterface': create_node_interface, ++ 'setNodePreferredInterface': set_node_preferred_interface + }) +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index d27c84e..fef34d3 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -1529,6 +1529,22 @@ class LinstorVolumeManager(object): + 'Failed to destroy node `{}`: {}'.format(node_name, error_str) + ) + ++ def create_node_interface(self, hostname, name, ip_addr): ++ result = self._linstor.netinterface_create(hostname, name, ip_addr) ++ if not linstor.Linstor.all_api_responses_no_error(result): ++ raise LinstorVolumeManagerError( ++ 'Unable to create interface on `{}`: {}'.format(hostname, ', '.join( ++ [str(x) for x in result])) ++ ) ++ ++ def set_node_preferred_interface(self, hostname, name): ++ result = self._linstor.node_modify(hostname, property_dict={'PrefNic': name}) ++ if not linstor.Linstor.all_api_responses_no_error(result): ++ raise LinstorVolumeManagerError( ++ 'Unable to set preferred interface on `{}`: {}'.format(hostname, ', '.join( ++ [str(x) for x in result])) ++ ) ++ + def get_nodes_info(self): + """ + Get all nodes + statuses, used or not by the pool. +-- +2.45.2 + diff --git a/SOURCES/0150-fix-LinstorSR-support-VDI.resize-on-thick-volumes.patch b/SOURCES/0150-fix-LinstorSR-support-VDI.resize-on-thick-volumes.patch new file mode 100644 index 00000000..23e3df78 --- /dev/null +++ b/SOURCES/0150-fix-LinstorSR-support-VDI.resize-on-thick-volumes.patch @@ -0,0 +1,31 @@ +From 77bbf3dd74958cf038766b6d37f584522d692106 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Fri, 1 Dec 2023 11:55:12 +0100 +Subject: [PATCH 150/175] fix(LinstorSR): support VDI.resize on thick volumes + +--- + drivers/LinstorSR.py | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 1d1b51a..a524338 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -1939,11 +1939,14 @@ class LinstorVDI(VDI.VDI): + + if self.vdi_type == vhdutil.VDI_TYPE_RAW: + old_volume_size = self.size ++ new_volume_size = LinstorVolumeManager.round_up_volume_size(size) + else: + old_volume_size = self.utilisation + if self.sr._provisioning == 'thin': + # VDI is currently deflated, so keep it deflated. + new_volume_size = old_volume_size ++ else: ++ new_volume_size = LinstorVhdUtil.compute_volume_size(size, self.vdi_type) + assert new_volume_size >= old_volume_size + + space_needed = new_volume_size - old_volume_size +-- +2.45.2 + diff --git a/SOURCES/0151-fix-linstorvolumemanager-format-correctly-exception-.patch b/SOURCES/0151-fix-linstorvolumemanager-format-correctly-exception-.patch new file mode 100644 index 00000000..7c5b45d1 --- /dev/null +++ b/SOURCES/0151-fix-linstorvolumemanager-format-correctly-exception-.patch @@ -0,0 +1,30 @@ +From 8d7880e0063d1fe5e79563a45e1224098e075d40 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Mon, 4 Dec 2023 16:36:55 +0100 +Subject: [PATCH 151/175] fix(linstorvolumemanager): format correctly exception + during db mount + +Signed-off-by: Ronan Abhamon +--- + drivers/linstorvolumemanager.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index fef34d3..a41314e 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -2764,9 +2764,9 @@ class LinstorVolumeManager(object): + # 3. Remove useless backup directory. + try: + os.rmdir(backup_path) +- except Exception: ++ except Exception as e: + raise LinstorVolumeManagerError( +- 'Failed to remove backup path {} of LINSTOR config {}' ++ 'Failed to remove backup path {} of LINSTOR config: {}' + .format(backup_path, e) + ) + except Exception as e: +-- +2.45.2 + diff --git a/SOURCES/0152-fix-LinstorSR-ensure-we-can-skip-coalesces-if-device.patch b/SOURCES/0152-fix-LinstorSR-ensure-we-can-skip-coalesces-if-device.patch new file mode 100644 index 00000000..95b172ff --- /dev/null +++ b/SOURCES/0152-fix-LinstorSR-ensure-we-can-skip-coalesces-if-device.patch @@ -0,0 +1,32 @@ +From 8ff742a8296b7ec3e4f8a35a749c54eaf37a54eb Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Mon, 4 Dec 2023 18:57:08 +0100 +Subject: [PATCH 152/175] fix(LinstorSR): ensure we can skip coalesces if + device path can't be fetched + +Signed-off-by: Ronan Abhamon +--- + drivers/cleanup.py | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/drivers/cleanup.py b/drivers/cleanup.py +index 8635f48..8c16f68 100755 +--- a/drivers/cleanup.py ++++ b/drivers/cleanup.py +@@ -1548,7 +1548,12 @@ class LinstorVDI(VDI): + def _activateChain(self): + vdi = self + while vdi: +- p = self.sr._linstor.get_device_path(vdi.uuid) ++ try: ++ p = self.sr._linstor.get_device_path(vdi.uuid) ++ except Exception as e: ++ # Use SMException to skip coalesce. ++ # Otherwise the GC is stopped... ++ raise util.SMException(str(e)) + vdi = vdi.parent + + def _setHidden(self, hidden=True): +-- +2.45.2 + diff --git a/SOURCES/0153-feat-linstor-manager-add-methods-to-modify-destroy-l.patch b/SOURCES/0153-feat-linstor-manager-add-methods-to-modify-destroy-l.patch new file mode 100644 index 00000000..554714fa --- /dev/null +++ b/SOURCES/0153-feat-linstor-manager-add-methods-to-modify-destroy-l.patch @@ -0,0 +1,255 @@ +From 4ce72650888831acf1297f804d41bbe60f09f5d5 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Tue, 19 Dec 2023 14:49:33 +0100 +Subject: [PATCH 153/175] feat(linstor-manager): add methods to + modify/destroy/list net interfaces + +Signed-off-by: Ronan Abhamon +--- + drivers/linstor-manager | 76 ++++++++++++++++++++++--- + drivers/linstorvolumemanager.py | 98 ++++++++++++++++++++++++++++----- + 2 files changed, 152 insertions(+), 22 deletions(-) + +diff --git a/drivers/linstor-manager b/drivers/linstor-manager +index 2469b50..6b45875 100755 +--- a/drivers/linstor-manager ++++ b/drivers/linstor-manager +@@ -265,6 +265,19 @@ def force_destroy_drbd_volume(minor): + if ret: + raise Exception('Failed to destroy volume: {}'.format(stderr)) + ++ ++def get_ip_addr_of_pif(session, pif_uuid): ++ pif_ref = session.xenapi.PIF.get_by_uuid(pif_uuid) ++ pif = session.xenapi.PIF.get_record(pif_ref) ++ ++ if not pif['currently_attached']: ++ raise XenAPIPlugin.Failure('-1', ['PIF is not plugged']) ++ ++ ip_addr = pif['IP'] if pif['primary_address_type'].lower() == 'ipv4' else pif['IPv6'].split('/')[0] ++ if ip_addr == '': ++ raise XenAPIPlugin.Failure('-1', ['PIF has no IP']) ++ return ip_addr ++ + # ------------------------------------------------------------------------------ + + +@@ -983,15 +996,24 @@ def create_node_interface(session, args): + name = args['name'] + pif_uuid = args['pifUuid'] + +- pif_ref = session.xenapi.PIF.get_by_uuid(pif_uuid) +- pif = session.xenapi.PIF.get_record(pif_ref) ++ ip_addr = get_ip_addr_of_pif(session, pif_uuid) + +- if not pif['currently_attached']: +- raise XenAPIPlugin.Failure('-1', ['PIF is not plugged']) ++ linstor = LinstorVolumeManager( ++ get_controller_uri(), ++ group_name, ++ logger=util.SMlog ++ ) ++ try: ++ linstor.create_node_interface(hostname, name, ip_addr) ++ except Exception as e: ++ raise XenAPIPlugin.Failure('-1', [str(e)]) ++ return str(True) + +- ip_addr = pif['IP'] if pif['primary_address_type'].lower() == 'ipv4' else pif['IPv6'].split('/')[0] +- if ip_addr == '': +- raise XenAPIPlugin.Failure('-1', ['PIF has no IP']) ++ ++def destroy_node_interface(session, args): ++ group_name = args['groupName'] ++ hostname = args['hostname'] ++ name = args['name'] + + linstor = LinstorVolumeManager( + get_controller_uri(), +@@ -999,12 +1021,47 @@ def create_node_interface(session, args): + logger=util.SMlog + ) + try: +- linstor.create_node_interface(hostname, name, ip_addr) ++ linstor.destroy_node_interface(hostname, name) + except Exception as e: + raise XenAPIPlugin.Failure('-1', [str(e)]) + return str(True) + + ++def modify_node_interface(session, args): ++ group_name = args['groupName'] ++ hostname = args['hostname'] ++ name = args['name'] ++ pif_uuid = args['pifUuid'] ++ ++ ip_addr = get_ip_addr_of_pif(session, pif_uuid) ++ ++ linstor = LinstorVolumeManager( ++ get_controller_uri(), ++ group_name, ++ logger=util.SMlog ++ ) ++ try: ++ linstor.modify_node_interface(hostname, name, ip_addr) ++ except Exception as e: ++ raise XenAPIPlugin.Failure('-1', [str(e)]) ++ return str(True) ++ ++ ++def list_node_interfaces(session, args): ++ group_name = args['groupName'] ++ hostname = args['hostname'] ++ ++ linstor = LinstorVolumeManager( ++ get_controller_uri(), ++ group_name, ++ logger=util.SMlog ++ ) ++ try: ++ return json.dumps(linstor.list_node_interfaces(hostname)) ++ except Exception as e: ++ raise XenAPIPlugin.Failure('-1', [str(e)]) ++ ++ + def set_node_preferred_interface(session, args): + group_name = args['groupName'] + hostname = args['hostname'] +@@ -1072,5 +1129,8 @@ if __name__ == '__main__': + 'healthCheck': health_check, + + 'createNodeInterface': create_node_interface, ++ 'destroyNodeInterface': destroy_node_interface, ++ 'modifyNodeInterface': modify_node_interface, ++ 'listNodeInterfaces': list_node_interfaces, + 'setNodePreferredInterface': set_node_preferred_interface + }) +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index a41314e..32d1533 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -872,7 +872,6 @@ class LinstorVolumeManager(object): + ) + return size * 1024 + +- + def set_auto_promote_timeout(self, volume_uuid, timeout): + """ + Define the blocking time of open calls when a DRBD +@@ -1120,7 +1119,6 @@ class LinstorVolumeManager(object): + """ + return get_all_volume_openers(self.get_volume_name(volume_uuid), '0') + +- + def get_volumes_with_name(self): + """ + Give a volume dictionnary that contains names actually owned. +@@ -1529,21 +1527,93 @@ class LinstorVolumeManager(object): + 'Failed to destroy node `{}`: {}'.format(node_name, error_str) + ) + +- def create_node_interface(self, hostname, name, ip_addr): +- result = self._linstor.netinterface_create(hostname, name, ip_addr) +- if not linstor.Linstor.all_api_responses_no_error(result): ++ def create_node_interface(self, node_name, name, ip): ++ """ ++ Create a new node interface in the LINSTOR database. ++ :param str node_name: Node name of the interface to use. ++ :param str name: Interface to create. ++ :param str ip: IP of the interface. ++ """ ++ result = self._linstor.netinterface_create(node_name, name, ip) ++ errors = self._filter_errors(result) ++ if errors: ++ error_str = self._get_error_str(errors) + raise LinstorVolumeManagerError( +- 'Unable to create interface on `{}`: {}'.format(hostname, ', '.join( +- [str(x) for x in result])) +- ) ++ 'Failed to create node interface on `{}`: {}'.format(node_name, error_str) ++ ) + +- def set_node_preferred_interface(self, hostname, name): +- result = self._linstor.node_modify(hostname, property_dict={'PrefNic': name}) +- if not linstor.Linstor.all_api_responses_no_error(result): ++ def destroy_node_interface(self, node_name, name): ++ """ ++ Destroy a node interface in the LINSTOR database. ++ :param str node_name: Node name of the interface to remove. ++ :param str name: Interface to remove. ++ """ ++ result = self._linstor.netinterface_delete(node_name, name) ++ errors = self._filter_errors(result) ++ if errors: ++ error_str = self._get_error_str(errors) + raise LinstorVolumeManagerError( +- 'Unable to set preferred interface on `{}`: {}'.format(hostname, ', '.join( +- [str(x) for x in result])) +- ) ++ 'Failed to destroy node interface on `{}`: {}'.format(node_name, error_str) ++ ) ++ ++ def modify_node_interface(self, node_name, name, ip): ++ """ ++ Modify a node interface in the LINSTOR database. Create it if necessary. ++ :param str node_name: Node name of the interface to use. ++ :param str name: Interface to modify or create. ++ :param str ip: IP of the interface. ++ """ ++ result = self._linstor.netinterface_create(node_name, name, ip) ++ errors = self._filter_errors(result) ++ if not errors: ++ return ++ ++ if self._check_errors(errors, [linstor.consts.FAIL_EXISTS_NET_IF]): ++ result = self._linstor.netinterface_modify(node_name, name, ip) ++ errors = self._filter_errors(result) ++ if not errors: ++ return ++ ++ error_str = self._get_error_str(errors) ++ raise LinstorVolumeManagerError( ++ 'Unable to modify interface on `{}`: {}'.format(node_name, error_str) ++ ) ++ ++ def list_node_interfaces(self, node_name): ++ """ ++ List all node interfaces. ++ :param str node_name: Node name to use to list interfaces. ++ :rtype: list ++ : ++ """ ++ result = self._linstor.net_interface_list(node_name) ++ if not result: ++ raise LinstorVolumeManagerError( ++ 'Unable to list interfaces on `{}`: no list received'.format(node_name) ++ ) ++ ++ interfaces = {} ++ for interface in result: ++ interface = interface._rest_data ++ interfaces[interface['name']] = { ++ 'address': interface['address'], ++ 'active': interface['is_active'] ++ } ++ return interfaces ++ ++ def set_node_preferred_interface(self, node_name, name): ++ """ ++ Set the preferred interface to use on a node. ++ :param str node_name: Node name of the interface. ++ :param str name: Preferred interface to use. ++ """ ++ result = self._linstor.node_modify(node_name, property_dict={'PrefNic': name}) ++ errors = self._filter_errors(result) ++ if errors: ++ error_str = self._get_error_str(errors) ++ raise LinstorVolumeManagerError( ++ 'Failed to set preferred node interface on `{}`: {}'.format(node_name, error_str) ++ ) + + def get_nodes_info(self): + """ +-- +2.45.2 + diff --git a/SOURCES/0154-fix-LinstorSR-force-a-defined-volume-prefix-if-we-ca.patch b/SOURCES/0154-fix-LinstorSR-force-a-defined-volume-prefix-if-we-ca.patch new file mode 100644 index 00000000..d9cb68b2 --- /dev/null +++ b/SOURCES/0154-fix-LinstorSR-force-a-defined-volume-prefix-if-we-ca.patch @@ -0,0 +1,27 @@ +From 41187ef7c58496dd3cccce223730edf5f4706d46 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Fri, 12 Jan 2024 10:28:20 +0100 +Subject: [PATCH 154/175] fix(LinstorSR): force a defined volume prefix if we + can't import libs + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index a524338..a73ae5a 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -27,6 +27,8 @@ try: + + LINSTOR_AVAILABLE = True + except ImportError: ++ PERSISTENT_PREFIX = 'unknown' ++ + LINSTOR_AVAILABLE = False + + from lock import Lock +-- +2.45.2 + diff --git a/SOURCES/0155-fix-LinstorSR-explicit-error-message-when-a-group-is.patch b/SOURCES/0155-fix-LinstorSR-explicit-error-message-when-a-group-is.patch new file mode 100644 index 00000000..bd199317 --- /dev/null +++ b/SOURCES/0155-fix-LinstorSR-explicit-error-message-when-a-group-is.patch @@ -0,0 +1,29 @@ +From 30fdeb99a513ebc9ce66a1ab2d07459506a8b645 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Thu, 18 Jan 2024 10:24:01 +0100 +Subject: [PATCH 155/175] fix(LinstorSR): explicit error message when a group + is not unique during SR creation + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index a73ae5a..fed1de2 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -569,7 +569,9 @@ class LinstorSR(SR.SR): + if group_name and group_name == self._group_name: + raise xs_errors.XenError( + 'LinstorSRCreate', +- opterr='group name must be unique' ++ opterr='group name must be unique, already used by PBD {}'.format( ++ xenapi.PBD.get_uuid(pbd) ++ ) + ) + + if srs: +-- +2.45.2 + diff --git a/SOURCES/0156-fix-LinstorSR-make-sure-VDI.delete-doesn-t-throw-und.patch b/SOURCES/0156-fix-LinstorSR-make-sure-VDI.delete-doesn-t-throw-und.patch new file mode 100644 index 00000000..147a7d47 --- /dev/null +++ b/SOURCES/0156-fix-LinstorSR-make-sure-VDI.delete-doesn-t-throw-und.patch @@ -0,0 +1,70 @@ +From 1bd49c3aacab50b38a0c2c85b8ed6c54134630f7 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Thu, 18 Jan 2024 11:18:11 +0100 +Subject: [PATCH 156/175] fix(LinstorSR): make sure VDI.delete doesn't throw + under specific conditions + +If we can update the volume state in the KV-store, there is no reason to raise +in case of future failure for another reason. Why? Because the volume will be +deleted by the next GC execution. + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 9 ++++++++- + drivers/linstorvolumemanager.py | 13 ++++++++++--- + 2 files changed, 18 insertions(+), 4 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index fed1de2..1e09e9b 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -1760,7 +1760,14 @@ class LinstorVDI(VDI.VDI): + 'Failed to remove the volume (maybe is leaf coalescing) ' + 'for {} err: {}'.format(self.uuid, e) + ) +- raise xs_errors.XenError('VDIDelete', opterr=str(e)) ++ ++ try: ++ raise xs_errors.XenError('VDIDelete', opterr=str(e)) ++ except LinstorVolumeManagerError as e: ++ if e.code != LinstorVolumeManagerError.ERR_VOLUME_DESTROY: ++ raise xs_errors.XenError('VDIDelete', opterr=str(e)) ++ ++ return + + if self.uuid in self.sr.vdis: + del self.sr.vdis[self.uuid] +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 32d1533..97e5372 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -272,7 +272,8 @@ def demote_drbd_resource(node_name, resource_name): + class LinstorVolumeManagerError(Exception): + ERR_GENERIC = 0, + ERR_VOLUME_EXISTS = 1, +- ERR_VOLUME_NOT_EXISTS = 2 ++ ERR_VOLUME_NOT_EXISTS = 2, ++ ERR_VOLUME_DESTROY = 3 + + def __init__(self, message, code=ERR_GENERIC): + super(LinstorVolumeManagerError, self).__init__(message) +@@ -681,8 +682,14 @@ class LinstorVolumeManager(object): + volume_properties = self._get_volume_properties(volume_uuid) + volume_properties[self.PROP_NOT_EXISTS] = self.STATE_NOT_EXISTS + +- self._volumes.remove(volume_uuid) +- self._destroy_volume(volume_uuid) ++ try: ++ self._volumes.remove(volume_uuid) ++ self._destroy_volume(volume_uuid) ++ except Exception as e: ++ raise LinstorVolumeManagerError( ++ str(e), ++ LinstorVolumeManagerError.ERR_VOLUME_DESTROY ++ ) + + def lock_volume(self, volume_uuid, locked=True): + """ +-- +2.45.2 + diff --git a/SOURCES/0157-fix-LinstorSR-add-drbd-in-the-blacklist-of-multipath.patch b/SOURCES/0157-fix-LinstorSR-add-drbd-in-the-blacklist-of-multipath.patch new file mode 100644 index 00000000..1852a2f5 --- /dev/null +++ b/SOURCES/0157-fix-LinstorSR-add-drbd-in-the-blacklist-of-multipath.patch @@ -0,0 +1,34 @@ +From df9ea419809cc4140b5e0c56da128a69c2304086 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Fri, 19 Jan 2024 14:39:17 +0100 +Subject: [PATCH 157/175] fix(LinstorSR): add drbd in the blacklist of + multipath.conf + +If DRBD is installed for the first time, and if the multipathd +service is not restarted, volumes can be blocked by this daemon. + +Note: the drbd-utils RPM adds the same change in /etc/multipath/conf.d/drbd.conf, +but this package is generally installed using XOSTOR UI and we don't display a +reboot message to be performed like the host update view. So it's probably good +to always have this modification whether we have drbd-utils or not. + +Signed-off-by: Ronan Abhamon +--- + multipath/multipath.conf | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/multipath/multipath.conf b/multipath/multipath.conf +index c854b57..309bf2a 100644 +--- a/multipath/multipath.conf ++++ b/multipath/multipath.conf +@@ -23,6 +23,7 @@ blacklist { + devnode "scini*" + devnode "^rbd[0-9]*" + devnode "^nbd[0-9]*" ++ devnode "^drbd[0-9]*" + } + # Leave this section in place even if empty + blacklist_exceptions { +-- +2.45.2 + diff --git a/SOURCES/0158-fix-linstorvolumemanager-create-cloned-volumes-on-ho.patch b/SOURCES/0158-fix-linstorvolumemanager-create-cloned-volumes-on-ho.patch new file mode 100644 index 00000000..d2c40375 --- /dev/null +++ b/SOURCES/0158-fix-linstorvolumemanager-create-cloned-volumes-on-ho.patch @@ -0,0 +1,126 @@ +From 4e01c279744c08677f325283ca1f54feb7c6f375 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Mon, 22 Jan 2024 11:25:25 +0100 +Subject: [PATCH 158/175] fix(linstorvolumemanager): create cloned volumes on + host selected by LINSTOR + +Signed-off-by: Ronan Abhamon +--- + drivers/linstorvolumemanager.py | 94 ++------------------------------- + 1 file changed, 3 insertions(+), 91 deletions(-) + +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 97e5372..5de86a1 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -1245,8 +1245,7 @@ class LinstorVolumeManager(object): + def shallow_clone_volume(self, volume_uuid, clone_uuid, persistent=True): + """ + Clone a volume. Do not copy the data, this method creates a new volume +- with the same size. It tries to create the volume on the same host +- than volume source. ++ with the same size. + :param str volume_uuid: The volume to clone. + :param str clone_uuid: The cloned volume. + :param bool persistent: If false the volume will be unavailable +@@ -1267,95 +1266,8 @@ class LinstorVolumeManager(object): + 'Invalid size of {} for volume `{}`'.format(size, volume_name) + ) + +- # 2. Find the node(s) with the maximum space. +- candidates = self._find_best_size_candidates() +- if not candidates: +- raise LinstorVolumeManagerError( +- 'Unable to shallow clone volume `{}`, no free space found.' +- ) +- +- # 3. Compute node names and search if we can try to clone +- # on the same nodes than volume. +- def find_best_nodes(): +- for candidate in candidates: +- for node_name in candidate.node_names: +- if node_name in ideal_node_names: +- return candidate.node_names +- +- node_names = find_best_nodes() +- if not node_names: +- node_names = candidates[0].node_names +- +- if len(node_names) < self._redundancy: +- raise LinstorVolumeManagerError( +- 'Unable to shallow clone volume `{}`, '.format(volume_uuid) + +- '{} are required to clone, found: {}'.format( +- self._redundancy, len(node_names) +- ) +- ) +- +- # 4. Compute resources to create. +- clone_volume_name = self.build_volume_name(util.gen_uuid()) +- diskless_node_names = self._get_node_names() +- resources = [] +- for node_name in node_names: +- diskless_node_names.remove(node_name) +- resources.append(linstor.ResourceData( +- node_name=node_name, +- rsc_name=clone_volume_name, +- storage_pool=self._group_name +- )) +- +- # 5. Create resources! +- def clean(): +- try: +- self._destroy_volume(clone_uuid, force=True) +- except Exception as e: +- self._logger( +- 'Unable to destroy volume {} after shallow clone fail: {}' +- .format(clone_uuid, e) +- ) +- +- def create(): +- # Note: placed outside try/except block because we create only definition first. +- # There is no reason to call `clean` before the real resource creation. +- volume_properties = self._create_volume_with_properties( +- clone_uuid, clone_volume_name, size, place_resources=False +- ) +- +- # After this point, `clean` can be called for any fail because the clone UUID +- # is really unique. No risk to remove existing data. +- try: +- result = self._linstor.resource_create(resources) +- error_str = self._get_error_str(result) +- if error_str: +- raise LinstorVolumeManagerError( +- 'Could not create cloned volume `{}` of `{}` from ' +- 'SR `{}`: {}'.format( +- clone_uuid, volume_uuid, self._group_name, +- error_str +- ) +- ) +- return volume_properties +- except Exception: +- clean() +- raise +- +- # Retry because we can get errors like this: +- # "Resource disappeared while waiting for it to be ready" or +- # "Resource did not became ready on node 'XXX' within reasonable time, check Satellite for errors." +- # in the LINSTOR server. +- volume_properties = util.retry(create, maxretry=5) +- +- try: +- device_path = self._find_device_path(clone_uuid, clone_volume_name) +- if persistent: +- volume_properties[self.PROP_NOT_EXISTS] = self.STATE_EXISTS +- self._volumes.add(clone_uuid) +- return device_path +- except Exception as e: +- clean() +- raise ++ # 2. Create clone! ++ return self.create_volume(clone_uuid, size, persistent) + + def remove_resourceless_volumes(self): + """ +-- +2.45.2 + diff --git a/SOURCES/0159-fix-linstorvolumemanager-don-t-align-volumes-on-LVM-.patch b/SOURCES/0159-fix-linstorvolumemanager-don-t-align-volumes-on-LVM-.patch new file mode 100644 index 00000000..9b4d4a89 --- /dev/null +++ b/SOURCES/0159-fix-linstorvolumemanager-don-t-align-volumes-on-LVM-.patch @@ -0,0 +1,32 @@ +From eb696a5641d88d6b07579c58a95514fe7cb2812a Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Fri, 26 Jan 2024 15:29:21 +0100 +Subject: [PATCH 159/175] fix(linstorvolumemanager): don't align volumes on LVM + sector size + +It's the goal of the LINSTOR stack to align properly on the LVM layer. +Otherwise without this patch we get an increase in snapshots and clones with a size of 4MiB. + +Signed-off-by: Ronan Abhamon +--- + drivers/linstorvolumemanager.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 5de86a1..7410fd7 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -309,8 +309,8 @@ class LinstorVolumeManager(object): + + DEV_ROOT_PATH = DRBD_BY_RES_PATH + +- # Default LVM extent size. +- BLOCK_SIZE = 4 * 1024 * 1024 ++ # Default sector size. ++ BLOCK_SIZE = 512 + + # List of volume properties. + PROP_METADATA = 'metadata' +-- +2.45.2 + diff --git a/SOURCES/0160-fix-linstorvolumemanager-assert-with-message-after-l.patch b/SOURCES/0160-fix-linstorvolumemanager-assert-with-message-after-l.patch new file mode 100644 index 00000000..95146760 --- /dev/null +++ b/SOURCES/0160-fix-linstorvolumemanager-assert-with-message-after-l.patch @@ -0,0 +1,33 @@ +From c5a0c0eb7055e3e6bec0607767f02b14de66384a Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Mon, 5 Feb 2024 18:01:22 +0100 +Subject: [PATCH 160/175] fix(linstorvolumemanager): assert with message after + log in update_volume_uuid + +Signed-off-by: Ronan Abhamon +--- + drivers/linstorvolumemanager.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 7410fd7..5f2e06e 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -972,12 +972,12 @@ class LinstorVolumeManager(object): + deleted VDI. + """ + +- assert volume_uuid != new_volume_uuid +- + self._logger( + 'Trying to update volume UUID {} to {}...' + .format(volume_uuid, new_volume_uuid) + ) ++ assert volume_uuid != new_volume_uuid, 'can\'t update volume UUID, same value' ++ + if not force: + self._ensure_volume_exists(volume_uuid) + self.ensure_volume_is_not_locked(volume_uuid) +-- +2.45.2 + diff --git a/SOURCES/0161-fix-linstorvolumemanager-retry-resize-if-volume-is-n.patch b/SOURCES/0161-fix-linstorvolumemanager-retry-resize-if-volume-is-n.patch new file mode 100644 index 00000000..aabf912f --- /dev/null +++ b/SOURCES/0161-fix-linstorvolumemanager-retry-resize-if-volume-is-n.patch @@ -0,0 +1,58 @@ +From a4f9493ea489a16799a69ac5b6e8016872eaa518 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Mon, 5 Feb 2024 23:13:06 +0100 +Subject: [PATCH 161/175] fix(linstorvolumemanager): retry resize if volume is + not up to date + +Signed-off-by: Ronan Abhamon +--- + drivers/linstorvolumemanager.py | 30 +++++++++++++++++++++--------- + 1 file changed, 21 insertions(+), 9 deletions(-) + +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 5f2e06e..79ac84a 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -824,18 +824,30 @@ class LinstorVolumeManager(object): + + volume_name = self.get_volume_name(volume_uuid) + self.ensure_volume_is_not_locked(volume_uuid) +- new_size = self.round_up_volume_size(new_size) ++ new_size = self.round_up_volume_size(new_size) / 1024 + +- result = self._linstor.volume_dfn_modify( +- rsc_name=volume_name, +- volume_nr=0, +- size=new_size / 1024 +- ) ++ retry_count = 30 ++ while True: ++ result = self._linstor.volume_dfn_modify( ++ rsc_name=volume_name, ++ volume_nr=0, ++ size=new_size ++ ) + +- self._mark_resource_cache_as_dirty() ++ self._mark_resource_cache_as_dirty() ++ ++ error_str = self._get_error_str(result) ++ if not error_str: ++ break ++ ++ # After volume creation, DRBD volume can be unusable during many seconds. ++ # So we must retry the definition change if the device is not up to date. ++ # Often the case for thick provisioning. ++ if retry_count and error_str.find('non-UpToDate DRBD device') >= 0: ++ time.sleep(2) ++ retry_count -= 1 ++ continue + +- error_str = self._get_error_str(result) +- if error_str: + raise LinstorVolumeManagerError( + 'Could not resize volume `{}` from SR `{}`: {}' + .format(volume_uuid, self._group_name, error_str) +-- +2.45.2 + diff --git a/SOURCES/0162-fix-LinstorSR-create-DRBD-diskless-if-necessary-for-.patch b/SOURCES/0162-fix-LinstorSR-create-DRBD-diskless-if-necessary-for-.patch new file mode 100644 index 00000000..51f4f482 --- /dev/null +++ b/SOURCES/0162-fix-LinstorSR-create-DRBD-diskless-if-necessary-for-.patch @@ -0,0 +1,101 @@ +From b870540473df318ec74fc8b7a2f916177cdece25 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Tue, 6 Feb 2024 00:10:32 +0100 +Subject: [PATCH 162/175] fix(LinstorSR): create DRBD diskless if necessary for + each VHD parent + +It's necessary to have all parents during snapshot to create a new VHD child. + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 60 ++++++++++++++++++++++++-------------------- + 1 file changed, 33 insertions(+), 27 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 1e09e9b..53afbef 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -1827,32 +1827,7 @@ class LinstorVDI(VDI.VDI): + return self._attach_using_http_nbd() + + # Ensure we have a path... +- while vdi_uuid: +- path = self._linstor.get_device_path(vdi_uuid) +- if not util.pathexists(path): +- raise xs_errors.XenError( +- 'VDIUnavailable', opterr='Could not find: {}'.format(path) +- ) +- +- # Diskless path can be created on the fly, ensure we can open it. +- def check_volume_usable(): +- while True: +- try: +- with open(path, 'r+'): +- pass +- except IOError as e: +- if e.errno == errno.ENODATA: +- time.sleep(2) +- continue +- if e.errno == errno.EROFS: +- util.SMlog('Volume not attachable because RO. Openers: {}'.format( +- self.sr._linstor.get_volume_openers(vdi_uuid) +- )) +- raise +- break +- util.retry(check_volume_usable, 15, 2) +- +- vdi_uuid = self.sr._vhdutil.get_vhd_info(vdi_uuid).parentUuid ++ self._create_chain_paths(self.uuid) + + self.attached = True + return VDI.VDI.attach(self, self.sr.uuid, self.uuid) +@@ -2379,7 +2354,7 @@ class LinstorVDI(VDI.VDI): + raise xs_errors.XenError('SnapshotChainTooLong') + + # Ensure we have a valid path if we don't have a local diskful. +- self.sr._linstor.get_device_path(self.uuid) ++ self._create_chain_paths(self.uuid) + + volume_path = self.path + if not util.pathexists(volume_path): +@@ -2842,6 +2817,37 @@ class LinstorVDI(VDI.VDI): + self._kill_persistent_nbd_server(volume_name) + self._kill_persistent_http_server(volume_name) + ++ def _create_chain_paths(self, vdi_uuid): ++ # OPTIMIZE: Add a limit_to_first_allocated_block param to limit vhdutil calls. ++ # Useful for the snapshot code algorithm. ++ ++ while vdi_uuid: ++ path = self._linstor.get_device_path(vdi_uuid) ++ if not util.pathexists(path): ++ raise xs_errors.XenError( ++ 'VDIUnavailable', opterr='Could not find: {}'.format(path) ++ ) ++ ++ # Diskless path can be created on the fly, ensure we can open it. ++ def check_volume_usable(): ++ while True: ++ try: ++ with open(path, 'r+'): ++ pass ++ except IOError as e: ++ if e.errno == errno.ENODATA: ++ time.sleep(2) ++ continue ++ if e.errno == errno.EROFS: ++ util.SMlog('Volume not attachable because RO. Openers: {}'.format( ++ self.sr._linstor.get_volume_openers(vdi_uuid) ++ )) ++ raise ++ break ++ util.retry(check_volume_usable, 15, 2) ++ ++ vdi_uuid = self.sr._vhdutil.get_vhd_info(vdi_uuid).parentUuid ++ + # ------------------------------------------------------------------------------ + + +-- +2.45.2 + diff --git a/SOURCES/0163-fix-LinstorSR-fix-bad-call-to-vhdutil.inflate-bad-ex.patch b/SOURCES/0163-fix-LinstorSR-fix-bad-call-to-vhdutil.inflate-bad-ex.patch new file mode 100644 index 00000000..40668533 --- /dev/null +++ b/SOURCES/0163-fix-LinstorSR-fix-bad-call-to-vhdutil.inflate-bad-ex.patch @@ -0,0 +1,36 @@ +From 4b79b1f585370c5e285a8c91e8ccdf7c3670a490 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Tue, 6 Feb 2024 00:14:11 +0100 +Subject: [PATCH 163/175] fix(LinstorSR): fix bad call to vhdutil.inflate + bad + exception + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 53afbef..de10f42 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -1944,7 +1944,7 @@ class LinstorVDI(VDI.VDI): + else: + if new_volume_size != old_volume_size: + self.sr._vhdutil.inflate( +- self.sr._journaler, self._linstor, self.uuid, self.path, ++ self.sr._journaler, self.uuid, self.path, + new_volume_size, old_volume_size + ) + self.sr._vhdutil.set_size_virt_fast(self.path, size) +@@ -2497,7 +2497,7 @@ class LinstorVDI(VDI.VDI): + self.session.xenapi.VDI.set_sm_config( + vdi_ref, active_vdi.sm_config + ) +- except Exception as e: ++ except Exception: + util.logException('Failed to snapshot!') + try: + self.sr._handle_interrupted_clone( +-- +2.45.2 + diff --git a/SOURCES/0164-fix-LinstorSR-activate-VG-if-attach-from-config-is-a.patch b/SOURCES/0164-fix-LinstorSR-activate-VG-if-attach-from-config-is-a.patch new file mode 100644 index 00000000..9a2b66e5 --- /dev/null +++ b/SOURCES/0164-fix-LinstorSR-activate-VG-if-attach-from-config-is-a.patch @@ -0,0 +1,27 @@ +From dfcec4b53eaaca42548c5e2d6582404b68817a6c Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Mon, 12 Feb 2024 20:54:06 +0100 +Subject: [PATCH 164/175] fix(LinstorSR): activate VG if attach from config is + asked + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index de10f42..b6b1529 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -382,7 +382,7 @@ class LinstorSR(SR.SR): + + def load(self, *args, **kwargs): + # Activate all LVMs to make drbd-reactor happy. +- if self.srcmd.cmd == 'sr_attach': ++ if self.srcmd.cmd in ('sr_attach', 'vdi_attach_from_config'): + activate_lvm_group(self._group_name) + + if not self._has_session: +-- +2.45.2 + diff --git a/SOURCES/0165-feat-LinstorSR-use-a-specific-resource-group-for-DB-.patch b/SOURCES/0165-feat-LinstorSR-use-a-specific-resource-group-for-DB-.patch new file mode 100644 index 00000000..241b594a --- /dev/null +++ b/SOURCES/0165-feat-LinstorSR-use-a-specific-resource-group-for-DB-.patch @@ -0,0 +1,521 @@ +From b7364a6f259a892892fc4f340927ea80c58174a0 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Tue, 19 Mar 2024 23:09:54 +0100 +Subject: [PATCH 165/175] feat(LinstorSR): use a specific resource group for DB + and HA + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 7 +- + drivers/linstorvolumemanager.py | 253 ++++++++++++++++++++++---------- + 2 files changed, 182 insertions(+), 78 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index b6b1529..3421f79 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -1662,8 +1662,11 @@ class LinstorVDI(VDI.VDI): + volume_name = REDO_LOG_VOLUME_NAME + + self._linstor.create_volume( +- self.uuid, volume_size, persistent=False, +- volume_name=volume_name ++ self.uuid, ++ volume_size, ++ persistent=False, ++ volume_name=volume_name, ++ high_availability=volume_name is not None + ) + volume_info = self._linstor.get_volume_info(self.uuid) + +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 79ac84a..4118a28 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -273,7 +273,8 @@ class LinstorVolumeManagerError(Exception): + ERR_GENERIC = 0, + ERR_VOLUME_EXISTS = 1, + ERR_VOLUME_NOT_EXISTS = 2, +- ERR_VOLUME_DESTROY = 3 ++ ERR_VOLUME_DESTROY = 3, ++ ERR_GROUP_NOT_EXISTS = 4 + + def __init__(self, message, code=ERR_GENERIC): + super(LinstorVolumeManagerError, self).__init__(message) +@@ -298,11 +299,9 @@ class LinstorVolumeManager(object): + """ + + __slots__ = ( +- '_linstor', '_logger', +- '_uri', '_base_group_name', +- '_redundancy', '_group_name', +- '_volumes', '_storage_pools', +- '_storage_pools_time', ++ '_linstor', '_logger', '_redundancy', ++ '_base_group_name', '_group_name', '_ha_group_name', ++ '_volumes', '_storage_pools', '_storage_pools_time', + '_kv_cache', '_resource_cache', '_volume_info_cache', + '_kv_cache_dirty', '_resource_cache_dirty', '_volume_info_cache_dirty' + ) +@@ -348,6 +347,7 @@ class LinstorVolumeManager(object): + # A LINSTOR (resource, group, ...) name cannot start with a number. + # So we add a prefix behind our SR/VOLUME uuids. + PREFIX_SR = 'xcp-sr-' ++ PREFIX_HA = 'xcp-ha-' + PREFIX_VOLUME = 'xcp-volume-' + + # Limit request number when storage pool info is asked, we fetch +@@ -406,8 +406,7 @@ class LinstorVolumeManager(object): + + # Ensure group exists. + group_name = self._build_group_name(group_name) +- groups = self._linstor.resource_group_list_raise([group_name]) +- groups = groups.resource_groups ++ groups = self._linstor.resource_group_list_raise([group_name]).resource_groups + if not groups: + raise LinstorVolumeManagerError( + 'Unable to find `{}` Linstor SR'.format(group_name) +@@ -417,6 +416,7 @@ class LinstorVolumeManager(object): + self._logger = logger + self._redundancy = groups[0].select_filter.place_count + self._group_name = group_name ++ self._ha_group_name = self._build_ha_group_name(self._base_group_name) + self._volumes = set() + self._storage_pools_time = 0 + +@@ -617,7 +617,12 @@ class LinstorVolumeManager(object): + return volume_uuid in self._volumes + + def create_volume( +- self, volume_uuid, size, persistent=True, volume_name=None ++ self, ++ volume_uuid, ++ size, ++ persistent=True, ++ volume_name=None, ++ high_availability=False + ): + """ + Create a new volume on the SR. +@@ -627,6 +632,8 @@ class LinstorVolumeManager(object): + on the next constructor call LinstorSR(...). + :param str volume_name: If set, this name is used in the LINSTOR + database instead of a generated name. ++ :param bool high_availability: If set, the volume is created in ++ the HA group. + :return: The current device path of the volume. + :rtype: str + """ +@@ -635,7 +642,11 @@ class LinstorVolumeManager(object): + if not volume_name: + volume_name = self.build_volume_name(util.gen_uuid()) + volume_properties = self._create_volume_with_properties( +- volume_uuid, volume_name, size, place_resources=True ++ volume_uuid, ++ volume_name, ++ size, ++ True, # place_resources ++ high_availability + ) + + # Volume created! Now try to find the device path. +@@ -651,7 +662,7 @@ class LinstorVolumeManager(object): + 'LINSTOR volume {} created!'.format(volume_uuid) + ) + return device_path +- except Exception as e: ++ except Exception: + # There is an issue to find the path. + # At this point the volume has just been created, so force flag can be used. + self._destroy_volume(volume_uuid, force=True) +@@ -1359,6 +1370,7 @@ class LinstorVolumeManager(object): + + # 4.5. Destroy group and storage pools. + self._destroy_resource_group(self._linstor, self._group_name) ++ self._destroy_resource_group(self._linstor, self._ha_group_name) + for pool in self._get_storage_pools(force=True): + self._destroy_storage_pool( + self._linstor, pool.name, pool.node_name +@@ -1659,6 +1671,16 @@ class LinstorVolumeManager(object): + """ + return self._request_database_path(self._linstor) + ++ @classmethod ++ def get_all_group_names(cls, base_name): ++ """ ++ Get all group names. I.e. list of current group + HA. ++ :param str base_name: The SR group_name to use. ++ :return: List of group names. ++ :rtype: list ++ """ ++ return [cls._build_group_name(base_name), cls._build_ha_group_name(base_name)] ++ + @classmethod + def create_sr( + cls, group_name, ips, redundancy, +@@ -1744,8 +1766,8 @@ class LinstorVolumeManager(object): + driver_pool_name = group_name + base_group_name = group_name + group_name = cls._build_group_name(group_name) +- pools = lin.storage_pool_list_raise(filter_by_stor_pools=[group_name]) +- pools = pools.storage_pools ++ storage_pool_name = group_name ++ pools = lin.storage_pool_list_raise(filter_by_stor_pools=[storage_pool_name]).storage_pools + if pools: + existing_node_names = map(lambda pool: pool.node_name, pools) + raise LinstorVolumeManagerError( +@@ -1754,7 +1776,7 @@ class LinstorVolumeManager(object): + ) + + if lin.resource_group_list_raise( +- [group_name] ++ cls.get_all_group_names(base_group_name) + ).resource_groups: + if not lin.resource_dfn_list_raise().resource_definitions: + backup_path = cls._create_database_backup_path() +@@ -1791,7 +1813,7 @@ class LinstorVolumeManager(object): + + result = lin.storage_pool_create( + node_name=node_name, +- storage_pool_name=group_name, ++ storage_pool_name=storage_pool_name, + storage_driver='LVM_THIN' if thin_provisioning else 'LVM', + driver_pool_name=driver_pool_name + ) +@@ -1807,7 +1829,7 @@ class LinstorVolumeManager(object): + 'Volume group `{}` not found on `{}`. Ignoring...' + .format(group_name, node_name) + ) +- cls._destroy_storage_pool(lin, group_name, node_name) ++ cls._destroy_storage_pool(lin, storage_pool_name, node_name) + else: + error_str = cls._get_error_str(result) + raise LinstorVolumeManagerError( +@@ -1825,49 +1847,28 @@ class LinstorVolumeManager(object): + ) + ) + +- # 2.b. Create resource group. +- rg_creation_attempt = 0 +- while True: +- result = lin.resource_group_create( +- name=group_name, +- place_count=redundancy, +- storage_pool=group_name, +- diskless_on_remaining=False +- ) +- error_str = cls._get_error_str(result) +- if not error_str: +- break +- +- errors = cls._filter_errors(result) +- if cls._check_errors(errors, [linstor.consts.FAIL_EXISTS_RSC_GRP]): +- rg_creation_attempt += 1 +- if rg_creation_attempt < 2: +- try: +- cls._destroy_resource_group(lin, group_name) +- except Exception as e: +- error_str = 'Failed to destroy old and empty RG: {}'.format(e) +- else: +- continue +- +- raise LinstorVolumeManagerError( +- 'Could not create RG `{}`: {}'.format(group_name, error_str) +- ) +- +- # 2.c. Create volume group. +- result = lin.volume_group_create(group_name) +- error_str = cls._get_error_str(result) +- if error_str: +- raise LinstorVolumeManagerError( +- 'Could not create VG `{}`: {}'.format( +- group_name, error_str +- ) +- ) ++ # 2.b. Create resource groups. ++ ha_group_name = cls._build_ha_group_name(base_group_name) ++ cls._create_resource_group( ++ lin, ++ group_name, ++ storage_pool_name, ++ redundancy, ++ True ++ ) ++ cls._create_resource_group( ++ lin, ++ ha_group_name, ++ storage_pool_name, ++ 3, ++ True ++ ) + + # 3. Create the LINSTOR database volume and mount it. + try: + logger('Creating database volume...') + volume_path = cls._create_database_volume( +- lin, group_name, node_names, redundancy, auto_quorum ++ lin, ha_group_name, storage_pool_name, node_names, redundancy, auto_quorum + ) + except LinstorVolumeManagerError as e: + if e.code != LinstorVolumeManagerError.ERR_VOLUME_EXISTS: +@@ -1907,6 +1908,7 @@ class LinstorVolumeManager(object): + logger('Destroying resource group and storage pools after fail...') + try: + cls._destroy_resource_group(lin, group_name) ++ cls._destroy_resource_group(lin, ha_group_name) + except Exception as e2: + logger('Failed to destroy resource group: {}'.format(e2)) + pass +@@ -1914,7 +1916,7 @@ class LinstorVolumeManager(object): + i = min(i, len(node_names) - 1) + while j <= i: + try: +- cls._destroy_storage_pool(lin, group_name, node_names[j]) ++ cls._destroy_storage_pool(lin, storage_pool_name, node_names[j]) + except Exception as e2: + logger('Failed to destroy resource group: {}'.format(e2)) + pass +@@ -1952,7 +1954,7 @@ class LinstorVolumeManager(object): + def build_volume_name(cls, base_name): + """ + Build a volume name given a base name (i.e. a UUID). +- :param str volume_name: The volume name to use. ++ :param str base_name: The volume name to use. + :return: A valid or not device path. + :rtype: str + """ +@@ -2031,7 +2033,7 @@ class LinstorVolumeManager(object): + resource_names = set() + dfns = self._linstor.resource_dfn_list_raise().resource_definitions + for dfn in dfns: +- if dfn.resource_group_name == self._group_name and ( ++ if dfn.resource_group_name in self.get_all_group_names(self._base_group_name) and ( + ignore_deleted or + linstor.consts.FLAG_DELETE not in dfn.flags + ): +@@ -2149,27 +2151,54 @@ class LinstorVolumeManager(object): + return self._storage_pools + + def _create_volume( +- self, volume_uuid, volume_name, size, place_resources ++ self, ++ volume_uuid, ++ volume_name, ++ size, ++ place_resources, ++ high_availability + ): + size = self.round_up_volume_size(size) + self._mark_resource_cache_as_dirty() + ++ group_name = self._ha_group_name if high_availability else self._group_name + def create_definition(): +- self._check_volume_creation_errors( +- self._linstor.resource_group_spawn( +- rsc_grp_name=self._group_name, +- rsc_dfn_name=volume_name, +- vlm_sizes=['{}B'.format(size)], +- definitions_only=True +- ), +- volume_uuid, +- self._group_name +- ) ++ first_attempt = True ++ while True: ++ try: ++ self._check_volume_creation_errors( ++ self._linstor.resource_group_spawn( ++ rsc_grp_name=group_name, ++ rsc_dfn_name=volume_name, ++ vlm_sizes=['{}B'.format(size)], ++ definitions_only=True ++ ), ++ volume_uuid, ++ self._group_name ++ ) ++ break ++ except LinstorVolumeManagerError as e: ++ if ( ++ not first_attempt or ++ not high_availability or ++ e.code != LinstorVolumeManagerError.ERR_GROUP_NOT_EXISTS ++ ): ++ raise ++ ++ first_attempt = False ++ self._create_resource_group( ++ self._linstor, ++ group_name, ++ self._group_name, ++ 3, ++ True ++ ) ++ + self._configure_volume_peer_slots(self._linstor, volume_name) + + def clean(): + try: +- self._destroy_volume(volume_uuid, force=True) ++ self._destroy_volume(volume_uuid, force=True, preserve_properties=True) + except Exception as e: + self._logger( + 'Unable to destroy volume {} after creation fail: {}' +@@ -2201,7 +2230,12 @@ class LinstorVolumeManager(object): + util.retry(create, maxretry=5) + + def _create_volume_with_properties( +- self, volume_uuid, volume_name, size, place_resources ++ self, ++ volume_uuid, ++ volume_name, ++ size, ++ place_resources, ++ high_availability + ): + if self.check_volume_exists(volume_uuid): + raise LinstorVolumeManagerError( +@@ -2230,7 +2264,11 @@ class LinstorVolumeManager(object): + volume_properties[self.PROP_VOLUME_NAME] = volume_name + + self._create_volume( +- volume_uuid, volume_name, size, place_resources ++ volume_uuid, ++ volume_name, ++ size, ++ place_resources, ++ high_availability + ) + + assert volume_properties.namespace == \ +@@ -2331,7 +2369,7 @@ class LinstorVolumeManager(object): + break + self._destroy_resource(resource_name) + +- def _destroy_volume(self, volume_uuid, force=False): ++ def _destroy_volume(self, volume_uuid, force=False, preserve_properties=False): + volume_properties = self._get_volume_properties(volume_uuid) + try: + volume_name = volume_properties.get(self.PROP_VOLUME_NAME) +@@ -2339,7 +2377,8 @@ class LinstorVolumeManager(object): + self._destroy_resource(volume_name, force) + + # Assume this call is atomic. +- volume_properties.clear() ++ if not preserve_properties: ++ volume_properties.clear() + except Exception as e: + raise LinstorVolumeManagerError( + 'Cannot destroy volume `{}`: {}'.format(volume_uuid, e) +@@ -2599,7 +2638,7 @@ class LinstorVolumeManager(object): + + @classmethod + def _create_database_volume( +- cls, lin, group_name, node_names, redundancy, auto_quorum ++ cls, lin, group_name, storage_pool_name, node_names, redundancy, auto_quorum + ): + try: + dfns = lin.resource_dfn_list_raise().resource_definitions +@@ -2621,7 +2660,7 @@ class LinstorVolumeManager(object): + # I don't understand why but this command protect against this bug. + try: + pools = lin.storage_pool_list_raise( +- filter_by_stor_pools=[group_name] ++ filter_by_stor_pools=[storage_pool_name] + ) + except Exception as e: + raise LinstorVolumeManagerError( +@@ -2663,7 +2702,7 @@ class LinstorVolumeManager(object): + resources.append(linstor.ResourceData( + node_name=node_name, + rsc_name=DATABASE_VOLUME_NAME, +- storage_pool=group_name ++ storage_pool=storage_pool_name + )) + # Create diskless resources on the remaining set. + for node_name in diskful_nodes[redundancy:] + diskless_nodes: +@@ -2825,6 +2864,55 @@ class LinstorVolumeManager(object): + # after LINSTOR database volume destruction. + return util.retry(destroy, maxretry=10) + ++ @classmethod ++ def _create_resource_group( ++ cls, ++ lin, ++ group_name, ++ storage_pool_name, ++ redundancy, ++ destroy_old_group ++ ): ++ rg_creation_attempt = 0 ++ while True: ++ result = lin.resource_group_create( ++ name=group_name, ++ place_count=redundancy, ++ storage_pool=storage_pool_name, ++ diskless_on_remaining=False ++ ) ++ error_str = cls._get_error_str(result) ++ if not error_str: ++ break ++ ++ errors = cls._filter_errors(result) ++ if destroy_old_group and cls._check_errors(errors, [ ++ linstor.consts.FAIL_EXISTS_RSC_GRP ++ ]): ++ rg_creation_attempt += 1 ++ if rg_creation_attempt < 2: ++ try: ++ cls._destroy_resource_group(lin, group_name) ++ except Exception as e: ++ error_str = 'Failed to destroy old and empty RG: {}'.format(e) ++ else: ++ continue ++ ++ raise LinstorVolumeManagerError( ++ 'Could not create RG `{}`: {}'.format( ++ group_name, error_str ++ ) ++ ) ++ ++ result = lin.volume_group_create(group_name) ++ error_str = cls._get_error_str(result) ++ if error_str: ++ raise LinstorVolumeManagerError( ++ 'Could not create VG `{}`: {}'.format( ++ group_name, error_str ++ ) ++ ) ++ + @classmethod + def _destroy_resource_group(cls, lin, group_name): + def destroy(): +@@ -2849,6 +2937,12 @@ class LinstorVolumeManager(object): + # `VG/LV`. "/" is not accepted by LINSTOR. + return '{}{}'.format(cls.PREFIX_SR, base_name.replace('/', '_')) + ++ # Used to store important data in a HA context, ++ # i.e. a replication count of 3. ++ @classmethod ++ def _build_ha_group_name(cls, base_name): ++ return '{}{}'.format(cls.PREFIX_HA, base_name.replace('/', '_')) ++ + @classmethod + def _check_volume_creation_errors(cls, result, volume_uuid, group_name): + errors = cls._filter_errors(result) +@@ -2861,6 +2955,13 @@ class LinstorVolumeManager(object): + LinstorVolumeManagerError.ERR_VOLUME_EXISTS + ) + ++ if cls._check_errors(errors, [linstor.consts.FAIL_NOT_FOUND_RSC_GRP]): ++ raise LinstorVolumeManagerError( ++ 'Failed to create volume `{}` from SR `{}`, resource group doesn\'t exist' ++ .format(volume_uuid, group_name), ++ LinstorVolumeManagerError.ERR_GROUP_NOT_EXISTS ++ ) ++ + if errors: + raise LinstorVolumeManagerError( + 'Failed to create volume `{}` from SR `{}`: {}'.format( +-- +2.45.2 + diff --git a/SOURCES/0166-feat-linstor-manager-add-getNodePreferredInterface-h.patch b/SOURCES/0166-feat-linstor-manager-add-getNodePreferredInterface-h.patch new file mode 100644 index 00000000..649bf858 --- /dev/null +++ b/SOURCES/0166-feat-linstor-manager-add-getNodePreferredInterface-h.patch @@ -0,0 +1,76 @@ +From 4b8db294574d248231edf40f7b7e9fdb4f37e79f Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Mon, 15 Apr 2024 11:22:18 +0200 +Subject: [PATCH 166/175] feat(linstor-manager): add + `getNodePreferredInterface` helper + +Signed-off-by: Ronan Abhamon +--- + drivers/linstor-manager | 16 ++++++++++++++++ + drivers/linstorvolumemanager.py | 17 +++++++++++++++++ + 2 files changed, 33 insertions(+) + +diff --git a/drivers/linstor-manager b/drivers/linstor-manager +index 6b45875..a2501d7 100755 +--- a/drivers/linstor-manager ++++ b/drivers/linstor-manager +@@ -1062,6 +1062,21 @@ def list_node_interfaces(session, args): + raise XenAPIPlugin.Failure('-1', [str(e)]) + + ++def get_node_preferred_interface(session, args): ++ group_name = args['groupName'] ++ hostname = args['hostname'] ++ ++ linstor = LinstorVolumeManager( ++ get_controller_uri(), ++ group_name, ++ logger=util.SMlog ++ ) ++ try: ++ return linstor.get_node_preferred_interface(hostname) ++ except Exception as e: ++ raise XenAPIPlugin.Failure('-1', [str(e)]) ++ ++ + def set_node_preferred_interface(session, args): + group_name = args['groupName'] + hostname = args['hostname'] +@@ -1132,5 +1147,6 @@ if __name__ == '__main__': + 'destroyNodeInterface': destroy_node_interface, + 'modifyNodeInterface': modify_node_interface, + 'listNodeInterfaces': list_node_interfaces, ++ 'getNodePreferredInterface': get_node_preferred_interface, + 'setNodePreferredInterface': set_node_preferred_interface + }) +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 4118a28..46c3283 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -1544,6 +1544,23 @@ class LinstorVolumeManager(object): + } + return interfaces + ++ def get_node_preferred_interface(self, node_name): ++ """ ++ Get the preferred interface used by a node. ++ :param str node_name: Node name of the interface to get. ++ :rtype: str ++ """ ++ try: ++ nodes = self._linstor.node_list_raise([node_name]).nodes ++ if nodes: ++ properties = nodes[0].props ++ return properties.get('PrefNic', 'default') ++ return nodes ++ except Exception as e: ++ raise LinstorVolumeManagerError( ++ 'Failed to get preferred interface: `{}`'.format(e) ++ ) ++ + def set_node_preferred_interface(self, node_name, name): + """ + Set the preferred interface to use on a node. +-- +2.45.2 + diff --git a/SOURCES/0167-fix-linstorvolumemanager-blocks-deletion-of-default-.patch b/SOURCES/0167-fix-linstorvolumemanager-blocks-deletion-of-default-.patch new file mode 100644 index 00000000..d9ddb69a --- /dev/null +++ b/SOURCES/0167-fix-linstorvolumemanager-blocks-deletion-of-default-.patch @@ -0,0 +1,31 @@ +From 8c5f5efd12ea9509aa7862790a73d41b6386d8ff Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Mon, 15 Apr 2024 11:26:00 +0200 +Subject: [PATCH 167/175] fix(linstorvolumemanager): blocks deletion of default + network interface + +Signed-off-by: Ronan Abhamon +--- + drivers/linstorvolumemanager.py | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 46c3283..02059d8 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -1491,6 +1491,12 @@ class LinstorVolumeManager(object): + :param str node_name: Node name of the interface to remove. + :param str name: Interface to remove. + """ ++ ++ if name == 'default': ++ raise LinstorVolumeManagerError( ++ 'Unable to delete the default interface of a node!' ++ ) ++ + result = self._linstor.netinterface_delete(node_name, name) + errors = self._filter_errors(result) + if errors: +-- +2.45.2 + diff --git a/SOURCES/0168-feat-linstorvolumemanager-change-logic-of-get_resour.patch b/SOURCES/0168-feat-linstorvolumemanager-change-logic-of-get_resour.patch new file mode 100644 index 00000000..14ada705 --- /dev/null +++ b/SOURCES/0168-feat-linstorvolumemanager-change-logic-of-get_resour.patch @@ -0,0 +1,104 @@ +From 1da13644d6fb8ef1c77c23b5201f2f9c247170ee Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Mon, 15 Apr 2024 17:56:47 +0200 +Subject: [PATCH 168/175] feat(linstorvolumemanager): change logic of + `get_resources_info`: - Add a nested level "nodes" for each resource - Add a + "uuid" attr on resources - Rename LINSTOR "uuid" to "linstor-uuid" - Optimize + code + +Signed-off-by: Ronan Abhamon +--- + drivers/linstor-manager | 1 + + drivers/linstorvolumemanager.py | 34 ++++++++++++++++++++------------- + 2 files changed, 22 insertions(+), 13 deletions(-) + +diff --git a/drivers/linstor-manager b/drivers/linstor-manager +index a2501d7..ed85525 100755 +--- a/drivers/linstor-manager ++++ b/drivers/linstor-manager +@@ -884,6 +884,7 @@ def health_check(session, args): + 'controller-uri': '', + 'nodes': {}, + 'storage-pools': {}, ++ 'resources': {}, + 'warnings': [], + 'errors': [] + } +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 02059d8..25c226a 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -1624,7 +1624,7 @@ class LinstorVolumeManager(object): + + storage_pools[pool.node_name].append({ + 'storage-pool-name': pool.name, +- 'uuid': pool.uuid, ++ 'linstor-uuid': pool.uuid, + 'free-size': size, + 'capacity': capacity + }) +@@ -1637,16 +1637,19 @@ class LinstorVolumeManager(object): + :rtype: dict(str, list) + """ + resources = {} +- resource_list = self._linstor.resource_list_raise() ++ resource_list = self._get_resource_cache() ++ volume_names = self.get_volumes_with_name() + for resource in resource_list.resources: + if resource.name not in resources: +- resources[resource.name] = {} ++ resources[resource.name] = { 'nodes': {}, 'uuid': '' } ++ resource_nodes = resources[resource.name]['nodes'] + +- resources[resource.name][resource.node_name] = { ++ resource_nodes[resource.node_name] = { + 'volumes': [], + 'diskful': linstor.consts.FLAG_DISKLESS not in resource.flags, + 'tie-breaker': linstor.consts.FLAG_TIE_BREAKER in resource.flags + } ++ resource_volumes = resource_nodes[resource.node_name]['volumes'] + + for volume in resource.volumes: + # We ignore diskless pools of the form "DfltDisklessStorPool". +@@ -1665,17 +1668,17 @@ class LinstorVolumeManager(object): + else: + allocated_size *= 1024 + +- resources[resource.name][resource.node_name]['volumes'].append({ +- 'storage-pool-name': volume.storage_pool_name, +- 'uuid': volume.uuid, +- 'number': volume.number, +- 'device-path': volume.device_path, +- 'usable-size': usable_size, +- 'allocated-size': allocated_size +- }) ++ resource_volumes.append({ ++ 'storage-pool-name': volume.storage_pool_name, ++ 'linstor-uuid': volume.uuid, ++ 'number': volume.number, ++ 'device-path': volume.device_path, ++ 'usable-size': usable_size, ++ 'allocated-size': allocated_size ++ }) + + for resource_state in resource_list.resource_states: +- resource = resources[resource_state.rsc_name][resource_state.node_name] ++ resource = resources[resource_state.rsc_name]['nodes'][resource_state.node_name] + resource['in-use'] = resource_state.in_use + + volumes = resource['volumes'] +@@ -1684,6 +1687,11 @@ class LinstorVolumeManager(object): + if volume: + volume['disk-state'] = volume_state.disk_state + ++ for volume_uuid, volume_name in volume_names.items(): ++ resource = resources.get(volume_name) ++ if resource: ++ resource['uuid'] = volume_uuid ++ + return resources + + def get_database_path(self): +-- +2.45.2 + diff --git a/SOURCES/0169-feat-linstor-manager-add-error-codes-to-healthCheck-.patch b/SOURCES/0169-feat-linstor-manager-add-error-codes-to-healthCheck-.patch new file mode 100644 index 00000000..67c74e52 --- /dev/null +++ b/SOURCES/0169-feat-linstor-manager-add-error-codes-to-healthCheck-.patch @@ -0,0 +1,251 @@ +From 054c7a40d249d7f7bfb6daf0e7aa2b58319311c2 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Thu, 18 Apr 2024 13:57:37 +0200 +Subject: [PATCH 169/175] feat(linstor-manager): add error codes to healthCheck + helper + +Signed-off-by: Ronan Abhamon +--- + drivers/linstor-manager | 153 +++++++++++++++++++++++++------- + drivers/linstorvolumemanager.py | 2 +- + 2 files changed, 120 insertions(+), 35 deletions(-) + +diff --git a/drivers/linstor-manager b/drivers/linstor-manager +index ed85525..94aa4fb 100755 +--- a/drivers/linstor-manager ++++ b/drivers/linstor-manager +@@ -27,6 +27,7 @@ import socket + import XenAPI + import XenAPIPlugin + ++from json import JSONEncoder + from linstorjournaler import LinstorJournaler + from linstorvhdutil import LinstorVhdUtil + from linstorvolumemanager import get_controller_uri, get_local_volume_openers, LinstorVolumeManager +@@ -877,6 +878,64 @@ def get_drbd_openers(session, args): + raise + + ++class HealthCheckError(object): ++ __slots__ = ('data') ++ ++ MASK_REPORT_LEVEL = 0x7000000 ++ MASK_TYPE = 0xFF0000 ++ MASK_VALUE = 0XFFFF ++ ++ # 24-26 bits ++ REPORT_LEVEL_WARN = 0x1000000 ++ REPORT_LEVEL_ERR = 0x2000000 ++ ++ # 16-23 bits ++ TYPE_GENERIC = 0x10000 ++ TYPE_NODE = 0x20000 ++ TYPE_STORAGE_POOL = 0x30000 ++ TYPE_VOLUME = 0x40000 ++ TYPE_RESOURCE = 0x50000 ++ ++ # 1-15 bits ++ GENERIC_UNEXPECTED = REPORT_LEVEL_ERR | TYPE_GENERIC | 0 ++ GENERIC_LINSTOR_UNREACHABLE = REPORT_LEVEL_ERR | TYPE_GENERIC | 1 ++ ++ NODE_NOT_ONLINE = REPORT_LEVEL_WARN | TYPE_NODE | 0 ++ ++ STORAGE_POOL_UNKNOWN_FREE_SIZE = REPORT_LEVEL_ERR | TYPE_STORAGE_POOL | 0 ++ STORAGE_POOL_UNKNOWN_CAPACITY = REPORT_LEVEL_ERR | TYPE_STORAGE_POOL | 1 ++ STORAGE_POOL_LOW_FREE_SIZE = REPORT_LEVEL_WARN | TYPE_STORAGE_POOL | 2 ++ ++ VOLUME_UNKNOWN_STATE = REPORT_LEVEL_WARN | TYPE_VOLUME | 0 ++ VOLUME_INVALID_STATE = REPORT_LEVEL_ERR | TYPE_VOLUME | 1 ++ VOLUME_WRONG_DISKLESS_STATE = REPORT_LEVEL_WARN | TYPE_VOLUME | 2 ++ VOLUME_INTERNAL_UNVERIFIED_STATE = REPORT_LEVEL_WARN | TYPE_VOLUME | 3 ++ ++ MAP_CODE_TO_PARAMS = { ++ GENERIC_UNEXPECTED: { 'message' }, ++ GENERIC_LINSTOR_UNREACHABLE: { 'message' }, ++ NODE_NOT_ONLINE: { 'name', 'status' }, ++ STORAGE_POOL_UNKNOWN_FREE_SIZE: { 'name' }, ++ STORAGE_POOL_UNKNOWN_CAPACITY: { 'name' }, ++ STORAGE_POOL_LOW_FREE_SIZE: { 'name', 'threshold' }, ++ VOLUME_UNKNOWN_STATE: { 'node', 'resource', 'number' }, ++ VOLUME_INVALID_STATE: { 'node', 'resource', 'number', 'state' }, ++ VOLUME_WRONG_DISKLESS_STATE: { 'node', 'resource', 'number', 'state' }, ++ VOLUME_INTERNAL_UNVERIFIED_STATE: { 'node', 'resource', 'number', 'state' } ++ } ++ ++ def __init__(self, code, **kwargs): ++ attributes = self.MAP_CODE_TO_PARAMS[code] ++ data = { 'code': code } ++ for attr_name, attr_value in kwargs.items(): ++ assert attr_name in attributes ++ data[attr_name] = attr_value ++ self.data = data ++ ++ def to_json(self): ++ return self.data ++ ++ + def health_check(session, args): + group_name = args['groupName'] + +@@ -885,11 +944,15 @@ def health_check(session, args): + 'nodes': {}, + 'storage-pools': {}, + 'resources': {}, +- 'warnings': [], + 'errors': [] + } + + def format_result(): ++ # See: https://stackoverflow.com/questions/18478287/making-object-json-serializable-with-regular-encoder/18561055#18561055 ++ def _default(self, obj): ++ return getattr(obj.__class__, 'to_json', _default.default)(obj) ++ _default.default = JSONEncoder().default ++ JSONEncoder.default = _default + return json.dumps(result) + + # 1. Get controller. +@@ -912,7 +975,10 @@ def health_check(session, args): + ) + except Exception as e: + # Probably a network issue, or offline controller. +- result['errors'].append('Cannot join SR: `{}`.'.format(e)) ++ result['errors'].append(HealthCheckError( ++ code=HealthCheckError.GENERIC_LINSTOR_UNREACHABLE, ++ message=str(e) ++ )) + return format_result() + + try: +@@ -921,7 +987,11 @@ def health_check(session, args): + result['nodes'] = nodes + for node_name, status in nodes.items(): + if status != 'ONLINE': +- result['warnings'].append('Node `{}` is {}.'.format(node_name, status)) ++ result['errors'].append(HealthCheckError( ++ code=HealthCheckError.NODE_NOT_ONLINE, ++ name=node_name, ++ status=status ++ )) + + # 3. Check storage pool statuses. + storage_pools_per_node = linstor.get_storage_pools_info() +@@ -931,23 +1001,25 @@ def health_check(session, args): + free_size = storage_pool['free-size'] + capacity = storage_pool['capacity'] + if free_size < 0 or capacity <= 0: +- result['errors'].append( +- 'Cannot get free size and/or capacity of storage pool `{}`.' +- .format(storage_pool['uuid']) +- ) +- elif free_size > capacity: +- result['errors'].append( +- 'Free size of storage pool `{}` is greater than capacity.' +- .format(storage_pool['uuid']) +- ) ++ if free_size < 0: ++ result['errors'].append(HealthCheckError( ++ code=HealthCheckError.STORAGE_POOL_UNKNOWN_FREE_SIZE, ++ name=storage_pool['name'] ++ )) ++ elif capacity < 0: ++ result['errors'].append(HealthCheckError( ++ code=HealthCheckError.STORAGE_POOL_UNKNOWN_CAPACITY, ++ name=storage_pool['name'] ++ )) + else: + remaining_percent = free_size / float(capacity) * 100.0 + threshold = 10.0 + if remaining_percent < threshold: +- result['warnings'].append( +- 'Remaining size of storage pool `{}` is below {}% of its capacity.' +- .format(storage_pool['uuid'], threshold) +- ) ++ result['errors'].append(HealthCheckError( ++ code=HealthCheckError.STORAGE_POOL_LOW_FREE_SIZE, ++ name=storage_pool['name'], ++ threshold=threshold ++ )) + + # 4. Check resource statuses. + all_resources = linstor.get_resources_info() +@@ -960,33 +1032,46 @@ def health_check(session, args): + if disk_state in ['UpToDate', 'Created', 'Attached']: + continue + if disk_state == 'DUnknown': +- result['warnings'].append( +- 'Unknown state for volume `{}` at index {} for resource `{}` on node `{}`' +- .format(volume['device-path'], volume_index, resource_name, node_name) +- ) ++ result['errors'].append(HealthCheckError( ++ code=HealthCheckError.VOLUME_UNKNOWN_STATE, ++ node=node_name, ++ resource=resource_name, ++ number=volume_index ++ )) + continue + if disk_state in ['Inconsistent', 'Failed', 'To: Creating', 'To: Attachable', 'To: Attaching']: +- result['errors'].append( +- 'Invalid state `{}` for volume `{}` at index {} for resource `{}` on node `{}`' +- .format(disk_state, volume['device-path'], volume_index, resource_name, node_name) +- ) ++ result['errors'].append(HealthCheckError( ++ code=HealthCheckError.VOLUME_INVALID_STATE, ++ node=node_name, ++ resource=resource_name, ++ number=volume_index, ++ state=disk_state ++ )) + continue + if disk_state == 'Diskless': + if resource['diskful']: +- result['errors'].append( +- 'Unintentional diskless state detected for volume `{}` at index {} for resource `{}` on node `{}`' +- .format(volume['device-path'], volume_index, resource_name, node_name) +- ) ++ result['errors'].append(HealthCheckError( ++ code=HealthCheckError.VOLUME_WRONG_DISKLESS_STATE, ++ node=node_name, ++ resource=resource_name, ++ number=volume_index, ++ state=disk_state ++ )) + elif resource['tie-breaker']: + volume['disk-state'] = 'TieBreaker' + continue +- result['warnings'].append( +- 'Unhandled state `{}` for volume `{}` at index {} for resource `{}` on node `{}`' +- .format(disk_state, volume['device-path'], volume_index, resource_name, node_name) +- ) +- ++ result['errors'].append(HealthCheckError( ++ code=HealthCheckError.VOLUME_INTERNAL_UNVERIFIED_STATE, ++ node=node_name, ++ resource=resource_name, ++ number=volume_index, ++ state=disk_state ++ )) + except Exception as e: +- result['errors'].append('Unexpected error: `{}`'.format(e)) ++ result['errors'].append(HealthCheckError( ++ code=HealthCheckError.GENERIC_UNEXPECTED, ++ message=str(e) ++ )) + + return format_result() + +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 25c226a..94d5c51 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -1623,7 +1623,7 @@ class LinstorVolumeManager(object): + capacity *= 1024 + + storage_pools[pool.node_name].append({ +- 'storage-pool-name': pool.name, ++ 'name': pool.name, + 'linstor-uuid': pool.uuid, + 'free-size': size, + 'capacity': capacity +-- +2.45.2 + diff --git a/SOURCES/0170-fix-LinstorSR-fix-bad-exception-reference-during-sna.patch b/SOURCES/0170-fix-LinstorSR-fix-bad-exception-reference-during-sna.patch new file mode 100644 index 00000000..5bca6017 --- /dev/null +++ b/SOURCES/0170-fix-LinstorSR-fix-bad-exception-reference-during-sna.patch @@ -0,0 +1,39 @@ +From bbec79d3445aa772b2f3f5884fc1906becfd604d Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Wed, 24 Apr 2024 15:10:49 +0200 +Subject: [PATCH 170/175] fix(LinstorSR): fix bad exception reference during + snapshot + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 3421f79..3bd31e9 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -2500,17 +2500,17 @@ class LinstorVDI(VDI.VDI): + self.session.xenapi.VDI.set_sm_config( + vdi_ref, active_vdi.sm_config + ) +- except Exception: ++ except Exception as e: + util.logException('Failed to snapshot!') + try: + self.sr._handle_interrupted_clone( + active_uuid, clone_info, force_undo=True + ) + self.sr._journaler.remove(LinstorJournaler.CLONE, active_uuid) +- except Exception as e: ++ except Exception as clean_error: + util.SMlog( + 'WARNING: Failed to clean up failed snapshot: {}' +- .format(e) ++ .format(clean_error) + ) + raise xs_errors.XenError('VDIClone', opterr=str(e)) + +-- +2.45.2 + diff --git a/SOURCES/0171-fix-tapdisk-pause-ensure-LINSTOR-VHD-chain-is-availa.patch b/SOURCES/0171-fix-tapdisk-pause-ensure-LINSTOR-VHD-chain-is-availa.patch new file mode 100644 index 00000000..428c0158 --- /dev/null +++ b/SOURCES/0171-fix-tapdisk-pause-ensure-LINSTOR-VHD-chain-is-availa.patch @@ -0,0 +1,159 @@ +From 351e47f2acd98c7fa662553b48d84efbeb939a91 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Wed, 24 Apr 2024 17:29:26 +0200 +Subject: [PATCH 171/175] fix(tapdisk-pause): ensure LINSTOR VHD chain is + available + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 35 ++--------------------------------- + drivers/linstorvhdutil.py | 38 ++++++++++++++++++++++++++++++++++++++ + drivers/tapdisk-pause | 6 ++++-- + 3 files changed, 44 insertions(+), 35 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 3bd31e9..c5ed7c5 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -1830,7 +1830,7 @@ class LinstorVDI(VDI.VDI): + return self._attach_using_http_nbd() + + # Ensure we have a path... +- self._create_chain_paths(self.uuid) ++ self.sr._vhdutil.create_chain_paths(self.uuid) + + self.attached = True + return VDI.VDI.attach(self, self.sr.uuid, self.uuid) +@@ -2357,7 +2357,7 @@ class LinstorVDI(VDI.VDI): + raise xs_errors.XenError('SnapshotChainTooLong') + + # Ensure we have a valid path if we don't have a local diskful. +- self._create_chain_paths(self.uuid) ++ self.sr._vhdutil.create_chain_paths(self.uuid) + + volume_path = self.path + if not util.pathexists(volume_path): +@@ -2820,37 +2820,6 @@ class LinstorVDI(VDI.VDI): + self._kill_persistent_nbd_server(volume_name) + self._kill_persistent_http_server(volume_name) + +- def _create_chain_paths(self, vdi_uuid): +- # OPTIMIZE: Add a limit_to_first_allocated_block param to limit vhdutil calls. +- # Useful for the snapshot code algorithm. +- +- while vdi_uuid: +- path = self._linstor.get_device_path(vdi_uuid) +- if not util.pathexists(path): +- raise xs_errors.XenError( +- 'VDIUnavailable', opterr='Could not find: {}'.format(path) +- ) +- +- # Diskless path can be created on the fly, ensure we can open it. +- def check_volume_usable(): +- while True: +- try: +- with open(path, 'r+'): +- pass +- except IOError as e: +- if e.errno == errno.ENODATA: +- time.sleep(2) +- continue +- if e.errno == errno.EROFS: +- util.SMlog('Volume not attachable because RO. Openers: {}'.format( +- self.sr._linstor.get_volume_openers(vdi_uuid) +- )) +- raise +- break +- util.retry(check_volume_usable, 15, 2) +- +- vdi_uuid = self.sr._vhdutil.get_vhd_info(vdi_uuid).parentUuid +- + # ------------------------------------------------------------------------------ + + +diff --git a/drivers/linstorvhdutil.py b/drivers/linstorvhdutil.py +index 23d8b6a..17b7790 100644 +--- a/drivers/linstorvhdutil.py ++++ b/drivers/linstorvhdutil.py +@@ -21,6 +21,7 @@ import distutils.util + import errno + import json + import socket ++import time + import util + import vhdutil + import xs_errors +@@ -141,6 +142,43 @@ class LinstorVhdUtil: + self._session = session + self._linstor = linstor + ++ def create_chain_paths(self, vdi_uuid): ++ # OPTIMIZE: Add a limit_to_first_allocated_block param to limit vhdutil calls. ++ # Useful for the snapshot code algorithm. ++ ++ leaf_vdi_path = self._linstor.get_device_path(vdi_uuid) ++ path = leaf_vdi_path ++ while True: ++ if not util.pathexists(path): ++ raise xs_errors.XenError( ++ 'VDIUnavailable', opterr='Could not find: {}'.format(path) ++ ) ++ ++ # Diskless path can be created on the fly, ensure we can open it. ++ def check_volume_usable(): ++ while True: ++ try: ++ with open(path, 'r+'): ++ pass ++ except IOError as e: ++ if e.errno == errno.ENODATA: ++ time.sleep(2) ++ continue ++ if e.errno == errno.EROFS: ++ util.SMlog('Volume not attachable because RO. Openers: {}'.format( ++ self._linstor.get_volume_openers(vdi_uuid) ++ )) ++ raise ++ break ++ util.retry(check_volume_usable, 15, 2) ++ ++ vdi_uuid = self.get_vhd_info(vdi_uuid).parentUuid ++ if not vdi_uuid: ++ break ++ path = self._linstor.get_device_path(vdi_uuid) ++ ++ return leaf_vdi_path ++ + # -------------------------------------------------------------------------- + # Getters: read locally and try on another host in case of failure. + # -------------------------------------------------------------------------- +diff --git a/drivers/tapdisk-pause b/drivers/tapdisk-pause +index e0bca7b..c316cdf 100755 +--- a/drivers/tapdisk-pause ++++ b/drivers/tapdisk-pause +@@ -30,6 +30,7 @@ import vhdutil + import lvmcache + + try: ++ from linstorvhdutil import LinstorVhdUtil + from linstorvolumemanager import get_controller_uri, LinstorVolumeManager + LINSTOR_AVAILABLE = True + except ImportError: +@@ -162,11 +163,12 @@ class Tapdisk: + dconf = session.xenapi.PBD.get_device_config(pbd) + group_name = dconf['group-name'] + +- device_path = LinstorVolumeManager( ++ linstor = LinstorVolumeManager( + get_controller_uri(), + group_name, + logger=util.SMlog +- ).get_device_path(self.vdi_uuid) ++ ) ++ device_path = LinstorVhdUtil(session, linstor).create_chain_paths(self.vdi_uuid) + + if realpath != device_path: + util.SMlog( +-- +2.45.2 + diff --git a/SOURCES/0172-fix-LVHDoISCSISR-disable-restart-of-ISCSI-daemon.patch b/SOURCES/0172-fix-LVHDoISCSISR-disable-restart-of-ISCSI-daemon.patch new file mode 100644 index 00000000..532dd12e --- /dev/null +++ b/SOURCES/0172-fix-LVHDoISCSISR-disable-restart-of-ISCSI-daemon.patch @@ -0,0 +1,96 @@ +From 20c54e8a9e0b66425b50a2733a821071f737946a Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Fri, 26 Apr 2024 14:20:04 +0200 +Subject: [PATCH 172/175] fix(LVHDoISCSISR): disable restart of ISCSI daemon + +Signed-off-by: Ronan Abhamon +--- + drivers/LVHDoISCSISR.py | 2 ++ + tests/test_LVHDoISCSISR.py | 51 -------------------------------------- + 2 files changed, 2 insertions(+), 51 deletions(-) + +diff --git a/drivers/LVHDoISCSISR.py b/drivers/LVHDoISCSISR.py +index 1fa6f6f..da2c9ed 100755 +--- a/drivers/LVHDoISCSISR.py ++++ b/drivers/LVHDoISCSISR.py +@@ -553,6 +553,8 @@ class LVHDoISCSISR(LVHDSR.LVHDSR): + return out + + def check_sr(self, sr_uuid): ++ # Disable to prevent daemon restart. ++ return + """Hook to check SR health""" + pbdref = util.find_my_pbd(self.session, self.host_ref, self.sr_ref) + if pbdref: +diff --git a/tests/test_LVHDoISCSISR.py b/tests/test_LVHDoISCSISR.py +index ba668d0..c876ed8 100644 +--- a/tests/test_LVHDoISCSISR.py ++++ b/tests/test_LVHDoISCSISR.py +@@ -167,15 +167,6 @@ class TestLVHDoISCSISR(ISCSITestCase): + + super(TestLVHDoISCSISR, self).setUp() + +- @property +- def mock_baseiscsi(self): +- assert len(self.base_srs) == 1 +- single_sr = None +- for sr in self.base_srs: +- single_sr = sr +- +- return single_sr +- + def baseiscsi(self, srcmd, sr_uuid): + new_baseiscsi = mock.create_autospec(BaseISCSISR) + local_iqn = srcmd.dconf['localIQN'] +@@ -199,48 +190,6 @@ class TestLVHDoISCSISR(ISCSITestCase): + self.subject = LVHDoISCSISR.LVHDoISCSISR( + sr_cmd, self.sr_uuid) + +- def test_check_sr_pbd_not_found(self): +- # Arrange +- self.mock_util.find_my_pbd.return_value = None +- self.create_test_sr(self.create_sr_command()) +- +- # Act +- self.subject.check_sr(TEST_SR_UUID) +- +- # Assert +- self.mock_util.find_my_pbd.assert_called_with( +- self.mock_session, 'test_host', 'sr_ref') +- +- def test_check_sr_correct_sessions_count(self): +- # Arrange +- self.mock_util.find_my_pbd.return_value = 'my_pbd' +- self.mock_session.xenapi.PBD.get_other_config.return_value = { +- 'iscsi_sessions': 2 +- } +- self.create_test_sr(self.create_sr_command()) +- +- # Act +- self.subject.check_sr(TEST_SR_UUID) +- +- # Assert +- self.mock_session.xenapi.PBD.get_other_config.assert_called_with('my_pbd') +- +- def test_check_sr_not_enough_sessions(self): +- # Arrange +- self.mock_util.find_my_pbd.return_value = 'my_pbd' +- self.mock_session.xenapi.PBD.get_other_config.return_value = { +- 'iscsi_sessions': 1 +- } +- self.create_test_sr(self.create_sr_command()) +- +- # Act +- self.subject.check_sr(TEST_SR_UUID) +- +- # Assert +- self.mock_baseiscsi.attach.assert_called_with( +- TEST_SR_UUID +- ) +- + def test_sr_attach_multi_session(self): + # Arrange + self.mock_util.find_my_pbd.return_value = 'my_pbd' +-- +2.45.2 + diff --git a/SOURCES/0173-fix-linstorvhdutil-retry-check-on-another-machine-in.patch b/SOURCES/0173-fix-linstorvhdutil-retry-check-on-another-machine-in.patch new file mode 100644 index 00000000..e642869a --- /dev/null +++ b/SOURCES/0173-fix-linstorvhdutil-retry-check-on-another-machine-in.patch @@ -0,0 +1,76 @@ +From 8be0fee5e4dfdcd34301a48512f01f15f9a9795a Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Mon, 6 May 2024 18:15:00 +0200 +Subject: [PATCH 173/175] fix(linstorvhdutil): retry check on another machine + in case of failure (#54) + +Signed-off-by: Ronan Abhamon +--- + drivers/linstor-manager | 5 +++-- + drivers/linstorvhdutil.py | 19 +++++++++++++++++-- + 2 files changed, 20 insertions(+), 4 deletions(-) + +diff --git a/drivers/linstor-manager b/drivers/linstor-manager +index 94aa4fb..47cbd2b 100755 +--- a/drivers/linstor-manager ++++ b/drivers/linstor-manager +@@ -29,7 +29,7 @@ import XenAPIPlugin + + from json import JSONEncoder + from linstorjournaler import LinstorJournaler +-from linstorvhdutil import LinstorVhdUtil ++from linstorvhdutil import LinstorVhdUtil, check_ex + from linstorvolumemanager import get_controller_uri, get_local_volume_openers, LinstorVolumeManager + from lock import Lock + import json +@@ -390,7 +390,8 @@ def check(session, args): + args['ignoreMissingFooter'] + ) + fast = distutils.util.strtobool(args['fast']) +- return str(vhdutil.check(device_path, ignore_missing_footer, fast)) ++ check_ex(device_path, ignore_missing_footer, fast) ++ return str(True) + except Exception as e: + util.SMlog('linstor-manager:check error: {}'.format(e)) + raise +diff --git a/drivers/linstorvhdutil.py b/drivers/linstorvhdutil.py +index 17b7790..fd2bc8b 100644 +--- a/drivers/linstorvhdutil.py ++++ b/drivers/linstorvhdutil.py +@@ -50,6 +50,16 @@ def call_remote_method(session, host_ref, method, device_path, args): + return response + + ++def check_ex(path, ignoreMissingFooter = False, fast = False): ++ cmd = [vhdutil.VHD_UTIL, "check", vhdutil.OPT_LOG_ERR, "-n", path] ++ if ignoreMissingFooter: ++ cmd.append("-i") ++ if fast: ++ cmd.append("-B") ++ ++ vhdutil.ioretry(cmd) ++ ++ + class LinstorCallException(util.SMException): + def __init__(self, cmd_err): + self.cmd_err = cmd_err +@@ -188,9 +198,14 @@ class LinstorVhdUtil: + 'ignoreMissingFooter': ignore_missing_footer, + 'fast': fast + } +- return self._check(vdi_uuid, **kwargs) # pylint: disable = E1123 ++ try: ++ self._check(vdi_uuid, **kwargs) # pylint: disable = E1123 ++ return True ++ except Exception as e: ++ util.SMlog('Call to `check` failed: {}'.format(e)) ++ return False + +- @linstorhostcall(vhdutil.check, 'check') ++ @linstorhostcall(check_ex, 'check') + def _check(self, vdi_uuid, response): + return distutils.util.strtobool(response) + +-- +2.45.2 + diff --git a/SOURCES/0174-fix-LinstorSR-explicit-errors-when-database-path-is-.patch b/SOURCES/0174-fix-LinstorSR-explicit-errors-when-database-path-is-.patch new file mode 100644 index 00000000..aacabec1 --- /dev/null +++ b/SOURCES/0174-fix-LinstorSR-explicit-errors-when-database-path-is-.patch @@ -0,0 +1,49 @@ +From 9f90f7277672389d539639049675a98db2c0cda4 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Mon, 6 May 2024 21:35:36 +0200 +Subject: [PATCH 174/175] fix(LinstorSR): explicit errors when database path is + fetched + +--- + drivers/LinstorSR.py | 4 ++-- + drivers/linstorvolumemanager.py | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index c5ed7c5..9f0986c 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -766,7 +766,7 @@ class LinstorSR(SR.SR): + # is started without a shared and mounted /var/lib/linstor path. + try: + self._linstor.get_database_path() +- except Exception: ++ except Exception as e: + # Failed to get database path, ensure we don't have + # VDIs in the XAPI database... + if self.session.xenapi.SR.get_VDIs( +@@ -774,7 +774,7 @@ class LinstorSR(SR.SR): + ): + raise xs_errors.XenError( + 'SRUnavailable', +- opterr='Database is not mounted' ++ opterr='Database is not mounted or node name is invalid ({})'.format(e) + ) + + # Update the database before the restart of the GC to avoid +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 94d5c51..948d45d 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -2648,7 +2648,7 @@ class LinstorVolumeManager(object): + ) + except Exception as e: + raise LinstorVolumeManagerError( +- 'Unable to get resources during database creation: {}' ++ 'Unable to fetch database resource: {}' + .format(e) + ) + +-- +2.45.2 + diff --git a/SOURCES/0175-fix-LinstorSR-Misc-fixes-on-destroy.patch b/SOURCES/0175-fix-LinstorSR-Misc-fixes-on-destroy.patch new file mode 100644 index 00000000..3e3561fd --- /dev/null +++ b/SOURCES/0175-fix-LinstorSR-Misc-fixes-on-destroy.patch @@ -0,0 +1,136 @@ +From 04eb8ccfa07b1c666c788fdd1475a8267878bd46 Mon Sep 17 00:00:00 2001 +From: Damien Thenot +Date: Tue, 30 Apr 2024 15:38:34 +0200 +Subject: [PATCH 175/175] fix(LinstorSR): Misc fixes on destroy + +linstor-manager: +- fix on get_drbd_volumes + Failed because the key backing-disk is not always present. + +LinstorSR: +- Refactored some hosts variable to reference the OpaqueRef status + +linstorvolumemanager: +- Add destroying DRBD remnants on each hosts before destroying resource groups +- Correctly remove DB files (#57) + `glob` method only returns the dir when not wildcard + is used in the path. + Therefore the remove call right after will fail everytime. + +Signed-off-by: Damien Thenot +Co-authored-by: Benjamin Reis +Co-authored-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 10 +++++----- + drivers/linstor-manager | 5 ++++- + drivers/linstorvolumemanager.py | 24 +++++++++++++++++++----- + 3 files changed, 28 insertions(+), 11 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 9f0986c..8d95890 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -650,17 +650,17 @@ class LinstorSR(SR.SR): + opterr='Cannot get controller node name' + ) + +- host = None ++ host_ref = None + if node_name == 'localhost': +- host = util.get_this_host_ref(self.session) ++ host_ref = util.get_this_host_ref(self.session) + else: + for slave in util.get_all_slaves(self.session): + r_name = self.session.xenapi.host.get_record(slave)['hostname'] + if r_name == node_name: +- host = slave ++ host_ref = slave + break + +- if not host: ++ if not host_ref: + raise xs_errors.XenError( + 'LinstorSRDelete', + opterr='Failed to find host with hostname: {}'.format( +@@ -677,7 +677,7 @@ class LinstorSR(SR.SR): + 'groupName': self._group_name, + } + self._exec_manager_command( +- host, 'destroy', args, 'LinstorSRDelete' ++ host_ref, 'destroy', args, 'LinstorSRDelete' + ) + except Exception as e: + try: +diff --git a/drivers/linstor-manager b/drivers/linstor-manager +index 47cbd2b..f0404b8 100755 +--- a/drivers/linstor-manager ++++ b/drivers/linstor-manager +@@ -241,7 +241,10 @@ def get_drbd_volumes(volume_group=None): + config = json.loads(stdout) + for resource in config: + for volume in resource['_this_host']['volumes']: +- backing_disk = volume['backing-disk'] ++ backing_disk = volume.get('backing-disk') ++ if not backing_disk: ++ continue ++ + match = BACKING_DISK_RE.match(backing_disk) + if not match: + continue +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 948d45d..103f91b 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -18,7 +18,6 @@ + + import distutils.util + import errno +-import glob + import json + import linstor + import os.path +@@ -1362,13 +1361,27 @@ class LinstorVolumeManager(object): + + # 4.4. Refresh linstor connection. + # Without we get this error: +- # "Cannot delete resource group 'xcp-sr-linstor_group_thin_device' because it has existing resource definitions.." ++ # "Cannot delete resource group 'xcp-sr-linstor_group_thin_device' because it has existing resource definitions.." + # Because the deletion of the databse was not seen by Linstor for some reason. + # It seems a simple refresh of the Linstor connection make it aware of the deletion. + self._linstor.disconnect() + self._linstor.connect() + +- # 4.5. Destroy group and storage pools. ++ # 4.5. Destroy remaining drbd nodes on hosts. ++ # We check if there is a DRBD node on hosts that could mean blocking when destroying resource groups. ++ # It needs to be done locally by each host so we go through the linstor-manager plugin. ++ # If we don't do this sometimes, the destroy will fail when trying to destroy the resource groups with: ++ # "linstor-manager:destroy error: Failed to destroy SP `xcp-sr-linstor_group_thin_device` on node `r620-s2`: The specified storage pool 'xcp-sr-linstor_group_thin_device' on node 'r620-s2' can not be deleted as volumes / snapshot-volumes are still using it." ++ session = util.timeout_call(5, util.get_localAPI_session) ++ for host_ref in session.xenapi.host.get_all(): ++ try: ++ response = session.xenapi.host.call_plugin( ++ host_ref, 'linstor-manager', 'destroyDrbdVolumes', {'volume_group': self._group_name} ++ ) ++ except Exception as e: ++ util.SMlog('Calling destroyDrbdVolumes on host {} failed with error {}'.format(host_ref, e)) ++ ++ # 4.6. Destroy group and storage pools. + self._destroy_resource_group(self._linstor, self._group_name) + self._destroy_resource_group(self._linstor, self._ha_group_name) + for pool in self._get_storage_pools(force=True): +@@ -1381,8 +1394,9 @@ class LinstorVolumeManager(object): + + try: + self._start_controller(start=False) +- for file in glob.glob(DATABASE_PATH + '/'): +- os.remove(file) ++ for file in os.listdir(DATABASE_PATH): ++ if file != 'lost+found': ++ os.remove(DATABASE_PATH + '/' + file) + except Exception as e: + util.SMlog( + 'Ignoring failure after LINSTOR SR destruction: {}' +-- +2.45.2 + diff --git a/SPECS/sm.spec b/SPECS/sm.spec index 4f776657..1a849884 100644 --- a/SPECS/sm.spec +++ b/SPECS/sm.spec @@ -11,7 +11,7 @@ Summary: sm - XCP storage managers Name: sm Version: 2.30.8 -Release: %{?xsrel}.1%{?dist} +Release: %{?xsrel}.1.0.linstor.1%{?dist} Group: System/Hypervisor License: LGPL URL: https://github.com/xapi-project/sm @@ -80,6 +80,9 @@ Conflicts: kernel < 4.19.19-5.0.0 Obsoletes: sm-additional-drivers +# To remove after stable release of LINSTOR. +Provides: sm-linstor + # XCP-ng patches # Generated from our sm repository # git format-patch v2.30.8-12-xcpng..2.30.8-8.2 @@ -115,6 +118,158 @@ Patch1020: 0020-Backport-NFS4-only-support.patch Patch1021: 0021-Backport-probe-for-NFS4-when-rpcinfo-does-not-includ.patch Patch1022: 0022-feat-LargeBlock-backport-of-largeblocksr-51-55.patch Patch1023: 0023-feat-LVHDSR-add-a-way-to-modify-config-of-LVMs-56.patch +Patch1024: 0024-Fix-timeout_call-alarm-must-be-reset-in-case-of-succ.patch +Patch1025: 0025-timeout_call-returns-the-result-of-user-function-now.patch +Patch1026: 0026-Always-remove-the-pause-tag-from-VDIs-in-case-of-fai.patch +Patch1027: 0027-fix-LinstorSR-repair-volumes-only-if-an-exclusive-co.patch +Patch1028: 0028-feat-LinstorSR-Improve-LINSTOR-performance.patch +Patch1029: 0029-feat-LinstorSR-robustify-scan-to-avoid-losing-VDIs-i.patch +Patch1030: 0030-feat-LinstorSR-display-a-correctly-readable-size-for.patch +Patch1031: 0031-feat-linstor-monitord-scan-all-LINSTOR-SRs-every-12-.patch +Patch1032: 0032-fix-LinstorSR-call-correctly-method-in-_locked_load-.patch +Patch1033: 0033-feat-LinstorSR-integrate-minidrbdcluster-daemon.patch +Patch1034: 0034-feat-LinstorSR-ensure-heartbeat-and-redo_log-VDIs-ar.patch +Patch1035: 0035-feat-LinstorSR-protect-sr-commands-to-avoid-forgetti.patch +Patch1036: 0036-fix-LinstorJournaler-ensure-uri-is-not-None-during-l.patch +Patch1037: 0037-feat-LinstorSR-add-an-option-to-disable-auto-quorum-.patch +Patch1038: 0038-fix-LinstorVolumeManager-add-a-workaround-to-create-.patch +Patch1039: 0039-feat-LinstorSR-add-optional-ips-parameter.patch +Patch1040: 0040-feat-LinstorSR-add-a-helper-log_drbd_erofs-to-trace-.patch +Patch1041: 0041-fix-LinstorSR-try-to-restart-the-services-again-if-t.patch +Patch1042: 0042-fix-LinstorSR-robustify-linstor-manager-to-never-inc.patch +Patch1043: 0043-fix-LinstorSR-prevent-starting-controller-during-fai.patch +Patch1044: 0044-feat-LinstorVolumeManager-increase-peer-slots-limit-.patch +Patch1045: 0045-feat-LinstorVolumeManager-add-a-fallback-to-find-con.patch +Patch1046: 0046-fix-var-lib-linstor.mount-ensure-we-always-mount-dat.patch +Patch1047: 0047-feat-LinstorVolumeManager-add-a-fallback-to-find-nod.patch +Patch1048: 0048-feat-LinstorSR-explain-on-which-host-plugins-command.patch +Patch1049: 0049-fix-LinstorSR-create-diskless-path-if-necessary-duri.patch +Patch1050: 0050-feat-LinstorSR-use-HTTP-NBD-instead-of-DRBD-directly.patch +Patch1051: 0051-fix-LinstorSR-find-controller-when-XAPI-unreachable-.patch +Patch1052: 0052-fix-LinstorSR-use-IPs-instead-of-hostnames-in-NBD-se.patch +Patch1053: 0053-fix-LinstorVolumeManager-ensure-we-always-use-IPs-in.patch +Patch1054: 0054-feat-linstor-manager-add-methods-to-add-remove-host-.patch +Patch1055: 0055-feat-LinstorVolumeManager-support-SR-creation-with-d.patch +Patch1056: 0056-feat-LinstorSR-add-a-config-var-to-disable-HTTP-NBD-.patch +Patch1057: 0057-feat-LinstorSr-ensure-LVM-group-is-activated-during-.patch +Patch1058: 0058-feat-linstor-manager-add-method-to-create-LinstorSR-.patch +Patch1059: 0059-fix-LinstorSR-always-set-vdi_path-in-generate_config.patch +Patch1060: 0060-fix-minidrbdcluster-supports-new-properties-like-for.patch +Patch1061: 0061-fix-LinstorSR-enabled-disable-minidrbcluster-with-fi.patch +Patch1062: 0062-fix-linstor-manager-change-linstor-satellite-start-b.patch +Patch1063: 0063-Fix-is_open-call-for-LinstorSR.patch +Patch1064: 0064-fix-linstorvhdutil-fix-boolean-params-of-check-call.patch +Patch1065: 0065-feat-linstor-manager-robustify-exec_create_sr.patch +Patch1066: 0066-fix-cleanup-print-LINSTOR-VDI-UUID-if-error-during-i.patch +Patch1067: 0067-feat-cleanup-raise-and-dump-DRBD-openers-in-case-of-.patch +Patch1068: 0068-feat-linstorvhdutil-trace-DRBD-openers-in-case-of-ER.patch +Patch1069: 0069-fix-linstorvolumemanager-compute-correctly-size-in-a.patch +Patch1070: 0070-feat-LinstorSR-use-DRBD-openers-instead-of-lsof-to-l.patch +Patch1071: 0071-feat-LinstorSR-support-cProfile-to-trace-calls-when-.patch +Patch1072: 0072-fix-LinstorJournaler-reset-namespace-when-get-is-cal.patch +Patch1073: 0073-fix-linstorvhdutil-fix-coalesce-with-VM-running-unde.patch +Patch1074: 0074-fix-linstorvolumemanager-_get_volumes_info-doesn-t-r.patch +Patch1075: 0075-fix-linstorvolumemanager-remove-double-prefix-on-kv-.patch +Patch1076: 0076-feat-LinstorSR-add-linstor-kv-dump-helper-to-print-k.patch +Patch1077: 0077-fix-LinstorSR-disable-VHD-key-hash-usage-to-limit-ex.patch +Patch1078: 0078-fix-minidrbdcluster-ensure-SIGINT-is-handled-correct.patch +Patch1079: 0079-feat-minidrbdcluster-stop-resource-services-at-start.patch +Patch1080: 0080-feat-linstor-manager-add-new-healthCheck-function-to.patch +Patch1081: 0081-fix-LinstorSR-fix-xha-conf-parsing-return-host-ip-no.patch +Patch1082: 0082-fix-LinstorSR-start-correctly-HA-servers-HTTP-NBD-af.patch +Patch1083: 0083-fix-linstorvolumemanager-use-an-array-to-store-diskf.patch +Patch1084: 0084-feat-linstorvolumemanager-support-snaps-when-a-host-.patch +Patch1085: 0085-fix-linstorvolumemanager-support-offline-hosts-when-.patch +Patch1086: 0086-fix-linstorvolumemanager-define-_base_group_name-mem.patch +Patch1087: 0087-feat-linstorvhdutil-modify-logic-of-local-vhdutil-ca.patch +Patch1088: 0088-fix-linstorvolumemanager-robustify-failed-snapshots.patch +Patch1089: 0089-fix-linstorvolumemanager-use-a-namespace-for-volumes.patch +Patch1090: 0090-feat-linstor-kv-dump-rename-to-linstor-kv-tool-add-r.patch +Patch1091: 0091-fix-LinstorSR-handle-correctly-localhost-during-star.patch +Patch1092: 0092-fix-cleanup.py-call-repair-on-another-host-when-EROF.patch +Patch1093: 0093-fix-LinstorSR-avoid-introduction-of-DELETED-volumes.patch +Patch1094: 0094-feat-linstor-kv-tool-remove-all-volumes-supports-jou.patch +Patch1095: 0095-fix-linstorvhdutil-due-to-bad-refactoring-check-call.patch +Patch1096: 0096-feat-linstorvhdutil-ensure-we-use-VHD-parent-to-find.patch +Patch1097: 0097-feat-linstorvolumemanager-force-DRBD-demote-after-fa.patch +Patch1098: 0098-fix-linstorvhdutil-ensure-we-retry-creation-in-all-s.patch +Patch1099: 0099-fix-linstorvhdutil-don-t-retry-local-vhdutil-call-wh.patch +Patch1100: 0100-feat-fork-log-daemon-ignore-SIGTERM.patch +Patch1101: 0101-feat-LinstorSR-wait-for-http-disk-server-startup.patch +Patch1102: 0102-fix-LinstorSR-handle-inflate-resize-actions-correctl.patch +Patch1103: 0103-fix-linstor-manager-add-a-static-iptables-rule-for-D.patch +Patch1104: 0104-feat-LinstorSR-sync-with-last-http-nbd-transfer-vers.patch +Patch1105: 0105-fix-LinstorSR-don-t-check-VDI-metadata-while-listing.patch +Patch1106: 0106-fix-LinstorSR-don-t-check-metadata-when-destroying-s.patch +Patch1107: 0107-fix-linstorvhdutil-handle-correctly-generic-exceptio.patch +Patch1108: 0108-fix-minidrbdcluster-robustify-to-unmount-correctly-L.patch +Patch1109: 0109-fix-minidrbdcluster-handle-correctly-KeyboardInterru.patch +Patch1110: 0110-feat-LinstorSR-use-drbd-reactor-instead-of-minidrbdc.patch +Patch1111: 0111-fix-LinstorSR-ensure-vhdutil-calls-are-correctly-exe.patch +Patch1112: 0112-fix-LinstorSR-replace-bad-param-in-detach_thin-impl.patch +Patch1113: 0113-fix-linstorvolumemanager-remove-usage-of-realpath.patch +Patch1114: 0114-fix-linstorvhdutil-avoid-parent-path-resolution.patch +Patch1115: 0115-fix-LinstorSR-create-parent-path-during-attach.patch +Patch1116: 0116-fix-LinstorSR-retry-if-we-can-t-build-volume-cache.patch +Patch1117: 0117-fix-linstorvolumemanager-reduce-peer-slots-param-to-.patch +Patch1118: 0118-fix-LinstorSR-attach-a-valid-XAPI-session-is_open-is.patch +Patch1119: 0119-fix-LinstorSR-ensure-we-always-have-a-DRBD-path-to-s.patch +Patch1120: 0120-fix-LinstorSR-remove-hosts-ips-param.patch +Patch1121: 0121-fix-LinstorSR-compute-correctly-SR-size-using-pool-c.patch +Patch1122: 0122-fix-blktap2-ensure-we-can-import-this-module-when-LI.patch +Patch1123: 0123-fix-LinstorSR-ensure-volume-cache-can-be-recreated.patch +Patch1124: 0124-fix-linstor-manager-remove-dead-useless-code-in-add-.patch +Patch1125: 0125-fix-LinstorSR-Ensure-we-always-have-a-device-path-du.patch +Patch1126: 0126-fix-LinstorSR-always-use-lock.acquire-during-attach-.patch +Patch1127: 0127-fix-LinstorSR-mare-sure-hostnames-are-unique-at-SR-c.patch +Patch1128: 0128-fix-LinstorSR-ensure-we-can-attach-non-special-stati.patch +Patch1129: 0129-fix-LinstorSR-ensure-we-can-detach-when-deflate-call.patch +Patch1130: 0130-fix-LinstorSR-assume-VDI-is-always-a-VHD-when-the-in.patch +Patch1131: 0131-fix-LinstorSR-remove-SR-lock-during-thin-attach-deta.patch +Patch1132: 0132-fix-LinstorSR-ensure-database-is-mounted-during-scan.patch +Patch1133: 0133-fix-LinstorSR-restart-drbd-reactor-in-case-of-failur.patch +Patch1134: 0134-fix-linstorvolumemanager-retry-in-case-of-failure-du.patch +Patch1135: 0135-fix-linstorvolumemanager-avoid-diskless-creation-whe.patch +Patch1136: 0136-fix-LinstorSR-remove-diskless-after-VDI.detach-calls.patch +Patch1137: 0137-fix-LinstorSR-robustify-_load_vdi_info-in-cleanup.py.patch +Patch1138: 0138-fix-LinstorSR-ensure-detach-never-fails-on-plugin-fa.patch +Patch1139: 0139-fix-LinstorSR-ensure-we-coalesce-only-volumes-with-a.patch +Patch1140: 0140-fix-LinstorSR-don-t-try-to-repair-persistent-volumes.patch +Patch1141: 0141-fix-linstorvhdutil-format-correctly-message-if-vhd-u.patch +Patch1142: 0142-fix-LinstorSR-wait-during-attach-to-open-DRBD-path.patch +Patch1143: 0143-fix-LinstorSR-support-different-volume-sizes-in-clea.patch +Patch1144: 0144-fix-LinstorSR-remove-useless-IPS_XHA_CACHE-var.patch +Patch1145: 0145-fix-LinstorSR-ensure-we-can-deflate-on-any-host-afte.patch +Patch1146: 0146-fix-LinstorSR-ensure-we-always-use-real-DRBD-VHD-siz.patch +Patch1147: 0147-feat-linstor-kv-tool-If-no-controller-uri-option-is-.patch +Patch1148: 0148-fix-linstorvolumemanager-robustify-SR-destroy-46.patch +Patch1149: 0149-feat-linstor-manager-extend-API-with-createNodeInter.patch +Patch1150: 0150-fix-LinstorSR-support-VDI.resize-on-thick-volumes.patch +Patch1151: 0151-fix-linstorvolumemanager-format-correctly-exception-.patch +Patch1152: 0152-fix-LinstorSR-ensure-we-can-skip-coalesces-if-device.patch +Patch1153: 0153-feat-linstor-manager-add-methods-to-modify-destroy-l.patch +Patch1154: 0154-fix-LinstorSR-force-a-defined-volume-prefix-if-we-ca.patch +Patch1155: 0155-fix-LinstorSR-explicit-error-message-when-a-group-is.patch +Patch1156: 0156-fix-LinstorSR-make-sure-VDI.delete-doesn-t-throw-und.patch +Patch1157: 0157-fix-LinstorSR-add-drbd-in-the-blacklist-of-multipath.patch +Patch1158: 0158-fix-linstorvolumemanager-create-cloned-volumes-on-ho.patch +Patch1159: 0159-fix-linstorvolumemanager-don-t-align-volumes-on-LVM-.patch +Patch1160: 0160-fix-linstorvolumemanager-assert-with-message-after-l.patch +Patch1161: 0161-fix-linstorvolumemanager-retry-resize-if-volume-is-n.patch +Patch1162: 0162-fix-LinstorSR-create-DRBD-diskless-if-necessary-for-.patch +Patch1163: 0163-fix-LinstorSR-fix-bad-call-to-vhdutil.inflate-bad-ex.patch +Patch1164: 0164-fix-LinstorSR-activate-VG-if-attach-from-config-is-a.patch +Patch1165: 0165-feat-LinstorSR-use-a-specific-resource-group-for-DB-.patch +Patch1166: 0166-feat-linstor-manager-add-getNodePreferredInterface-h.patch +Patch1167: 0167-fix-linstorvolumemanager-blocks-deletion-of-default-.patch +Patch1168: 0168-feat-linstorvolumemanager-change-logic-of-get_resour.patch +Patch1169: 0169-feat-linstor-manager-add-error-codes-to-healthCheck-.patch +Patch1170: 0170-fix-LinstorSR-fix-bad-exception-reference-during-sna.patch +Patch1171: 0171-fix-tapdisk-pause-ensure-LINSTOR-VHD-chain-is-availa.patch +Patch1172: 0172-fix-LVHDoISCSISR-disable-restart-of-ISCSI-daemon.patch +Patch1173: 0173-fix-linstorvhdutil-retry-check-on-another-machine-in.patch +Patch1174: 0174-fix-LinstorSR-explicit-errors-when-database-path-is-.patch +Patch1175: 0175-fix-LinstorSR-Misc-fixes-on-destroy.patch %description This package contains storage backends used in XCP @@ -216,6 +371,9 @@ cp -r htmlcov %{buildroot}/htmlcov %files %defattr(-,root,root,-) +/etc/systemd/system/drbd-reactor.service.d/override.conf +/etc/systemd/system/linstor-satellite.service.d/override.conf +/etc/systemd/system/var-lib-linstor.service /etc/udev/scripts/xs-mpath-scsidev.sh /etc/xapi.d/plugins/coalesce-leaf /etc/xapi.d/plugins/lvhd-thin @@ -227,6 +385,7 @@ cp -r htmlcov %{buildroot}/htmlcov /etc/xapi.d/plugins/trim /etc/xensource/master.d/02-vhdcleanup /opt/xensource/bin/blktap2 +/opt/xensource/bin/linstor-kv-tool /opt/xensource/bin/tapdisk-cache-stats /opt/xensource/bin/xe-getarrayidentifier /opt/xensource/bin/xe-get-arrayid-lunnum @@ -236,6 +395,7 @@ cp -r htmlcov %{buildroot}/htmlcov /opt/xensource/libexec/dcopy /opt/xensource/libexec/local-device-change /opt/xensource/libexec/make-dummy-sr +/opt/xensource/libexec/safe-umount /opt/xensource/libexec/usb_change /opt/xensource/libexec/kickpipe /opt/xensource/libexec/set-iscsi-initiator @@ -513,10 +673,14 @@ cp -r htmlcov %{buildroot}/htmlcov /opt/xensource/sm/linstorvolumemanager.py /opt/xensource/sm/linstorvolumemanager.pyc /opt/xensource/sm/linstorvolumemanager.pyo +/opt/xensource/libexec/fork-log-daemon /opt/xensource/libexec/linstor-monitord %{_unitdir}/linstor-monitor.service %changelog +* Wed Jun 12 2024 Ronan Abhamon 2.30.8-12.1.0.linstor.1 +- Add "Provides": sm-linstor (necessary for the "Requires" of xcp-ng-linstor) +- Add LINSTOR patches * Wed Jun 12 2024 Ronan Abhamon - 2.30.8-12.1 - Add 0023-feat-LVHDSR-add-a-way-to-modify-config-of-LVMs-56.patch From e44e2b3c813930568a6cb48e64f205cc33bfba04 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 17 Jun 2024 17:51:55 +0200 Subject: [PATCH 2/8] Reload automatically multipathd configuration (#41) We must reload the multipathd configuration without restarting the service to prevent the opening of /dev/drbdXXXX volumes. Otherwise if multipathd opens a DRBD volume, it blocks its access to other hosts. Signed-off-by: Ronan Abhamon --- SPECS/sm.spec | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/SPECS/sm.spec b/SPECS/sm.spec index 1a849884..5b0c369a 100644 --- a/SPECS/sm.spec +++ b/SPECS/sm.spec @@ -11,7 +11,7 @@ Summary: sm - XCP storage managers Name: sm Version: 2.30.8 -Release: %{?xsrel}.1.0.linstor.1%{?dist} +Release: %{?xsrel}.1.0.linstor.2%{?dist} Group: System/Hypervisor License: LGPL URL: https://github.com/xapi-project/sm @@ -71,6 +71,7 @@ Requires(post): systemd Requires(preun): systemd Requires(postun): systemd Requires: xenserver-multipath +Requires(post): xenserver-multipath Requires: xenserver-lvm2 >= 2.02.180-11.xs+2.0.2 Requires: python2-bitarray Requires(post): xs-presets >= 1.3 @@ -324,6 +325,14 @@ systemctl start sr_health_check.timer # However it won't start without linstor-controller.service systemctl enable linstor-monitor.service +# XCP-ng: We must reload the multipathd configuration without restarting the service to prevent +# the opening of /dev/drbdXXXX volumes. Otherwise if multipathd opens a DRBD volume, +# it blocks its access to other hosts. +# This command is also important if our multipath conf is modified for other drivers. +if [ $1 -gt 1 ]; then + multipathd reconfigure +fi + %preun %systemd_preun make-dummy-sr.service %systemd_preun mpcount.service @@ -678,6 +687,9 @@ cp -r htmlcov %{buildroot}/htmlcov %{_unitdir}/linstor-monitor.service %changelog +* Mon Jun 17 2024 Ronan Abhamon 2.30.8-12.1.0.linstor.2 +- Reload automatically multipathd config after each update + * Wed Jun 12 2024 Ronan Abhamon 2.30.8-12.1.0.linstor.1 - Add "Provides": sm-linstor (necessary for the "Requires" of xcp-ng-linstor) - Add LINSTOR patches From 5db761bccf5c4e2c8afac423e852b6ada72b14b3 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 28 Jun 2024 11:22:10 +0200 Subject: [PATCH 3/8] Add 0176-fix-LinstorSR-open-non-leaf-volumes-in-RO-mode-creat.patch Signed-off-by: Ronan Abhamon --- ...21cc248d79b749a63d4ad099e6d5f4b8b588.patch | 2 +- ...-sm.service-s-description-for-XCP-ng.patch | 2 +- .../0003-Add-TrueNAS-multipath-config.patch | 2 +- ...add-CephFS-GlusterFS-and-XFS-drivers.patch | 2 +- ...-ZFS-driver-to-avoid-losing-VDI-meta.patch | 2 +- ...driver-for-users-who-need-to-transit.patch | 2 +- ...07-feat-drivers-add-LinstorSR-driver.patch | 2 +- ...nit-tests-concerning-ZFS-close-xcp-n.patch | 2 +- ...no-NFS-ACLs-provided-assume-everyone.patch | 2 +- .../0010-Added-SM-Driver-for-MooseFS.patch | 2 +- ...mount-in-ISOSR-when-legacy_mode-is-u.patch | 2 +- ...SR-uses-now-UUID-subdirs-for-each-SR.patch | 2 +- ...Fix-is_open-call-for-many-drivers-25.patch | 2 +- ...HING-capability-for-many-SR-types-24.patch | 2 +- ...ve-SR_PROBE-from-ZFS-capabilities-37.patch | 2 +- ...ix-vdi-ref-when-static-vdis-are-used.patch | 2 +- ...-not-to-edit-multipath.conf-directly.patch | 2 +- ...om.conf-multipath-configuration-file.patch | 2 +- ...all-etc-multipath-conf.d-custom.conf.patch | 2 +- SOURCES/0020-Backport-NFS4-only-support.patch | 2 +- ...or-NFS4-when-rpcinfo-does-not-includ.patch | 2 +- ...Block-backport-of-largeblocksr-51-55.patch | 2 +- ...dd-a-way-to-modify-config-of-LVMs-56.patch | 2 +- ...-alarm-must-be-reset-in-case-of-succ.patch | 2 +- ...urns-the-result-of-user-function-now.patch | 2 +- ...e-pause-tag-from-VDIs-in-case-of-fai.patch | 2 +- ...pair-volumes-only-if-an-exclusive-co.patch | 2 +- ...instorSR-Improve-LINSTOR-performance.patch | 2 +- ...obustify-scan-to-avoid-losing-VDIs-i.patch | 2 +- ...isplay-a-correctly-readable-size-for.patch | 2 +- ...itord-scan-all-LINSTOR-SRs-every-12-.patch | 2 +- ...ll-correctly-method-in-_locked_load-.patch | 2 +- ...rSR-integrate-minidrbdcluster-daemon.patch | 2 +- ...nsure-heartbeat-and-redo_log-VDIs-ar.patch | 2 +- ...rotect-sr-commands-to-avoid-forgetti.patch | 2 +- ...aler-ensure-uri-is-not-None-during-l.patch | 2 +- ...dd-an-option-to-disable-auto-quorum-.patch | 2 +- ...eManager-add-a-workaround-to-create-.patch | 2 +- ...LinstorSR-add-optional-ips-parameter.patch | 2 +- ...dd-a-helper-log_drbd_erofs-to-trace-.patch | 15 ++-- ...y-to-restart-the-services-again-if-t.patch | 4 +- ...bustify-linstor-manager-to-never-inc.patch | 4 +- ...event-starting-controller-during-fai.patch | 4 +- ...meManager-increase-peer-slots-limit-.patch | 4 +- ...meManager-add-a-fallback-to-find-con.patch | 4 +- ...tor.mount-ensure-we-always-mount-dat.patch | 4 +- ...meManager-add-a-fallback-to-find-nod.patch | 4 +- ...xplain-on-which-host-plugins-command.patch | 4 +- ...eate-diskless-path-if-necessary-duri.patch | 4 +- ...se-HTTP-NBD-instead-of-DRBD-directly.patch | 4 +- ...nd-controller-when-XAPI-unreachable-.patch | 4 +- ...e-IPs-instead-of-hostnames-in-NBD-se.patch | 4 +- ...eManager-ensure-we-always-use-IPs-in.patch | 4 +- ...ager-add-methods-to-add-remove-host-.patch | 4 +- ...meManager-support-SR-creation-with-d.patch | 4 +- ...dd-a-config-var-to-disable-HTTP-NBD-.patch | 4 +- ...nsure-LVM-group-is-activated-during-.patch | 4 +- ...ager-add-method-to-create-LinstorSR-.patch | 4 +- ...ways-set-vdi_path-in-generate_config.patch | 4 +- ...ter-supports-new-properties-like-for.patch | 4 +- ...abled-disable-minidrbcluster-with-fi.patch | 4 +- ...ger-change-linstor-satellite-start-b.patch | 4 +- .../0063-Fix-is_open-call-for-LinstorSR.patch | 4 +- ...til-fix-boolean-params-of-check-call.patch | 4 +- ...tor-manager-robustify-exec_create_sr.patch | 4 +- ...t-LINSTOR-VDI-UUID-if-error-during-i.patch | 4 +- ...se-and-dump-DRBD-openers-in-case-of-.patch | 4 +- ...til-trace-DRBD-openers-in-case-of-ER.patch | 4 +- ...emanager-compute-correctly-size-in-a.patch | 4 +- ...se-DRBD-openers-instead-of-lsof-to-l.patch | 10 +-- ...upport-cProfile-to-trace-calls-when-.patch | 4 +- ...aler-reset-namespace-when-get-is-cal.patch | 4 +- ...il-fix-coalesce-with-VM-running-unde.patch | 4 +- ...emanager-_get_volumes_info-doesn-t-r.patch | 4 +- ...emanager-remove-double-prefix-on-kv-.patch | 4 +- ...dd-linstor-kv-dump-helper-to-print-k.patch | 4 +- ...sable-VHD-key-hash-usage-to-limit-ex.patch | 4 +- ...ter-ensure-SIGINT-is-handled-correct.patch | 4 +- ...ster-stop-resource-services-at-start.patch | 4 +- ...ager-add-new-healthCheck-function-to.patch | 4 +- ...x-xha-conf-parsing-return-host-ip-no.patch | 4 +- ...art-correctly-HA-servers-HTTP-NBD-af.patch | 4 +- ...emanager-use-an-array-to-store-diskf.patch | 4 +- ...memanager-support-snaps-when-a-host-.patch | 4 +- ...emanager-support-offline-hosts-when-.patch | 4 +- ...emanager-define-_base_group_name-mem.patch | 4 +- ...til-modify-logic-of-local-vhdutil-ca.patch | 4 +- ...memanager-robustify-failed-snapshots.patch | 4 +- ...emanager-use-a-namespace-for-volumes.patch | 4 +- ...dump-rename-to-linstor-kv-tool-add-r.patch | 4 +- ...ndle-correctly-localhost-during-star.patch | 4 +- ...all-repair-on-another-host-when-EROF.patch | 4 +- ...void-introduction-of-DELETED-volumes.patch | 4 +- ...tool-remove-all-volumes-supports-jou.patch | 4 +- ...il-due-to-bad-refactoring-check-call.patch | 4 +- ...til-ensure-we-use-VHD-parent-to-find.patch | 4 +- ...memanager-force-DRBD-demote-after-fa.patch | 4 +- ...il-ensure-we-retry-creation-in-all-s.patch | 4 +- ...il-don-t-retry-local-vhdutil-call-wh.patch | 4 +- ...-feat-fork-log-daemon-ignore-SIGTERM.patch | 4 +- ...SR-wait-for-http-disk-server-startup.patch | 4 +- ...ndle-inflate-resize-actions-correctl.patch | 4 +- ...ger-add-a-static-iptables-rule-for-D.patch | 4 +- ...ync-with-last-http-nbd-transfer-vers.patch | 4 +- ...n-t-check-VDI-metadata-while-listing.patch | 4 +- ...n-t-check-metadata-when-destroying-s.patch | 4 +- ...il-handle-correctly-generic-exceptio.patch | 4 +- ...ter-robustify-to-unmount-correctly-L.patch | 4 +- ...ter-handle-correctly-KeyboardInterru.patch | 4 +- ...se-drbd-reactor-instead-of-minidrbdc.patch | 4 +- ...sure-vhdutil-calls-are-correctly-exe.patch | 4 +- ...eplace-bad-param-in-detach_thin-impl.patch | 4 +- ...lumemanager-remove-usage-of-realpath.patch | 4 +- ...vhdutil-avoid-parent-path-resolution.patch | 4 +- ...rSR-create-parent-path-during-attach.patch | 4 +- ...retry-if-we-can-t-build-volume-cache.patch | 4 +- ...emanager-reduce-peer-slots-param-to-.patch | 4 +- ...tach-a-valid-XAPI-session-is_open-is.patch | 4 +- ...sure-we-always-have-a-DRBD-path-to-s.patch | 4 +- ...fix-LinstorSR-remove-hosts-ips-param.patch | 4 +- ...mpute-correctly-SR-size-using-pool-c.patch | 4 +- ...re-we-can-import-this-module-when-LI.patch | 10 +-- ...ensure-volume-cache-can-be-recreated.patch | 4 +- ...ger-remove-dead-useless-code-in-add-.patch | 4 +- ...sure-we-always-have-a-device-path-du.patch | 4 +- ...ways-use-lock.acquire-during-attach-.patch | 4 +- ...re-sure-hostnames-are-unique-at-SR-c.patch | 4 +- ...sure-we-can-attach-non-special-stati.patch | 4 +- ...sure-we-can-detach-when-deflate-call.patch | 4 +- ...sume-VDI-is-always-a-VHD-when-the-in.patch | 4 +- ...move-SR-lock-during-thin-attach-deta.patch | 4 +- ...sure-database-is-mounted-during-scan.patch | 4 +- ...start-drbd-reactor-in-case-of-failur.patch | 4 +- ...emanager-retry-in-case-of-failure-du.patch | 4 +- ...emanager-avoid-diskless-creation-whe.patch | 4 +- ...move-diskless-after-VDI.detach-calls.patch | 4 +- ...bustify-_load_vdi_info-in-cleanup.py.patch | 4 +- ...sure-detach-never-fails-on-plugin-fa.patch | 4 +- ...sure-we-coalesce-only-volumes-with-a.patch | 4 +- ...n-t-try-to-repair-persistent-volumes.patch | 4 +- ...il-format-correctly-message-if-vhd-u.patch | 4 +- ...wait-during-attach-to-open-DRBD-path.patch | 4 +- ...pport-different-volume-sizes-in-clea.patch | 4 +- ...rSR-remove-useless-IPS_XHA_CACHE-var.patch | 4 +- ...sure-we-can-deflate-on-any-host-afte.patch | 4 +- ...sure-we-always-use-real-DRBD-VHD-siz.patch | 4 +- ...tool-If-no-controller-uri-option-is-.patch | 4 +- ...olumemanager-robustify-SR-destroy-46.patch | 4 +- ...ager-extend-API-with-createNodeInter.patch | 4 +- ...-support-VDI.resize-on-thick-volumes.patch | 4 +- ...emanager-format-correctly-exception-.patch | 4 +- ...sure-we-can-skip-coalesces-if-device.patch | 4 +- ...ager-add-methods-to-modify-destroy-l.patch | 4 +- ...rce-a-defined-volume-prefix-if-we-ca.patch | 4 +- ...plicit-error-message-when-a-group-is.patch | 4 +- ...ke-sure-VDI.delete-doesn-t-throw-und.patch | 4 +- ...d-drbd-in-the-blacklist-of-multipath.patch | 4 +- ...emanager-create-cloned-volumes-on-ho.patch | 4 +- ...emanager-don-t-align-volumes-on-LVM-.patch | 4 +- ...emanager-assert-with-message-after-l.patch | 4 +- ...emanager-retry-resize-if-volume-is-n.patch | 4 +- ...eate-DRBD-diskless-if-necessary-for-.patch | 4 +- ...x-bad-call-to-vhdutil.inflate-bad-ex.patch | 4 +- ...tivate-VG-if-attach-from-config-is-a.patch | 4 +- ...se-a-specific-resource-group-for-DB-.patch | 4 +- ...ager-add-getNodePreferredInterface-h.patch | 4 +- ...emanager-blocks-deletion-of-default-.patch | 4 +- ...memanager-change-logic-of-get_resour.patch | 4 +- ...ager-add-error-codes-to-healthCheck-.patch | 4 +- ...x-bad-exception-reference-during-sna.patch | 4 +- ...e-ensure-LINSTOR-VHD-chain-is-availa.patch | 4 +- ...SISR-disable-restart-of-ISCSI-daemon.patch | 4 +- ...il-retry-check-on-another-machine-in.patch | 4 +- ...plicit-errors-when-database-path-is-.patch | 4 +- ...-fix-LinstorSR-Misc-fixes-on-destroy.patch | 4 +- ...en-non-leaf-volumes-in-RO-mode-creat.patch | 85 +++++++++++++++++++ SPECS/sm.spec | 6 +- 177 files changed, 413 insertions(+), 323 deletions(-) create mode 100644 SOURCES/0176-fix-LinstorSR-open-non-leaf-volumes-in-RO-mode-creat.patch diff --git a/SOURCES/0001-backport-of-ccd121cc248d79b749a63d4ad099e6d5f4b8b588.patch b/SOURCES/0001-backport-of-ccd121cc248d79b749a63d4ad099e6d5f4b8b588.patch index a7530744..5db24d1e 100644 --- a/SOURCES/0001-backport-of-ccd121cc248d79b749a63d4ad099e6d5f4b8b588.patch +++ b/SOURCES/0001-backport-of-ccd121cc248d79b749a63d4ad099e6d5f4b8b588.patch @@ -1,7 +1,7 @@ From a365619c2835e593259dad3c26761575f64066d6 Mon Sep 17 00:00:00 2001 From: Mark Syms Date: Thu, 20 May 2021 17:40:06 +0100 -Subject: [PATCH 001/175] backport of ccd121cc248d79b749a63d4ad099e6d5f4b8b588: +Subject: [PATCH 001/176] backport of ccd121cc248d79b749a63d4ad099e6d5f4b8b588: CA-354692: check for device parameter in create/probe calls Signed-off-by: Mark Syms diff --git a/SOURCES/0002-Update-xs-sm.service-s-description-for-XCP-ng.patch b/SOURCES/0002-Update-xs-sm.service-s-description-for-XCP-ng.patch index 62d810a6..fd7790bf 100644 --- a/SOURCES/0002-Update-xs-sm.service-s-description-for-XCP-ng.patch +++ b/SOURCES/0002-Update-xs-sm.service-s-description-for-XCP-ng.patch @@ -1,7 +1,7 @@ From 283242d159438c4b301e153a95adde5dfaea3b58 Mon Sep 17 00:00:00 2001 From: Samuel Verschelde Date: Thu, 13 Aug 2020 15:22:17 +0200 -Subject: [PATCH 002/175] Update xs-sm.service's description for XCP-ng +Subject: [PATCH 002/176] 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. diff --git a/SOURCES/0003-Add-TrueNAS-multipath-config.patch b/SOURCES/0003-Add-TrueNAS-multipath-config.patch index b86ab1e6..245fc6e7 100644 --- a/SOURCES/0003-Add-TrueNAS-multipath-config.patch +++ b/SOURCES/0003-Add-TrueNAS-multipath-config.patch @@ -1,7 +1,7 @@ From d6528d899b762ec5d7ceec1fb9c8b13c2c7e6f73 Mon Sep 17 00:00:00 2001 From: Samuel Verschelde Date: Thu, 13 Aug 2020 15:26:43 +0200 -Subject: [PATCH 003/175] Add TrueNAS multipath config +Subject: [PATCH 003/176] 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. diff --git a/SOURCES/0004-feat-drivers-add-CephFS-GlusterFS-and-XFS-drivers.patch b/SOURCES/0004-feat-drivers-add-CephFS-GlusterFS-and-XFS-drivers.patch index eeddb59a..e254baab 100644 --- a/SOURCES/0004-feat-drivers-add-CephFS-GlusterFS-and-XFS-drivers.patch +++ b/SOURCES/0004-feat-drivers-add-CephFS-GlusterFS-and-XFS-drivers.patch @@ -1,7 +1,7 @@ From 13542e244eea28a4c60708de99a50fa8c3d4ec5a Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 20 Jul 2020 16:26:42 +0200 -Subject: [PATCH 004/175] feat(drivers): add CephFS, GlusterFS and XFS drivers +Subject: [PATCH 004/176] feat(drivers): add CephFS, GlusterFS and XFS drivers --- Makefile | 3 + diff --git a/SOURCES/0005-feat-drivers-add-ZFS-driver-to-avoid-losing-VDI-meta.patch b/SOURCES/0005-feat-drivers-add-ZFS-driver-to-avoid-losing-VDI-meta.patch index c84d1d3a..9ba1d42e 100644 --- a/SOURCES/0005-feat-drivers-add-ZFS-driver-to-avoid-losing-VDI-meta.patch +++ b/SOURCES/0005-feat-drivers-add-ZFS-driver-to-avoid-losing-VDI-meta.patch @@ -1,7 +1,7 @@ From 4525a55b84eb46f4c67797da6eaf61a329dac9d7 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 12 Aug 2020 11:14:33 +0200 -Subject: [PATCH 005/175] feat(drivers): add ZFS driver to avoid losing VDI +Subject: [PATCH 005/176] feat(drivers): add ZFS driver to avoid losing VDI metadata (xcp-ng/xcp#401) --- diff --git a/SOURCES/0006-Re-add-the-ext4-driver-for-users-who-need-to-transit.patch b/SOURCES/0006-Re-add-the-ext4-driver-for-users-who-need-to-transit.patch index d8031c33..051eebb9 100644 --- a/SOURCES/0006-Re-add-the-ext4-driver-for-users-who-need-to-transit.patch +++ b/SOURCES/0006-Re-add-the-ext4-driver-for-users-who-need-to-transit.patch @@ -1,7 +1,7 @@ From 5987a43e40444a524768b1434de1a67c6e53000a Mon Sep 17 00:00:00 2001 From: Samuel Verschelde Date: Thu, 13 Aug 2020 17:10:12 +0200 -Subject: [PATCH 006/175] Re-add the ext4 driver for users who need to +Subject: [PATCH 006/176] Re-add the ext4 driver for users who need to transition The driver is needed to transition to the ext driver. diff --git a/SOURCES/0007-feat-drivers-add-LinstorSR-driver.patch b/SOURCES/0007-feat-drivers-add-LinstorSR-driver.patch index 349c98dd..1838e31a 100644 --- a/SOURCES/0007-feat-drivers-add-LinstorSR-driver.patch +++ b/SOURCES/0007-feat-drivers-add-LinstorSR-driver.patch @@ -1,7 +1,7 @@ From 3b19f4d691a10f0023d936a0328e4a7684b4d3fa Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 16 Mar 2020 15:39:44 +0100 -Subject: [PATCH 007/175] feat(drivers): add LinstorSR driver +Subject: [PATCH 007/176] feat(drivers): add LinstorSR driver Some important points: diff --git a/SOURCES/0008-feat-tests-add-unit-tests-concerning-ZFS-close-xcp-n.patch b/SOURCES/0008-feat-tests-add-unit-tests-concerning-ZFS-close-xcp-n.patch index 3ad4bf63..6e526b03 100644 --- a/SOURCES/0008-feat-tests-add-unit-tests-concerning-ZFS-close-xcp-n.patch +++ b/SOURCES/0008-feat-tests-add-unit-tests-concerning-ZFS-close-xcp-n.patch @@ -1,7 +1,7 @@ From c43a4dbdff827fe7a65f93a4fa4b817344c854aa Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 27 Oct 2020 15:04:36 +0100 -Subject: [PATCH 008/175] feat(tests): add unit tests concerning ZFS (close +Subject: [PATCH 008/176] feat(tests): add unit tests concerning ZFS (close xcp-ng/xcp#425) - Check if "create" doesn't succeed without zfs packages diff --git a/SOURCES/0009-If-no-NFS-ACLs-provided-assume-everyone.patch b/SOURCES/0009-If-no-NFS-ACLs-provided-assume-everyone.patch index 04062c30..96c33fd8 100644 --- a/SOURCES/0009-If-no-NFS-ACLs-provided-assume-everyone.patch +++ b/SOURCES/0009-If-no-NFS-ACLs-provided-assume-everyone.patch @@ -1,7 +1,7 @@ From c1f90914648fc31104ebc535f653c9b70d27fc47 Mon Sep 17 00:00:00 2001 From: BenjiReis Date: Thu, 25 Feb 2021 09:54:52 +0100 -Subject: [PATCH 009/175] If no NFS ACLs provided, assume everyone: +Subject: [PATCH 009/176] 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: "*". diff --git a/SOURCES/0010-Added-SM-Driver-for-MooseFS.patch b/SOURCES/0010-Added-SM-Driver-for-MooseFS.patch index ddc703b8..aacd797b 100644 --- a/SOURCES/0010-Added-SM-Driver-for-MooseFS.patch +++ b/SOURCES/0010-Added-SM-Driver-for-MooseFS.patch @@ -1,7 +1,7 @@ From 46f4c9f02e0c0bacecf4fba09bdf94a419955d10 Mon Sep 17 00:00:00 2001 From: Aleksander Wieliczko Date: Fri, 29 Jan 2021 15:21:23 +0100 -Subject: [PATCH 010/175] Added SM Driver for MooseFS +Subject: [PATCH 010/176] Added SM Driver for MooseFS Co-authored-by: Piotr Robert Konopelko Signed-off-by: Aleksander Wieliczko diff --git a/SOURCES/0011-Avoid-usage-of-umount-in-ISOSR-when-legacy_mode-is-u.patch b/SOURCES/0011-Avoid-usage-of-umount-in-ISOSR-when-legacy_mode-is-u.patch index 319bef15..ecc92f0a 100644 --- a/SOURCES/0011-Avoid-usage-of-umount-in-ISOSR-when-legacy_mode-is-u.patch +++ b/SOURCES/0011-Avoid-usage-of-umount-in-ISOSR-when-legacy_mode-is-u.patch @@ -1,7 +1,7 @@ From 78e02205515d1926448d9148e07190278f192fe1 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 2 Dec 2021 09:28:37 +0100 -Subject: [PATCH 011/175] Avoid usage of `umount` in `ISOSR` when `legacy_mode` +Subject: [PATCH 011/176] 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 diff --git a/SOURCES/0012-MooseFS-SR-uses-now-UUID-subdirs-for-each-SR.patch b/SOURCES/0012-MooseFS-SR-uses-now-UUID-subdirs-for-each-SR.patch index dd25b1ee..d35fd0bf 100644 --- a/SOURCES/0012-MooseFS-SR-uses-now-UUID-subdirs-for-each-SR.patch +++ b/SOURCES/0012-MooseFS-SR-uses-now-UUID-subdirs-for-each-SR.patch @@ -1,7 +1,7 @@ From 96777e1aebf0b4bf800d71c03a87908282669971 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 18 May 2022 17:28:09 +0200 -Subject: [PATCH 012/175] MooseFS SR uses now UUID subdirs for each SR +Subject: [PATCH 012/176] 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 diff --git a/SOURCES/0013-Fix-is_open-call-for-many-drivers-25.patch b/SOURCES/0013-Fix-is_open-call-for-many-drivers-25.patch index 647e06af..bcfe92e1 100644 --- a/SOURCES/0013-Fix-is_open-call-for-many-drivers-25.patch +++ b/SOURCES/0013-Fix-is_open-call-for-many-drivers-25.patch @@ -1,7 +1,7 @@ From ebb716f123eb8b6c4e8b2ff1147926211af183db Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 23 Jun 2022 10:36:36 +0200 -Subject: [PATCH 013/175] Fix is_open call for many drivers (#25) +Subject: [PATCH 013/176] 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. diff --git a/SOURCES/0014-Remove-SR_CACHING-capability-for-many-SR-types-24.patch b/SOURCES/0014-Remove-SR_CACHING-capability-for-many-SR-types-24.patch index 6c163746..9643877e 100644 --- a/SOURCES/0014-Remove-SR_CACHING-capability-for-many-SR-types-24.patch +++ b/SOURCES/0014-Remove-SR_CACHING-capability-for-many-SR-types-24.patch @@ -1,7 +1,7 @@ From 658d391b17fa66a312401e43b22cefb897ea3b57 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 23 Jun 2022 10:37:07 +0200 -Subject: [PATCH 014/175] Remove SR_CACHING capability for many SR types (#24) +Subject: [PATCH 014/176] 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. diff --git a/SOURCES/0015-Remove-SR_PROBE-from-ZFS-capabilities-37.patch b/SOURCES/0015-Remove-SR_PROBE-from-ZFS-capabilities-37.patch index 08605897..d64a3557 100644 --- a/SOURCES/0015-Remove-SR_PROBE-from-ZFS-capabilities-37.patch +++ b/SOURCES/0015-Remove-SR_PROBE-from-ZFS-capabilities-37.patch @@ -1,7 +1,7 @@ From 7263d70aa77dbc18b40b000811be3cf01ab8f4ad Mon Sep 17 00:00:00 2001 From: BenjiReis Date: Fri, 4 Aug 2023 12:10:08 +0200 -Subject: [PATCH 015/175] Remove `SR_PROBE` from ZFS capabilities (#37) +Subject: [PATCH 015/176] Remove `SR_PROBE` from ZFS capabilities (#37) The probe method is not implemented so we shouldn't advertise it. diff --git a/SOURCES/0016-Fix-vdi-ref-when-static-vdis-are-used.patch b/SOURCES/0016-Fix-vdi-ref-when-static-vdis-are-used.patch index 6c46aa1c..f518d26a 100644 --- a/SOURCES/0016-Fix-vdi-ref-when-static-vdis-are-used.patch +++ b/SOURCES/0016-Fix-vdi-ref-when-static-vdis-are-used.patch @@ -1,7 +1,7 @@ From 85c1fa8737facb51f419b0539661f8fffcc36d8d Mon Sep 17 00:00:00 2001 From: Guillaume Date: Wed, 16 Aug 2023 13:42:21 +0200 -Subject: [PATCH 016/175] Fix vdi-ref when static vdis are used +Subject: [PATCH 016/176] 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. diff --git a/SOURCES/0017-Tell-users-not-to-edit-multipath.conf-directly.patch b/SOURCES/0017-Tell-users-not-to-edit-multipath.conf-directly.patch index 6f18c4db..e69d7e41 100644 --- a/SOURCES/0017-Tell-users-not-to-edit-multipath.conf-directly.patch +++ b/SOURCES/0017-Tell-users-not-to-edit-multipath.conf-directly.patch @@ -1,7 +1,7 @@ From 0d635eac00e89fcfa16856f53947511f0911e2bc Mon Sep 17 00:00:00 2001 From: Samuel Verschelde Date: Fri, 27 Jan 2023 12:03:15 +0100 -Subject: [PATCH 017/175] Tell users not to edit multipath.conf directly +Subject: [PATCH 017/176] 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 diff --git a/SOURCES/0018-Add-custom.conf-multipath-configuration-file.patch b/SOURCES/0018-Add-custom.conf-multipath-configuration-file.patch index 8357419f..e1a30ce2 100644 --- a/SOURCES/0018-Add-custom.conf-multipath-configuration-file.patch +++ b/SOURCES/0018-Add-custom.conf-multipath-configuration-file.patch @@ -1,7 +1,7 @@ From 6fc44ae6ca8bf73c576ec9f74b53de0ed51cd5de Mon Sep 17 00:00:00 2001 From: Samuel Verschelde Date: Fri, 27 Jan 2023 12:23:13 +0100 -Subject: [PATCH 018/175] Add custom.conf multipath configuration file +Subject: [PATCH 018/176] 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 diff --git a/SOURCES/0019-Install-etc-multipath-conf.d-custom.conf.patch b/SOURCES/0019-Install-etc-multipath-conf.d-custom.conf.patch index 42d61ea5..da2e0ed1 100644 --- a/SOURCES/0019-Install-etc-multipath-conf.d-custom.conf.patch +++ b/SOURCES/0019-Install-etc-multipath-conf.d-custom.conf.patch @@ -1,7 +1,7 @@ From 17129f5341223dae7a0b38516e8b01990b61df1d Mon Sep 17 00:00:00 2001 From: Samuel Verschelde Date: Fri, 25 Aug 2023 17:47:34 +0200 -Subject: [PATCH 019/175] Install /etc/multipath/conf.d/custom.conf +Subject: [PATCH 019/176] Install /etc/multipath/conf.d/custom.conf Update Makefile so that the file is installed along with sm. diff --git a/SOURCES/0020-Backport-NFS4-only-support.patch b/SOURCES/0020-Backport-NFS4-only-support.patch index a6f6f278..00b84c50 100644 --- a/SOURCES/0020-Backport-NFS4-only-support.patch +++ b/SOURCES/0020-Backport-NFS4-only-support.patch @@ -1,7 +1,7 @@ From 8f5cd11745a54fcfb127a23494a1fc2af5ed723b Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Mon, 18 Dec 2023 10:22:26 +0100 -Subject: [PATCH 020/175] Backport NFS4 only support +Subject: [PATCH 020/176] Backport NFS4 only support See: https://github.com/xapi-project/sm/pull/617 diff --git a/SOURCES/0021-Backport-probe-for-NFS4-when-rpcinfo-does-not-includ.patch b/SOURCES/0021-Backport-probe-for-NFS4-when-rpcinfo-does-not-includ.patch index fa43b4c2..d26372dd 100644 --- a/SOURCES/0021-Backport-probe-for-NFS4-when-rpcinfo-does-not-includ.patch +++ b/SOURCES/0021-Backport-probe-for-NFS4-when-rpcinfo-does-not-includ.patch @@ -1,7 +1,7 @@ From ee88d74e603d364e0fb958ce867dc38ea61281db Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Mon, 18 Dec 2023 10:35:46 +0100 -Subject: [PATCH 021/175] Backport probe for NFS4 when rpcinfo does not include +Subject: [PATCH 021/176] Backport probe for NFS4 when rpcinfo does not include it See: https://github.com/xapi-project/sm/pull/655 diff --git a/SOURCES/0022-feat-LargeBlock-backport-of-largeblocksr-51-55.patch b/SOURCES/0022-feat-LargeBlock-backport-of-largeblocksr-51-55.patch index 09d8feb1..2d0e2094 100644 --- a/SOURCES/0022-feat-LargeBlock-backport-of-largeblocksr-51-55.patch +++ b/SOURCES/0022-feat-LargeBlock-backport-of-largeblocksr-51-55.patch @@ -1,7 +1,7 @@ From 86d936b5359bfaee5a3d392daed5c9199839901f Mon Sep 17 00:00:00 2001 From: Damien Thenot Date: Tue, 7 May 2024 15:20:22 +0200 -Subject: [PATCH 022/175] feat(LargeBlock): backport of largeblocksr (#51) +Subject: [PATCH 022/176] feat(LargeBlock): backport of largeblocksr (#51) (#55) A SR inheriting from a EXTSR allowing to use a 4KiB blocksize device as diff --git a/SOURCES/0023-feat-LVHDSR-add-a-way-to-modify-config-of-LVMs-56.patch b/SOURCES/0023-feat-LVHDSR-add-a-way-to-modify-config-of-LVMs-56.patch index 2854833e..19ba4c60 100644 --- a/SOURCES/0023-feat-LVHDSR-add-a-way-to-modify-config-of-LVMs-56.patch +++ b/SOURCES/0023-feat-LVHDSR-add-a-way-to-modify-config-of-LVMs-56.patch @@ -1,7 +1,7 @@ From 906aede91ac5b450e6e11332ab070d0ec7b71dbb Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 28 May 2024 15:17:21 +0200 -Subject: [PATCH 023/175] feat(LVHDSR): add a way to modify config of LVMs +Subject: [PATCH 023/176] feat(LVHDSR): add a way to modify config of LVMs (#56) With this change the driver supports a "lvm-conf" param on "other-config". diff --git a/SOURCES/0024-Fix-timeout_call-alarm-must-be-reset-in-case-of-succ.patch b/SOURCES/0024-Fix-timeout_call-alarm-must-be-reset-in-case-of-succ.patch index ce87b8e3..2b14ac2d 100644 --- a/SOURCES/0024-Fix-timeout_call-alarm-must-be-reset-in-case-of-succ.patch +++ b/SOURCES/0024-Fix-timeout_call-alarm-must-be-reset-in-case-of-succ.patch @@ -1,7 +1,7 @@ From b1bffda87658150032f68a59d90117eb8260ae14 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 16 Feb 2022 18:24:56 +0100 -Subject: [PATCH 024/175] Fix timeout_call: alarm must be reset in case of +Subject: [PATCH 024/176] Fix timeout_call: alarm must be reset in case of success Otherwise the SIGALRM signal can be emitted after the execution diff --git a/SOURCES/0025-timeout_call-returns-the-result-of-user-function-now.patch b/SOURCES/0025-timeout_call-returns-the-result-of-user-function-now.patch index 70edef7f..927b0152 100644 --- a/SOURCES/0025-timeout_call-returns-the-result-of-user-function-now.patch +++ b/SOURCES/0025-timeout_call-returns-the-result-of-user-function-now.patch @@ -1,7 +1,7 @@ From e4fa58e917a6d5e090778cfd654383e966abfe9e Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 16 Feb 2022 18:28:06 +0100 -Subject: [PATCH 025/175] timeout_call returns the result of user function now +Subject: [PATCH 025/176] timeout_call returns the result of user function now Signed-off-by: Ronan Abhamon --- diff --git a/SOURCES/0026-Always-remove-the-pause-tag-from-VDIs-in-case-of-fai.patch b/SOURCES/0026-Always-remove-the-pause-tag-from-VDIs-in-case-of-fai.patch index 4cfaa461..63b1e536 100644 --- a/SOURCES/0026-Always-remove-the-pause-tag-from-VDIs-in-case-of-fai.patch +++ b/SOURCES/0026-Always-remove-the-pause-tag-from-VDIs-in-case-of-fai.patch @@ -1,7 +1,7 @@ From b32670416ce70d546b3569a6f4cb507c0d3507bf Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 5 Feb 2024 23:16:16 +0100 -Subject: [PATCH 026/175] Always remove the pause tag from VDIs in case of +Subject: [PATCH 026/176] Always remove the pause tag from VDIs in case of failure During VDI activation in the blktap module and in case of failure diff --git a/SOURCES/0027-fix-LinstorSR-repair-volumes-only-if-an-exclusive-co.patch b/SOURCES/0027-fix-LinstorSR-repair-volumes-only-if-an-exclusive-co.patch index 28454331..7a5f8aac 100644 --- a/SOURCES/0027-fix-LinstorSR-repair-volumes-only-if-an-exclusive-co.patch +++ b/SOURCES/0027-fix-LinstorSR-repair-volumes-only-if-an-exclusive-co.patch @@ -1,7 +1,7 @@ From 56bdcd5312a20c92f5a1683b506ce447fa1914fa Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 20 Nov 2020 16:42:52 +0100 -Subject: [PATCH 027/175] fix(LinstorSR): repair volumes only if an exclusive +Subject: [PATCH 027/176] fix(LinstorSR): repair volumes only if an exclusive command is executed Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0028-feat-LinstorSR-Improve-LINSTOR-performance.patch b/SOURCES/0028-feat-LinstorSR-Improve-LINSTOR-performance.patch index 0a9b199b..0cde5794 100644 --- a/SOURCES/0028-feat-LinstorSR-Improve-LINSTOR-performance.patch +++ b/SOURCES/0028-feat-LinstorSR-Improve-LINSTOR-performance.patch @@ -1,7 +1,7 @@ From 7e1008189ee1d49545d65f14bf6bee65cec21d5c Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 10 Dec 2020 17:56:15 +0100 -Subject: [PATCH 028/175] feat(LinstorSR): Improve LINSTOR performance +Subject: [PATCH 028/176] feat(LinstorSR): Improve LINSTOR performance Details: - vdi_attach and vdi_detach are now exclusive diff --git a/SOURCES/0029-feat-LinstorSR-robustify-scan-to-avoid-losing-VDIs-i.patch b/SOURCES/0029-feat-LinstorSR-robustify-scan-to-avoid-losing-VDIs-i.patch index 91d4edc5..2426f1cf 100644 --- a/SOURCES/0029-feat-LinstorSR-robustify-scan-to-avoid-losing-VDIs-i.patch +++ b/SOURCES/0029-feat-LinstorSR-robustify-scan-to-avoid-losing-VDIs-i.patch @@ -1,7 +1,7 @@ From 78f29568ef2faee1f7fd01888169e07336f26f46 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 7 Jan 2021 11:17:08 +0100 -Subject: [PATCH 029/175] feat(LinstorSR): robustify scan to avoid losing VDIs +Subject: [PATCH 029/176] feat(LinstorSR): robustify scan to avoid losing VDIs if function is called outside module Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0030-feat-LinstorSR-display-a-correctly-readable-size-for.patch b/SOURCES/0030-feat-LinstorSR-display-a-correctly-readable-size-for.patch index 80dc1744..57ab42e1 100644 --- a/SOURCES/0030-feat-LinstorSR-display-a-correctly-readable-size-for.patch +++ b/SOURCES/0030-feat-LinstorSR-display-a-correctly-readable-size-for.patch @@ -1,7 +1,7 @@ From fe6494d475ef9c2ef612c1273cdf6dc57f1b876a Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 8 Jan 2021 16:12:15 +0100 -Subject: [PATCH 030/175] feat(LinstorSR): display a correctly readable size +Subject: [PATCH 030/176] feat(LinstorSR): display a correctly readable size for the user Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0031-feat-linstor-monitord-scan-all-LINSTOR-SRs-every-12-.patch b/SOURCES/0031-feat-linstor-monitord-scan-all-LINSTOR-SRs-every-12-.patch index 3cfba4e4..950d9a0b 100644 --- a/SOURCES/0031-feat-linstor-monitord-scan-all-LINSTOR-SRs-every-12-.patch +++ b/SOURCES/0031-feat-linstor-monitord-scan-all-LINSTOR-SRs-every-12-.patch @@ -1,7 +1,7 @@ From 6b1de43b38cabd9adc9888136c9134e167876c15 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 12 Jan 2021 14:06:34 +0100 -Subject: [PATCH 031/175] feat(linstor-monitord): scan all LINSTOR SRs every 12 +Subject: [PATCH 031/176] feat(linstor-monitord): scan all LINSTOR SRs every 12 minutes to update allocated size stats Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0032-fix-LinstorSR-call-correctly-method-in-_locked_load-.patch b/SOURCES/0032-fix-LinstorSR-call-correctly-method-in-_locked_load-.patch index 0cce3f0f..e34eb278 100644 --- a/SOURCES/0032-fix-LinstorSR-call-correctly-method-in-_locked_load-.patch +++ b/SOURCES/0032-fix-LinstorSR-call-correctly-method-in-_locked_load-.patch @@ -1,7 +1,7 @@ From 6cdc1b2a0b9f5a8ec880800fc4c8ca5244987733 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 15 Jan 2021 17:01:05 +0100 -Subject: [PATCH 032/175] fix(LinstorSR): call correctly method in _locked_load +Subject: [PATCH 032/176] fix(LinstorSR): call correctly method in _locked_load when vdi_attach_from_config is executed Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0033-feat-LinstorSR-integrate-minidrbdcluster-daemon.patch b/SOURCES/0033-feat-LinstorSR-integrate-minidrbdcluster-daemon.patch index 9a175f65..fc3264f1 100644 --- a/SOURCES/0033-feat-LinstorSR-integrate-minidrbdcluster-daemon.patch +++ b/SOURCES/0033-feat-LinstorSR-integrate-minidrbdcluster-daemon.patch @@ -1,7 +1,7 @@ From 88914c19b02c38e05fe457e45f1d41431a0bde8b Mon Sep 17 00:00:00 2001 From: Wescoeur Date: Wed, 20 Jan 2021 18:04:26 +0100 -Subject: [PATCH 033/175] feat(LinstorSR): integrate minidrbdcluster daemon +Subject: [PATCH 033/176] feat(LinstorSR): integrate minidrbdcluster daemon Now, we can: - Start a controller on any node diff --git a/SOURCES/0034-feat-LinstorSR-ensure-heartbeat-and-redo_log-VDIs-ar.patch b/SOURCES/0034-feat-LinstorSR-ensure-heartbeat-and-redo_log-VDIs-ar.patch index d6720efc..fb0b8157 100644 --- a/SOURCES/0034-feat-LinstorSR-ensure-heartbeat-and-redo_log-VDIs-ar.patch +++ b/SOURCES/0034-feat-LinstorSR-ensure-heartbeat-and-redo_log-VDIs-ar.patch @@ -1,7 +1,7 @@ From 6e0d84cf900e9c41cba663093c911fa025debd34 Mon Sep 17 00:00:00 2001 From: Wescoeur Date: Wed, 24 Feb 2021 11:17:23 +0100 -Subject: [PATCH 034/175] feat(LinstorSR): ensure heartbeat and redo_log VDIs +Subject: [PATCH 034/176] feat(LinstorSR): ensure heartbeat and redo_log VDIs are not diskless Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0035-feat-LinstorSR-protect-sr-commands-to-avoid-forgetti.patch b/SOURCES/0035-feat-LinstorSR-protect-sr-commands-to-avoid-forgetti.patch index 3cb3227e..5563d786 100644 --- a/SOURCES/0035-feat-LinstorSR-protect-sr-commands-to-avoid-forgetti.patch +++ b/SOURCES/0035-feat-LinstorSR-protect-sr-commands-to-avoid-forgetti.patch @@ -1,7 +1,7 @@ From 1039b9bb973e2911ae222cd40f4a683bc6fbb83b Mon Sep 17 00:00:00 2001 From: Wescoeur Date: Thu, 25 Feb 2021 17:52:57 +0100 -Subject: [PATCH 035/175] feat(LinstorSR): protect sr commands to avoid +Subject: [PATCH 035/176] feat(LinstorSR): protect sr commands to avoid forgetting LINSTOR volumes when master satellite is down Steps to reproduce: diff --git a/SOURCES/0036-fix-LinstorJournaler-ensure-uri-is-not-None-during-l.patch b/SOURCES/0036-fix-LinstorJournaler-ensure-uri-is-not-None-during-l.patch index 3a8d0b43..a5a353ed 100644 --- a/SOURCES/0036-fix-LinstorJournaler-ensure-uri-is-not-None-during-l.patch +++ b/SOURCES/0036-fix-LinstorJournaler-ensure-uri-is-not-None-during-l.patch @@ -1,7 +1,7 @@ From b49cf026ac1d098feec5dbc14898285a59c16011 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 8 Mar 2021 13:25:28 +0100 -Subject: [PATCH 036/175] fix(LinstorJournaler): ensure uri is not None during +Subject: [PATCH 036/176] fix(LinstorJournaler): ensure uri is not None during linstor.KV creation Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0037-feat-LinstorSR-add-an-option-to-disable-auto-quorum-.patch b/SOURCES/0037-feat-LinstorSR-add-an-option-to-disable-auto-quorum-.patch index a0473f7c..a18d6f48 100644 --- a/SOURCES/0037-feat-LinstorSR-add-an-option-to-disable-auto-quorum-.patch +++ b/SOURCES/0037-feat-LinstorSR-add-an-option-to-disable-auto-quorum-.patch @@ -1,7 +1,7 @@ From cab8593814b9b741a20d218df673a58d98dc3a79 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 22 Mar 2021 17:32:26 +0100 -Subject: [PATCH 037/175] feat(LinstorSR): add an option to disable auto-quorum +Subject: [PATCH 037/176] feat(LinstorSR): add an option to disable auto-quorum on volume DB + fix doc Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0038-fix-LinstorVolumeManager-add-a-workaround-to-create-.patch b/SOURCES/0038-fix-LinstorVolumeManager-add-a-workaround-to-create-.patch index 550f18bc..ab84c7ca 100644 --- a/SOURCES/0038-fix-LinstorVolumeManager-add-a-workaround-to-create-.patch +++ b/SOURCES/0038-fix-LinstorVolumeManager-add-a-workaround-to-create-.patch @@ -1,7 +1,7 @@ From 9e0f7c02ae9c09c9d3be6ab4bcec31325d95e719 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 23 Mar 2021 14:49:39 +0100 -Subject: [PATCH 038/175] fix(LinstorVolumeManager): add a workaround to create +Subject: [PATCH 038/176] fix(LinstorVolumeManager): add a workaround to create properly SR with thin LVM Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0039-feat-LinstorSR-add-optional-ips-parameter.patch b/SOURCES/0039-feat-LinstorSR-add-optional-ips-parameter.patch index cdc5c0f1..8594ad64 100644 --- a/SOURCES/0039-feat-LinstorSR-add-optional-ips-parameter.patch +++ b/SOURCES/0039-feat-LinstorSR-add-optional-ips-parameter.patch @@ -1,7 +1,7 @@ From 89daa5b5525c2636a624fa4cf583d5b43ca06aad Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 24 Mar 2021 10:06:58 +0100 -Subject: [PATCH 039/175] feat(LinstorSR): add optional ips parameter +Subject: [PATCH 039/176] feat(LinstorSR): add optional ips parameter Signed-off-by: Ronan Abhamon --- diff --git a/SOURCES/0040-feat-LinstorSR-add-a-helper-log_drbd_erofs-to-trace-.patch b/SOURCES/0040-feat-LinstorSR-add-a-helper-log_drbd_erofs-to-trace-.patch index 167ecc14..e26cc1bf 100644 --- a/SOURCES/0040-feat-LinstorSR-add-a-helper-log_drbd_erofs-to-trace-.patch +++ b/SOURCES/0040-feat-LinstorSR-add-a-helper-log_drbd_erofs-to-trace-.patch @@ -1,19 +1,19 @@ -From a9b37afd7c792af514898a3128fc129b8d5c90e4 Mon Sep 17 00:00:00 2001 +From fbe2c09a13bb93031b43b77a54cdb678e743654a Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 26 Mar 2021 16:13:20 +0100 -Subject: [PATCH 040/175] feat(LinstorSR): add a helper `log_drbd_erofs` to +Subject: [PATCH 040/176] feat(LinstorSR): add a helper `log_drbd_erofs` to trace EROFS errno code with DRBD resources + check EROFS error Signed-off-by: Ronan Abhamon --- - drivers/blktap2.py | 18 ++++++- + drivers/blktap2.py | 19 +++++++- drivers/linstor-manager | 19 +++++++- drivers/linstorvolumemanager.py | 83 ++++++++++++++++++++++++++++++++- drivers/vhdutil.py | 2 +- - 4 files changed, 118 insertions(+), 4 deletions(-) + 4 files changed, 119 insertions(+), 4 deletions(-) diff --git a/drivers/blktap2.py b/drivers/blktap2.py -index e9305ce..70e74c6 100755 +index e9305ce..14c564e 100755 --- a/drivers/blktap2.py +++ b/drivers/blktap2.py @@ -36,6 +36,7 @@ import json @@ -24,7 +24,7 @@ index e9305ce..70e74c6 100755 from syslog import openlog, syslog from stat import * # S_ISBLK(), ... import nfs -@@ -817,7 +818,22 @@ class Tapdisk(object): +@@ -817,7 +818,23 @@ class Tapdisk(object): TapCtl.attach(pid, minor) try: @@ -33,6 +33,7 @@ index e9305ce..70e74c6 100755 + while True: + try: + TapCtl.open(pid, minor, _type, path, options) ++ break + except TapCtl.CommandFailure as e: + err = ( + 'status' in e.info and e.info['status'] @@ -44,7 +45,7 @@ index e9305ce..70e74c6 100755 + continue + if err == errno.EROFS: + log_lsof_drbd(path) -+ break ++ raise try: tapdisk = cls.__from_blktap(blktap) node = '/sys/dev/block/%d:%d' % (tapdisk.major(), tapdisk.minor) diff --git a/SOURCES/0041-fix-LinstorSR-try-to-restart-the-services-again-if-t.patch b/SOURCES/0041-fix-LinstorSR-try-to-restart-the-services-again-if-t.patch index e39f15d6..862f435e 100644 --- a/SOURCES/0041-fix-LinstorSR-try-to-restart-the-services-again-if-t.patch +++ b/SOURCES/0041-fix-LinstorSR-try-to-restart-the-services-again-if-t.patch @@ -1,7 +1,7 @@ -From 8c41a8dd967155cebcaa814da070aca0d0e4f884 Mon Sep 17 00:00:00 2001 +From c651376bea317652fd4e6bc53af741935126dc14 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 28 Apr 2021 15:15:58 +0200 -Subject: [PATCH 041/175] fix(LinstorSR): try to restart the services again if +Subject: [PATCH 041/176] fix(LinstorSR): try to restart the services again if there is a failure in linstor-manager Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0042-fix-LinstorSR-robustify-linstor-manager-to-never-inc.patch b/SOURCES/0042-fix-LinstorSR-robustify-linstor-manager-to-never-inc.patch index 88d45675..8c25aebb 100644 --- a/SOURCES/0042-fix-LinstorSR-robustify-linstor-manager-to-never-inc.patch +++ b/SOURCES/0042-fix-LinstorSR-robustify-linstor-manager-to-never-inc.patch @@ -1,7 +1,7 @@ -From 37830a5946c792522da2ee00c7b0961714157d5f Mon Sep 17 00:00:00 2001 +From 54f90dbbb0433346a2ce8bf2563ab24277085011 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 26 Aug 2021 15:26:11 +0200 -Subject: [PATCH 042/175] fix(LinstorSR): robustify linstor-manager to never +Subject: [PATCH 042/176] fix(LinstorSR): robustify linstor-manager to never include from plugins path Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0043-fix-LinstorSR-prevent-starting-controller-during-fai.patch b/SOURCES/0043-fix-LinstorSR-prevent-starting-controller-during-fai.patch index 02a9c999..49214fe7 100644 --- a/SOURCES/0043-fix-LinstorSR-prevent-starting-controller-during-fai.patch +++ b/SOURCES/0043-fix-LinstorSR-prevent-starting-controller-during-fai.patch @@ -1,7 +1,7 @@ -From 11ec5ee20b72dc71fc2e06a8b9950fb9ba39d827 Mon Sep 17 00:00:00 2001 +From 1f8ccb5783db73c690eb900d43ee79fccd0776ba Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 26 Aug 2021 16:52:01 +0200 -Subject: [PATCH 043/175] fix(LinstorSR): prevent starting controller during +Subject: [PATCH 043/176] fix(LinstorSR): prevent starting controller during fail in linstor manager destroy method Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0044-feat-LinstorVolumeManager-increase-peer-slots-limit-.patch b/SOURCES/0044-feat-LinstorVolumeManager-increase-peer-slots-limit-.patch index aaa92c9f..821cf34f 100644 --- a/SOURCES/0044-feat-LinstorVolumeManager-increase-peer-slots-limit-.patch +++ b/SOURCES/0044-feat-LinstorVolumeManager-increase-peer-slots-limit-.patch @@ -1,7 +1,7 @@ -From 4cd5b2cf5839b03eac7a2ac283681814993521b8 Mon Sep 17 00:00:00 2001 +From 8284e3d6bac01e92fe0fd1f3594ae34b60749ee0 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 19 Oct 2021 14:48:17 +0200 -Subject: [PATCH 044/175] feat(LinstorVolumeManager): increase peer slots limit +Subject: [PATCH 044/176] feat(LinstorVolumeManager): increase peer slots limit (support 31 connections to a DRBD) - Also, create diskless devices when db is created diff --git a/SOURCES/0045-feat-LinstorVolumeManager-add-a-fallback-to-find-con.patch b/SOURCES/0045-feat-LinstorVolumeManager-add-a-fallback-to-find-con.patch index 3b1aed4c..55e5b9c9 100644 --- a/SOURCES/0045-feat-LinstorVolumeManager-add-a-fallback-to-find-con.patch +++ b/SOURCES/0045-feat-LinstorVolumeManager-add-a-fallback-to-find-con.patch @@ -1,7 +1,7 @@ -From 861d82036fb2bd397c7b97ce1d2720bc6d7a977b Mon Sep 17 00:00:00 2001 +From c12c3f0de5c9fc0c9330263a452509697e86ec6e Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 20 Oct 2021 14:33:04 +0200 -Subject: [PATCH 045/175] feat(LinstorVolumeManager): add a fallback to find +Subject: [PATCH 045/176] feat(LinstorVolumeManager): add a fallback to find controller uri (when len(hosts) >= 4) Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0046-fix-var-lib-linstor.mount-ensure-we-always-mount-dat.patch b/SOURCES/0046-fix-var-lib-linstor.mount-ensure-we-always-mount-dat.patch index af66a68c..84ec183c 100644 --- a/SOURCES/0046-fix-var-lib-linstor.mount-ensure-we-always-mount-dat.patch +++ b/SOURCES/0046-fix-var-lib-linstor.mount-ensure-we-always-mount-dat.patch @@ -1,7 +1,7 @@ -From 56ab590173a6de1d5958afd1642fe956353f631e Mon Sep 17 00:00:00 2001 +From c532e3550512008db3ba7fd5dcb1367d18d73578 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 21 Oct 2021 11:13:07 +0200 -Subject: [PATCH 046/175] fix(var-lib-linstor.mount): ensure we always mount +Subject: [PATCH 046/176] fix(var-lib-linstor.mount): ensure we always mount database with RW flags Sometimes systemd fallback to read only FS if the volume can't be mounted, we must diff --git a/SOURCES/0047-feat-LinstorVolumeManager-add-a-fallback-to-find-nod.patch b/SOURCES/0047-feat-LinstorVolumeManager-add-a-fallback-to-find-nod.patch index 3eaed984..4e10747a 100644 --- a/SOURCES/0047-feat-LinstorVolumeManager-add-a-fallback-to-find-nod.patch +++ b/SOURCES/0047-feat-LinstorVolumeManager-add-a-fallback-to-find-nod.patch @@ -1,7 +1,7 @@ -From cd1ac514af440aae4cdf8d6feae40e49b681460b Mon Sep 17 00:00:00 2001 +From a7aeadb712732b37f7dc8857d3999bfc01751308 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 21 Oct 2021 11:51:32 +0200 -Subject: [PATCH 047/175] feat(LinstorVolumeManager): add a fallback to find +Subject: [PATCH 047/176] feat(LinstorVolumeManager): add a fallback to find node name (when len(hosts) >= 4) Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0048-feat-LinstorSR-explain-on-which-host-plugins-command.patch b/SOURCES/0048-feat-LinstorSR-explain-on-which-host-plugins-command.patch index af8309f0..bf4b130f 100644 --- a/SOURCES/0048-feat-LinstorSR-explain-on-which-host-plugins-command.patch +++ b/SOURCES/0048-feat-LinstorSR-explain-on-which-host-plugins-command.patch @@ -1,7 +1,7 @@ -From 00e42259522a7df6ded203f021893abbc3da5faa Mon Sep 17 00:00:00 2001 +From 7747dc7656e0291ac3233d74157d7703671b0b06 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 26 Oct 2021 10:44:00 +0200 -Subject: [PATCH 048/175] feat(LinstorSR): explain on which host, plugins +Subject: [PATCH 048/176] feat(LinstorSR): explain on which host, plugins commands are executed Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0049-fix-LinstorSR-create-diskless-path-if-necessary-duri.patch b/SOURCES/0049-fix-LinstorSR-create-diskless-path-if-necessary-duri.patch index f1d2d04e..18a82c41 100644 --- a/SOURCES/0049-fix-LinstorSR-create-diskless-path-if-necessary-duri.patch +++ b/SOURCES/0049-fix-LinstorSR-create-diskless-path-if-necessary-duri.patch @@ -1,7 +1,7 @@ -From 0ecc1e49f3ba17f7cbbc68d3b99fc66c629269bf Mon Sep 17 00:00:00 2001 +From 0f3667547a0b1c68a96ff12e49dc2fa8edc52da7 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 3 Nov 2021 14:59:31 +0100 -Subject: [PATCH 049/175] fix(LinstorSR): create diskless path if necessary +Subject: [PATCH 049/176] fix(LinstorSR): create diskless path if necessary during VDI loading Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0050-feat-LinstorSR-use-HTTP-NBD-instead-of-DRBD-directly.patch b/SOURCES/0050-feat-LinstorSR-use-HTTP-NBD-instead-of-DRBD-directly.patch index c0aa72b6..3e565999 100644 --- a/SOURCES/0050-feat-LinstorSR-use-HTTP-NBD-instead-of-DRBD-directly.patch +++ b/SOURCES/0050-feat-LinstorSR-use-HTTP-NBD-instead-of-DRBD-directly.patch @@ -1,7 +1,7 @@ -From a10314cb88276569e22142659254ae78c636e285 Mon Sep 17 00:00:00 2001 +From d0c2d229c7119e53f1675388c6f2d07afdcafb45 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 12 May 2022 17:52:35 +0200 -Subject: [PATCH 050/175] feat(LinstorSR): use HTTP/NBD instead of DRBD +Subject: [PATCH 050/176] feat(LinstorSR): use HTTP/NBD instead of DRBD directly with heartbeat VDI Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0051-fix-LinstorSR-find-controller-when-XAPI-unreachable-.patch b/SOURCES/0051-fix-LinstorSR-find-controller-when-XAPI-unreachable-.patch index cce1612a..54dda941 100644 --- a/SOURCES/0051-fix-LinstorSR-find-controller-when-XAPI-unreachable-.patch +++ b/SOURCES/0051-fix-LinstorSR-find-controller-when-XAPI-unreachable-.patch @@ -1,7 +1,7 @@ -From 0b679551a430853c7a661b58925e671607a74214 Mon Sep 17 00:00:00 2001 +From 8ae218c2942ac22a017a9cc880ab631f5aa69c36 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 3 Mar 2022 15:02:17 +0100 -Subject: [PATCH 051/175] fix(LinstorSR): find controller when XAPI unreachable +Subject: [PATCH 051/176] fix(LinstorSR): find controller when XAPI unreachable (XHA) Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0052-fix-LinstorSR-use-IPs-instead-of-hostnames-in-NBD-se.patch b/SOURCES/0052-fix-LinstorSR-use-IPs-instead-of-hostnames-in-NBD-se.patch index 8ad79396..f7074358 100644 --- a/SOURCES/0052-fix-LinstorSR-use-IPs-instead-of-hostnames-in-NBD-se.patch +++ b/SOURCES/0052-fix-LinstorSR-use-IPs-instead-of-hostnames-in-NBD-se.patch @@ -1,7 +1,7 @@ -From c4ff0f4c15ff0e74162ecf3c7f494356e6051404 Mon Sep 17 00:00:00 2001 +From db8a2032a451a16d6bb7a7cadd6fbc8ce4795443 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 24 Mar 2022 18:13:46 +0100 -Subject: [PATCH 052/175] fix(LinstorSR): use IPs instead of hostnames in NBD +Subject: [PATCH 052/176] fix(LinstorSR): use IPs instead of hostnames in NBD server Without this patch we can't use XCP-ng hosts configured with static IPS. diff --git a/SOURCES/0053-fix-LinstorVolumeManager-ensure-we-always-use-IPs-in.patch b/SOURCES/0053-fix-LinstorVolumeManager-ensure-we-always-use-IPs-in.patch index 6f0f5f12..09fa33d6 100644 --- a/SOURCES/0053-fix-LinstorVolumeManager-ensure-we-always-use-IPs-in.patch +++ b/SOURCES/0053-fix-LinstorVolumeManager-ensure-we-always-use-IPs-in.patch @@ -1,7 +1,7 @@ -From a6fe5b35ab2fd4a0086d8060ad449d6484911b0a Mon Sep 17 00:00:00 2001 +From e7ecc4da932107ccc26ec88b0dd37818222c6852 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 31 Mar 2022 11:21:19 +0200 -Subject: [PATCH 053/175] fix(LinstorVolumeManager): ensure we always use IPs +Subject: [PATCH 053/176] fix(LinstorVolumeManager): ensure we always use IPs in _get_controller_uri Otherwise if a hostname is returned, we can't use it if the XCP-ng pool diff --git a/SOURCES/0054-feat-linstor-manager-add-methods-to-add-remove-host-.patch b/SOURCES/0054-feat-linstor-manager-add-methods-to-add-remove-host-.patch index 18b6a019..27e0f763 100644 --- a/SOURCES/0054-feat-linstor-manager-add-methods-to-add-remove-host-.patch +++ b/SOURCES/0054-feat-linstor-manager-add-methods-to-add-remove-host-.patch @@ -1,7 +1,7 @@ -From f0a4a15b68d15acce9b74b965c4ff46af3f62532 Mon Sep 17 00:00:00 2001 +From cf24400a72eca939c89f7896fe4235adab492b88 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 6 Apr 2022 17:53:02 +0200 -Subject: [PATCH 054/175] feat(linstor-manager): add methods to add remove/host +Subject: [PATCH 054/176] feat(linstor-manager): add methods to add remove/host from LINSTOR SR Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0055-feat-LinstorVolumeManager-support-SR-creation-with-d.patch b/SOURCES/0055-feat-LinstorVolumeManager-support-SR-creation-with-d.patch index 720dd272..522e80fb 100644 --- a/SOURCES/0055-feat-LinstorVolumeManager-support-SR-creation-with-d.patch +++ b/SOURCES/0055-feat-LinstorVolumeManager-support-SR-creation-with-d.patch @@ -1,7 +1,7 @@ -From cc4ab2139ea80d7367d7838c8c720616c2e89ac8 Mon Sep 17 00:00:00 2001 +From 737bf6cafdcabf0e4e675e6440488a13df703f51 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 13 Apr 2022 15:56:42 +0200 -Subject: [PATCH 055/175] feat(LinstorVolumeManager): support SR creation with +Subject: [PATCH 055/176] feat(LinstorVolumeManager): support SR creation with diskless nodes Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0056-feat-LinstorSR-add-a-config-var-to-disable-HTTP-NBD-.patch b/SOURCES/0056-feat-LinstorSR-add-a-config-var-to-disable-HTTP-NBD-.patch index 6328d2d0..668833e4 100644 --- a/SOURCES/0056-feat-LinstorSR-add-a-config-var-to-disable-HTTP-NBD-.patch +++ b/SOURCES/0056-feat-LinstorSR-add-a-config-var-to-disable-HTTP-NBD-.patch @@ -1,7 +1,7 @@ -From c2b52c658307838fc3d3565452c426214b45c504 Mon Sep 17 00:00:00 2001 +From 8a4e120a3b9c03b8f44ebc5bc28c774e1fb13fea Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 14 Apr 2022 10:30:23 +0200 -Subject: [PATCH 056/175] feat(LinstorSR): add a config var to disable HTTP/NBD +Subject: [PATCH 056/176] feat(LinstorSR): add a config var to disable HTTP/NBD servers Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0057-feat-LinstorSr-ensure-LVM-group-is-activated-during-.patch b/SOURCES/0057-feat-LinstorSr-ensure-LVM-group-is-activated-during-.patch index e0ffd003..f53638d4 100644 --- a/SOURCES/0057-feat-LinstorSr-ensure-LVM-group-is-activated-during-.patch +++ b/SOURCES/0057-feat-LinstorSr-ensure-LVM-group-is-activated-during-.patch @@ -1,7 +1,7 @@ -From 97c81ae64c853e98c6bc48b61a0858b098c81938 Mon Sep 17 00:00:00 2001 +From 68128105b3464925de8959b6b57c436f7fafd2c7 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 14 Apr 2022 15:45:20 +0200 -Subject: [PATCH 057/175] feat(LinstorSr): ensure LVM group is activated during +Subject: [PATCH 057/176] feat(LinstorSr): ensure LVM group is activated during SR.attach/create Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0058-feat-linstor-manager-add-method-to-create-LinstorSR-.patch b/SOURCES/0058-feat-linstor-manager-add-method-to-create-LinstorSR-.patch index 58d6042c..91a732b9 100644 --- a/SOURCES/0058-feat-linstor-manager-add-method-to-create-LinstorSR-.patch +++ b/SOURCES/0058-feat-linstor-manager-add-method-to-create-LinstorSR-.patch @@ -1,7 +1,7 @@ -From 74c9cc1367cc31592f332aff0bdfd24cf2d20cb3 Mon Sep 17 00:00:00 2001 +From b2e5c8fe9e77c7691f65af4b5d90cc4359064254 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 25 Apr 2022 14:47:51 +0200 -Subject: [PATCH 058/175] feat(linstor-manager): add method to create LinstorSR +Subject: [PATCH 058/176] feat(linstor-manager): add method to create LinstorSR + to list/destroy DRBD volumes Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0059-fix-LinstorSR-always-set-vdi_path-in-generate_config.patch b/SOURCES/0059-fix-LinstorSR-always-set-vdi_path-in-generate_config.patch index b91ccf3f..772941cf 100644 --- a/SOURCES/0059-fix-LinstorSR-always-set-vdi_path-in-generate_config.patch +++ b/SOURCES/0059-fix-LinstorSR-always-set-vdi_path-in-generate_config.patch @@ -1,7 +1,7 @@ -From 8ac154aad2da2216e2e741f7cb8990d36e563412 Mon Sep 17 00:00:00 2001 +From 14e0b3c2bc3cbfccfa8356a953c51f38b20feb41 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 26 Apr 2022 11:20:08 +0200 -Subject: [PATCH 059/175] fix(LinstorSR): always set vdi_path in +Subject: [PATCH 059/176] fix(LinstorSR): always set vdi_path in generate_config If the volume of a generated config is not related to HTTP/NBD diff --git a/SOURCES/0060-fix-minidrbdcluster-supports-new-properties-like-for.patch b/SOURCES/0060-fix-minidrbdcluster-supports-new-properties-like-for.patch index ac97ceb7..51a6b73e 100644 --- a/SOURCES/0060-fix-minidrbdcluster-supports-new-properties-like-for.patch +++ b/SOURCES/0060-fix-minidrbdcluster-supports-new-properties-like-for.patch @@ -1,7 +1,7 @@ -From fe078eb130b76a11d3079b7aa9adf7dbaafa3597 Mon Sep 17 00:00:00 2001 +From 5ecce33563f1c19c3ac9b61b3a6656594e96dfee Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 13 May 2022 14:35:57 +0200 -Subject: [PATCH 060/175] fix(minidrbdcluster): supports new properties like +Subject: [PATCH 060/176] fix(minidrbdcluster): supports new properties like `force-io-failures` Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0061-fix-LinstorSR-enabled-disable-minidrbcluster-with-fi.patch b/SOURCES/0061-fix-LinstorSR-enabled-disable-minidrbcluster-with-fi.patch index 7a863ddd..165f979d 100644 --- a/SOURCES/0061-fix-LinstorSR-enabled-disable-minidrbcluster-with-fi.patch +++ b/SOURCES/0061-fix-LinstorSR-enabled-disable-minidrbcluster-with-fi.patch @@ -1,7 +1,7 @@ -From 405e400377002bc9d47a21214d711649c8ed221e Mon Sep 17 00:00:00 2001 +From 4d0a06570aced0a760f9dfdceec64fe5db257cd6 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 18 May 2022 17:28:33 +0200 -Subject: [PATCH 061/175] fix(LinstorSR): enabled/disable minidrbcluster with +Subject: [PATCH 061/176] fix(LinstorSR): enabled/disable minidrbcluster with fixed order Ensure we disable minidrbdcluster during SR destruction on all hosts diff --git a/SOURCES/0062-fix-linstor-manager-change-linstor-satellite-start-b.patch b/SOURCES/0062-fix-linstor-manager-change-linstor-satellite-start-b.patch index 6a986181..921cd2ea 100644 --- a/SOURCES/0062-fix-linstor-manager-change-linstor-satellite-start-b.patch +++ b/SOURCES/0062-fix-linstor-manager-change-linstor-satellite-start-b.patch @@ -1,7 +1,7 @@ -From bf1f15e728645d9383158312fd1d5ec24844262a Mon Sep 17 00:00:00 2001 +From 94412eef0fcaf1b5ac5d0367e25b7ce54b33845c Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 31 May 2022 14:01:45 +0200 -Subject: [PATCH 062/175] fix(linstor-manager): change linstor satellite start +Subject: [PATCH 062/176] fix(linstor-manager): change linstor satellite start behavior Ensure we don't have an invalid cache used by a satellite: diff --git a/SOURCES/0063-Fix-is_open-call-for-LinstorSR.patch b/SOURCES/0063-Fix-is_open-call-for-LinstorSR.patch index ddf608a0..0ac35bf6 100644 --- a/SOURCES/0063-Fix-is_open-call-for-LinstorSR.patch +++ b/SOURCES/0063-Fix-is_open-call-for-LinstorSR.patch @@ -1,7 +1,7 @@ -From 4eb1c5526a4d6ac8583ba125321a7747bd6d1680 Mon Sep 17 00:00:00 2001 +From 85411fa09ac82dcafe0ad600fcbfaa92d10380c5 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 2 Jun 2022 09:04:28 +0200 -Subject: [PATCH 063/175] Fix is_open call for LinstorSR +Subject: [PATCH 063/176] Fix is_open call for LinstorSR 1. Ensure LinstorSR driver is imported in `_is_open` definition to register it in the driver list. Otherwise this function always fails with a SRUnknownType exception. diff --git a/SOURCES/0064-fix-linstorvhdutil-fix-boolean-params-of-check-call.patch b/SOURCES/0064-fix-linstorvhdutil-fix-boolean-params-of-check-call.patch index d3fa44bb..53c5a6ab 100644 --- a/SOURCES/0064-fix-linstorvhdutil-fix-boolean-params-of-check-call.patch +++ b/SOURCES/0064-fix-linstorvhdutil-fix-boolean-params-of-check-call.patch @@ -1,7 +1,7 @@ -From 90fdca84eb567c2b9bf85be90d9d1fadc9eab195 Mon Sep 17 00:00:00 2001 +From 6006799b8f99c1b0bcd303543145ea602196f55a Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 2 Jun 2022 09:28:32 +0200 -Subject: [PATCH 064/175] fix(linstorvhdutil): fix boolean params of `check` +Subject: [PATCH 064/176] fix(linstorvhdutil): fix boolean params of `check` call `ignoreMissingFooter` and `fast` must be string types to be used with XAPI plugin API. diff --git a/SOURCES/0065-feat-linstor-manager-robustify-exec_create_sr.patch b/SOURCES/0065-feat-linstor-manager-robustify-exec_create_sr.patch index 0e163dea..8866763c 100644 --- a/SOURCES/0065-feat-linstor-manager-robustify-exec_create_sr.patch +++ b/SOURCES/0065-feat-linstor-manager-robustify-exec_create_sr.patch @@ -1,7 +1,7 @@ -From c5ae69bbb54ff636d33aebced1d45f2ad85c0a5f Mon Sep 17 00:00:00 2001 +From 04e8aff781147e433b56f68626e60a48daa48d8d Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 30 Jun 2022 17:09:51 +0200 -Subject: [PATCH 065/175] feat(linstor-manager): robustify exec_create_sr +Subject: [PATCH 065/176] feat(linstor-manager): robustify exec_create_sr - Use lvm.py XCP-ng xapi plugins instead of lvm (old name) - Check arguments to create the SR diff --git a/SOURCES/0066-fix-cleanup-print-LINSTOR-VDI-UUID-if-error-during-i.patch b/SOURCES/0066-fix-cleanup-print-LINSTOR-VDI-UUID-if-error-during-i.patch index 02896845..fe1ebe7b 100644 --- a/SOURCES/0066-fix-cleanup-print-LINSTOR-VDI-UUID-if-error-during-i.patch +++ b/SOURCES/0066-fix-cleanup-print-LINSTOR-VDI-UUID-if-error-during-i.patch @@ -1,7 +1,7 @@ -From 6f4c788286657aac1bfdc9bbf42a9cedc774f913 Mon Sep 17 00:00:00 2001 +From a410c0926c90f086dfd75c8f0800f8340bd17b6c Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 8 Jul 2022 14:52:25 +0200 -Subject: [PATCH 066/175] fix(cleanup): print LINSTOR VDI UUID if error during +Subject: [PATCH 066/176] fix(cleanup): print LINSTOR VDI UUID if error during info loading (not SR UUID) Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0067-feat-cleanup-raise-and-dump-DRBD-openers-in-case-of-.patch b/SOURCES/0067-feat-cleanup-raise-and-dump-DRBD-openers-in-case-of-.patch index 252450c2..e8338cb1 100644 --- a/SOURCES/0067-feat-cleanup-raise-and-dump-DRBD-openers-in-case-of-.patch +++ b/SOURCES/0067-feat-cleanup-raise-and-dump-DRBD-openers-in-case-of-.patch @@ -1,7 +1,7 @@ -From 6172013641736dd476ad311873b95446da5ffd62 Mon Sep 17 00:00:00 2001 +From 863142f5c55a0aa0d6c2a9d4f3df8b22d72ae830 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 21 Jul 2022 11:39:20 +0200 -Subject: [PATCH 067/175] feat(cleanup): raise and dump DRBD openers in case of +Subject: [PATCH 067/176] feat(cleanup): raise and dump DRBD openers in case of bad coalesce Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0068-feat-linstorvhdutil-trace-DRBD-openers-in-case-of-ER.patch b/SOURCES/0068-feat-linstorvhdutil-trace-DRBD-openers-in-case-of-ER.patch index eb30f6a7..b4063dca 100644 --- a/SOURCES/0068-feat-linstorvhdutil-trace-DRBD-openers-in-case-of-ER.patch +++ b/SOURCES/0068-feat-linstorvhdutil-trace-DRBD-openers-in-case-of-ER.patch @@ -1,7 +1,7 @@ -From 9f3cefdcfd8e285c1fd04a05250951cd760586e4 Mon Sep 17 00:00:00 2001 +From 0e339b0d445c78b6c7f5497d8ed1d3aefab91ff1 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 22 Jul 2022 10:26:20 +0200 -Subject: [PATCH 068/175] feat(linstorvhdutil): trace DRBD openers in case of +Subject: [PATCH 068/176] feat(linstorvhdutil): trace DRBD openers in case of EROFS errors Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0069-fix-linstorvolumemanager-compute-correctly-size-in-a.patch b/SOURCES/0069-fix-linstorvolumemanager-compute-correctly-size-in-a.patch index d04a89a1..48a2ddcb 100644 --- a/SOURCES/0069-fix-linstorvolumemanager-compute-correctly-size-in-a.patch +++ b/SOURCES/0069-fix-linstorvolumemanager-compute-correctly-size-in-a.patch @@ -1,7 +1,7 @@ -From 23eca6c7c8e050d284eecc71ae7115a61bf3ab80 Mon Sep 17 00:00:00 2001 +From 68aacc7508fac8113652c6670d2ac5f2ea936a70 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 29 Jul 2022 17:25:48 +0200 -Subject: [PATCH 069/175] fix(linstorvolumemanager): compute correctly size in +Subject: [PATCH 069/176] fix(linstorvolumemanager): compute correctly size in allocated_volume_size Remove replication count in computation. diff --git a/SOURCES/0070-feat-LinstorSR-use-DRBD-openers-instead-of-lsof-to-l.patch b/SOURCES/0070-feat-LinstorSR-use-DRBD-openers-instead-of-lsof-to-l.patch index cc663ce2..2de0c618 100644 --- a/SOURCES/0070-feat-LinstorSR-use-DRBD-openers-instead-of-lsof-to-l.patch +++ b/SOURCES/0070-feat-LinstorSR-use-DRBD-openers-instead-of-lsof-to-l.patch @@ -1,7 +1,7 @@ -From 667d63a0ccd29d6f29da828d898f245b3047d90b Mon Sep 17 00:00:00 2001 +From 18ac9ddc0672f43c3139baa13a4f761b7876589c Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 9 Aug 2022 11:07:57 +0200 -Subject: [PATCH 070/175] feat(LinstorSR): use DRBD openers instead of lsof to +Subject: [PATCH 070/176] feat(LinstorSR): use DRBD openers instead of lsof to log in blktap2 Signed-off-by: Ronan Abhamon @@ -12,7 +12,7 @@ Signed-off-by: Ronan Abhamon 3 files changed, 100 insertions(+), 128 deletions(-) diff --git a/drivers/blktap2.py b/drivers/blktap2.py -index 70e74c6..719a152 100755 +index 14c564e..370f7fb 100755 --- a/drivers/blktap2.py +++ b/drivers/blktap2.py @@ -36,7 +36,7 @@ import json @@ -24,13 +24,13 @@ index 70e74c6..719a152 100755 from syslog import openlog, syslog from stat import * # S_ISBLK(), ... import nfs -@@ -832,7 +832,7 @@ class Tapdisk(object): +@@ -833,7 +833,7 @@ class Tapdisk(object): time.sleep(1) continue if err == errno.EROFS: - log_lsof_drbd(path) + log_drbd_openers(path) - break + raise try: tapdisk = cls.__from_blktap(blktap) diff --git a/drivers/linstor-manager b/drivers/linstor-manager diff --git a/SOURCES/0071-feat-LinstorSR-support-cProfile-to-trace-calls-when-.patch b/SOURCES/0071-feat-LinstorSR-support-cProfile-to-trace-calls-when-.patch index 03ad7ede..467b6c09 100644 --- a/SOURCES/0071-feat-LinstorSR-support-cProfile-to-trace-calls-when-.patch +++ b/SOURCES/0071-feat-LinstorSR-support-cProfile-to-trace-calls-when-.patch @@ -1,7 +1,7 @@ -From bcb84677d8cbc5ebd67cfb83499b0c12cf6e692b Mon Sep 17 00:00:00 2001 +From 3f729f3f7dde9406ef215145a4f6eefa81aae1f8 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 25 Aug 2022 12:11:18 +0200 -Subject: [PATCH 071/175] feat(LinstorSR): support cProfile to trace calls when +Subject: [PATCH 071/176] feat(LinstorSR): support cProfile to trace calls when a command is executed Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0072-fix-LinstorJournaler-reset-namespace-when-get-is-cal.patch b/SOURCES/0072-fix-LinstorJournaler-reset-namespace-when-get-is-cal.patch index 00d7c071..240e18ce 100644 --- a/SOURCES/0072-fix-LinstorJournaler-reset-namespace-when-get-is-cal.patch +++ b/SOURCES/0072-fix-LinstorJournaler-reset-namespace-when-get-is-cal.patch @@ -1,7 +1,7 @@ -From 899eef77b37161b19a2dfb074220220af6b2f9e4 Mon Sep 17 00:00:00 2001 +From 59692503da25a54c146930e8d4d89b9630aedaa2 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 24 Aug 2022 17:09:11 +0200 -Subject: [PATCH 072/175] fix(LinstorJournaler): reset namespace when `get` is +Subject: [PATCH 072/176] fix(LinstorJournaler): reset namespace when `get` is called Otherwise, we can be in the wrong namespace and the key to find will be inaccessible. diff --git a/SOURCES/0073-fix-linstorvhdutil-fix-coalesce-with-VM-running-unde.patch b/SOURCES/0073-fix-linstorvhdutil-fix-coalesce-with-VM-running-unde.patch index 7af8c8d5..092b11ec 100644 --- a/SOURCES/0073-fix-linstorvhdutil-fix-coalesce-with-VM-running-unde.patch +++ b/SOURCES/0073-fix-linstorvhdutil-fix-coalesce-with-VM-running-unde.patch @@ -1,7 +1,7 @@ -From 6d61c34f334684920d6138ef7a56b8a1dcf00c15 Mon Sep 17 00:00:00 2001 +From bcfea8f64f43e8f8d074df3c191227d8410b0402 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 25 Aug 2022 10:54:56 +0200 -Subject: [PATCH 073/175] fix(linstorvhdutil): fix coalesce with VM running +Subject: [PATCH 073/176] fix(linstorvhdutil): fix coalesce with VM running under specific scenario: When a VM is running, we can't coalesce without this patch with a long chain diff --git a/SOURCES/0074-fix-linstorvolumemanager-_get_volumes_info-doesn-t-r.patch b/SOURCES/0074-fix-linstorvolumemanager-_get_volumes_info-doesn-t-r.patch index acc6a5e5..38cb754f 100644 --- a/SOURCES/0074-fix-linstorvolumemanager-_get_volumes_info-doesn-t-r.patch +++ b/SOURCES/0074-fix-linstorvolumemanager-_get_volumes_info-doesn-t-r.patch @@ -1,7 +1,7 @@ -From 7308c3894a4ce77e6b21543add154e5877e91ca1 Mon Sep 17 00:00:00 2001 +From e98d435ba2b95672803cd15c5ba6cd89209743d0 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 5 Sep 2022 15:09:17 +0200 -Subject: [PATCH 074/175] fix(linstorvolumemanager): `_get_volumes_info` +Subject: [PATCH 074/176] fix(linstorvolumemanager): `_get_volumes_info` doesn't raise with offline host Ensure this method doesn't raise an exception when a host is offline. diff --git a/SOURCES/0075-fix-linstorvolumemanager-remove-double-prefix-on-kv-.patch b/SOURCES/0075-fix-linstorvolumemanager-remove-double-prefix-on-kv-.patch index 78156439..8246f81f 100644 --- a/SOURCES/0075-fix-linstorvolumemanager-remove-double-prefix-on-kv-.patch +++ b/SOURCES/0075-fix-linstorvolumemanager-remove-double-prefix-on-kv-.patch @@ -1,7 +1,7 @@ -From 2f6b96a0f585003ef9804cc098c074a0e3098210 Mon Sep 17 00:00:00 2001 +From 462cc34d48bfafc96dd042ae7ee97c5801b436a5 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 12 Sep 2022 15:56:09 +0200 -Subject: [PATCH 075/175] fix(linstorvolumemanager): remove double prefix on kv +Subject: [PATCH 075/176] fix(linstorvolumemanager): remove double prefix on kv group name - Before this patch, when the kv store was created/accessed, a double "xcp-sr-" prefix was used. diff --git a/SOURCES/0076-feat-LinstorSR-add-linstor-kv-dump-helper-to-print-k.patch b/SOURCES/0076-feat-LinstorSR-add-linstor-kv-dump-helper-to-print-k.patch index d7a9b5e5..ad48290d 100644 --- a/SOURCES/0076-feat-LinstorSR-add-linstor-kv-dump-helper-to-print-k.patch +++ b/SOURCES/0076-feat-LinstorSR-add-linstor-kv-dump-helper-to-print-k.patch @@ -1,7 +1,7 @@ -From 1e50208fdab9c0e695b85220d92f36f88eafca13 Mon Sep 17 00:00:00 2001 +From f0413a9d9d7616aac2fe7394cdb0dc50fdaeb835 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 12 Sep 2022 17:54:57 +0200 -Subject: [PATCH 076/175] feat(LinstorSR): add linstor-kv-dump helper to print +Subject: [PATCH 076/176] feat(LinstorSR): add linstor-kv-dump helper to print kv store Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0077-fix-LinstorSR-disable-VHD-key-hash-usage-to-limit-ex.patch b/SOURCES/0077-fix-LinstorSR-disable-VHD-key-hash-usage-to-limit-ex.patch index 611e1d02..091fbd0c 100644 --- a/SOURCES/0077-fix-LinstorSR-disable-VHD-key-hash-usage-to-limit-ex.patch +++ b/SOURCES/0077-fix-LinstorSR-disable-VHD-key-hash-usage-to-limit-ex.patch @@ -1,7 +1,7 @@ -From bb194e0947f30a3615931342f07e21c8214f9a1e Mon Sep 17 00:00:00 2001 +From bb7d53d85fd4a28470d48b6bb1e2d75d23b73389 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 14 Sep 2022 10:17:18 +0200 -Subject: [PATCH 077/175] fix(LinstorSR): disable VHD key hash usage to limit +Subject: [PATCH 077/176] fix(LinstorSR): disable VHD key hash usage to limit exec time Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0078-fix-minidrbdcluster-ensure-SIGINT-is-handled-correct.patch b/SOURCES/0078-fix-minidrbdcluster-ensure-SIGINT-is-handled-correct.patch index 97f66fb7..5d558e00 100644 --- a/SOURCES/0078-fix-minidrbdcluster-ensure-SIGINT-is-handled-correct.patch +++ b/SOURCES/0078-fix-minidrbdcluster-ensure-SIGINT-is-handled-correct.patch @@ -1,7 +1,7 @@ -From 11ed73c197e19281f402a8b7f16e54885a57a682 Mon Sep 17 00:00:00 2001 +From 189b17a606d3f35bcc8bb8bf77f6e2ef71208a11 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 15 Sep 2022 11:34:25 +0200 -Subject: [PATCH 078/175] fix(minidrbdcluster): ensure SIGINT is handled +Subject: [PATCH 078/176] fix(minidrbdcluster): ensure SIGINT is handled correctly This patch is here to make sure no LINSTOR controller survives when diff --git a/SOURCES/0079-feat-minidrbdcluster-stop-resource-services-at-start.patch b/SOURCES/0079-feat-minidrbdcluster-stop-resource-services-at-start.patch index 524632ba..4fbf24a2 100644 --- a/SOURCES/0079-feat-minidrbdcluster-stop-resource-services-at-start.patch +++ b/SOURCES/0079-feat-minidrbdcluster-stop-resource-services-at-start.patch @@ -1,7 +1,7 @@ -From 17cad633307433667bccdb8374daee25ec5c92bc Mon Sep 17 00:00:00 2001 +From 53dec398287a12e016abbe243311479f6a0d3efe Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 15 Sep 2022 11:49:34 +0200 -Subject: [PATCH 079/175] feat(minidrbdcluster): stop resource services at +Subject: [PATCH 079/176] feat(minidrbdcluster): stop resource services at startup - Ensure all services are stopped when minidrbcluster is started. diff --git a/SOURCES/0080-feat-linstor-manager-add-new-healthCheck-function-to.patch b/SOURCES/0080-feat-linstor-manager-add-new-healthCheck-function-to.patch index 0ec8bb48..e61cf241 100644 --- a/SOURCES/0080-feat-linstor-manager-add-new-healthCheck-function-to.patch +++ b/SOURCES/0080-feat-linstor-manager-add-new-healthCheck-function-to.patch @@ -1,7 +1,7 @@ -From c91ef97914fedfb63cbe16aa90c97bc502b4c637 Mon Sep 17 00:00:00 2001 +From efa609510d724b3aacfe144517ad34fa2b854b8d Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 23 Sep 2022 17:45:08 +0200 -Subject: [PATCH 080/175] feat(linstor-manager): add new `healthCheck` function +Subject: [PATCH 080/176] feat(linstor-manager): add new `healthCheck` function to monitor pool (#26) Print a JSON output to monitor state of LINSTOR SRs: diff --git a/SOURCES/0081-fix-LinstorSR-fix-xha-conf-parsing-return-host-ip-no.patch b/SOURCES/0081-fix-LinstorSR-fix-xha-conf-parsing-return-host-ip-no.patch index c81f32e4..81e6bcde 100644 --- a/SOURCES/0081-fix-LinstorSR-fix-xha-conf-parsing-return-host-ip-no.patch +++ b/SOURCES/0081-fix-LinstorSR-fix-xha-conf-parsing-return-host-ip-no.patch @@ -1,7 +1,7 @@ -From f3a1300f1fd9b0cb8d258c10bd3c65feb4d97e7b Mon Sep 17 00:00:00 2001 +From b477bf0c0779fbbf5cd600029a9b7bf6b73520a9 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 4 Oct 2022 11:01:33 +0200 -Subject: [PATCH 081/175] fix(LinstorSR): fix xha conf parsing => return host +Subject: [PATCH 081/176] fix(LinstorSR): fix xha conf parsing => return host ip, not the UUID Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0082-fix-LinstorSR-start-correctly-HA-servers-HTTP-NBD-af.patch b/SOURCES/0082-fix-LinstorSR-start-correctly-HA-servers-HTTP-NBD-af.patch index 3d9c6a93..ca6278aa 100644 --- a/SOURCES/0082-fix-LinstorSR-start-correctly-HA-servers-HTTP-NBD-af.patch +++ b/SOURCES/0082-fix-LinstorSR-start-correctly-HA-servers-HTTP-NBD-af.patch @@ -1,7 +1,7 @@ -From 1b0ff0601d1f660f2df376bf9d29875adfa69df2 Mon Sep 17 00:00:00 2001 +From 9869614ead6245808ca8f0763a07a00ebe3ac6b8 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 4 Oct 2022 18:48:09 +0200 -Subject: [PATCH 082/175] fix(LinstorSR): start correctly HA servers (HTTP/NBD) +Subject: [PATCH 082/176] fix(LinstorSR): start correctly HA servers (HTTP/NBD) after reboot Use a timeout call after a reboot to get a XAPI session because diff --git a/SOURCES/0083-fix-linstorvolumemanager-use-an-array-to-store-diskf.patch b/SOURCES/0083-fix-linstorvolumemanager-use-an-array-to-store-diskf.patch index 868fa2e1..cb5fa0a3 100644 --- a/SOURCES/0083-fix-linstorvolumemanager-use-an-array-to-store-diskf.patch +++ b/SOURCES/0083-fix-linstorvolumemanager-use-an-array-to-store-diskf.patch @@ -1,7 +1,7 @@ -From df9f3e905f8b10746fb2aa3938212c898d7f1c13 Mon Sep 17 00:00:00 2001 +From 03c55a736769042775bd8da2ebc71377c04050a6 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 5 Oct 2022 10:45:50 +0200 -Subject: [PATCH 083/175] fix(linstorvolumemanager): use an array to store +Subject: [PATCH 083/176] fix(linstorvolumemanager): use an array to store diskful volumes info Otherwise the `is_diskful` attr only reflects the info of one host diff --git a/SOURCES/0084-feat-linstorvolumemanager-support-snaps-when-a-host-.patch b/SOURCES/0084-feat-linstorvolumemanager-support-snaps-when-a-host-.patch index d75fae2d..250dbd53 100644 --- a/SOURCES/0084-feat-linstorvolumemanager-support-snaps-when-a-host-.patch +++ b/SOURCES/0084-feat-linstorvolumemanager-support-snaps-when-a-host-.patch @@ -1,7 +1,7 @@ -From 68c6961c4b1640fc69804686a72503f30bf82012 Mon Sep 17 00:00:00 2001 +From f750cc76f61fb75711176c444c3a89b9a3cbcc4f Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 6 Oct 2022 17:54:10 +0200 -Subject: [PATCH 084/175] feat(linstorvolumemanager): support snaps when a host +Subject: [PATCH 084/176] feat(linstorvolumemanager): support snaps when a host is offline - Don't create diskless volumes during clone, delay it. diff --git a/SOURCES/0085-fix-linstorvolumemanager-support-offline-hosts-when-.patch b/SOURCES/0085-fix-linstorvolumemanager-support-offline-hosts-when-.patch index e14afad8..ab7ca344 100644 --- a/SOURCES/0085-fix-linstorvolumemanager-support-offline-hosts-when-.patch +++ b/SOURCES/0085-fix-linstorvolumemanager-support-offline-hosts-when-.patch @@ -1,7 +1,7 @@ -From 7ab08a324346a2aa6b8ae42c08f7becd6647ddd5 Mon Sep 17 00:00:00 2001 +From 604dd18a16f87188bc6a6ca0a69c31cd68ac6f77 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 7 Oct 2022 17:18:37 +0200 -Subject: [PATCH 085/175] fix(linstorvolumemanager): support offline hosts when +Subject: [PATCH 085/176] fix(linstorvolumemanager): support offline hosts when plugins are called - Robustify plugin calls diff --git a/SOURCES/0086-fix-linstorvolumemanager-define-_base_group_name-mem.patch b/SOURCES/0086-fix-linstorvolumemanager-define-_base_group_name-mem.patch index 3f7b075a..a846df3a 100644 --- a/SOURCES/0086-fix-linstorvolumemanager-define-_base_group_name-mem.patch +++ b/SOURCES/0086-fix-linstorvolumemanager-define-_base_group_name-mem.patch @@ -1,7 +1,7 @@ -From 7c499761b11550c592ef22e52343effee91e6015 Mon Sep 17 00:00:00 2001 +From 6f4af2ac0ddcff854e58ae8fb927035ad4a79ede Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 7 Oct 2022 17:45:26 +0200 -Subject: [PATCH 086/175] fix(linstorvolumemanager): define _base_group_name +Subject: [PATCH 086/176] fix(linstorvolumemanager): define _base_group_name member at SR creation Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0087-feat-linstorvhdutil-modify-logic-of-local-vhdutil-ca.patch b/SOURCES/0087-feat-linstorvhdutil-modify-logic-of-local-vhdutil-ca.patch index 62ee0a3c..910e8393 100644 --- a/SOURCES/0087-feat-linstorvhdutil-modify-logic-of-local-vhdutil-ca.patch +++ b/SOURCES/0087-feat-linstorvhdutil-modify-logic-of-local-vhdutil-ca.patch @@ -1,7 +1,7 @@ -From 36c1c5d109eda8fd2451b58f2c1b1eca4ba6d570 Mon Sep 17 00:00:00 2001 +From f99e317510721cac568bae6b854b4622b8525999 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 10 Oct 2022 14:33:24 +0200 -Subject: [PATCH 087/175] feat(linstorvhdutil): modify logic of local vhdutil +Subject: [PATCH 087/176] feat(linstorvhdutil): modify logic of local vhdutil calls - Always log openers when we can't call vhdutil locally diff --git a/SOURCES/0088-fix-linstorvolumemanager-robustify-failed-snapshots.patch b/SOURCES/0088-fix-linstorvolumemanager-robustify-failed-snapshots.patch index 6135e063..ef6f6332 100644 --- a/SOURCES/0088-fix-linstorvolumemanager-robustify-failed-snapshots.patch +++ b/SOURCES/0088-fix-linstorvolumemanager-robustify-failed-snapshots.patch @@ -1,7 +1,7 @@ -From e0d0c13e2621849ebeab9c9059020b4ff229bbc8 Mon Sep 17 00:00:00 2001 +From 0fe8a97bc5c810ca0d58248c59055c801728da26 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 17 Oct 2022 18:14:16 +0200 -Subject: [PATCH 088/175] fix(linstorvolumemanager): robustify failed snapshots +Subject: [PATCH 088/176] fix(linstorvolumemanager): robustify failed snapshots - Ensure we can always rename a failed snap, so we must check if we have metadata in the KV-store. Otherwise an error is triggered diff --git a/SOURCES/0089-fix-linstorvolumemanager-use-a-namespace-for-volumes.patch b/SOURCES/0089-fix-linstorvolumemanager-use-a-namespace-for-volumes.patch index a8506af4..a774c2b9 100644 --- a/SOURCES/0089-fix-linstorvolumemanager-use-a-namespace-for-volumes.patch +++ b/SOURCES/0089-fix-linstorvolumemanager-use-a-namespace-for-volumes.patch @@ -1,7 +1,7 @@ -From 123cd37a6540f5e0863e542460ebf30f3334556f Mon Sep 17 00:00:00 2001 +From b0059113393273e375d95c0a70fee4e5fa9f97bd Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 8 Nov 2022 17:31:45 +0100 -Subject: [PATCH 089/175] fix(linstorvolumemanager): use a namespace for +Subject: [PATCH 089/176] fix(linstorvolumemanager): use a namespace for volumes - This change is not compatible with existing LINSTOR SR instances! diff --git a/SOURCES/0090-feat-linstor-kv-dump-rename-to-linstor-kv-tool-add-r.patch b/SOURCES/0090-feat-linstor-kv-dump-rename-to-linstor-kv-tool-add-r.patch index 705fd681..c54e1125 100644 --- a/SOURCES/0090-feat-linstor-kv-dump-rename-to-linstor-kv-tool-add-r.patch +++ b/SOURCES/0090-feat-linstor-kv-dump-rename-to-linstor-kv-tool-add-r.patch @@ -1,7 +1,7 @@ -From 3c684d34002733bba72bcbf650c16accf65ea50e Mon Sep 17 00:00:00 2001 +From e31e75852287028db29348575e4fcc116c96f768 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 14 Nov 2022 17:18:48 +0100 -Subject: [PATCH 090/175] feat(linstor-kv-dump): rename to linstor-kv-tool + +Subject: [PATCH 090/176] feat(linstor-kv-dump): rename to linstor-kv-tool + add remove volume helpers --- diff --git a/SOURCES/0091-fix-LinstorSR-handle-correctly-localhost-during-star.patch b/SOURCES/0091-fix-LinstorSR-handle-correctly-localhost-during-star.patch index e5929b46..3b8c1e61 100644 --- a/SOURCES/0091-fix-LinstorSR-handle-correctly-localhost-during-star.patch +++ b/SOURCES/0091-fix-LinstorSR-handle-correctly-localhost-during-star.patch @@ -1,7 +1,7 @@ -From 8e014b9cc6319c9caed73a9a80a2aff9808c3d79 Mon Sep 17 00:00:00 2001 +From 655e79b7e58d322cdb6ac46816939d26ffbbbd46 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 16 Nov 2022 12:12:12 +0100 -Subject: [PATCH 091/175] fix(LinstorSR): handle correctly localhost during +Subject: [PATCH 091/176] fix(LinstorSR): handle correctly localhost during start/stop of minidrbdcluster Otherwise another controller can be started during `xe sr-destroy` call. diff --git a/SOURCES/0092-fix-cleanup.py-call-repair-on-another-host-when-EROF.patch b/SOURCES/0092-fix-cleanup.py-call-repair-on-another-host-when-EROF.patch index bc9d1f39..633fa3ed 100644 --- a/SOURCES/0092-fix-cleanup.py-call-repair-on-another-host-when-EROF.patch +++ b/SOURCES/0092-fix-cleanup.py-call-repair-on-another-host-when-EROF.patch @@ -1,7 +1,7 @@ -From 848edaa1638986bae64f5c5763591b84b0a7e9f6 Mon Sep 17 00:00:00 2001 +From a26ad7fd840e9fcd8a03f6cfc9da8f4ac4628013 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 17 Nov 2022 15:43:25 +0100 -Subject: [PATCH 092/175] fix(cleanup.py): call repair on another host when +Subject: [PATCH 092/176] fix(cleanup.py): call repair on another host when EROFS is returned (DRBD) Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0093-fix-LinstorSR-avoid-introduction-of-DELETED-volumes.patch b/SOURCES/0093-fix-LinstorSR-avoid-introduction-of-DELETED-volumes.patch index 89041442..dced4d0d 100644 --- a/SOURCES/0093-fix-LinstorSR-avoid-introduction-of-DELETED-volumes.patch +++ b/SOURCES/0093-fix-LinstorSR-avoid-introduction-of-DELETED-volumes.patch @@ -1,7 +1,7 @@ -From 52b2b554440c15f8297c8d34ce19557cd2483a02 Mon Sep 17 00:00:00 2001 +From 545433b159c70e922529e9af199c9e3c5e756598 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 17 Nov 2022 15:46:02 +0100 -Subject: [PATCH 093/175] fix(LinstorSR): avoid introduction of DELETED volumes +Subject: [PATCH 093/176] fix(LinstorSR): avoid introduction of DELETED volumes Signed-off-by: Ronan Abhamon --- diff --git a/SOURCES/0094-feat-linstor-kv-tool-remove-all-volumes-supports-jou.patch b/SOURCES/0094-feat-linstor-kv-tool-remove-all-volumes-supports-jou.patch index 32e732cd..65331959 100644 --- a/SOURCES/0094-feat-linstor-kv-tool-remove-all-volumes-supports-jou.patch +++ b/SOURCES/0094-feat-linstor-kv-tool-remove-all-volumes-supports-jou.patch @@ -1,7 +1,7 @@ -From 6f5f234f5883430143f7c30a2584c25118b17cbc Mon Sep 17 00:00:00 2001 +From 95e513e7de43ef9e16996bdb309ac0823eb25e71 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 18 Nov 2022 10:40:58 +0100 -Subject: [PATCH 094/175] feat(linstor-kv-tool): remove-all-volumes supports +Subject: [PATCH 094/176] feat(linstor-kv-tool): remove-all-volumes supports journals now Not yet supported for remove-volume, not sure about the consequences diff --git a/SOURCES/0095-fix-linstorvhdutil-due-to-bad-refactoring-check-call.patch b/SOURCES/0095-fix-linstorvhdutil-due-to-bad-refactoring-check-call.patch index 9be46457..bf61bfc3 100644 --- a/SOURCES/0095-fix-linstorvhdutil-due-to-bad-refactoring-check-call.patch +++ b/SOURCES/0095-fix-linstorvhdutil-due-to-bad-refactoring-check-call.patch @@ -1,7 +1,7 @@ -From 14a8891b866962415750050e6649f7ebb2a2fe78 Mon Sep 17 00:00:00 2001 +From 282e1585023068f1fcdefa01ce2848169b562d22 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 23 Nov 2022 15:26:51 +0100 -Subject: [PATCH 095/175] fix(linstorvhdutil): due to bad refactoring, check +Subject: [PATCH 095/176] fix(linstorvhdutil): due to bad refactoring, check call was broken Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0096-feat-linstorvhdutil-ensure-we-use-VHD-parent-to-find.patch b/SOURCES/0096-feat-linstorvhdutil-ensure-we-use-VHD-parent-to-find.patch index e25546c1..1823b52c 100644 --- a/SOURCES/0096-feat-linstorvhdutil-ensure-we-use-VHD-parent-to-find.patch +++ b/SOURCES/0096-feat-linstorvhdutil-ensure-we-use-VHD-parent-to-find.patch @@ -1,7 +1,7 @@ -From acdceeddc7b867d4cbaf1e692faafbbac5deb2f8 Mon Sep 17 00:00:00 2001 +From 6f90401e51c222f526f3f2d90828c9f918d56519 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 23 Nov 2022 15:28:23 +0100 -Subject: [PATCH 096/175] feat(linstorvhdutil): ensure we use VHD parent to +Subject: [PATCH 096/176] feat(linstorvhdutil): ensure we use VHD parent to find host where to coalesce Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0097-feat-linstorvolumemanager-force-DRBD-demote-after-fa.patch b/SOURCES/0097-feat-linstorvolumemanager-force-DRBD-demote-after-fa.patch index b915c962..77a59b92 100644 --- a/SOURCES/0097-feat-linstorvolumemanager-force-DRBD-demote-after-fa.patch +++ b/SOURCES/0097-feat-linstorvolumemanager-force-DRBD-demote-after-fa.patch @@ -1,7 +1,7 @@ -From 73954dd1f6b34d6d95188a27a96355c6362f8188 Mon Sep 17 00:00:00 2001 +From d4d49f0c55b9d07e4f2315e4985800c8ae2f1a32 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 5 Dec 2022 18:40:11 +0100 -Subject: [PATCH 097/175] feat(linstorvolumemanager): force DRBD demote after +Subject: [PATCH 097/176] feat(linstorvolumemanager): force DRBD demote after failed volume creation/clone Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0098-fix-linstorvhdutil-ensure-we-retry-creation-in-all-s.patch b/SOURCES/0098-fix-linstorvhdutil-ensure-we-retry-creation-in-all-s.patch index 130a165d..06e303b9 100644 --- a/SOURCES/0098-fix-linstorvhdutil-ensure-we-retry-creation-in-all-s.patch +++ b/SOURCES/0098-fix-linstorvhdutil-ensure-we-retry-creation-in-all-s.patch @@ -1,7 +1,7 @@ -From a12dfe920174e4d88b5239702f5a15d44e06c6c8 Mon Sep 17 00:00:00 2001 +From 8b614c3baa05acbe822ace1a3b09676f8042a137 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 6 Dec 2022 11:22:15 +0100 -Subject: [PATCH 098/175] fix(linstorvhdutil): ensure we retry creation in all +Subject: [PATCH 098/176] fix(linstorvhdutil): ensure we retry creation in all situations Without this patch, a basic resource creation is never restarted diff --git a/SOURCES/0099-fix-linstorvhdutil-don-t-retry-local-vhdutil-call-wh.patch b/SOURCES/0099-fix-linstorvhdutil-don-t-retry-local-vhdutil-call-wh.patch index a4cabc5b..3dd64fef 100644 --- a/SOURCES/0099-fix-linstorvhdutil-don-t-retry-local-vhdutil-call-wh.patch +++ b/SOURCES/0099-fix-linstorvhdutil-don-t-retry-local-vhdutil-call-wh.patch @@ -1,7 +1,7 @@ -From 4f1241af4c7e21308654fb4518fdf75b80012da6 Mon Sep 17 00:00:00 2001 +From afb50b27131b0b7a22e0a92731831a1beb975024 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 7 Dec 2022 17:56:39 +0100 -Subject: [PATCH 099/175] fix(linstorvhdutil): don't retry local vhdutil call +Subject: [PATCH 099/176] fix(linstorvhdutil): don't retry local vhdutil call when EROFS is detected Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0100-feat-fork-log-daemon-ignore-SIGTERM.patch b/SOURCES/0100-feat-fork-log-daemon-ignore-SIGTERM.patch index a6cbebdf..ab4c611d 100644 --- a/SOURCES/0100-feat-fork-log-daemon-ignore-SIGTERM.patch +++ b/SOURCES/0100-feat-fork-log-daemon-ignore-SIGTERM.patch @@ -1,7 +1,7 @@ -From 4b4e082a5e9fea8e1fb5ec158b1ca77f4e812665 Mon Sep 17 00:00:00 2001 +From 62142a4d7d2934b20e08fc8dc49876d5cb5eba5a Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 15 Dec 2022 14:36:04 +0100 -Subject: [PATCH 100/175] feat(fork-log-daemon): ignore SIGTERM +Subject: [PATCH 100/176] feat(fork-log-daemon): ignore SIGTERM Without this patch, the output logs of the fork-log-daemon child are never displayed when SIGTERM is sent to the PGID. diff --git a/SOURCES/0101-feat-LinstorSR-wait-for-http-disk-server-startup.patch b/SOURCES/0101-feat-LinstorSR-wait-for-http-disk-server-startup.patch index e8ff0753..29a0f4aa 100644 --- a/SOURCES/0101-feat-LinstorSR-wait-for-http-disk-server-startup.patch +++ b/SOURCES/0101-feat-LinstorSR-wait-for-http-disk-server-startup.patch @@ -1,7 +1,7 @@ -From 8ad803a9c30e925ac23baca07093e50021b613b0 Mon Sep 17 00:00:00 2001 +From a5b4176e1894dc8f87b1ba1710d3fad936e9b4c1 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 16 Dec 2022 16:52:50 +0100 -Subject: [PATCH 101/175] feat(LinstorSR): wait for http-disk-server startup +Subject: [PATCH 101/176] feat(LinstorSR): wait for http-disk-server startup Avoid a race condition with NBD server. We must be sure the HTTP server is reachable before the NBD server execution, diff --git a/SOURCES/0102-fix-LinstorSR-handle-inflate-resize-actions-correctl.patch b/SOURCES/0102-fix-LinstorSR-handle-inflate-resize-actions-correctl.patch index 7671b154..af11fd04 100644 --- a/SOURCES/0102-fix-LinstorSR-handle-inflate-resize-actions-correctl.patch +++ b/SOURCES/0102-fix-LinstorSR-handle-inflate-resize-actions-correctl.patch @@ -1,7 +1,7 @@ -From fead430aa4d86c1e1e38740b168cc03ecd66a5e9 Mon Sep 17 00:00:00 2001 +From b4856d1ba2aa3611c4f3b2fec2eb2e8651f52722 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 16 Jan 2023 17:58:51 +0100 -Subject: [PATCH 102/175] fix(LinstorSR): handle inflate + resize actions +Subject: [PATCH 102/176] fix(LinstorSR): handle inflate + resize actions correctly - Ensure LINSTOR set the expected new volume size when inflate is executed, diff --git a/SOURCES/0103-fix-linstor-manager-add-a-static-iptables-rule-for-D.patch b/SOURCES/0103-fix-linstor-manager-add-a-static-iptables-rule-for-D.patch index cd1f364c..def0e20a 100644 --- a/SOURCES/0103-fix-linstor-manager-add-a-static-iptables-rule-for-D.patch +++ b/SOURCES/0103-fix-linstor-manager-add-a-static-iptables-rule-for-D.patch @@ -1,7 +1,7 @@ -From 296db208f06e16c78b8b0252581e6cd8426f3876 Mon Sep 17 00:00:00 2001 +From cd0a324a1a1652b5632c77a6f8757e45021ac8b5 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 17 Jan 2023 11:55:00 +0100 -Subject: [PATCH 103/175] fix(linstor-manager): add a static iptables rule for +Subject: [PATCH 103/176] fix(linstor-manager): add a static iptables rule for DRBD volumes Using the XAPI iptables firewall may drop DRBD packets when the connection diff --git a/SOURCES/0104-feat-LinstorSR-sync-with-last-http-nbd-transfer-vers.patch b/SOURCES/0104-feat-LinstorSR-sync-with-last-http-nbd-transfer-vers.patch index 6dbfdc08..af8e4970 100644 --- a/SOURCES/0104-feat-LinstorSR-sync-with-last-http-nbd-transfer-vers.patch +++ b/SOURCES/0104-feat-LinstorSR-sync-with-last-http-nbd-transfer-vers.patch @@ -1,7 +1,7 @@ -From fd510146ef0d8873a12d6cbbb04340b7526a045f Mon Sep 17 00:00:00 2001 +From 77fec3e18231511672dd0472d30bb2070e4cfc3f Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 3 Feb 2023 16:38:49 +0100 -Subject: [PATCH 104/175] feat(LinstorSR): sync with last http-nbd-transfer +Subject: [PATCH 104/176] feat(LinstorSR): sync with last http-nbd-transfer version - Increase auto promote timeout of heartbeat VDI to reduce CPU usage diff --git a/SOURCES/0105-fix-LinstorSR-don-t-check-VDI-metadata-while-listing.patch b/SOURCES/0105-fix-LinstorSR-don-t-check-VDI-metadata-while-listing.patch index efe634c6..1426b615 100644 --- a/SOURCES/0105-fix-LinstorSR-don-t-check-VDI-metadata-while-listing.patch +++ b/SOURCES/0105-fix-LinstorSR-don-t-check-VDI-metadata-while-listing.patch @@ -1,7 +1,7 @@ -From eea21b1624629f2c14815f39be8637c0561aa712 Mon Sep 17 00:00:00 2001 +From babbfe1b1aee6a23a8bc560e2e145a7c76e3a0ce Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 13 Feb 2023 17:24:16 +0100 -Subject: [PATCH 105/175] fix(LinstorSR): don't check VDI metadata while +Subject: [PATCH 105/176] fix(LinstorSR): don't check VDI metadata while listing VDIs if it's deleted Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0106-fix-LinstorSR-don-t-check-metadata-when-destroying-s.patch b/SOURCES/0106-fix-LinstorSR-don-t-check-metadata-when-destroying-s.patch index 4e07dbb3..8714864b 100644 --- a/SOURCES/0106-fix-LinstorSR-don-t-check-metadata-when-destroying-s.patch +++ b/SOURCES/0106-fix-LinstorSR-don-t-check-metadata-when-destroying-s.patch @@ -1,7 +1,7 @@ -From 57d6cc396c16026a9f3c8198cec90e53b23ae864 Mon Sep 17 00:00:00 2001 +From 5a145c627171a9a8bc528b39af425b6a568f59f2 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 13 Feb 2023 17:27:43 +0100 -Subject: [PATCH 106/175] fix(LinstorSR): don't check metadata when destroying +Subject: [PATCH 106/176] fix(LinstorSR): don't check metadata when destroying snap in undo_clone Remove useless check in the snap rollback helper when there is an error diff --git a/SOURCES/0107-fix-linstorvhdutil-handle-correctly-generic-exceptio.patch b/SOURCES/0107-fix-linstorvhdutil-handle-correctly-generic-exceptio.patch index 76f8439a..8c01fe5a 100644 --- a/SOURCES/0107-fix-linstorvhdutil-handle-correctly-generic-exceptio.patch +++ b/SOURCES/0107-fix-linstorvhdutil-handle-correctly-generic-exceptio.patch @@ -1,7 +1,7 @@ -From 063e62e873ef74d24518898b08ca9113f2b3c02c Mon Sep 17 00:00:00 2001 +From 54b428be28d1836220f2ba42081c01acc64350b0 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 15 Feb 2023 11:34:54 +0100 -Subject: [PATCH 107/175] fix(linstorvhdutil): handle correctly generic +Subject: [PATCH 107/176] fix(linstorvhdutil): handle correctly generic exceptions in _raise_openers_exception Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0108-fix-minidrbdcluster-robustify-to-unmount-correctly-L.patch b/SOURCES/0108-fix-minidrbdcluster-robustify-to-unmount-correctly-L.patch index 56da4392..84918917 100644 --- a/SOURCES/0108-fix-minidrbdcluster-robustify-to-unmount-correctly-L.patch +++ b/SOURCES/0108-fix-minidrbdcluster-robustify-to-unmount-correctly-L.patch @@ -1,7 +1,7 @@ -From cc5aeb3a19df3dba03761339684bc73abb984d76 Mon Sep 17 00:00:00 2001 +From 7655e04fca6a7b79a43515327e875e41cc95c018 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 16 Feb 2023 14:24:07 +0100 -Subject: [PATCH 108/175] fix(minidrbdcluster): robustify to unmount correctly +Subject: [PATCH 108/176] fix(minidrbdcluster): robustify to unmount correctly LINSTOR DB There is a small delay during which the database may not be unmounted diff --git a/SOURCES/0109-fix-minidrbdcluster-handle-correctly-KeyboardInterru.patch b/SOURCES/0109-fix-minidrbdcluster-handle-correctly-KeyboardInterru.patch index 376b2a10..4bb417c1 100644 --- a/SOURCES/0109-fix-minidrbdcluster-handle-correctly-KeyboardInterru.patch +++ b/SOURCES/0109-fix-minidrbdcluster-handle-correctly-KeyboardInterru.patch @@ -1,7 +1,7 @@ -From 7b89b35c98e8493a02a98d562f388deaf5a49085 Mon Sep 17 00:00:00 2001 +From 52c4db7630977dc5ce1127e4ac14ee55a0edb0f5 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 20 Feb 2023 19:30:18 +0100 -Subject: [PATCH 109/175] fix(minidrbdcluster): handle correctly +Subject: [PATCH 109/176] fix(minidrbdcluster): handle correctly KeyboardInterrupt with systemd units It's necessary to always add systemd services in the running list before diff --git a/SOURCES/0110-feat-LinstorSR-use-drbd-reactor-instead-of-minidrbdc.patch b/SOURCES/0110-feat-LinstorSR-use-drbd-reactor-instead-of-minidrbdc.patch index abfd50c9..e0a10389 100644 --- a/SOURCES/0110-feat-LinstorSR-use-drbd-reactor-instead-of-minidrbdc.patch +++ b/SOURCES/0110-feat-LinstorSR-use-drbd-reactor-instead-of-minidrbdc.patch @@ -1,7 +1,7 @@ -From cc3f40a89621d1d4cf2978f2805f03f403d706b6 Mon Sep 17 00:00:00 2001 +From b07a2ef5f210e9f3dd8f4d8f4d8d71895ee99ab4 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 24 Feb 2023 14:28:29 +0100 -Subject: [PATCH 110/175] feat(LinstorSR): use drbd-reactor instead of +Subject: [PATCH 110/176] feat(LinstorSR): use drbd-reactor instead of minidrbdcluster Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0111-fix-LinstorSR-ensure-vhdutil-calls-are-correctly-exe.patch b/SOURCES/0111-fix-LinstorSR-ensure-vhdutil-calls-are-correctly-exe.patch index 3c8ed6ed..e0e59ade 100644 --- a/SOURCES/0111-fix-LinstorSR-ensure-vhdutil-calls-are-correctly-exe.patch +++ b/SOURCES/0111-fix-LinstorSR-ensure-vhdutil-calls-are-correctly-exe.patch @@ -1,7 +1,7 @@ -From 3e81ea7348e1c5cb03737274a3b3064b7e540723 Mon Sep 17 00:00:00 2001 +From 68885c56099d7e6e623789b4d49c54faa5075e45 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 1 Mar 2023 10:56:43 +0100 -Subject: [PATCH 111/175] fix(LinstorSR): ensure vhdutil calls are correctly +Subject: [PATCH 111/176] fix(LinstorSR): ensure vhdutil calls are correctly executed on pools with > 3 hosts Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0112-fix-LinstorSR-replace-bad-param-in-detach_thin-impl.patch b/SOURCES/0112-fix-LinstorSR-replace-bad-param-in-detach_thin-impl.patch index d1fd82b9..5aa6c7e6 100644 --- a/SOURCES/0112-fix-LinstorSR-replace-bad-param-in-detach_thin-impl.patch +++ b/SOURCES/0112-fix-LinstorSR-replace-bad-param-in-detach_thin-impl.patch @@ -1,7 +1,7 @@ -From 7213113e00cb6520e43fe829f241ce5c8624b0ac Mon Sep 17 00:00:00 2001 +From 8642904e23c8818458f6112d52df60cd5a351331 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 9 Mar 2023 17:06:59 +0100 -Subject: [PATCH 112/175] fix(LinstorSR): replace bad param in detach_thin impl +Subject: [PATCH 112/176] fix(LinstorSR): replace bad param in detach_thin impl To get the physical size, the volume UUID must be used, not the path. diff --git a/SOURCES/0113-fix-linstorvolumemanager-remove-usage-of-realpath.patch b/SOURCES/0113-fix-linstorvolumemanager-remove-usage-of-realpath.patch index e9dcbb73..c4e3a1d0 100644 --- a/SOURCES/0113-fix-linstorvolumemanager-remove-usage-of-realpath.patch +++ b/SOURCES/0113-fix-linstorvolumemanager-remove-usage-of-realpath.patch @@ -1,7 +1,7 @@ -From a1fc2e8fad3bbc7b026da58a12f9b02443064276 Mon Sep 17 00:00:00 2001 +From 358f096a8343367d50c161d48f08055e07c4836f Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 10 Mar 2023 18:11:10 +0100 -Subject: [PATCH 113/175] fix(linstorvolumemanager): remove usage of realpath +Subject: [PATCH 113/176] fix(linstorvolumemanager): remove usage of realpath Because a diskless DRBD path not always exist, get_volume_name_from_device_path can fail. It's easy to reproduce using > 4 hosts and with a call to linstorvhdutil.get_vhd_info: diff --git a/SOURCES/0114-fix-linstorvhdutil-avoid-parent-path-resolution.patch b/SOURCES/0114-fix-linstorvhdutil-avoid-parent-path-resolution.patch index 41fe7f68..9b2e00c0 100644 --- a/SOURCES/0114-fix-linstorvhdutil-avoid-parent-path-resolution.patch +++ b/SOURCES/0114-fix-linstorvhdutil-avoid-parent-path-resolution.patch @@ -1,7 +1,7 @@ -From 04ac5c5f64864623255983e707aa389be51e202b Mon Sep 17 00:00:00 2001 +From 229fefbe7164db97136ea9cf1c3e8c2d4c19235c Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 16 Mar 2023 18:54:46 +0100 -Subject: [PATCH 114/175] fix(linstorvhdutil): avoid parent path resolution +Subject: [PATCH 114/176] fix(linstorvhdutil): avoid parent path resolution When many hosts are used (>= 4), we can fail to get VHD info (with parent option) because the local parent VDI diff --git a/SOURCES/0115-fix-LinstorSR-create-parent-path-during-attach.patch b/SOURCES/0115-fix-LinstorSR-create-parent-path-during-attach.patch index d6f93956..25c8a751 100644 --- a/SOURCES/0115-fix-LinstorSR-create-parent-path-during-attach.patch +++ b/SOURCES/0115-fix-LinstorSR-create-parent-path-during-attach.patch @@ -1,7 +1,7 @@ -From 126e4d7f73c6623faad921d711400edc60bbc953 Mon Sep 17 00:00:00 2001 +From 7cf6a3b784d098a8a7b40fb7082a8dabbd029157 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 17 Mar 2023 12:06:08 +0100 -Subject: [PATCH 115/175] fix(LinstorSR): create parent path during attach +Subject: [PATCH 115/176] fix(LinstorSR): create parent path during attach It's necessary to force DRBD diskless path creation when a VDI is attached. Otherwise the attach can fail on pool with diff --git a/SOURCES/0116-fix-LinstorSR-retry-if-we-can-t-build-volume-cache.patch b/SOURCES/0116-fix-LinstorSR-retry-if-we-can-t-build-volume-cache.patch index 942fe8ae..15ff4880 100644 --- a/SOURCES/0116-fix-LinstorSR-retry-if-we-can-t-build-volume-cache.patch +++ b/SOURCES/0116-fix-LinstorSR-retry-if-we-can-t-build-volume-cache.patch @@ -1,7 +1,7 @@ -From 5d6f7147e4254b8cdf5d171246570cf880d5ba3d Mon Sep 17 00:00:00 2001 +From b95191cf0e28705a2f92b73d42d252d81ae6e158 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 3 Apr 2023 10:03:57 +0200 -Subject: [PATCH 116/175] fix(LinstorSR): retry if we can't build volume cache +Subject: [PATCH 116/176] fix(LinstorSR): retry if we can't build volume cache Otherwise after SR creation, the master PBD can be unplugged. See: https://xcp-ng.org/forum/post/60726 diff --git a/SOURCES/0117-fix-linstorvolumemanager-reduce-peer-slots-param-to-.patch b/SOURCES/0117-fix-linstorvolumemanager-reduce-peer-slots-param-to-.patch index a3c21aac..ca8f080b 100644 --- a/SOURCES/0117-fix-linstorvolumemanager-reduce-peer-slots-param-to-.patch +++ b/SOURCES/0117-fix-linstorvolumemanager-reduce-peer-slots-param-to-.patch @@ -1,7 +1,7 @@ -From ba333e163a620b32f3f50d318b92cbdf4b36c56e Mon Sep 17 00:00:00 2001 +From df37baf1baf365a247931efb759320bfcef6bfed Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 25 Apr 2023 10:46:00 +0200 -Subject: [PATCH 117/175] fix(linstorvolumemanager): reduce peer-slots param to +Subject: [PATCH 117/176] fix(linstorvolumemanager): reduce peer-slots param to 3 Because we use 3 backing disks at most, it's useless to increase the default linstor limit (8). diff --git a/SOURCES/0118-fix-LinstorSR-attach-a-valid-XAPI-session-is_open-is.patch b/SOURCES/0118-fix-LinstorSR-attach-a-valid-XAPI-session-is_open-is.patch index e4b78363..102808c7 100644 --- a/SOURCES/0118-fix-LinstorSR-attach-a-valid-XAPI-session-is_open-is.patch +++ b/SOURCES/0118-fix-LinstorSR-attach-a-valid-XAPI-session-is_open-is.patch @@ -1,7 +1,7 @@ -From 43241b09b329987a0407e0d7c50f7d7f5ed67d4c Mon Sep 17 00:00:00 2001 +From 2ba830e5083bcc1376344da20949368b0129d294 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 25 Apr 2023 11:20:55 +0200 -Subject: [PATCH 118/175] fix(LinstorSR): attach a valid XAPI session is_open +Subject: [PATCH 118/176] fix(LinstorSR): attach a valid XAPI session is_open is called Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0119-fix-LinstorSR-ensure-we-always-have-a-DRBD-path-to-s.patch b/SOURCES/0119-fix-LinstorSR-ensure-we-always-have-a-DRBD-path-to-s.patch index ecb0af90..148086d8 100644 --- a/SOURCES/0119-fix-LinstorSR-ensure-we-always-have-a-DRBD-path-to-s.patch +++ b/SOURCES/0119-fix-LinstorSR-ensure-we-always-have-a-DRBD-path-to-s.patch @@ -1,7 +1,7 @@ -From bea8bbb3a20b59fd8e4ecaedd5dc74c9e72ffe9b Mon Sep 17 00:00:00 2001 +From 9e6203c5d245e14816f2cadd66fdeceb53595ade Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 28 Apr 2023 10:43:27 +0200 -Subject: [PATCH 119/175] fix(LinstorSR): ensure we always have a DRBD path to +Subject: [PATCH 119/176] fix(LinstorSR): ensure we always have a DRBD path to snap Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0120-fix-LinstorSR-remove-hosts-ips-param.patch b/SOURCES/0120-fix-LinstorSR-remove-hosts-ips-param.patch index 6760e251..54dde8c9 100644 --- a/SOURCES/0120-fix-LinstorSR-remove-hosts-ips-param.patch +++ b/SOURCES/0120-fix-LinstorSR-remove-hosts-ips-param.patch @@ -1,7 +1,7 @@ -From 964e328f78b4d337fc2f3b3d57d2db21847012f7 Mon Sep 17 00:00:00 2001 +From ce7503b8489735c12b3bb5eb48c4e8937c1c4765 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 30 May 2023 11:19:13 +0200 -Subject: [PATCH 120/175] fix(LinstorSR): remove hosts/ips param +Subject: [PATCH 120/176] fix(LinstorSR): remove hosts/ips param --- drivers/LinstorSR.py | 47 +++++---------------------------- diff --git a/SOURCES/0121-fix-LinstorSR-compute-correctly-SR-size-using-pool-c.patch b/SOURCES/0121-fix-LinstorSR-compute-correctly-SR-size-using-pool-c.patch index bfd7ed95..14ce0f71 100644 --- a/SOURCES/0121-fix-LinstorSR-compute-correctly-SR-size-using-pool-c.patch +++ b/SOURCES/0121-fix-LinstorSR-compute-correctly-SR-size-using-pool-c.patch @@ -1,7 +1,7 @@ -From fad043f547a38223fc3a52400db70cf3b0ec2243 Mon Sep 17 00:00:00 2001 +From 55e92941365b6b39a78209d2d775e510a7a3ba32 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 1 Jun 2023 17:40:37 +0200 -Subject: [PATCH 121/175] fix(LinstorSR): compute correctly SR size using pool +Subject: [PATCH 121/176] fix(LinstorSR): compute correctly SR size using pool count Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0122-fix-blktap2-ensure-we-can-import-this-module-when-LI.patch b/SOURCES/0122-fix-blktap2-ensure-we-can-import-this-module-when-LI.patch index 22025024..0443e87a 100644 --- a/SOURCES/0122-fix-blktap2-ensure-we-can-import-this-module-when-LI.patch +++ b/SOURCES/0122-fix-blktap2-ensure-we-can-import-this-module-when-LI.patch @@ -1,7 +1,7 @@ -From a4b69f4d89c45a4a7f90eff858bc59214832f321 Mon Sep 17 00:00:00 2001 +From 36dc495fb24764c5e1b7f4de379efc5568b105f0 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 6 Jun 2023 11:50:54 +0200 -Subject: [PATCH 122/175] fix(blktap2): ensure we can import this module when +Subject: [PATCH 122/176] fix(blktap2): ensure we can import this module when LINSTOR is not installed Signed-off-by: Ronan Abhamon @@ -10,7 +10,7 @@ Signed-off-by: Ronan Abhamon 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/blktap2.py b/drivers/blktap2.py -index 719a152..2a37efb 100755 +index 370f7fb..fd7c643 100755 --- a/drivers/blktap2.py +++ b/drivers/blktap2.py @@ -36,7 +36,6 @@ import json @@ -34,14 +34,14 @@ index 719a152..2a37efb 100755 PLUGIN_TAP_PAUSE = "tapdisk-pause" SOCKPATH = "/var/xapi/xcp-rrdd" -@@ -831,7 +836,7 @@ class Tapdisk(object): +@@ -832,7 +837,7 @@ class Tapdisk(object): retry_open += 1 time.sleep(1) continue - if err == errno.EROFS: + if LINSTOR_AVAILABLE and err == errno.EROFS: log_drbd_openers(path) - break + raise try: -- 2.45.2 diff --git a/SOURCES/0123-fix-LinstorSR-ensure-volume-cache-can-be-recreated.patch b/SOURCES/0123-fix-LinstorSR-ensure-volume-cache-can-be-recreated.patch index 5dcf86d1..a874f79f 100644 --- a/SOURCES/0123-fix-LinstorSR-ensure-volume-cache-can-be-recreated.patch +++ b/SOURCES/0123-fix-LinstorSR-ensure-volume-cache-can-be-recreated.patch @@ -1,7 +1,7 @@ -From 87042f09234e5887abc071ea581d052c7451948f Mon Sep 17 00:00:00 2001 +From 9ac47f3a66ba8b232d0940cc84b63708df04fdea Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 21 Jun 2023 14:10:18 +0200 -Subject: [PATCH 123/175] fix(LinstorSR): ensure volume cache can be recreated +Subject: [PATCH 123/176] fix(LinstorSR): ensure volume cache can be recreated After SR creation we may fail to load volumes with this exception: "Failed to get usable size of..." and so we can't plug the master PBD. diff --git a/SOURCES/0124-fix-linstor-manager-remove-dead-useless-code-in-add-.patch b/SOURCES/0124-fix-linstor-manager-remove-dead-useless-code-in-add-.patch index e5393015..9877df57 100644 --- a/SOURCES/0124-fix-linstor-manager-remove-dead-useless-code-in-add-.patch +++ b/SOURCES/0124-fix-linstor-manager-remove-dead-useless-code-in-add-.patch @@ -1,7 +1,7 @@ -From 60d3410e1b96cb2f41f03b96c4079721aab4dd50 Mon Sep 17 00:00:00 2001 +From 6cc5256d1eb193eed6eee76b2b9b68445eaa78c7 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 20 Jul 2023 10:46:33 +0200 -Subject: [PATCH 124/175] fix(linstor-manager): remove dead/useless code in +Subject: [PATCH 124/176] fix(linstor-manager): remove dead/useless code in add/remove_host helpers Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0125-fix-LinstorSR-Ensure-we-always-have-a-device-path-du.patch b/SOURCES/0125-fix-LinstorSR-Ensure-we-always-have-a-device-path-du.patch index eeb5a756..ea510727 100644 --- a/SOURCES/0125-fix-LinstorSR-Ensure-we-always-have-a-device-path-du.patch +++ b/SOURCES/0125-fix-LinstorSR-Ensure-we-always-have-a-device-path-du.patch @@ -1,7 +1,7 @@ -From 6f07d38ac46cc917e837d4e33a46c8036e1228ec Mon Sep 17 00:00:00 2001 +From 6b8eff2089024d5a675a34a978d95bde365c1296 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 1 Aug 2023 15:16:17 +0200 -Subject: [PATCH 125/175] fix(LinstorSR): Ensure we always have a device path +Subject: [PATCH 125/176] fix(LinstorSR): Ensure we always have a device path during leaf-coalesce calls So we must not verify that we have a valid DRBD path in the load step, diff --git a/SOURCES/0126-fix-LinstorSR-always-use-lock.acquire-during-attach-.patch b/SOURCES/0126-fix-LinstorSR-always-use-lock.acquire-during-attach-.patch index 0bd85bee..1d3689ed 100644 --- a/SOURCES/0126-fix-LinstorSR-always-use-lock.acquire-during-attach-.patch +++ b/SOURCES/0126-fix-LinstorSR-always-use-lock.acquire-during-attach-.patch @@ -1,7 +1,7 @@ -From a658e5ce04f42e3c20518ba5efdd6ed05d5e0b13 Mon Sep 17 00:00:00 2001 +From f3a1c26b46601c5bbcaeda3ef494a7f59ce7c6c6 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 16 Aug 2023 12:04:01 +0200 -Subject: [PATCH 126/175] fix(LinstorSR): always use lock.acquire() during +Subject: [PATCH 126/176] fix(LinstorSR): always use lock.acquire() during attach/detach We can't use a retry range on the lock because we can trigger a bad situation diff --git a/SOURCES/0127-fix-LinstorSR-mare-sure-hostnames-are-unique-at-SR-c.patch b/SOURCES/0127-fix-LinstorSR-mare-sure-hostnames-are-unique-at-SR-c.patch index a998fdc0..5399fb99 100644 --- a/SOURCES/0127-fix-LinstorSR-mare-sure-hostnames-are-unique-at-SR-c.patch +++ b/SOURCES/0127-fix-LinstorSR-mare-sure-hostnames-are-unique-at-SR-c.patch @@ -1,7 +1,7 @@ -From 864a2275e1ee395834058ce9b433f290bd932420 Mon Sep 17 00:00:00 2001 +From abda6f13ca112aa1a8f142e290377982f76f060a Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 17 Aug 2023 14:52:13 +0200 -Subject: [PATCH 127/175] fix(LinstorSR): mare sure hostnames are unique at SR +Subject: [PATCH 127/176] fix(LinstorSR): mare sure hostnames are unique at SR creation Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0128-fix-LinstorSR-ensure-we-can-attach-non-special-stati.patch b/SOURCES/0128-fix-LinstorSR-ensure-we-can-attach-non-special-stati.patch index 0714e161..11207884 100644 --- a/SOURCES/0128-fix-LinstorSR-ensure-we-can-attach-non-special-stati.patch +++ b/SOURCES/0128-fix-LinstorSR-ensure-we-can-attach-non-special-stati.patch @@ -1,7 +1,7 @@ -From ecb19cbe25ce76b20f946ab166474766f45c9f08 Mon Sep 17 00:00:00 2001 +From a2dd4de7e8e512297a332c270070a62bc75aca55 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 18 Aug 2023 11:06:56 +0200 -Subject: [PATCH 128/175] fix(LinstorSR): ensure we can attach non-special +Subject: [PATCH 128/176] fix(LinstorSR): ensure we can attach non-special static VDIs Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0129-fix-LinstorSR-ensure-we-can-detach-when-deflate-call.patch b/SOURCES/0129-fix-LinstorSR-ensure-we-can-detach-when-deflate-call.patch index a8e6384a..4b76f8b2 100644 --- a/SOURCES/0129-fix-LinstorSR-ensure-we-can-detach-when-deflate-call.patch +++ b/SOURCES/0129-fix-LinstorSR-ensure-we-can-detach-when-deflate-call.patch @@ -1,7 +1,7 @@ -From b88d2a1cc9e4346e322a6b500159f2a0c5e4bba2 Mon Sep 17 00:00:00 2001 +From 3cf1041ce9802829651010063c3d8eebe969ba26 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 31 Aug 2023 18:00:27 +0200 -Subject: [PATCH 129/175] fix(LinstorSR): ensure we can detach when deflate +Subject: [PATCH 129/176] fix(LinstorSR): ensure we can detach when deflate call is not possible Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0130-fix-LinstorSR-assume-VDI-is-always-a-VHD-when-the-in.patch b/SOURCES/0130-fix-LinstorSR-assume-VDI-is-always-a-VHD-when-the-in.patch index f4b4addb..caeb7ef7 100644 --- a/SOURCES/0130-fix-LinstorSR-assume-VDI-is-always-a-VHD-when-the-in.patch +++ b/SOURCES/0130-fix-LinstorSR-assume-VDI-is-always-a-VHD-when-the-in.patch @@ -1,7 +1,7 @@ -From 36c88f1ee37fa5f78f7dcc41b2ed7aaeac680dde Mon Sep 17 00:00:00 2001 +From 10f62cd78f1ce950b4f1527ab5baa227192a88ed Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 28 Sep 2023 16:00:02 +0200 -Subject: [PATCH 130/175] fix(LinstorSR): assume VDI is always a VHD when the +Subject: [PATCH 130/176] fix(LinstorSR): assume VDI is always a VHD when the info is missing during cleanup Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0131-fix-LinstorSR-remove-SR-lock-during-thin-attach-deta.patch b/SOURCES/0131-fix-LinstorSR-remove-SR-lock-during-thin-attach-deta.patch index a7157132..2cbc93b2 100644 --- a/SOURCES/0131-fix-LinstorSR-remove-SR-lock-during-thin-attach-deta.patch +++ b/SOURCES/0131-fix-LinstorSR-remove-SR-lock-during-thin-attach-deta.patch @@ -1,7 +1,7 @@ -From 5ffe8d608678a31e1f8ece28f5af617d8f623762 Mon Sep 17 00:00:00 2001 +From 5c8c56aea83a2cd4e2ffe57ba54aaf21474f68be Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 2 Oct 2023 16:48:49 +0200 -Subject: [PATCH 131/175] fix(LinstorSR): remove SR lock during thin +Subject: [PATCH 131/176] fix(LinstorSR): remove SR lock during thin attach/detach This lock is normally useless and can create a dead lock when thin mode is activated: diff --git a/SOURCES/0132-fix-LinstorSR-ensure-database-is-mounted-during-scan.patch b/SOURCES/0132-fix-LinstorSR-ensure-database-is-mounted-during-scan.patch index ddd78b92..dfdf9b8c 100644 --- a/SOURCES/0132-fix-LinstorSR-ensure-database-is-mounted-during-scan.patch +++ b/SOURCES/0132-fix-LinstorSR-ensure-database-is-mounted-during-scan.patch @@ -1,7 +1,7 @@ -From 5a653534f1bb404003ddb76a09660abf58ce2931 Mon Sep 17 00:00:00 2001 +From af4c39361fa080e170eb2d9ae58cd839d2b7b550 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 3 Oct 2023 18:42:42 +0200 -Subject: [PATCH 132/175] fix(LinstorSR): ensure database is mounted during +Subject: [PATCH 132/176] fix(LinstorSR): ensure database is mounted during scan Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0133-fix-LinstorSR-restart-drbd-reactor-in-case-of-failur.patch b/SOURCES/0133-fix-LinstorSR-restart-drbd-reactor-in-case-of-failur.patch index 776a77dc..f279dbf8 100644 --- a/SOURCES/0133-fix-LinstorSR-restart-drbd-reactor-in-case-of-failur.patch +++ b/SOURCES/0133-fix-LinstorSR-restart-drbd-reactor-in-case-of-failur.patch @@ -1,7 +1,7 @@ -From 723d0346edcb889ec6999992f1f3f269ad837866 Mon Sep 17 00:00:00 2001 +From 8154937eec169d7d7e9d9f00ff401ea279e5741c Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 4 Oct 2023 14:30:36 +0200 -Subject: [PATCH 133/175] fix(LinstorSR): restart drbd-reactor in case of +Subject: [PATCH 133/176] fix(LinstorSR): restart drbd-reactor in case of failure Otherwise we can have all hosts unusable after a massive reboot: diff --git a/SOURCES/0134-fix-linstorvolumemanager-retry-in-case-of-failure-du.patch b/SOURCES/0134-fix-linstorvolumemanager-retry-in-case-of-failure-du.patch index 9e4acdff..48e4eff2 100644 --- a/SOURCES/0134-fix-linstorvolumemanager-retry-in-case-of-failure-du.patch +++ b/SOURCES/0134-fix-linstorvolumemanager-retry-in-case-of-failure-du.patch @@ -1,7 +1,7 @@ -From 16cf3bd03335cd85ddb928de24531e11cc73475f Mon Sep 17 00:00:00 2001 +From 17f5732413d7c5d95173ae36600a66f917981f1a Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 9 Oct 2023 10:37:32 +0200 -Subject: [PATCH 134/175] fix(linstorvolumemanager): retry in case of failure +Subject: [PATCH 134/176] fix(linstorvolumemanager): retry in case of failure during mkfs call on database The device is not always ready after creation. diff --git a/SOURCES/0135-fix-linstorvolumemanager-avoid-diskless-creation-whe.patch b/SOURCES/0135-fix-linstorvolumemanager-avoid-diskless-creation-whe.patch index 9366a370..373dae23 100644 --- a/SOURCES/0135-fix-linstorvolumemanager-avoid-diskless-creation-whe.patch +++ b/SOURCES/0135-fix-linstorvolumemanager-avoid-diskless-creation-whe.patch @@ -1,7 +1,7 @@ -From 37265b1466c56548c8480dec4f0e9b47ea52384f Mon Sep 17 00:00:00 2001 +From bef526786b135beef522a40b571044dbd0922e58 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 26 Sep 2023 11:48:38 +0200 -Subject: [PATCH 135/175] fix(linstorvolumemanager): avoid diskless creation +Subject: [PATCH 135/176] fix(linstorvolumemanager): avoid diskless creation when a new resource is added Like said in this discussion https://github.com/xcp-ng/sm/pull/34 : diff --git a/SOURCES/0136-fix-LinstorSR-remove-diskless-after-VDI.detach-calls.patch b/SOURCES/0136-fix-LinstorSR-remove-diskless-after-VDI.detach-calls.patch index 639bcc82..56452ad5 100644 --- a/SOURCES/0136-fix-LinstorSR-remove-diskless-after-VDI.detach-calls.patch +++ b/SOURCES/0136-fix-LinstorSR-remove-diskless-after-VDI.detach-calls.patch @@ -1,7 +1,7 @@ -From 51e183044653af148b1e2ad0fda99e5ee987c025 Mon Sep 17 00:00:00 2001 +From efbfea0c312d112122346f3a1e6efea952d6f96d Mon Sep 17 00:00:00 2001 From: Rene Peinthor Date: Tue, 25 Jul 2023 11:19:39 +0200 -Subject: [PATCH 136/175] fix(LinstorSR): remove diskless after VDI.detach +Subject: [PATCH 136/176] fix(LinstorSR): remove diskless after VDI.detach calls Signed-off-by: Rene Peinthor diff --git a/SOURCES/0137-fix-LinstorSR-robustify-_load_vdi_info-in-cleanup.py.patch b/SOURCES/0137-fix-LinstorSR-robustify-_load_vdi_info-in-cleanup.py.patch index 3dd4d206..cf886e6f 100644 --- a/SOURCES/0137-fix-LinstorSR-robustify-_load_vdi_info-in-cleanup.py.patch +++ b/SOURCES/0137-fix-LinstorSR-robustify-_load_vdi_info-in-cleanup.py.patch @@ -1,7 +1,7 @@ -From 61c5216457523eecd22684b2e00aff4c0b165907 Mon Sep 17 00:00:00 2001 +From 427909f25d2ff571c5e0e165b20e3303883403a5 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 11 Oct 2023 12:39:56 +0200 -Subject: [PATCH 137/175] fix(LinstorSR): robustify _load_vdi_info in +Subject: [PATCH 137/176] fix(LinstorSR): robustify _load_vdi_info in cleanup.py After a failed snapshot like that: diff --git a/SOURCES/0138-fix-LinstorSR-ensure-detach-never-fails-on-plugin-fa.patch b/SOURCES/0138-fix-LinstorSR-ensure-detach-never-fails-on-plugin-fa.patch index e84d77b5..09cfeb6c 100644 --- a/SOURCES/0138-fix-LinstorSR-ensure-detach-never-fails-on-plugin-fa.patch +++ b/SOURCES/0138-fix-LinstorSR-ensure-detach-never-fails-on-plugin-fa.patch @@ -1,7 +1,7 @@ -From 7eaa9c4c8f1053c1fed35e0c42d7783b3064fdd2 Mon Sep 17 00:00:00 2001 +From 4fdaf148c813d3b1b380deabcf246f74b8993a59 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 23 Oct 2023 14:31:27 +0200 -Subject: [PATCH 138/175] fix(LinstorSR): ensure detach never fails on plugin +Subject: [PATCH 138/176] fix(LinstorSR): ensure detach never fails on plugin failure Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0139-fix-LinstorSR-ensure-we-coalesce-only-volumes-with-a.patch b/SOURCES/0139-fix-LinstorSR-ensure-we-coalesce-only-volumes-with-a.patch index 21fdcd24..b7bddd2d 100644 --- a/SOURCES/0139-fix-LinstorSR-ensure-we-coalesce-only-volumes-with-a.patch +++ b/SOURCES/0139-fix-LinstorSR-ensure-we-coalesce-only-volumes-with-a.patch @@ -1,7 +1,7 @@ -From 4f4326e015f13074ba713c58a8347c7fe6a5db3d Mon Sep 17 00:00:00 2001 +From 5981f334d3fa7fff186446d094b9b83a92d20cb1 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 23 Oct 2023 15:52:23 +0200 -Subject: [PATCH 139/175] fix(LinstorSR): ensure we coalesce only volumes with +Subject: [PATCH 139/176] fix(LinstorSR): ensure we coalesce only volumes with a valid size --- diff --git a/SOURCES/0140-fix-LinstorSR-don-t-try-to-repair-persistent-volumes.patch b/SOURCES/0140-fix-LinstorSR-don-t-try-to-repair-persistent-volumes.patch index dbe7cfeb..a3f2791e 100644 --- a/SOURCES/0140-fix-LinstorSR-don-t-try-to-repair-persistent-volumes.patch +++ b/SOURCES/0140-fix-LinstorSR-don-t-try-to-repair-persistent-volumes.patch @@ -1,7 +1,7 @@ -From 1712a2e6e321ba2871d04b2da7d6f5e9ff3080a0 Mon Sep 17 00:00:00 2001 +From b7a02cef58da7eb734cfa1c876593a43946300c1 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 24 Oct 2023 11:57:40 +0200 -Subject: [PATCH 140/175] fix(LinstorSR): don't try to repair persistent +Subject: [PATCH 140/176] fix(LinstorSR): don't try to repair persistent volumes in GC Use constants to simplify maintenance. diff --git a/SOURCES/0141-fix-linstorvhdutil-format-correctly-message-if-vhd-u.patch b/SOURCES/0141-fix-linstorvhdutil-format-correctly-message-if-vhd-u.patch index 0c0b0180..9c7bde7c 100644 --- a/SOURCES/0141-fix-linstorvhdutil-format-correctly-message-if-vhd-u.patch +++ b/SOURCES/0141-fix-linstorvhdutil-format-correctly-message-if-vhd-u.patch @@ -1,7 +1,7 @@ -From 54a4909b24a679c308b96c358aaebe2fa55cd2f8 Mon Sep 17 00:00:00 2001 +From a600cd8fb9c29b709459b7446fc7fd0ac362bbdf Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 14 Nov 2023 18:21:53 +0100 -Subject: [PATCH 141/175] fix(linstorvhdutil): format correctly message if +Subject: [PATCH 141/176] fix(linstorvhdutil): format correctly message if vhd-util cannot be run Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0142-fix-LinstorSR-wait-during-attach-to-open-DRBD-path.patch b/SOURCES/0142-fix-LinstorSR-wait-during-attach-to-open-DRBD-path.patch index 05bb68fb..db8472be 100644 --- a/SOURCES/0142-fix-LinstorSR-wait-during-attach-to-open-DRBD-path.patch +++ b/SOURCES/0142-fix-LinstorSR-wait-during-attach-to-open-DRBD-path.patch @@ -1,7 +1,7 @@ -From 2db4a62b837c295deee9098b0cf6c0fb8547af2a Mon Sep 17 00:00:00 2001 +From ed9e6189aa9e86c7c32ec88baa9b8023cfd250d6 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 24 Oct 2023 23:07:23 +0200 -Subject: [PATCH 142/175] fix(LinstorSR): wait during attach to open DRBD path +Subject: [PATCH 142/176] fix(LinstorSR): wait during attach to open DRBD path ENODATA and other errors like EROFS can be raised when a new DRBD path is created on the fly. So ensure to block before tapdisk starts. diff --git a/SOURCES/0143-fix-LinstorSR-support-different-volume-sizes-in-clea.patch b/SOURCES/0143-fix-LinstorSR-support-different-volume-sizes-in-clea.patch index 6181427f..a5abf507 100644 --- a/SOURCES/0143-fix-LinstorSR-support-different-volume-sizes-in-clea.patch +++ b/SOURCES/0143-fix-LinstorSR-support-different-volume-sizes-in-clea.patch @@ -1,7 +1,7 @@ -From 97dfc6b7552ecf5891826107972bd4b8fcb4f2a4 Mon Sep 17 00:00:00 2001 +From 8ff35099e65e28f4a7ae4883606efc8f2f0b72f8 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 14 Nov 2023 18:08:26 +0100 -Subject: [PATCH 143/175] fix(LinstorSR): support different volume sizes in +Subject: [PATCH 143/176] fix(LinstorSR): support different volume sizes in cleanup.py Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0144-fix-LinstorSR-remove-useless-IPS_XHA_CACHE-var.patch b/SOURCES/0144-fix-LinstorSR-remove-useless-IPS_XHA_CACHE-var.patch index 924e661f..4ba282e4 100644 --- a/SOURCES/0144-fix-LinstorSR-remove-useless-IPS_XHA_CACHE-var.patch +++ b/SOURCES/0144-fix-LinstorSR-remove-useless-IPS_XHA_CACHE-var.patch @@ -1,7 +1,7 @@ -From 801dad839e5289d0498c1c27f89bbfe1ec21406a Mon Sep 17 00:00:00 2001 +From 66cb40e1203a06cb1561f28225ba53a449bae79f Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 20 Nov 2023 10:52:27 +0100 -Subject: [PATCH 144/175] fix(LinstorSR): remove useless IPS_XHA_CACHE var +Subject: [PATCH 144/176] fix(LinstorSR): remove useless IPS_XHA_CACHE var Signed-off-by: Ronan Abhamon --- diff --git a/SOURCES/0145-fix-LinstorSR-ensure-we-can-deflate-on-any-host-afte.patch b/SOURCES/0145-fix-LinstorSR-ensure-we-can-deflate-on-any-host-afte.patch index 037074a5..b99f750d 100644 --- a/SOURCES/0145-fix-LinstorSR-ensure-we-can-deflate-on-any-host-afte.patch +++ b/SOURCES/0145-fix-LinstorSR-ensure-we-can-deflate-on-any-host-afte.patch @@ -1,7 +1,7 @@ -From 9b3174fa7cc145bc6e91fbe0f6beb9bc67de616e Mon Sep 17 00:00:00 2001 +From 0941f0f67e86099523d389dfd3caffc09f848444 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 21 Nov 2023 13:50:24 +0100 -Subject: [PATCH 145/175] fix(LinstorSR): ensure we can deflate on any host +Subject: [PATCH 145/176] fix(LinstorSR): ensure we can deflate on any host after a journal rollback Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0146-fix-LinstorSR-ensure-we-always-use-real-DRBD-VHD-siz.patch b/SOURCES/0146-fix-LinstorSR-ensure-we-always-use-real-DRBD-VHD-siz.patch index 3f7e6c70..bc3aad89 100644 --- a/SOURCES/0146-fix-LinstorSR-ensure-we-always-use-real-DRBD-VHD-siz.patch +++ b/SOURCES/0146-fix-LinstorSR-ensure-we-always-use-real-DRBD-VHD-siz.patch @@ -1,7 +1,7 @@ -From 2a40d7f0b506df2d5761e722c50dfee67fae9eda Mon Sep 17 00:00:00 2001 +From 7aa1cd3e4e2539f424ec193fe599c51da9d63a0e Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 27 Nov 2023 12:15:43 +0100 -Subject: [PATCH 146/175] fix(LinstorSR): ensure we always use real DRBD/VHD +Subject: [PATCH 146/176] fix(LinstorSR): ensure we always use real DRBD/VHD sizes in inflate/deflate GC calls --- diff --git a/SOURCES/0147-feat-linstor-kv-tool-If-no-controller-uri-option-is-.patch b/SOURCES/0147-feat-linstor-kv-tool-If-no-controller-uri-option-is-.patch index f2dd959e..2b710488 100644 --- a/SOURCES/0147-feat-linstor-kv-tool-If-no-controller-uri-option-is-.patch +++ b/SOURCES/0147-feat-linstor-kv-tool-If-no-controller-uri-option-is-.patch @@ -1,7 +1,7 @@ -From f016b9e1a971a2b6679879619cb9a9cc08828ca5 Mon Sep 17 00:00:00 2001 +From f440e05248e5201289b5c7dfc25f3a4867912317 Mon Sep 17 00:00:00 2001 From: BenjiReis Date: Mon, 27 Nov 2023 14:23:57 +0100 -Subject: [PATCH 147/175] feat(linstor-kv-tool): If no controller uri option is +Subject: [PATCH 147/176] feat(linstor-kv-tool): If no controller uri option is provided fetch it (#48) Signed-off-by: BenjiReis diff --git a/SOURCES/0148-fix-linstorvolumemanager-robustify-SR-destroy-46.patch b/SOURCES/0148-fix-linstorvolumemanager-robustify-SR-destroy-46.patch index f5739bd0..0ddb448f 100644 --- a/SOURCES/0148-fix-linstorvolumemanager-robustify-SR-destroy-46.patch +++ b/SOURCES/0148-fix-linstorvolumemanager-robustify-SR-destroy-46.patch @@ -1,7 +1,7 @@ -From 34ebe2ad9e60d33477d4011cd675636dbd632aa4 Mon Sep 17 00:00:00 2001 +From 163521a5851d6cf808acd8e68e8b6905a9487300 Mon Sep 17 00:00:00 2001 From: BenjiReis Date: Wed, 29 Nov 2023 15:45:32 +0100 -Subject: [PATCH 148/175] fix(linstorvolumemanager): robustify SR destroy (#46) +Subject: [PATCH 148/176] fix(linstorvolumemanager): robustify SR destroy (#46) Signed-off-by: Ronan Abhamon Co-authored-by: BenjiReis diff --git a/SOURCES/0149-feat-linstor-manager-extend-API-with-createNodeInter.patch b/SOURCES/0149-feat-linstor-manager-extend-API-with-createNodeInter.patch index 00e227d7..5c17c55f 100644 --- a/SOURCES/0149-feat-linstor-manager-extend-API-with-createNodeInter.patch +++ b/SOURCES/0149-feat-linstor-manager-extend-API-with-createNodeInter.patch @@ -1,7 +1,7 @@ -From fd687a38cc2c24f652d2f99314f89e51e3f17a32 Mon Sep 17 00:00:00 2001 +From 695baec632e137b6fbab34b826f4c3224fddf2b3 Mon Sep 17 00:00:00 2001 From: BenjiReis Date: Wed, 29 Nov 2023 16:54:30 +0100 -Subject: [PATCH 149/175] feat(linstor-manager): extend API with +Subject: [PATCH 149/176] feat(linstor-manager): extend API with createNodeInterface and setNodePreferredInterface (#47) Signed-off-by: BenjiReis diff --git a/SOURCES/0150-fix-LinstorSR-support-VDI.resize-on-thick-volumes.patch b/SOURCES/0150-fix-LinstorSR-support-VDI.resize-on-thick-volumes.patch index 23e3df78..b0ff2c4b 100644 --- a/SOURCES/0150-fix-LinstorSR-support-VDI.resize-on-thick-volumes.patch +++ b/SOURCES/0150-fix-LinstorSR-support-VDI.resize-on-thick-volumes.patch @@ -1,7 +1,7 @@ -From 77bbf3dd74958cf038766b6d37f584522d692106 Mon Sep 17 00:00:00 2001 +From 2eccb722153fe6c903839c0fe5ed329533c4c1c3 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 1 Dec 2023 11:55:12 +0100 -Subject: [PATCH 150/175] fix(LinstorSR): support VDI.resize on thick volumes +Subject: [PATCH 150/176] fix(LinstorSR): support VDI.resize on thick volumes --- drivers/LinstorSR.py | 3 +++ diff --git a/SOURCES/0151-fix-linstorvolumemanager-format-correctly-exception-.patch b/SOURCES/0151-fix-linstorvolumemanager-format-correctly-exception-.patch index 7c5b45d1..767ad207 100644 --- a/SOURCES/0151-fix-linstorvolumemanager-format-correctly-exception-.patch +++ b/SOURCES/0151-fix-linstorvolumemanager-format-correctly-exception-.patch @@ -1,7 +1,7 @@ -From 8d7880e0063d1fe5e79563a45e1224098e075d40 Mon Sep 17 00:00:00 2001 +From af598434fde6668d79bbab53810f316e63d502a1 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 4 Dec 2023 16:36:55 +0100 -Subject: [PATCH 151/175] fix(linstorvolumemanager): format correctly exception +Subject: [PATCH 151/176] fix(linstorvolumemanager): format correctly exception during db mount Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0152-fix-LinstorSR-ensure-we-can-skip-coalesces-if-device.patch b/SOURCES/0152-fix-LinstorSR-ensure-we-can-skip-coalesces-if-device.patch index 95b172ff..1471435d 100644 --- a/SOURCES/0152-fix-LinstorSR-ensure-we-can-skip-coalesces-if-device.patch +++ b/SOURCES/0152-fix-LinstorSR-ensure-we-can-skip-coalesces-if-device.patch @@ -1,7 +1,7 @@ -From 8ff742a8296b7ec3e4f8a35a749c54eaf37a54eb Mon Sep 17 00:00:00 2001 +From dc34dd73b75ccfc06e85382114ea23da77834801 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 4 Dec 2023 18:57:08 +0100 -Subject: [PATCH 152/175] fix(LinstorSR): ensure we can skip coalesces if +Subject: [PATCH 152/176] fix(LinstorSR): ensure we can skip coalesces if device path can't be fetched Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0153-feat-linstor-manager-add-methods-to-modify-destroy-l.patch b/SOURCES/0153-feat-linstor-manager-add-methods-to-modify-destroy-l.patch index 554714fa..ea3f3fb1 100644 --- a/SOURCES/0153-feat-linstor-manager-add-methods-to-modify-destroy-l.patch +++ b/SOURCES/0153-feat-linstor-manager-add-methods-to-modify-destroy-l.patch @@ -1,7 +1,7 @@ -From 4ce72650888831acf1297f804d41bbe60f09f5d5 Mon Sep 17 00:00:00 2001 +From 334eddd740c2d9891f7671799f9c8f55a51c1a8a Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 19 Dec 2023 14:49:33 +0100 -Subject: [PATCH 153/175] feat(linstor-manager): add methods to +Subject: [PATCH 153/176] feat(linstor-manager): add methods to modify/destroy/list net interfaces Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0154-fix-LinstorSR-force-a-defined-volume-prefix-if-we-ca.patch b/SOURCES/0154-fix-LinstorSR-force-a-defined-volume-prefix-if-we-ca.patch index d9cb68b2..5cc7dfc5 100644 --- a/SOURCES/0154-fix-LinstorSR-force-a-defined-volume-prefix-if-we-ca.patch +++ b/SOURCES/0154-fix-LinstorSR-force-a-defined-volume-prefix-if-we-ca.patch @@ -1,7 +1,7 @@ -From 41187ef7c58496dd3cccce223730edf5f4706d46 Mon Sep 17 00:00:00 2001 +From 1f5d49121421691a9dabbbb4e0d44025e3abde27 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 12 Jan 2024 10:28:20 +0100 -Subject: [PATCH 154/175] fix(LinstorSR): force a defined volume prefix if we +Subject: [PATCH 154/176] fix(LinstorSR): force a defined volume prefix if we can't import libs Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0155-fix-LinstorSR-explicit-error-message-when-a-group-is.patch b/SOURCES/0155-fix-LinstorSR-explicit-error-message-when-a-group-is.patch index bd199317..c3d24820 100644 --- a/SOURCES/0155-fix-LinstorSR-explicit-error-message-when-a-group-is.patch +++ b/SOURCES/0155-fix-LinstorSR-explicit-error-message-when-a-group-is.patch @@ -1,7 +1,7 @@ -From 30fdeb99a513ebc9ce66a1ab2d07459506a8b645 Mon Sep 17 00:00:00 2001 +From 4ddcc31d0695b66e6135c2fe9d671d3059bfe720 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 18 Jan 2024 10:24:01 +0100 -Subject: [PATCH 155/175] fix(LinstorSR): explicit error message when a group +Subject: [PATCH 155/176] fix(LinstorSR): explicit error message when a group is not unique during SR creation Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0156-fix-LinstorSR-make-sure-VDI.delete-doesn-t-throw-und.patch b/SOURCES/0156-fix-LinstorSR-make-sure-VDI.delete-doesn-t-throw-und.patch index 147a7d47..5d836931 100644 --- a/SOURCES/0156-fix-LinstorSR-make-sure-VDI.delete-doesn-t-throw-und.patch +++ b/SOURCES/0156-fix-LinstorSR-make-sure-VDI.delete-doesn-t-throw-und.patch @@ -1,7 +1,7 @@ -From 1bd49c3aacab50b38a0c2c85b8ed6c54134630f7 Mon Sep 17 00:00:00 2001 +From 8656be850cc50c29a8d9cfd17c9e9258c7809467 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 18 Jan 2024 11:18:11 +0100 -Subject: [PATCH 156/175] fix(LinstorSR): make sure VDI.delete doesn't throw +Subject: [PATCH 156/176] fix(LinstorSR): make sure VDI.delete doesn't throw under specific conditions If we can update the volume state in the KV-store, there is no reason to raise diff --git a/SOURCES/0157-fix-LinstorSR-add-drbd-in-the-blacklist-of-multipath.patch b/SOURCES/0157-fix-LinstorSR-add-drbd-in-the-blacklist-of-multipath.patch index 1852a2f5..25bd82f7 100644 --- a/SOURCES/0157-fix-LinstorSR-add-drbd-in-the-blacklist-of-multipath.patch +++ b/SOURCES/0157-fix-LinstorSR-add-drbd-in-the-blacklist-of-multipath.patch @@ -1,7 +1,7 @@ -From df9ea419809cc4140b5e0c56da128a69c2304086 Mon Sep 17 00:00:00 2001 +From 35d2cfa162cb00a67d444a3ba8427842954523fe Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 19 Jan 2024 14:39:17 +0100 -Subject: [PATCH 157/175] fix(LinstorSR): add drbd in the blacklist of +Subject: [PATCH 157/176] fix(LinstorSR): add drbd in the blacklist of multipath.conf If DRBD is installed for the first time, and if the multipathd diff --git a/SOURCES/0158-fix-linstorvolumemanager-create-cloned-volumes-on-ho.patch b/SOURCES/0158-fix-linstorvolumemanager-create-cloned-volumes-on-ho.patch index d2c40375..6ecf1e6f 100644 --- a/SOURCES/0158-fix-linstorvolumemanager-create-cloned-volumes-on-ho.patch +++ b/SOURCES/0158-fix-linstorvolumemanager-create-cloned-volumes-on-ho.patch @@ -1,7 +1,7 @@ -From 4e01c279744c08677f325283ca1f54feb7c6f375 Mon Sep 17 00:00:00 2001 +From c14781d38cd6d00fbb0ac9511a9e5a4440698b6d Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 22 Jan 2024 11:25:25 +0100 -Subject: [PATCH 158/175] fix(linstorvolumemanager): create cloned volumes on +Subject: [PATCH 158/176] fix(linstorvolumemanager): create cloned volumes on host selected by LINSTOR Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0159-fix-linstorvolumemanager-don-t-align-volumes-on-LVM-.patch b/SOURCES/0159-fix-linstorvolumemanager-don-t-align-volumes-on-LVM-.patch index 9b4d4a89..d9485566 100644 --- a/SOURCES/0159-fix-linstorvolumemanager-don-t-align-volumes-on-LVM-.patch +++ b/SOURCES/0159-fix-linstorvolumemanager-don-t-align-volumes-on-LVM-.patch @@ -1,7 +1,7 @@ -From eb696a5641d88d6b07579c58a95514fe7cb2812a Mon Sep 17 00:00:00 2001 +From 7edbc090f1dcfa2bcc63e669af81e14c11addc05 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 26 Jan 2024 15:29:21 +0100 -Subject: [PATCH 159/175] fix(linstorvolumemanager): don't align volumes on LVM +Subject: [PATCH 159/176] fix(linstorvolumemanager): don't align volumes on LVM sector size It's the goal of the LINSTOR stack to align properly on the LVM layer. diff --git a/SOURCES/0160-fix-linstorvolumemanager-assert-with-message-after-l.patch b/SOURCES/0160-fix-linstorvolumemanager-assert-with-message-after-l.patch index 95146760..2997aa66 100644 --- a/SOURCES/0160-fix-linstorvolumemanager-assert-with-message-after-l.patch +++ b/SOURCES/0160-fix-linstorvolumemanager-assert-with-message-after-l.patch @@ -1,7 +1,7 @@ -From c5a0c0eb7055e3e6bec0607767f02b14de66384a Mon Sep 17 00:00:00 2001 +From 181e82b231f0abdb51594ec9c362c90dde80b31c Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 5 Feb 2024 18:01:22 +0100 -Subject: [PATCH 160/175] fix(linstorvolumemanager): assert with message after +Subject: [PATCH 160/176] fix(linstorvolumemanager): assert with message after log in update_volume_uuid Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0161-fix-linstorvolumemanager-retry-resize-if-volume-is-n.patch b/SOURCES/0161-fix-linstorvolumemanager-retry-resize-if-volume-is-n.patch index aabf912f..80bb4bbe 100644 --- a/SOURCES/0161-fix-linstorvolumemanager-retry-resize-if-volume-is-n.patch +++ b/SOURCES/0161-fix-linstorvolumemanager-retry-resize-if-volume-is-n.patch @@ -1,7 +1,7 @@ -From a4f9493ea489a16799a69ac5b6e8016872eaa518 Mon Sep 17 00:00:00 2001 +From 0481bcd2232e87b4458ffaabeff3c9f40d4362f4 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 5 Feb 2024 23:13:06 +0100 -Subject: [PATCH 161/175] fix(linstorvolumemanager): retry resize if volume is +Subject: [PATCH 161/176] fix(linstorvolumemanager): retry resize if volume is not up to date Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0162-fix-LinstorSR-create-DRBD-diskless-if-necessary-for-.patch b/SOURCES/0162-fix-LinstorSR-create-DRBD-diskless-if-necessary-for-.patch index 51f4f482..8bbd6568 100644 --- a/SOURCES/0162-fix-LinstorSR-create-DRBD-diskless-if-necessary-for-.patch +++ b/SOURCES/0162-fix-LinstorSR-create-DRBD-diskless-if-necessary-for-.patch @@ -1,7 +1,7 @@ -From b870540473df318ec74fc8b7a2f916177cdece25 Mon Sep 17 00:00:00 2001 +From eae3f5a79684319a75f65514d5b6c65e73ea4aee Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 6 Feb 2024 00:10:32 +0100 -Subject: [PATCH 162/175] fix(LinstorSR): create DRBD diskless if necessary for +Subject: [PATCH 162/176] fix(LinstorSR): create DRBD diskless if necessary for each VHD parent It's necessary to have all parents during snapshot to create a new VHD child. diff --git a/SOURCES/0163-fix-LinstorSR-fix-bad-call-to-vhdutil.inflate-bad-ex.patch b/SOURCES/0163-fix-LinstorSR-fix-bad-call-to-vhdutil.inflate-bad-ex.patch index 40668533..4f8fd0a1 100644 --- a/SOURCES/0163-fix-LinstorSR-fix-bad-call-to-vhdutil.inflate-bad-ex.patch +++ b/SOURCES/0163-fix-LinstorSR-fix-bad-call-to-vhdutil.inflate-bad-ex.patch @@ -1,7 +1,7 @@ -From 4b79b1f585370c5e285a8c91e8ccdf7c3670a490 Mon Sep 17 00:00:00 2001 +From 71f177ba5e1ddc71bd9acaad301849b62d719642 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 6 Feb 2024 00:14:11 +0100 -Subject: [PATCH 163/175] fix(LinstorSR): fix bad call to vhdutil.inflate + bad +Subject: [PATCH 163/176] fix(LinstorSR): fix bad call to vhdutil.inflate + bad exception Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0164-fix-LinstorSR-activate-VG-if-attach-from-config-is-a.patch b/SOURCES/0164-fix-LinstorSR-activate-VG-if-attach-from-config-is-a.patch index 9a2b66e5..b338cd8b 100644 --- a/SOURCES/0164-fix-LinstorSR-activate-VG-if-attach-from-config-is-a.patch +++ b/SOURCES/0164-fix-LinstorSR-activate-VG-if-attach-from-config-is-a.patch @@ -1,7 +1,7 @@ -From dfcec4b53eaaca42548c5e2d6582404b68817a6c Mon Sep 17 00:00:00 2001 +From 1340ce2e1ab70d2077294304a7de626cedef1302 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 12 Feb 2024 20:54:06 +0100 -Subject: [PATCH 164/175] fix(LinstorSR): activate VG if attach from config is +Subject: [PATCH 164/176] fix(LinstorSR): activate VG if attach from config is asked Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0165-feat-LinstorSR-use-a-specific-resource-group-for-DB-.patch b/SOURCES/0165-feat-LinstorSR-use-a-specific-resource-group-for-DB-.patch index 241b594a..10471c6a 100644 --- a/SOURCES/0165-feat-LinstorSR-use-a-specific-resource-group-for-DB-.patch +++ b/SOURCES/0165-feat-LinstorSR-use-a-specific-resource-group-for-DB-.patch @@ -1,7 +1,7 @@ -From b7364a6f259a892892fc4f340927ea80c58174a0 Mon Sep 17 00:00:00 2001 +From e3a1524d69685f7c48e3efc16cdfb69ae722d7cc Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 19 Mar 2024 23:09:54 +0100 -Subject: [PATCH 165/175] feat(LinstorSR): use a specific resource group for DB +Subject: [PATCH 165/176] feat(LinstorSR): use a specific resource group for DB and HA Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0166-feat-linstor-manager-add-getNodePreferredInterface-h.patch b/SOURCES/0166-feat-linstor-manager-add-getNodePreferredInterface-h.patch index 649bf858..65802499 100644 --- a/SOURCES/0166-feat-linstor-manager-add-getNodePreferredInterface-h.patch +++ b/SOURCES/0166-feat-linstor-manager-add-getNodePreferredInterface-h.patch @@ -1,7 +1,7 @@ -From 4b8db294574d248231edf40f7b7e9fdb4f37e79f Mon Sep 17 00:00:00 2001 +From 3d704956a9624303b4258e9e9954396bdeb1a0c5 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 15 Apr 2024 11:22:18 +0200 -Subject: [PATCH 166/175] feat(linstor-manager): add +Subject: [PATCH 166/176] feat(linstor-manager): add `getNodePreferredInterface` helper Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0167-fix-linstorvolumemanager-blocks-deletion-of-default-.patch b/SOURCES/0167-fix-linstorvolumemanager-blocks-deletion-of-default-.patch index d9ddb69a..fcad5147 100644 --- a/SOURCES/0167-fix-linstorvolumemanager-blocks-deletion-of-default-.patch +++ b/SOURCES/0167-fix-linstorvolumemanager-blocks-deletion-of-default-.patch @@ -1,7 +1,7 @@ -From 8c5f5efd12ea9509aa7862790a73d41b6386d8ff Mon Sep 17 00:00:00 2001 +From db37c5c68d38416de88a64c4cc1b70fd6971f8fb Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 15 Apr 2024 11:26:00 +0200 -Subject: [PATCH 167/175] fix(linstorvolumemanager): blocks deletion of default +Subject: [PATCH 167/176] fix(linstorvolumemanager): blocks deletion of default network interface Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0168-feat-linstorvolumemanager-change-logic-of-get_resour.patch b/SOURCES/0168-feat-linstorvolumemanager-change-logic-of-get_resour.patch index 14ada705..eada3036 100644 --- a/SOURCES/0168-feat-linstorvolumemanager-change-logic-of-get_resour.patch +++ b/SOURCES/0168-feat-linstorvolumemanager-change-logic-of-get_resour.patch @@ -1,7 +1,7 @@ -From 1da13644d6fb8ef1c77c23b5201f2f9c247170ee Mon Sep 17 00:00:00 2001 +From 91794049e90cbfa6997c27e1aa81dac3f460d0f3 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 15 Apr 2024 17:56:47 +0200 -Subject: [PATCH 168/175] feat(linstorvolumemanager): change logic of +Subject: [PATCH 168/176] feat(linstorvolumemanager): change logic of `get_resources_info`: - Add a nested level "nodes" for each resource - Add a "uuid" attr on resources - Rename LINSTOR "uuid" to "linstor-uuid" - Optimize code diff --git a/SOURCES/0169-feat-linstor-manager-add-error-codes-to-healthCheck-.patch b/SOURCES/0169-feat-linstor-manager-add-error-codes-to-healthCheck-.patch index 67c74e52..56eb77d4 100644 --- a/SOURCES/0169-feat-linstor-manager-add-error-codes-to-healthCheck-.patch +++ b/SOURCES/0169-feat-linstor-manager-add-error-codes-to-healthCheck-.patch @@ -1,7 +1,7 @@ -From 054c7a40d249d7f7bfb6daf0e7aa2b58319311c2 Mon Sep 17 00:00:00 2001 +From a160b11630ccea5ce2d4799c98cc4fa3949d7ab7 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 18 Apr 2024 13:57:37 +0200 -Subject: [PATCH 169/175] feat(linstor-manager): add error codes to healthCheck +Subject: [PATCH 169/176] feat(linstor-manager): add error codes to healthCheck helper Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0170-fix-LinstorSR-fix-bad-exception-reference-during-sna.patch b/SOURCES/0170-fix-LinstorSR-fix-bad-exception-reference-during-sna.patch index 5bca6017..5c00a966 100644 --- a/SOURCES/0170-fix-LinstorSR-fix-bad-exception-reference-during-sna.patch +++ b/SOURCES/0170-fix-LinstorSR-fix-bad-exception-reference-during-sna.patch @@ -1,7 +1,7 @@ -From bbec79d3445aa772b2f3f5884fc1906becfd604d Mon Sep 17 00:00:00 2001 +From 20a4fa3fc5932216a30a7b0e6e8fad292ae73859 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 24 Apr 2024 15:10:49 +0200 -Subject: [PATCH 170/175] fix(LinstorSR): fix bad exception reference during +Subject: [PATCH 170/176] fix(LinstorSR): fix bad exception reference during snapshot Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0171-fix-tapdisk-pause-ensure-LINSTOR-VHD-chain-is-availa.patch b/SOURCES/0171-fix-tapdisk-pause-ensure-LINSTOR-VHD-chain-is-availa.patch index 428c0158..be90a828 100644 --- a/SOURCES/0171-fix-tapdisk-pause-ensure-LINSTOR-VHD-chain-is-availa.patch +++ b/SOURCES/0171-fix-tapdisk-pause-ensure-LINSTOR-VHD-chain-is-availa.patch @@ -1,7 +1,7 @@ -From 351e47f2acd98c7fa662553b48d84efbeb939a91 Mon Sep 17 00:00:00 2001 +From d701a62618ab66606731ce6db0424849ed8cdf9f Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 24 Apr 2024 17:29:26 +0200 -Subject: [PATCH 171/175] fix(tapdisk-pause): ensure LINSTOR VHD chain is +Subject: [PATCH 171/176] fix(tapdisk-pause): ensure LINSTOR VHD chain is available Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0172-fix-LVHDoISCSISR-disable-restart-of-ISCSI-daemon.patch b/SOURCES/0172-fix-LVHDoISCSISR-disable-restart-of-ISCSI-daemon.patch index 532dd12e..b50738e2 100644 --- a/SOURCES/0172-fix-LVHDoISCSISR-disable-restart-of-ISCSI-daemon.patch +++ b/SOURCES/0172-fix-LVHDoISCSISR-disable-restart-of-ISCSI-daemon.patch @@ -1,7 +1,7 @@ -From 20c54e8a9e0b66425b50a2733a821071f737946a Mon Sep 17 00:00:00 2001 +From 09a03ec264af5ca874380c89aa9efaf6d6fe1b7e Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 26 Apr 2024 14:20:04 +0200 -Subject: [PATCH 172/175] fix(LVHDoISCSISR): disable restart of ISCSI daemon +Subject: [PATCH 172/176] fix(LVHDoISCSISR): disable restart of ISCSI daemon Signed-off-by: Ronan Abhamon --- diff --git a/SOURCES/0173-fix-linstorvhdutil-retry-check-on-another-machine-in.patch b/SOURCES/0173-fix-linstorvhdutil-retry-check-on-another-machine-in.patch index e642869a..c4dc5f27 100644 --- a/SOURCES/0173-fix-linstorvhdutil-retry-check-on-another-machine-in.patch +++ b/SOURCES/0173-fix-linstorvhdutil-retry-check-on-another-machine-in.patch @@ -1,7 +1,7 @@ -From 8be0fee5e4dfdcd34301a48512f01f15f9a9795a Mon Sep 17 00:00:00 2001 +From fa482bd8394f3ebd72f87aa1bae76b03c14ca120 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 6 May 2024 18:15:00 +0200 -Subject: [PATCH 173/175] fix(linstorvhdutil): retry check on another machine +Subject: [PATCH 173/176] fix(linstorvhdutil): retry check on another machine in case of failure (#54) Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0174-fix-LinstorSR-explicit-errors-when-database-path-is-.patch b/SOURCES/0174-fix-LinstorSR-explicit-errors-when-database-path-is-.patch index aacabec1..c9e7d967 100644 --- a/SOURCES/0174-fix-LinstorSR-explicit-errors-when-database-path-is-.patch +++ b/SOURCES/0174-fix-LinstorSR-explicit-errors-when-database-path-is-.patch @@ -1,7 +1,7 @@ -From 9f90f7277672389d539639049675a98db2c0cda4 Mon Sep 17 00:00:00 2001 +From cbd05b772d0510be31296bfc09cda7389dc796fd Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 6 May 2024 21:35:36 +0200 -Subject: [PATCH 174/175] fix(LinstorSR): explicit errors when database path is +Subject: [PATCH 174/176] fix(LinstorSR): explicit errors when database path is fetched --- diff --git a/SOURCES/0175-fix-LinstorSR-Misc-fixes-on-destroy.patch b/SOURCES/0175-fix-LinstorSR-Misc-fixes-on-destroy.patch index 3e3561fd..bca3d63e 100644 --- a/SOURCES/0175-fix-LinstorSR-Misc-fixes-on-destroy.patch +++ b/SOURCES/0175-fix-LinstorSR-Misc-fixes-on-destroy.patch @@ -1,7 +1,7 @@ -From 04eb8ccfa07b1c666c788fdd1475a8267878bd46 Mon Sep 17 00:00:00 2001 +From 318460ff8dfccafc928dfc12de211b2336da3386 Mon Sep 17 00:00:00 2001 From: Damien Thenot Date: Tue, 30 Apr 2024 15:38:34 +0200 -Subject: [PATCH 175/175] fix(LinstorSR): Misc fixes on destroy +Subject: [PATCH 175/176] fix(LinstorSR): Misc fixes on destroy linstor-manager: - fix on get_drbd_volumes diff --git a/SOURCES/0176-fix-LinstorSR-open-non-leaf-volumes-in-RO-mode-creat.patch b/SOURCES/0176-fix-LinstorSR-open-non-leaf-volumes-in-RO-mode-creat.patch new file mode 100644 index 00000000..4c8f0317 --- /dev/null +++ b/SOURCES/0176-fix-LinstorSR-open-non-leaf-volumes-in-RO-mode-creat.patch @@ -0,0 +1,85 @@ +From 8c6fe4981a647aa087a91d76ecc9fe5d4f94b082 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Thu, 20 Jun 2024 22:37:40 +0200 +Subject: [PATCH 176/176] fix(LinstorSR): open non-leaf volumes in RO mode + (create_chain_paths) + +We must never open non-leaf volumes with the write option. +Only read only mode should be used to allow any host to access DRBD data. +Otherwise an attach call on dom-0 can be interrupted because a host already has a read lock. + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 10 +++++----- + drivers/linstorvhdutil.py | 5 +++-- + 2 files changed, 8 insertions(+), 7 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 8d95890..2127057 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -1793,10 +1793,10 @@ class LinstorVDI(VDI.VDI): + 'scan SR first to trigger auto-repair' + ) + +- if not attach_from_config or self.sr._is_master: +- writable = 'args' not in self.sr.srcmd.params or \ +- self.sr.srcmd.params['args'][0] == 'true' ++ writable = 'args' not in self.sr.srcmd.params or \ ++ self.sr.srcmd.params['args'][0] == 'true' + ++ if not attach_from_config or self.sr._is_master: + # We need to inflate the volume if we don't have enough place + # to mount the VHD image. I.e. the volume capacity must be greater + # than the VHD size + bitmap size. +@@ -1830,7 +1830,7 @@ class LinstorVDI(VDI.VDI): + return self._attach_using_http_nbd() + + # Ensure we have a path... +- self.sr._vhdutil.create_chain_paths(self.uuid) ++ self.sr._vhdutil.create_chain_paths(self.uuid, readonly=not writable) + + self.attached = True + return VDI.VDI.attach(self, self.sr.uuid, self.uuid) +@@ -2357,7 +2357,7 @@ class LinstorVDI(VDI.VDI): + raise xs_errors.XenError('SnapshotChainTooLong') + + # Ensure we have a valid path if we don't have a local diskful. +- self.sr._vhdutil.create_chain_paths(self.uuid) ++ self.sr._vhdutil.create_chain_paths(self.uuid, readonly=True) + + volume_path = self.path + if not util.pathexists(volume_path): +diff --git a/drivers/linstorvhdutil.py b/drivers/linstorvhdutil.py +index fd2bc8b..7f8efa1 100644 +--- a/drivers/linstorvhdutil.py ++++ b/drivers/linstorvhdutil.py +@@ -152,7 +152,7 @@ class LinstorVhdUtil: + self._session = session + self._linstor = linstor + +- def create_chain_paths(self, vdi_uuid): ++ def create_chain_paths(self, vdi_uuid, readonly=False): + # OPTIMIZE: Add a limit_to_first_allocated_block param to limit vhdutil calls. + # Useful for the snapshot code algorithm. + +@@ -168,7 +168,7 @@ class LinstorVhdUtil: + def check_volume_usable(): + while True: + try: +- with open(path, 'r+'): ++ with open(path, 'r' if readonly else 'r+'): + pass + except IOError as e: + if e.errno == errno.ENODATA: +@@ -186,6 +186,7 @@ class LinstorVhdUtil: + if not vdi_uuid: + break + path = self._linstor.get_device_path(vdi_uuid) ++ readonly = True # Non-leaf is always readonly. + + return leaf_vdi_path + +-- +2.45.2 + diff --git a/SPECS/sm.spec b/SPECS/sm.spec index 5b0c369a..5150f326 100644 --- a/SPECS/sm.spec +++ b/SPECS/sm.spec @@ -11,7 +11,7 @@ Summary: sm - XCP storage managers Name: sm Version: 2.30.8 -Release: %{?xsrel}.1.0.linstor.2%{?dist} +Release: %{?xsrel}.1.0.linstor.3%{?dist} Group: System/Hypervisor License: LGPL URL: https://github.com/xapi-project/sm @@ -271,6 +271,7 @@ Patch1172: 0172-fix-LVHDoISCSISR-disable-restart-of-ISCSI-daemon.patch Patch1173: 0173-fix-linstorvhdutil-retry-check-on-another-machine-in.patch Patch1174: 0174-fix-LinstorSR-explicit-errors-when-database-path-is-.patch Patch1175: 0175-fix-LinstorSR-Misc-fixes-on-destroy.patch +Patch1176: 0176-fix-LinstorSR-open-non-leaf-volumes-in-RO-mode-creat.patch %description This package contains storage backends used in XCP @@ -687,6 +688,9 @@ cp -r htmlcov %{buildroot}/htmlcov %{_unitdir}/linstor-monitor.service %changelog +* Fri Jun 28 2024 Ronan Abhamon 2.30.8-12.1.0.linstor.3 +- Add 0176-fix-LinstorSR-open-non-leaf-volumes-in-RO-mode-creat.patch + * Mon Jun 17 2024 Ronan Abhamon 2.30.8-12.1.0.linstor.2 - Reload automatically multipathd config after each update From 330c790e0521dbd1efa2d2d70946457f23b59ad9 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 26 Jul 2024 14:20:53 +0200 Subject: [PATCH 4/8] Never destroy tie-breakers Patch1177: 0177-fix-LinstorSR-ensure-_is_master-is-always-set.patch Patch1178: 0178-fix-linstor-check-if-resource-is-tiebreaker-62.patch Signed-off-by: Ronan Abhamon --- ...21cc248d79b749a63d4ad099e6d5f4b8b588.patch | 2 +- ...-sm.service-s-description-for-XCP-ng.patch | 2 +- .../0003-Add-TrueNAS-multipath-config.patch | 2 +- ...add-CephFS-GlusterFS-and-XFS-drivers.patch | 2 +- ...-ZFS-driver-to-avoid-losing-VDI-meta.patch | 2 +- ...driver-for-users-who-need-to-transit.patch | 2 +- ...07-feat-drivers-add-LinstorSR-driver.patch | 2 +- ...nit-tests-concerning-ZFS-close-xcp-n.patch | 2 +- ...no-NFS-ACLs-provided-assume-everyone.patch | 2 +- .../0010-Added-SM-Driver-for-MooseFS.patch | 2 +- ...mount-in-ISOSR-when-legacy_mode-is-u.patch | 2 +- ...SR-uses-now-UUID-subdirs-for-each-SR.patch | 2 +- ...Fix-is_open-call-for-many-drivers-25.patch | 2 +- ...HING-capability-for-many-SR-types-24.patch | 2 +- ...ve-SR_PROBE-from-ZFS-capabilities-37.patch | 2 +- ...ix-vdi-ref-when-static-vdis-are-used.patch | 2 +- ...-not-to-edit-multipath.conf-directly.patch | 2 +- ...om.conf-multipath-configuration-file.patch | 2 +- ...all-etc-multipath-conf.d-custom.conf.patch | 2 +- SOURCES/0020-Backport-NFS4-only-support.patch | 2 +- ...or-NFS4-when-rpcinfo-does-not-includ.patch | 2 +- ...Block-backport-of-largeblocksr-51-55.patch | 2 +- ...dd-a-way-to-modify-config-of-LVMs-56.patch | 2 +- ...-alarm-must-be-reset-in-case-of-succ.patch | 2 +- ...urns-the-result-of-user-function-now.patch | 2 +- ...e-pause-tag-from-VDIs-in-case-of-fai.patch | 2 +- ...pair-volumes-only-if-an-exclusive-co.patch | 2 +- ...instorSR-Improve-LINSTOR-performance.patch | 2 +- ...obustify-scan-to-avoid-losing-VDIs-i.patch | 2 +- ...isplay-a-correctly-readable-size-for.patch | 2 +- ...itord-scan-all-LINSTOR-SRs-every-12-.patch | 2 +- ...ll-correctly-method-in-_locked_load-.patch | 2 +- ...rSR-integrate-minidrbdcluster-daemon.patch | 2 +- ...nsure-heartbeat-and-redo_log-VDIs-ar.patch | 2 +- ...rotect-sr-commands-to-avoid-forgetti.patch | 2 +- ...aler-ensure-uri-is-not-None-during-l.patch | 2 +- ...dd-an-option-to-disable-auto-quorum-.patch | 2 +- ...eManager-add-a-workaround-to-create-.patch | 2 +- ...LinstorSR-add-optional-ips-parameter.patch | 2 +- ...dd-a-helper-log_drbd_erofs-to-trace-.patch | 2 +- ...y-to-restart-the-services-again-if-t.patch | 2 +- ...bustify-linstor-manager-to-never-inc.patch | 2 +- ...event-starting-controller-during-fai.patch | 2 +- ...meManager-increase-peer-slots-limit-.patch | 2 +- ...meManager-add-a-fallback-to-find-con.patch | 2 +- ...tor.mount-ensure-we-always-mount-dat.patch | 2 +- ...meManager-add-a-fallback-to-find-nod.patch | 2 +- ...xplain-on-which-host-plugins-command.patch | 2 +- ...eate-diskless-path-if-necessary-duri.patch | 2 +- ...se-HTTP-NBD-instead-of-DRBD-directly.patch | 2 +- ...nd-controller-when-XAPI-unreachable-.patch | 2 +- ...e-IPs-instead-of-hostnames-in-NBD-se.patch | 2 +- ...eManager-ensure-we-always-use-IPs-in.patch | 2 +- ...ager-add-methods-to-add-remove-host-.patch | 2 +- ...meManager-support-SR-creation-with-d.patch | 2 +- ...dd-a-config-var-to-disable-HTTP-NBD-.patch | 2 +- ...nsure-LVM-group-is-activated-during-.patch | 2 +- ...ager-add-method-to-create-LinstorSR-.patch | 2 +- ...ways-set-vdi_path-in-generate_config.patch | 2 +- ...ter-supports-new-properties-like-for.patch | 2 +- ...abled-disable-minidrbcluster-with-fi.patch | 2 +- ...ger-change-linstor-satellite-start-b.patch | 2 +- .../0063-Fix-is_open-call-for-LinstorSR.patch | 2 +- ...til-fix-boolean-params-of-check-call.patch | 2 +- ...tor-manager-robustify-exec_create_sr.patch | 2 +- ...t-LINSTOR-VDI-UUID-if-error-during-i.patch | 2 +- ...se-and-dump-DRBD-openers-in-case-of-.patch | 2 +- ...til-trace-DRBD-openers-in-case-of-ER.patch | 2 +- ...emanager-compute-correctly-size-in-a.patch | 2 +- ...se-DRBD-openers-instead-of-lsof-to-l.patch | 2 +- ...upport-cProfile-to-trace-calls-when-.patch | 2 +- ...aler-reset-namespace-when-get-is-cal.patch | 2 +- ...il-fix-coalesce-with-VM-running-unde.patch | 2 +- ...emanager-_get_volumes_info-doesn-t-r.patch | 2 +- ...emanager-remove-double-prefix-on-kv-.patch | 2 +- ...dd-linstor-kv-dump-helper-to-print-k.patch | 2 +- ...sable-VHD-key-hash-usage-to-limit-ex.patch | 2 +- ...ter-ensure-SIGINT-is-handled-correct.patch | 2 +- ...ster-stop-resource-services-at-start.patch | 2 +- ...ager-add-new-healthCheck-function-to.patch | 2 +- ...x-xha-conf-parsing-return-host-ip-no.patch | 2 +- ...art-correctly-HA-servers-HTTP-NBD-af.patch | 2 +- ...emanager-use-an-array-to-store-diskf.patch | 2 +- ...memanager-support-snaps-when-a-host-.patch | 2 +- ...emanager-support-offline-hosts-when-.patch | 2 +- ...emanager-define-_base_group_name-mem.patch | 2 +- ...til-modify-logic-of-local-vhdutil-ca.patch | 2 +- ...memanager-robustify-failed-snapshots.patch | 2 +- ...emanager-use-a-namespace-for-volumes.patch | 2 +- ...dump-rename-to-linstor-kv-tool-add-r.patch | 2 +- ...ndle-correctly-localhost-during-star.patch | 2 +- ...all-repair-on-another-host-when-EROF.patch | 2 +- ...void-introduction-of-DELETED-volumes.patch | 2 +- ...tool-remove-all-volumes-supports-jou.patch | 2 +- ...il-due-to-bad-refactoring-check-call.patch | 2 +- ...til-ensure-we-use-VHD-parent-to-find.patch | 2 +- ...memanager-force-DRBD-demote-after-fa.patch | 2 +- ...il-ensure-we-retry-creation-in-all-s.patch | 2 +- ...il-don-t-retry-local-vhdutil-call-wh.patch | 2 +- ...-feat-fork-log-daemon-ignore-SIGTERM.patch | 2 +- ...SR-wait-for-http-disk-server-startup.patch | 2 +- ...ndle-inflate-resize-actions-correctl.patch | 2 +- ...ger-add-a-static-iptables-rule-for-D.patch | 2 +- ...ync-with-last-http-nbd-transfer-vers.patch | 2 +- ...n-t-check-VDI-metadata-while-listing.patch | 2 +- ...n-t-check-metadata-when-destroying-s.patch | 2 +- ...il-handle-correctly-generic-exceptio.patch | 2 +- ...ter-robustify-to-unmount-correctly-L.patch | 2 +- ...ter-handle-correctly-KeyboardInterru.patch | 2 +- ...se-drbd-reactor-instead-of-minidrbdc.patch | 2 +- ...sure-vhdutil-calls-are-correctly-exe.patch | 2 +- ...eplace-bad-param-in-detach_thin-impl.patch | 2 +- ...lumemanager-remove-usage-of-realpath.patch | 2 +- ...vhdutil-avoid-parent-path-resolution.patch | 2 +- ...rSR-create-parent-path-during-attach.patch | 2 +- ...retry-if-we-can-t-build-volume-cache.patch | 2 +- ...emanager-reduce-peer-slots-param-to-.patch | 2 +- ...tach-a-valid-XAPI-session-is_open-is.patch | 2 +- ...sure-we-always-have-a-DRBD-path-to-s.patch | 2 +- ...fix-LinstorSR-remove-hosts-ips-param.patch | 2 +- ...mpute-correctly-SR-size-using-pool-c.patch | 2 +- ...re-we-can-import-this-module-when-LI.patch | 2 +- ...ensure-volume-cache-can-be-recreated.patch | 2 +- ...ger-remove-dead-useless-code-in-add-.patch | 2 +- ...sure-we-always-have-a-device-path-du.patch | 2 +- ...ways-use-lock.acquire-during-attach-.patch | 2 +- ...re-sure-hostnames-are-unique-at-SR-c.patch | 2 +- ...sure-we-can-attach-non-special-stati.patch | 2 +- ...sure-we-can-detach-when-deflate-call.patch | 2 +- ...sume-VDI-is-always-a-VHD-when-the-in.patch | 2 +- ...move-SR-lock-during-thin-attach-deta.patch | 2 +- ...sure-database-is-mounted-during-scan.patch | 2 +- ...start-drbd-reactor-in-case-of-failur.patch | 2 +- ...emanager-retry-in-case-of-failure-du.patch | 2 +- ...emanager-avoid-diskless-creation-whe.patch | 2 +- ...move-diskless-after-VDI.detach-calls.patch | 2 +- ...bustify-_load_vdi_info-in-cleanup.py.patch | 2 +- ...sure-detach-never-fails-on-plugin-fa.patch | 2 +- ...sure-we-coalesce-only-volumes-with-a.patch | 2 +- ...n-t-try-to-repair-persistent-volumes.patch | 2 +- ...il-format-correctly-message-if-vhd-u.patch | 2 +- ...wait-during-attach-to-open-DRBD-path.patch | 2 +- ...pport-different-volume-sizes-in-clea.patch | 2 +- ...rSR-remove-useless-IPS_XHA_CACHE-var.patch | 2 +- ...sure-we-can-deflate-on-any-host-afte.patch | 2 +- ...sure-we-always-use-real-DRBD-VHD-siz.patch | 2 +- ...tool-If-no-controller-uri-option-is-.patch | 2 +- ...olumemanager-robustify-SR-destroy-46.patch | 2 +- ...ager-extend-API-with-createNodeInter.patch | 2 +- ...-support-VDI.resize-on-thick-volumes.patch | 2 +- ...emanager-format-correctly-exception-.patch | 2 +- ...sure-we-can-skip-coalesces-if-device.patch | 2 +- ...ager-add-methods-to-modify-destroy-l.patch | 2 +- ...rce-a-defined-volume-prefix-if-we-ca.patch | 2 +- ...plicit-error-message-when-a-group-is.patch | 2 +- ...ke-sure-VDI.delete-doesn-t-throw-und.patch | 2 +- ...d-drbd-in-the-blacklist-of-multipath.patch | 2 +- ...emanager-create-cloned-volumes-on-ho.patch | 2 +- ...emanager-don-t-align-volumes-on-LVM-.patch | 2 +- ...emanager-assert-with-message-after-l.patch | 2 +- ...emanager-retry-resize-if-volume-is-n.patch | 2 +- ...eate-DRBD-diskless-if-necessary-for-.patch | 2 +- ...x-bad-call-to-vhdutil.inflate-bad-ex.patch | 2 +- ...tivate-VG-if-attach-from-config-is-a.patch | 2 +- ...se-a-specific-resource-group-for-DB-.patch | 2 +- ...ager-add-getNodePreferredInterface-h.patch | 2 +- ...emanager-blocks-deletion-of-default-.patch | 2 +- ...memanager-change-logic-of-get_resour.patch | 2 +- ...ager-add-error-codes-to-healthCheck-.patch | 2 +- ...x-bad-exception-reference-during-sna.patch | 2 +- ...e-ensure-LINSTOR-VHD-chain-is-availa.patch | 2 +- ...SISR-disable-restart-of-ISCSI-daemon.patch | 2 +- ...il-retry-check-on-another-machine-in.patch | 2 +- ...plicit-errors-when-database-path-is-.patch | 2 +- ...-fix-LinstorSR-Misc-fixes-on-destroy.patch | 2 +- ...en-non-leaf-volumes-in-RO-mode-creat.patch | 2 +- ...orSR-ensure-_is_master-is-always-set.patch | 158 ++++++++++++++++++ ...r-check-if-resource-is-tiebreaker-62.patch | 35 ++++ SPECS/sm.spec | 8 +- 179 files changed, 376 insertions(+), 177 deletions(-) create mode 100644 SOURCES/0177-fix-LinstorSR-ensure-_is_master-is-always-set.patch create mode 100644 SOURCES/0178-fix-linstor-check-if-resource-is-tiebreaker-62.patch diff --git a/SOURCES/0001-backport-of-ccd121cc248d79b749a63d4ad099e6d5f4b8b588.patch b/SOURCES/0001-backport-of-ccd121cc248d79b749a63d4ad099e6d5f4b8b588.patch index 5db24d1e..08d41663 100644 --- a/SOURCES/0001-backport-of-ccd121cc248d79b749a63d4ad099e6d5f4b8b588.patch +++ b/SOURCES/0001-backport-of-ccd121cc248d79b749a63d4ad099e6d5f4b8b588.patch @@ -1,7 +1,7 @@ From a365619c2835e593259dad3c26761575f64066d6 Mon Sep 17 00:00:00 2001 From: Mark Syms Date: Thu, 20 May 2021 17:40:06 +0100 -Subject: [PATCH 001/176] backport of ccd121cc248d79b749a63d4ad099e6d5f4b8b588: +Subject: [PATCH 001/178] backport of ccd121cc248d79b749a63d4ad099e6d5f4b8b588: CA-354692: check for device parameter in create/probe calls Signed-off-by: Mark Syms diff --git a/SOURCES/0002-Update-xs-sm.service-s-description-for-XCP-ng.patch b/SOURCES/0002-Update-xs-sm.service-s-description-for-XCP-ng.patch index fd7790bf..3b588691 100644 --- a/SOURCES/0002-Update-xs-sm.service-s-description-for-XCP-ng.patch +++ b/SOURCES/0002-Update-xs-sm.service-s-description-for-XCP-ng.patch @@ -1,7 +1,7 @@ From 283242d159438c4b301e153a95adde5dfaea3b58 Mon Sep 17 00:00:00 2001 From: Samuel Verschelde Date: Thu, 13 Aug 2020 15:22:17 +0200 -Subject: [PATCH 002/176] Update xs-sm.service's description for XCP-ng +Subject: [PATCH 002/178] 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. diff --git a/SOURCES/0003-Add-TrueNAS-multipath-config.patch b/SOURCES/0003-Add-TrueNAS-multipath-config.patch index 245fc6e7..3d409dff 100644 --- a/SOURCES/0003-Add-TrueNAS-multipath-config.patch +++ b/SOURCES/0003-Add-TrueNAS-multipath-config.patch @@ -1,7 +1,7 @@ From d6528d899b762ec5d7ceec1fb9c8b13c2c7e6f73 Mon Sep 17 00:00:00 2001 From: Samuel Verschelde Date: Thu, 13 Aug 2020 15:26:43 +0200 -Subject: [PATCH 003/176] Add TrueNAS multipath config +Subject: [PATCH 003/178] 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. diff --git a/SOURCES/0004-feat-drivers-add-CephFS-GlusterFS-and-XFS-drivers.patch b/SOURCES/0004-feat-drivers-add-CephFS-GlusterFS-and-XFS-drivers.patch index e254baab..433867a4 100644 --- a/SOURCES/0004-feat-drivers-add-CephFS-GlusterFS-and-XFS-drivers.patch +++ b/SOURCES/0004-feat-drivers-add-CephFS-GlusterFS-and-XFS-drivers.patch @@ -1,7 +1,7 @@ From 13542e244eea28a4c60708de99a50fa8c3d4ec5a Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 20 Jul 2020 16:26:42 +0200 -Subject: [PATCH 004/176] feat(drivers): add CephFS, GlusterFS and XFS drivers +Subject: [PATCH 004/178] feat(drivers): add CephFS, GlusterFS and XFS drivers --- Makefile | 3 + diff --git a/SOURCES/0005-feat-drivers-add-ZFS-driver-to-avoid-losing-VDI-meta.patch b/SOURCES/0005-feat-drivers-add-ZFS-driver-to-avoid-losing-VDI-meta.patch index 9ba1d42e..17c4b95b 100644 --- a/SOURCES/0005-feat-drivers-add-ZFS-driver-to-avoid-losing-VDI-meta.patch +++ b/SOURCES/0005-feat-drivers-add-ZFS-driver-to-avoid-losing-VDI-meta.patch @@ -1,7 +1,7 @@ From 4525a55b84eb46f4c67797da6eaf61a329dac9d7 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 12 Aug 2020 11:14:33 +0200 -Subject: [PATCH 005/176] feat(drivers): add ZFS driver to avoid losing VDI +Subject: [PATCH 005/178] feat(drivers): add ZFS driver to avoid losing VDI metadata (xcp-ng/xcp#401) --- diff --git a/SOURCES/0006-Re-add-the-ext4-driver-for-users-who-need-to-transit.patch b/SOURCES/0006-Re-add-the-ext4-driver-for-users-who-need-to-transit.patch index 051eebb9..3ef5a693 100644 --- a/SOURCES/0006-Re-add-the-ext4-driver-for-users-who-need-to-transit.patch +++ b/SOURCES/0006-Re-add-the-ext4-driver-for-users-who-need-to-transit.patch @@ -1,7 +1,7 @@ From 5987a43e40444a524768b1434de1a67c6e53000a Mon Sep 17 00:00:00 2001 From: Samuel Verschelde Date: Thu, 13 Aug 2020 17:10:12 +0200 -Subject: [PATCH 006/176] Re-add the ext4 driver for users who need to +Subject: [PATCH 006/178] Re-add the ext4 driver for users who need to transition The driver is needed to transition to the ext driver. diff --git a/SOURCES/0007-feat-drivers-add-LinstorSR-driver.patch b/SOURCES/0007-feat-drivers-add-LinstorSR-driver.patch index 1838e31a..9f011a88 100644 --- a/SOURCES/0007-feat-drivers-add-LinstorSR-driver.patch +++ b/SOURCES/0007-feat-drivers-add-LinstorSR-driver.patch @@ -1,7 +1,7 @@ From 3b19f4d691a10f0023d936a0328e4a7684b4d3fa Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 16 Mar 2020 15:39:44 +0100 -Subject: [PATCH 007/176] feat(drivers): add LinstorSR driver +Subject: [PATCH 007/178] feat(drivers): add LinstorSR driver Some important points: diff --git a/SOURCES/0008-feat-tests-add-unit-tests-concerning-ZFS-close-xcp-n.patch b/SOURCES/0008-feat-tests-add-unit-tests-concerning-ZFS-close-xcp-n.patch index 6e526b03..f7e78d5a 100644 --- a/SOURCES/0008-feat-tests-add-unit-tests-concerning-ZFS-close-xcp-n.patch +++ b/SOURCES/0008-feat-tests-add-unit-tests-concerning-ZFS-close-xcp-n.patch @@ -1,7 +1,7 @@ From c43a4dbdff827fe7a65f93a4fa4b817344c854aa Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 27 Oct 2020 15:04:36 +0100 -Subject: [PATCH 008/176] feat(tests): add unit tests concerning ZFS (close +Subject: [PATCH 008/178] feat(tests): add unit tests concerning ZFS (close xcp-ng/xcp#425) - Check if "create" doesn't succeed without zfs packages diff --git a/SOURCES/0009-If-no-NFS-ACLs-provided-assume-everyone.patch b/SOURCES/0009-If-no-NFS-ACLs-provided-assume-everyone.patch index 96c33fd8..b1bf15a0 100644 --- a/SOURCES/0009-If-no-NFS-ACLs-provided-assume-everyone.patch +++ b/SOURCES/0009-If-no-NFS-ACLs-provided-assume-everyone.patch @@ -1,7 +1,7 @@ From c1f90914648fc31104ebc535f653c9b70d27fc47 Mon Sep 17 00:00:00 2001 From: BenjiReis Date: Thu, 25 Feb 2021 09:54:52 +0100 -Subject: [PATCH 009/176] If no NFS ACLs provided, assume everyone: +Subject: [PATCH 009/178] 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: "*". diff --git a/SOURCES/0010-Added-SM-Driver-for-MooseFS.patch b/SOURCES/0010-Added-SM-Driver-for-MooseFS.patch index aacd797b..63ead726 100644 --- a/SOURCES/0010-Added-SM-Driver-for-MooseFS.patch +++ b/SOURCES/0010-Added-SM-Driver-for-MooseFS.patch @@ -1,7 +1,7 @@ From 46f4c9f02e0c0bacecf4fba09bdf94a419955d10 Mon Sep 17 00:00:00 2001 From: Aleksander Wieliczko Date: Fri, 29 Jan 2021 15:21:23 +0100 -Subject: [PATCH 010/176] Added SM Driver for MooseFS +Subject: [PATCH 010/178] Added SM Driver for MooseFS Co-authored-by: Piotr Robert Konopelko Signed-off-by: Aleksander Wieliczko diff --git a/SOURCES/0011-Avoid-usage-of-umount-in-ISOSR-when-legacy_mode-is-u.patch b/SOURCES/0011-Avoid-usage-of-umount-in-ISOSR-when-legacy_mode-is-u.patch index ecc92f0a..b5a245fe 100644 --- a/SOURCES/0011-Avoid-usage-of-umount-in-ISOSR-when-legacy_mode-is-u.patch +++ b/SOURCES/0011-Avoid-usage-of-umount-in-ISOSR-when-legacy_mode-is-u.patch @@ -1,7 +1,7 @@ From 78e02205515d1926448d9148e07190278f192fe1 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 2 Dec 2021 09:28:37 +0100 -Subject: [PATCH 011/176] Avoid usage of `umount` in `ISOSR` when `legacy_mode` +Subject: [PATCH 011/178] 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 diff --git a/SOURCES/0012-MooseFS-SR-uses-now-UUID-subdirs-for-each-SR.patch b/SOURCES/0012-MooseFS-SR-uses-now-UUID-subdirs-for-each-SR.patch index d35fd0bf..1ef1122c 100644 --- a/SOURCES/0012-MooseFS-SR-uses-now-UUID-subdirs-for-each-SR.patch +++ b/SOURCES/0012-MooseFS-SR-uses-now-UUID-subdirs-for-each-SR.patch @@ -1,7 +1,7 @@ From 96777e1aebf0b4bf800d71c03a87908282669971 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 18 May 2022 17:28:09 +0200 -Subject: [PATCH 012/176] MooseFS SR uses now UUID subdirs for each SR +Subject: [PATCH 012/178] 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 diff --git a/SOURCES/0013-Fix-is_open-call-for-many-drivers-25.patch b/SOURCES/0013-Fix-is_open-call-for-many-drivers-25.patch index bcfe92e1..c823663c 100644 --- a/SOURCES/0013-Fix-is_open-call-for-many-drivers-25.patch +++ b/SOURCES/0013-Fix-is_open-call-for-many-drivers-25.patch @@ -1,7 +1,7 @@ From ebb716f123eb8b6c4e8b2ff1147926211af183db Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 23 Jun 2022 10:36:36 +0200 -Subject: [PATCH 013/176] Fix is_open call for many drivers (#25) +Subject: [PATCH 013/178] 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. diff --git a/SOURCES/0014-Remove-SR_CACHING-capability-for-many-SR-types-24.patch b/SOURCES/0014-Remove-SR_CACHING-capability-for-many-SR-types-24.patch index 9643877e..644890cc 100644 --- a/SOURCES/0014-Remove-SR_CACHING-capability-for-many-SR-types-24.patch +++ b/SOURCES/0014-Remove-SR_CACHING-capability-for-many-SR-types-24.patch @@ -1,7 +1,7 @@ From 658d391b17fa66a312401e43b22cefb897ea3b57 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 23 Jun 2022 10:37:07 +0200 -Subject: [PATCH 014/176] Remove SR_CACHING capability for many SR types (#24) +Subject: [PATCH 014/178] 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. diff --git a/SOURCES/0015-Remove-SR_PROBE-from-ZFS-capabilities-37.patch b/SOURCES/0015-Remove-SR_PROBE-from-ZFS-capabilities-37.patch index d64a3557..bfd849fa 100644 --- a/SOURCES/0015-Remove-SR_PROBE-from-ZFS-capabilities-37.patch +++ b/SOURCES/0015-Remove-SR_PROBE-from-ZFS-capabilities-37.patch @@ -1,7 +1,7 @@ From 7263d70aa77dbc18b40b000811be3cf01ab8f4ad Mon Sep 17 00:00:00 2001 From: BenjiReis Date: Fri, 4 Aug 2023 12:10:08 +0200 -Subject: [PATCH 015/176] Remove `SR_PROBE` from ZFS capabilities (#37) +Subject: [PATCH 015/178] Remove `SR_PROBE` from ZFS capabilities (#37) The probe method is not implemented so we shouldn't advertise it. diff --git a/SOURCES/0016-Fix-vdi-ref-when-static-vdis-are-used.patch b/SOURCES/0016-Fix-vdi-ref-when-static-vdis-are-used.patch index f518d26a..40e8d09b 100644 --- a/SOURCES/0016-Fix-vdi-ref-when-static-vdis-are-used.patch +++ b/SOURCES/0016-Fix-vdi-ref-when-static-vdis-are-used.patch @@ -1,7 +1,7 @@ From 85c1fa8737facb51f419b0539661f8fffcc36d8d Mon Sep 17 00:00:00 2001 From: Guillaume Date: Wed, 16 Aug 2023 13:42:21 +0200 -Subject: [PATCH 016/176] Fix vdi-ref when static vdis are used +Subject: [PATCH 016/178] 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. diff --git a/SOURCES/0017-Tell-users-not-to-edit-multipath.conf-directly.patch b/SOURCES/0017-Tell-users-not-to-edit-multipath.conf-directly.patch index e69d7e41..d8f404fb 100644 --- a/SOURCES/0017-Tell-users-not-to-edit-multipath.conf-directly.patch +++ b/SOURCES/0017-Tell-users-not-to-edit-multipath.conf-directly.patch @@ -1,7 +1,7 @@ From 0d635eac00e89fcfa16856f53947511f0911e2bc Mon Sep 17 00:00:00 2001 From: Samuel Verschelde Date: Fri, 27 Jan 2023 12:03:15 +0100 -Subject: [PATCH 017/176] Tell users not to edit multipath.conf directly +Subject: [PATCH 017/178] 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 diff --git a/SOURCES/0018-Add-custom.conf-multipath-configuration-file.patch b/SOURCES/0018-Add-custom.conf-multipath-configuration-file.patch index e1a30ce2..359b0ee2 100644 --- a/SOURCES/0018-Add-custom.conf-multipath-configuration-file.patch +++ b/SOURCES/0018-Add-custom.conf-multipath-configuration-file.patch @@ -1,7 +1,7 @@ From 6fc44ae6ca8bf73c576ec9f74b53de0ed51cd5de Mon Sep 17 00:00:00 2001 From: Samuel Verschelde Date: Fri, 27 Jan 2023 12:23:13 +0100 -Subject: [PATCH 018/176] Add custom.conf multipath configuration file +Subject: [PATCH 018/178] 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 diff --git a/SOURCES/0019-Install-etc-multipath-conf.d-custom.conf.patch b/SOURCES/0019-Install-etc-multipath-conf.d-custom.conf.patch index da2e0ed1..d7c071bf 100644 --- a/SOURCES/0019-Install-etc-multipath-conf.d-custom.conf.patch +++ b/SOURCES/0019-Install-etc-multipath-conf.d-custom.conf.patch @@ -1,7 +1,7 @@ From 17129f5341223dae7a0b38516e8b01990b61df1d Mon Sep 17 00:00:00 2001 From: Samuel Verschelde Date: Fri, 25 Aug 2023 17:47:34 +0200 -Subject: [PATCH 019/176] Install /etc/multipath/conf.d/custom.conf +Subject: [PATCH 019/178] Install /etc/multipath/conf.d/custom.conf Update Makefile so that the file is installed along with sm. diff --git a/SOURCES/0020-Backport-NFS4-only-support.patch b/SOURCES/0020-Backport-NFS4-only-support.patch index 00b84c50..c452ea8e 100644 --- a/SOURCES/0020-Backport-NFS4-only-support.patch +++ b/SOURCES/0020-Backport-NFS4-only-support.patch @@ -1,7 +1,7 @@ From 8f5cd11745a54fcfb127a23494a1fc2af5ed723b Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Mon, 18 Dec 2023 10:22:26 +0100 -Subject: [PATCH 020/176] Backport NFS4 only support +Subject: [PATCH 020/178] Backport NFS4 only support See: https://github.com/xapi-project/sm/pull/617 diff --git a/SOURCES/0021-Backport-probe-for-NFS4-when-rpcinfo-does-not-includ.patch b/SOURCES/0021-Backport-probe-for-NFS4-when-rpcinfo-does-not-includ.patch index d26372dd..697cc047 100644 --- a/SOURCES/0021-Backport-probe-for-NFS4-when-rpcinfo-does-not-includ.patch +++ b/SOURCES/0021-Backport-probe-for-NFS4-when-rpcinfo-does-not-includ.patch @@ -1,7 +1,7 @@ From ee88d74e603d364e0fb958ce867dc38ea61281db Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Mon, 18 Dec 2023 10:35:46 +0100 -Subject: [PATCH 021/176] Backport probe for NFS4 when rpcinfo does not include +Subject: [PATCH 021/178] Backport probe for NFS4 when rpcinfo does not include it See: https://github.com/xapi-project/sm/pull/655 diff --git a/SOURCES/0022-feat-LargeBlock-backport-of-largeblocksr-51-55.patch b/SOURCES/0022-feat-LargeBlock-backport-of-largeblocksr-51-55.patch index 2d0e2094..9fdb27b6 100644 --- a/SOURCES/0022-feat-LargeBlock-backport-of-largeblocksr-51-55.patch +++ b/SOURCES/0022-feat-LargeBlock-backport-of-largeblocksr-51-55.patch @@ -1,7 +1,7 @@ From 86d936b5359bfaee5a3d392daed5c9199839901f Mon Sep 17 00:00:00 2001 From: Damien Thenot Date: Tue, 7 May 2024 15:20:22 +0200 -Subject: [PATCH 022/176] feat(LargeBlock): backport of largeblocksr (#51) +Subject: [PATCH 022/178] feat(LargeBlock): backport of largeblocksr (#51) (#55) A SR inheriting from a EXTSR allowing to use a 4KiB blocksize device as diff --git a/SOURCES/0023-feat-LVHDSR-add-a-way-to-modify-config-of-LVMs-56.patch b/SOURCES/0023-feat-LVHDSR-add-a-way-to-modify-config-of-LVMs-56.patch index 19ba4c60..7438e1c2 100644 --- a/SOURCES/0023-feat-LVHDSR-add-a-way-to-modify-config-of-LVMs-56.patch +++ b/SOURCES/0023-feat-LVHDSR-add-a-way-to-modify-config-of-LVMs-56.patch @@ -1,7 +1,7 @@ From 906aede91ac5b450e6e11332ab070d0ec7b71dbb Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 28 May 2024 15:17:21 +0200 -Subject: [PATCH 023/176] feat(LVHDSR): add a way to modify config of LVMs +Subject: [PATCH 023/178] feat(LVHDSR): add a way to modify config of LVMs (#56) With this change the driver supports a "lvm-conf" param on "other-config". diff --git a/SOURCES/0024-Fix-timeout_call-alarm-must-be-reset-in-case-of-succ.patch b/SOURCES/0024-Fix-timeout_call-alarm-must-be-reset-in-case-of-succ.patch index 2b14ac2d..3c50033f 100644 --- a/SOURCES/0024-Fix-timeout_call-alarm-must-be-reset-in-case-of-succ.patch +++ b/SOURCES/0024-Fix-timeout_call-alarm-must-be-reset-in-case-of-succ.patch @@ -1,7 +1,7 @@ From b1bffda87658150032f68a59d90117eb8260ae14 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 16 Feb 2022 18:24:56 +0100 -Subject: [PATCH 024/176] Fix timeout_call: alarm must be reset in case of +Subject: [PATCH 024/178] Fix timeout_call: alarm must be reset in case of success Otherwise the SIGALRM signal can be emitted after the execution diff --git a/SOURCES/0025-timeout_call-returns-the-result-of-user-function-now.patch b/SOURCES/0025-timeout_call-returns-the-result-of-user-function-now.patch index 927b0152..15c91a9e 100644 --- a/SOURCES/0025-timeout_call-returns-the-result-of-user-function-now.patch +++ b/SOURCES/0025-timeout_call-returns-the-result-of-user-function-now.patch @@ -1,7 +1,7 @@ From e4fa58e917a6d5e090778cfd654383e966abfe9e Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 16 Feb 2022 18:28:06 +0100 -Subject: [PATCH 025/176] timeout_call returns the result of user function now +Subject: [PATCH 025/178] timeout_call returns the result of user function now Signed-off-by: Ronan Abhamon --- diff --git a/SOURCES/0026-Always-remove-the-pause-tag-from-VDIs-in-case-of-fai.patch b/SOURCES/0026-Always-remove-the-pause-tag-from-VDIs-in-case-of-fai.patch index 63b1e536..eecb21a0 100644 --- a/SOURCES/0026-Always-remove-the-pause-tag-from-VDIs-in-case-of-fai.patch +++ b/SOURCES/0026-Always-remove-the-pause-tag-from-VDIs-in-case-of-fai.patch @@ -1,7 +1,7 @@ From b32670416ce70d546b3569a6f4cb507c0d3507bf Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 5 Feb 2024 23:16:16 +0100 -Subject: [PATCH 026/176] Always remove the pause tag from VDIs in case of +Subject: [PATCH 026/178] Always remove the pause tag from VDIs in case of failure During VDI activation in the blktap module and in case of failure diff --git a/SOURCES/0027-fix-LinstorSR-repair-volumes-only-if-an-exclusive-co.patch b/SOURCES/0027-fix-LinstorSR-repair-volumes-only-if-an-exclusive-co.patch index 7a5f8aac..5b232993 100644 --- a/SOURCES/0027-fix-LinstorSR-repair-volumes-only-if-an-exclusive-co.patch +++ b/SOURCES/0027-fix-LinstorSR-repair-volumes-only-if-an-exclusive-co.patch @@ -1,7 +1,7 @@ From 56bdcd5312a20c92f5a1683b506ce447fa1914fa Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 20 Nov 2020 16:42:52 +0100 -Subject: [PATCH 027/176] fix(LinstorSR): repair volumes only if an exclusive +Subject: [PATCH 027/178] fix(LinstorSR): repair volumes only if an exclusive command is executed Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0028-feat-LinstorSR-Improve-LINSTOR-performance.patch b/SOURCES/0028-feat-LinstorSR-Improve-LINSTOR-performance.patch index 0cde5794..b42795dd 100644 --- a/SOURCES/0028-feat-LinstorSR-Improve-LINSTOR-performance.patch +++ b/SOURCES/0028-feat-LinstorSR-Improve-LINSTOR-performance.patch @@ -1,7 +1,7 @@ From 7e1008189ee1d49545d65f14bf6bee65cec21d5c Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 10 Dec 2020 17:56:15 +0100 -Subject: [PATCH 028/176] feat(LinstorSR): Improve LINSTOR performance +Subject: [PATCH 028/178] feat(LinstorSR): Improve LINSTOR performance Details: - vdi_attach and vdi_detach are now exclusive diff --git a/SOURCES/0029-feat-LinstorSR-robustify-scan-to-avoid-losing-VDIs-i.patch b/SOURCES/0029-feat-LinstorSR-robustify-scan-to-avoid-losing-VDIs-i.patch index 2426f1cf..f2de3f53 100644 --- a/SOURCES/0029-feat-LinstorSR-robustify-scan-to-avoid-losing-VDIs-i.patch +++ b/SOURCES/0029-feat-LinstorSR-robustify-scan-to-avoid-losing-VDIs-i.patch @@ -1,7 +1,7 @@ From 78f29568ef2faee1f7fd01888169e07336f26f46 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 7 Jan 2021 11:17:08 +0100 -Subject: [PATCH 029/176] feat(LinstorSR): robustify scan to avoid losing VDIs +Subject: [PATCH 029/178] feat(LinstorSR): robustify scan to avoid losing VDIs if function is called outside module Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0030-feat-LinstorSR-display-a-correctly-readable-size-for.patch b/SOURCES/0030-feat-LinstorSR-display-a-correctly-readable-size-for.patch index 57ab42e1..b80fc4f6 100644 --- a/SOURCES/0030-feat-LinstorSR-display-a-correctly-readable-size-for.patch +++ b/SOURCES/0030-feat-LinstorSR-display-a-correctly-readable-size-for.patch @@ -1,7 +1,7 @@ From fe6494d475ef9c2ef612c1273cdf6dc57f1b876a Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 8 Jan 2021 16:12:15 +0100 -Subject: [PATCH 030/176] feat(LinstorSR): display a correctly readable size +Subject: [PATCH 030/178] feat(LinstorSR): display a correctly readable size for the user Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0031-feat-linstor-monitord-scan-all-LINSTOR-SRs-every-12-.patch b/SOURCES/0031-feat-linstor-monitord-scan-all-LINSTOR-SRs-every-12-.patch index 950d9a0b..b644f0a1 100644 --- a/SOURCES/0031-feat-linstor-monitord-scan-all-LINSTOR-SRs-every-12-.patch +++ b/SOURCES/0031-feat-linstor-monitord-scan-all-LINSTOR-SRs-every-12-.patch @@ -1,7 +1,7 @@ From 6b1de43b38cabd9adc9888136c9134e167876c15 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 12 Jan 2021 14:06:34 +0100 -Subject: [PATCH 031/176] feat(linstor-monitord): scan all LINSTOR SRs every 12 +Subject: [PATCH 031/178] feat(linstor-monitord): scan all LINSTOR SRs every 12 minutes to update allocated size stats Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0032-fix-LinstorSR-call-correctly-method-in-_locked_load-.patch b/SOURCES/0032-fix-LinstorSR-call-correctly-method-in-_locked_load-.patch index e34eb278..c4003b23 100644 --- a/SOURCES/0032-fix-LinstorSR-call-correctly-method-in-_locked_load-.patch +++ b/SOURCES/0032-fix-LinstorSR-call-correctly-method-in-_locked_load-.patch @@ -1,7 +1,7 @@ From 6cdc1b2a0b9f5a8ec880800fc4c8ca5244987733 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 15 Jan 2021 17:01:05 +0100 -Subject: [PATCH 032/176] fix(LinstorSR): call correctly method in _locked_load +Subject: [PATCH 032/178] fix(LinstorSR): call correctly method in _locked_load when vdi_attach_from_config is executed Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0033-feat-LinstorSR-integrate-minidrbdcluster-daemon.patch b/SOURCES/0033-feat-LinstorSR-integrate-minidrbdcluster-daemon.patch index fc3264f1..604f9f03 100644 --- a/SOURCES/0033-feat-LinstorSR-integrate-minidrbdcluster-daemon.patch +++ b/SOURCES/0033-feat-LinstorSR-integrate-minidrbdcluster-daemon.patch @@ -1,7 +1,7 @@ From 88914c19b02c38e05fe457e45f1d41431a0bde8b Mon Sep 17 00:00:00 2001 From: Wescoeur Date: Wed, 20 Jan 2021 18:04:26 +0100 -Subject: [PATCH 033/176] feat(LinstorSR): integrate minidrbdcluster daemon +Subject: [PATCH 033/178] feat(LinstorSR): integrate minidrbdcluster daemon Now, we can: - Start a controller on any node diff --git a/SOURCES/0034-feat-LinstorSR-ensure-heartbeat-and-redo_log-VDIs-ar.patch b/SOURCES/0034-feat-LinstorSR-ensure-heartbeat-and-redo_log-VDIs-ar.patch index fb0b8157..a1c3a772 100644 --- a/SOURCES/0034-feat-LinstorSR-ensure-heartbeat-and-redo_log-VDIs-ar.patch +++ b/SOURCES/0034-feat-LinstorSR-ensure-heartbeat-and-redo_log-VDIs-ar.patch @@ -1,7 +1,7 @@ From 6e0d84cf900e9c41cba663093c911fa025debd34 Mon Sep 17 00:00:00 2001 From: Wescoeur Date: Wed, 24 Feb 2021 11:17:23 +0100 -Subject: [PATCH 034/176] feat(LinstorSR): ensure heartbeat and redo_log VDIs +Subject: [PATCH 034/178] feat(LinstorSR): ensure heartbeat and redo_log VDIs are not diskless Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0035-feat-LinstorSR-protect-sr-commands-to-avoid-forgetti.patch b/SOURCES/0035-feat-LinstorSR-protect-sr-commands-to-avoid-forgetti.patch index 5563d786..d37b5f86 100644 --- a/SOURCES/0035-feat-LinstorSR-protect-sr-commands-to-avoid-forgetti.patch +++ b/SOURCES/0035-feat-LinstorSR-protect-sr-commands-to-avoid-forgetti.patch @@ -1,7 +1,7 @@ From 1039b9bb973e2911ae222cd40f4a683bc6fbb83b Mon Sep 17 00:00:00 2001 From: Wescoeur Date: Thu, 25 Feb 2021 17:52:57 +0100 -Subject: [PATCH 035/176] feat(LinstorSR): protect sr commands to avoid +Subject: [PATCH 035/178] feat(LinstorSR): protect sr commands to avoid forgetting LINSTOR volumes when master satellite is down Steps to reproduce: diff --git a/SOURCES/0036-fix-LinstorJournaler-ensure-uri-is-not-None-during-l.patch b/SOURCES/0036-fix-LinstorJournaler-ensure-uri-is-not-None-during-l.patch index a5a353ed..0bcd3803 100644 --- a/SOURCES/0036-fix-LinstorJournaler-ensure-uri-is-not-None-during-l.patch +++ b/SOURCES/0036-fix-LinstorJournaler-ensure-uri-is-not-None-during-l.patch @@ -1,7 +1,7 @@ From b49cf026ac1d098feec5dbc14898285a59c16011 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 8 Mar 2021 13:25:28 +0100 -Subject: [PATCH 036/176] fix(LinstorJournaler): ensure uri is not None during +Subject: [PATCH 036/178] fix(LinstorJournaler): ensure uri is not None during linstor.KV creation Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0037-feat-LinstorSR-add-an-option-to-disable-auto-quorum-.patch b/SOURCES/0037-feat-LinstorSR-add-an-option-to-disable-auto-quorum-.patch index a18d6f48..b7821c4c 100644 --- a/SOURCES/0037-feat-LinstorSR-add-an-option-to-disable-auto-quorum-.patch +++ b/SOURCES/0037-feat-LinstorSR-add-an-option-to-disable-auto-quorum-.patch @@ -1,7 +1,7 @@ From cab8593814b9b741a20d218df673a58d98dc3a79 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 22 Mar 2021 17:32:26 +0100 -Subject: [PATCH 037/176] feat(LinstorSR): add an option to disable auto-quorum +Subject: [PATCH 037/178] feat(LinstorSR): add an option to disable auto-quorum on volume DB + fix doc Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0038-fix-LinstorVolumeManager-add-a-workaround-to-create-.patch b/SOURCES/0038-fix-LinstorVolumeManager-add-a-workaround-to-create-.patch index ab84c7ca..02be14d5 100644 --- a/SOURCES/0038-fix-LinstorVolumeManager-add-a-workaround-to-create-.patch +++ b/SOURCES/0038-fix-LinstorVolumeManager-add-a-workaround-to-create-.patch @@ -1,7 +1,7 @@ From 9e0f7c02ae9c09c9d3be6ab4bcec31325d95e719 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 23 Mar 2021 14:49:39 +0100 -Subject: [PATCH 038/176] fix(LinstorVolumeManager): add a workaround to create +Subject: [PATCH 038/178] fix(LinstorVolumeManager): add a workaround to create properly SR with thin LVM Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0039-feat-LinstorSR-add-optional-ips-parameter.patch b/SOURCES/0039-feat-LinstorSR-add-optional-ips-parameter.patch index 8594ad64..bdc73815 100644 --- a/SOURCES/0039-feat-LinstorSR-add-optional-ips-parameter.patch +++ b/SOURCES/0039-feat-LinstorSR-add-optional-ips-parameter.patch @@ -1,7 +1,7 @@ From 89daa5b5525c2636a624fa4cf583d5b43ca06aad Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 24 Mar 2021 10:06:58 +0100 -Subject: [PATCH 039/176] feat(LinstorSR): add optional ips parameter +Subject: [PATCH 039/178] feat(LinstorSR): add optional ips parameter Signed-off-by: Ronan Abhamon --- diff --git a/SOURCES/0040-feat-LinstorSR-add-a-helper-log_drbd_erofs-to-trace-.patch b/SOURCES/0040-feat-LinstorSR-add-a-helper-log_drbd_erofs-to-trace-.patch index e26cc1bf..5e0bd66b 100644 --- a/SOURCES/0040-feat-LinstorSR-add-a-helper-log_drbd_erofs-to-trace-.patch +++ b/SOURCES/0040-feat-LinstorSR-add-a-helper-log_drbd_erofs-to-trace-.patch @@ -1,7 +1,7 @@ From fbe2c09a13bb93031b43b77a54cdb678e743654a Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 26 Mar 2021 16:13:20 +0100 -Subject: [PATCH 040/176] feat(LinstorSR): add a helper `log_drbd_erofs` to +Subject: [PATCH 040/178] feat(LinstorSR): add a helper `log_drbd_erofs` to trace EROFS errno code with DRBD resources + check EROFS error Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0041-fix-LinstorSR-try-to-restart-the-services-again-if-t.patch b/SOURCES/0041-fix-LinstorSR-try-to-restart-the-services-again-if-t.patch index 862f435e..1664b03e 100644 --- a/SOURCES/0041-fix-LinstorSR-try-to-restart-the-services-again-if-t.patch +++ b/SOURCES/0041-fix-LinstorSR-try-to-restart-the-services-again-if-t.patch @@ -1,7 +1,7 @@ From c651376bea317652fd4e6bc53af741935126dc14 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 28 Apr 2021 15:15:58 +0200 -Subject: [PATCH 041/176] fix(LinstorSR): try to restart the services again if +Subject: [PATCH 041/178] fix(LinstorSR): try to restart the services again if there is a failure in linstor-manager Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0042-fix-LinstorSR-robustify-linstor-manager-to-never-inc.patch b/SOURCES/0042-fix-LinstorSR-robustify-linstor-manager-to-never-inc.patch index 8c25aebb..b53f2576 100644 --- a/SOURCES/0042-fix-LinstorSR-robustify-linstor-manager-to-never-inc.patch +++ b/SOURCES/0042-fix-LinstorSR-robustify-linstor-manager-to-never-inc.patch @@ -1,7 +1,7 @@ From 54f90dbbb0433346a2ce8bf2563ab24277085011 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 26 Aug 2021 15:26:11 +0200 -Subject: [PATCH 042/176] fix(LinstorSR): robustify linstor-manager to never +Subject: [PATCH 042/178] fix(LinstorSR): robustify linstor-manager to never include from plugins path Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0043-fix-LinstorSR-prevent-starting-controller-during-fai.patch b/SOURCES/0043-fix-LinstorSR-prevent-starting-controller-during-fai.patch index 49214fe7..fc1f3d7f 100644 --- a/SOURCES/0043-fix-LinstorSR-prevent-starting-controller-during-fai.patch +++ b/SOURCES/0043-fix-LinstorSR-prevent-starting-controller-during-fai.patch @@ -1,7 +1,7 @@ From 1f8ccb5783db73c690eb900d43ee79fccd0776ba Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 26 Aug 2021 16:52:01 +0200 -Subject: [PATCH 043/176] fix(LinstorSR): prevent starting controller during +Subject: [PATCH 043/178] fix(LinstorSR): prevent starting controller during fail in linstor manager destroy method Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0044-feat-LinstorVolumeManager-increase-peer-slots-limit-.patch b/SOURCES/0044-feat-LinstorVolumeManager-increase-peer-slots-limit-.patch index 821cf34f..1306e8d8 100644 --- a/SOURCES/0044-feat-LinstorVolumeManager-increase-peer-slots-limit-.patch +++ b/SOURCES/0044-feat-LinstorVolumeManager-increase-peer-slots-limit-.patch @@ -1,7 +1,7 @@ From 8284e3d6bac01e92fe0fd1f3594ae34b60749ee0 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 19 Oct 2021 14:48:17 +0200 -Subject: [PATCH 044/176] feat(LinstorVolumeManager): increase peer slots limit +Subject: [PATCH 044/178] feat(LinstorVolumeManager): increase peer slots limit (support 31 connections to a DRBD) - Also, create diskless devices when db is created diff --git a/SOURCES/0045-feat-LinstorVolumeManager-add-a-fallback-to-find-con.patch b/SOURCES/0045-feat-LinstorVolumeManager-add-a-fallback-to-find-con.patch index 55e5b9c9..fa48e348 100644 --- a/SOURCES/0045-feat-LinstorVolumeManager-add-a-fallback-to-find-con.patch +++ b/SOURCES/0045-feat-LinstorVolumeManager-add-a-fallback-to-find-con.patch @@ -1,7 +1,7 @@ From c12c3f0de5c9fc0c9330263a452509697e86ec6e Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 20 Oct 2021 14:33:04 +0200 -Subject: [PATCH 045/176] feat(LinstorVolumeManager): add a fallback to find +Subject: [PATCH 045/178] feat(LinstorVolumeManager): add a fallback to find controller uri (when len(hosts) >= 4) Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0046-fix-var-lib-linstor.mount-ensure-we-always-mount-dat.patch b/SOURCES/0046-fix-var-lib-linstor.mount-ensure-we-always-mount-dat.patch index 84ec183c..72aa4cd2 100644 --- a/SOURCES/0046-fix-var-lib-linstor.mount-ensure-we-always-mount-dat.patch +++ b/SOURCES/0046-fix-var-lib-linstor.mount-ensure-we-always-mount-dat.patch @@ -1,7 +1,7 @@ From c532e3550512008db3ba7fd5dcb1367d18d73578 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 21 Oct 2021 11:13:07 +0200 -Subject: [PATCH 046/176] fix(var-lib-linstor.mount): ensure we always mount +Subject: [PATCH 046/178] fix(var-lib-linstor.mount): ensure we always mount database with RW flags Sometimes systemd fallback to read only FS if the volume can't be mounted, we must diff --git a/SOURCES/0047-feat-LinstorVolumeManager-add-a-fallback-to-find-nod.patch b/SOURCES/0047-feat-LinstorVolumeManager-add-a-fallback-to-find-nod.patch index 4e10747a..328595b7 100644 --- a/SOURCES/0047-feat-LinstorVolumeManager-add-a-fallback-to-find-nod.patch +++ b/SOURCES/0047-feat-LinstorVolumeManager-add-a-fallback-to-find-nod.patch @@ -1,7 +1,7 @@ From a7aeadb712732b37f7dc8857d3999bfc01751308 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 21 Oct 2021 11:51:32 +0200 -Subject: [PATCH 047/176] feat(LinstorVolumeManager): add a fallback to find +Subject: [PATCH 047/178] feat(LinstorVolumeManager): add a fallback to find node name (when len(hosts) >= 4) Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0048-feat-LinstorSR-explain-on-which-host-plugins-command.patch b/SOURCES/0048-feat-LinstorSR-explain-on-which-host-plugins-command.patch index bf4b130f..62513821 100644 --- a/SOURCES/0048-feat-LinstorSR-explain-on-which-host-plugins-command.patch +++ b/SOURCES/0048-feat-LinstorSR-explain-on-which-host-plugins-command.patch @@ -1,7 +1,7 @@ From 7747dc7656e0291ac3233d74157d7703671b0b06 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 26 Oct 2021 10:44:00 +0200 -Subject: [PATCH 048/176] feat(LinstorSR): explain on which host, plugins +Subject: [PATCH 048/178] feat(LinstorSR): explain on which host, plugins commands are executed Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0049-fix-LinstorSR-create-diskless-path-if-necessary-duri.patch b/SOURCES/0049-fix-LinstorSR-create-diskless-path-if-necessary-duri.patch index 18a82c41..1e9d4df3 100644 --- a/SOURCES/0049-fix-LinstorSR-create-diskless-path-if-necessary-duri.patch +++ b/SOURCES/0049-fix-LinstorSR-create-diskless-path-if-necessary-duri.patch @@ -1,7 +1,7 @@ From 0f3667547a0b1c68a96ff12e49dc2fa8edc52da7 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 3 Nov 2021 14:59:31 +0100 -Subject: [PATCH 049/176] fix(LinstorSR): create diskless path if necessary +Subject: [PATCH 049/178] fix(LinstorSR): create diskless path if necessary during VDI loading Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0050-feat-LinstorSR-use-HTTP-NBD-instead-of-DRBD-directly.patch b/SOURCES/0050-feat-LinstorSR-use-HTTP-NBD-instead-of-DRBD-directly.patch index 3e565999..94295b99 100644 --- a/SOURCES/0050-feat-LinstorSR-use-HTTP-NBD-instead-of-DRBD-directly.patch +++ b/SOURCES/0050-feat-LinstorSR-use-HTTP-NBD-instead-of-DRBD-directly.patch @@ -1,7 +1,7 @@ From d0c2d229c7119e53f1675388c6f2d07afdcafb45 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 12 May 2022 17:52:35 +0200 -Subject: [PATCH 050/176] feat(LinstorSR): use HTTP/NBD instead of DRBD +Subject: [PATCH 050/178] feat(LinstorSR): use HTTP/NBD instead of DRBD directly with heartbeat VDI Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0051-fix-LinstorSR-find-controller-when-XAPI-unreachable-.patch b/SOURCES/0051-fix-LinstorSR-find-controller-when-XAPI-unreachable-.patch index 54dda941..22c8143b 100644 --- a/SOURCES/0051-fix-LinstorSR-find-controller-when-XAPI-unreachable-.patch +++ b/SOURCES/0051-fix-LinstorSR-find-controller-when-XAPI-unreachable-.patch @@ -1,7 +1,7 @@ From 8ae218c2942ac22a017a9cc880ab631f5aa69c36 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 3 Mar 2022 15:02:17 +0100 -Subject: [PATCH 051/176] fix(LinstorSR): find controller when XAPI unreachable +Subject: [PATCH 051/178] fix(LinstorSR): find controller when XAPI unreachable (XHA) Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0052-fix-LinstorSR-use-IPs-instead-of-hostnames-in-NBD-se.patch b/SOURCES/0052-fix-LinstorSR-use-IPs-instead-of-hostnames-in-NBD-se.patch index f7074358..0e3d0fdc 100644 --- a/SOURCES/0052-fix-LinstorSR-use-IPs-instead-of-hostnames-in-NBD-se.patch +++ b/SOURCES/0052-fix-LinstorSR-use-IPs-instead-of-hostnames-in-NBD-se.patch @@ -1,7 +1,7 @@ From db8a2032a451a16d6bb7a7cadd6fbc8ce4795443 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 24 Mar 2022 18:13:46 +0100 -Subject: [PATCH 052/176] fix(LinstorSR): use IPs instead of hostnames in NBD +Subject: [PATCH 052/178] fix(LinstorSR): use IPs instead of hostnames in NBD server Without this patch we can't use XCP-ng hosts configured with static IPS. diff --git a/SOURCES/0053-fix-LinstorVolumeManager-ensure-we-always-use-IPs-in.patch b/SOURCES/0053-fix-LinstorVolumeManager-ensure-we-always-use-IPs-in.patch index 09fa33d6..45dc54f2 100644 --- a/SOURCES/0053-fix-LinstorVolumeManager-ensure-we-always-use-IPs-in.patch +++ b/SOURCES/0053-fix-LinstorVolumeManager-ensure-we-always-use-IPs-in.patch @@ -1,7 +1,7 @@ From e7ecc4da932107ccc26ec88b0dd37818222c6852 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 31 Mar 2022 11:21:19 +0200 -Subject: [PATCH 053/176] fix(LinstorVolumeManager): ensure we always use IPs +Subject: [PATCH 053/178] fix(LinstorVolumeManager): ensure we always use IPs in _get_controller_uri Otherwise if a hostname is returned, we can't use it if the XCP-ng pool diff --git a/SOURCES/0054-feat-linstor-manager-add-methods-to-add-remove-host-.patch b/SOURCES/0054-feat-linstor-manager-add-methods-to-add-remove-host-.patch index 27e0f763..bd9798ac 100644 --- a/SOURCES/0054-feat-linstor-manager-add-methods-to-add-remove-host-.patch +++ b/SOURCES/0054-feat-linstor-manager-add-methods-to-add-remove-host-.patch @@ -1,7 +1,7 @@ From cf24400a72eca939c89f7896fe4235adab492b88 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 6 Apr 2022 17:53:02 +0200 -Subject: [PATCH 054/176] feat(linstor-manager): add methods to add remove/host +Subject: [PATCH 054/178] feat(linstor-manager): add methods to add remove/host from LINSTOR SR Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0055-feat-LinstorVolumeManager-support-SR-creation-with-d.patch b/SOURCES/0055-feat-LinstorVolumeManager-support-SR-creation-with-d.patch index 522e80fb..01157232 100644 --- a/SOURCES/0055-feat-LinstorVolumeManager-support-SR-creation-with-d.patch +++ b/SOURCES/0055-feat-LinstorVolumeManager-support-SR-creation-with-d.patch @@ -1,7 +1,7 @@ From 737bf6cafdcabf0e4e675e6440488a13df703f51 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 13 Apr 2022 15:56:42 +0200 -Subject: [PATCH 055/176] feat(LinstorVolumeManager): support SR creation with +Subject: [PATCH 055/178] feat(LinstorVolumeManager): support SR creation with diskless nodes Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0056-feat-LinstorSR-add-a-config-var-to-disable-HTTP-NBD-.patch b/SOURCES/0056-feat-LinstorSR-add-a-config-var-to-disable-HTTP-NBD-.patch index 668833e4..8aea78b4 100644 --- a/SOURCES/0056-feat-LinstorSR-add-a-config-var-to-disable-HTTP-NBD-.patch +++ b/SOURCES/0056-feat-LinstorSR-add-a-config-var-to-disable-HTTP-NBD-.patch @@ -1,7 +1,7 @@ From 8a4e120a3b9c03b8f44ebc5bc28c774e1fb13fea Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 14 Apr 2022 10:30:23 +0200 -Subject: [PATCH 056/176] feat(LinstorSR): add a config var to disable HTTP/NBD +Subject: [PATCH 056/178] feat(LinstorSR): add a config var to disable HTTP/NBD servers Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0057-feat-LinstorSr-ensure-LVM-group-is-activated-during-.patch b/SOURCES/0057-feat-LinstorSr-ensure-LVM-group-is-activated-during-.patch index f53638d4..553c0a44 100644 --- a/SOURCES/0057-feat-LinstorSr-ensure-LVM-group-is-activated-during-.patch +++ b/SOURCES/0057-feat-LinstorSr-ensure-LVM-group-is-activated-during-.patch @@ -1,7 +1,7 @@ From 68128105b3464925de8959b6b57c436f7fafd2c7 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 14 Apr 2022 15:45:20 +0200 -Subject: [PATCH 057/176] feat(LinstorSr): ensure LVM group is activated during +Subject: [PATCH 057/178] feat(LinstorSr): ensure LVM group is activated during SR.attach/create Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0058-feat-linstor-manager-add-method-to-create-LinstorSR-.patch b/SOURCES/0058-feat-linstor-manager-add-method-to-create-LinstorSR-.patch index 91a732b9..478f5ac9 100644 --- a/SOURCES/0058-feat-linstor-manager-add-method-to-create-LinstorSR-.patch +++ b/SOURCES/0058-feat-linstor-manager-add-method-to-create-LinstorSR-.patch @@ -1,7 +1,7 @@ From b2e5c8fe9e77c7691f65af4b5d90cc4359064254 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 25 Apr 2022 14:47:51 +0200 -Subject: [PATCH 058/176] feat(linstor-manager): add method to create LinstorSR +Subject: [PATCH 058/178] feat(linstor-manager): add method to create LinstorSR + to list/destroy DRBD volumes Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0059-fix-LinstorSR-always-set-vdi_path-in-generate_config.patch b/SOURCES/0059-fix-LinstorSR-always-set-vdi_path-in-generate_config.patch index 772941cf..6fdf2046 100644 --- a/SOURCES/0059-fix-LinstorSR-always-set-vdi_path-in-generate_config.patch +++ b/SOURCES/0059-fix-LinstorSR-always-set-vdi_path-in-generate_config.patch @@ -1,7 +1,7 @@ From 14e0b3c2bc3cbfccfa8356a953c51f38b20feb41 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 26 Apr 2022 11:20:08 +0200 -Subject: [PATCH 059/176] fix(LinstorSR): always set vdi_path in +Subject: [PATCH 059/178] fix(LinstorSR): always set vdi_path in generate_config If the volume of a generated config is not related to HTTP/NBD diff --git a/SOURCES/0060-fix-minidrbdcluster-supports-new-properties-like-for.patch b/SOURCES/0060-fix-minidrbdcluster-supports-new-properties-like-for.patch index 51a6b73e..e8610274 100644 --- a/SOURCES/0060-fix-minidrbdcluster-supports-new-properties-like-for.patch +++ b/SOURCES/0060-fix-minidrbdcluster-supports-new-properties-like-for.patch @@ -1,7 +1,7 @@ From 5ecce33563f1c19c3ac9b61b3a6656594e96dfee Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 13 May 2022 14:35:57 +0200 -Subject: [PATCH 060/176] fix(minidrbdcluster): supports new properties like +Subject: [PATCH 060/178] fix(minidrbdcluster): supports new properties like `force-io-failures` Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0061-fix-LinstorSR-enabled-disable-minidrbcluster-with-fi.patch b/SOURCES/0061-fix-LinstorSR-enabled-disable-minidrbcluster-with-fi.patch index 165f979d..d67cdc2b 100644 --- a/SOURCES/0061-fix-LinstorSR-enabled-disable-minidrbcluster-with-fi.patch +++ b/SOURCES/0061-fix-LinstorSR-enabled-disable-minidrbcluster-with-fi.patch @@ -1,7 +1,7 @@ From 4d0a06570aced0a760f9dfdceec64fe5db257cd6 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 18 May 2022 17:28:33 +0200 -Subject: [PATCH 061/176] fix(LinstorSR): enabled/disable minidrbcluster with +Subject: [PATCH 061/178] fix(LinstorSR): enabled/disable minidrbcluster with fixed order Ensure we disable minidrbdcluster during SR destruction on all hosts diff --git a/SOURCES/0062-fix-linstor-manager-change-linstor-satellite-start-b.patch b/SOURCES/0062-fix-linstor-manager-change-linstor-satellite-start-b.patch index 921cd2ea..e42f1f48 100644 --- a/SOURCES/0062-fix-linstor-manager-change-linstor-satellite-start-b.patch +++ b/SOURCES/0062-fix-linstor-manager-change-linstor-satellite-start-b.patch @@ -1,7 +1,7 @@ From 94412eef0fcaf1b5ac5d0367e25b7ce54b33845c Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 31 May 2022 14:01:45 +0200 -Subject: [PATCH 062/176] fix(linstor-manager): change linstor satellite start +Subject: [PATCH 062/178] fix(linstor-manager): change linstor satellite start behavior Ensure we don't have an invalid cache used by a satellite: diff --git a/SOURCES/0063-Fix-is_open-call-for-LinstorSR.patch b/SOURCES/0063-Fix-is_open-call-for-LinstorSR.patch index 0ac35bf6..62df6549 100644 --- a/SOURCES/0063-Fix-is_open-call-for-LinstorSR.patch +++ b/SOURCES/0063-Fix-is_open-call-for-LinstorSR.patch @@ -1,7 +1,7 @@ From 85411fa09ac82dcafe0ad600fcbfaa92d10380c5 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 2 Jun 2022 09:04:28 +0200 -Subject: [PATCH 063/176] Fix is_open call for LinstorSR +Subject: [PATCH 063/178] Fix is_open call for LinstorSR 1. Ensure LinstorSR driver is imported in `_is_open` definition to register it in the driver list. Otherwise this function always fails with a SRUnknownType exception. diff --git a/SOURCES/0064-fix-linstorvhdutil-fix-boolean-params-of-check-call.patch b/SOURCES/0064-fix-linstorvhdutil-fix-boolean-params-of-check-call.patch index 53c5a6ab..a9e55866 100644 --- a/SOURCES/0064-fix-linstorvhdutil-fix-boolean-params-of-check-call.patch +++ b/SOURCES/0064-fix-linstorvhdutil-fix-boolean-params-of-check-call.patch @@ -1,7 +1,7 @@ From 6006799b8f99c1b0bcd303543145ea602196f55a Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 2 Jun 2022 09:28:32 +0200 -Subject: [PATCH 064/176] fix(linstorvhdutil): fix boolean params of `check` +Subject: [PATCH 064/178] fix(linstorvhdutil): fix boolean params of `check` call `ignoreMissingFooter` and `fast` must be string types to be used with XAPI plugin API. diff --git a/SOURCES/0065-feat-linstor-manager-robustify-exec_create_sr.patch b/SOURCES/0065-feat-linstor-manager-robustify-exec_create_sr.patch index 8866763c..351aab2c 100644 --- a/SOURCES/0065-feat-linstor-manager-robustify-exec_create_sr.patch +++ b/SOURCES/0065-feat-linstor-manager-robustify-exec_create_sr.patch @@ -1,7 +1,7 @@ From 04e8aff781147e433b56f68626e60a48daa48d8d Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 30 Jun 2022 17:09:51 +0200 -Subject: [PATCH 065/176] feat(linstor-manager): robustify exec_create_sr +Subject: [PATCH 065/178] feat(linstor-manager): robustify exec_create_sr - Use lvm.py XCP-ng xapi plugins instead of lvm (old name) - Check arguments to create the SR diff --git a/SOURCES/0066-fix-cleanup-print-LINSTOR-VDI-UUID-if-error-during-i.patch b/SOURCES/0066-fix-cleanup-print-LINSTOR-VDI-UUID-if-error-during-i.patch index fe1ebe7b..229ab9ca 100644 --- a/SOURCES/0066-fix-cleanup-print-LINSTOR-VDI-UUID-if-error-during-i.patch +++ b/SOURCES/0066-fix-cleanup-print-LINSTOR-VDI-UUID-if-error-during-i.patch @@ -1,7 +1,7 @@ From a410c0926c90f086dfd75c8f0800f8340bd17b6c Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 8 Jul 2022 14:52:25 +0200 -Subject: [PATCH 066/176] fix(cleanup): print LINSTOR VDI UUID if error during +Subject: [PATCH 066/178] fix(cleanup): print LINSTOR VDI UUID if error during info loading (not SR UUID) Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0067-feat-cleanup-raise-and-dump-DRBD-openers-in-case-of-.patch b/SOURCES/0067-feat-cleanup-raise-and-dump-DRBD-openers-in-case-of-.patch index e8338cb1..d3e40ab6 100644 --- a/SOURCES/0067-feat-cleanup-raise-and-dump-DRBD-openers-in-case-of-.patch +++ b/SOURCES/0067-feat-cleanup-raise-and-dump-DRBD-openers-in-case-of-.patch @@ -1,7 +1,7 @@ From 863142f5c55a0aa0d6c2a9d4f3df8b22d72ae830 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 21 Jul 2022 11:39:20 +0200 -Subject: [PATCH 067/176] feat(cleanup): raise and dump DRBD openers in case of +Subject: [PATCH 067/178] feat(cleanup): raise and dump DRBD openers in case of bad coalesce Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0068-feat-linstorvhdutil-trace-DRBD-openers-in-case-of-ER.patch b/SOURCES/0068-feat-linstorvhdutil-trace-DRBD-openers-in-case-of-ER.patch index b4063dca..d0777784 100644 --- a/SOURCES/0068-feat-linstorvhdutil-trace-DRBD-openers-in-case-of-ER.patch +++ b/SOURCES/0068-feat-linstorvhdutil-trace-DRBD-openers-in-case-of-ER.patch @@ -1,7 +1,7 @@ From 0e339b0d445c78b6c7f5497d8ed1d3aefab91ff1 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 22 Jul 2022 10:26:20 +0200 -Subject: [PATCH 068/176] feat(linstorvhdutil): trace DRBD openers in case of +Subject: [PATCH 068/178] feat(linstorvhdutil): trace DRBD openers in case of EROFS errors Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0069-fix-linstorvolumemanager-compute-correctly-size-in-a.patch b/SOURCES/0069-fix-linstorvolumemanager-compute-correctly-size-in-a.patch index 48a2ddcb..497d07f2 100644 --- a/SOURCES/0069-fix-linstorvolumemanager-compute-correctly-size-in-a.patch +++ b/SOURCES/0069-fix-linstorvolumemanager-compute-correctly-size-in-a.patch @@ -1,7 +1,7 @@ From 68aacc7508fac8113652c6670d2ac5f2ea936a70 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 29 Jul 2022 17:25:48 +0200 -Subject: [PATCH 069/176] fix(linstorvolumemanager): compute correctly size in +Subject: [PATCH 069/178] fix(linstorvolumemanager): compute correctly size in allocated_volume_size Remove replication count in computation. diff --git a/SOURCES/0070-feat-LinstorSR-use-DRBD-openers-instead-of-lsof-to-l.patch b/SOURCES/0070-feat-LinstorSR-use-DRBD-openers-instead-of-lsof-to-l.patch index 2de0c618..0741ffc1 100644 --- a/SOURCES/0070-feat-LinstorSR-use-DRBD-openers-instead-of-lsof-to-l.patch +++ b/SOURCES/0070-feat-LinstorSR-use-DRBD-openers-instead-of-lsof-to-l.patch @@ -1,7 +1,7 @@ From 18ac9ddc0672f43c3139baa13a4f761b7876589c Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 9 Aug 2022 11:07:57 +0200 -Subject: [PATCH 070/176] feat(LinstorSR): use DRBD openers instead of lsof to +Subject: [PATCH 070/178] feat(LinstorSR): use DRBD openers instead of lsof to log in blktap2 Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0071-feat-LinstorSR-support-cProfile-to-trace-calls-when-.patch b/SOURCES/0071-feat-LinstorSR-support-cProfile-to-trace-calls-when-.patch index 467b6c09..c3a1cc30 100644 --- a/SOURCES/0071-feat-LinstorSR-support-cProfile-to-trace-calls-when-.patch +++ b/SOURCES/0071-feat-LinstorSR-support-cProfile-to-trace-calls-when-.patch @@ -1,7 +1,7 @@ From 3f729f3f7dde9406ef215145a4f6eefa81aae1f8 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 25 Aug 2022 12:11:18 +0200 -Subject: [PATCH 071/176] feat(LinstorSR): support cProfile to trace calls when +Subject: [PATCH 071/178] feat(LinstorSR): support cProfile to trace calls when a command is executed Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0072-fix-LinstorJournaler-reset-namespace-when-get-is-cal.patch b/SOURCES/0072-fix-LinstorJournaler-reset-namespace-when-get-is-cal.patch index 240e18ce..4fba9a40 100644 --- a/SOURCES/0072-fix-LinstorJournaler-reset-namespace-when-get-is-cal.patch +++ b/SOURCES/0072-fix-LinstorJournaler-reset-namespace-when-get-is-cal.patch @@ -1,7 +1,7 @@ From 59692503da25a54c146930e8d4d89b9630aedaa2 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 24 Aug 2022 17:09:11 +0200 -Subject: [PATCH 072/176] fix(LinstorJournaler): reset namespace when `get` is +Subject: [PATCH 072/178] fix(LinstorJournaler): reset namespace when `get` is called Otherwise, we can be in the wrong namespace and the key to find will be inaccessible. diff --git a/SOURCES/0073-fix-linstorvhdutil-fix-coalesce-with-VM-running-unde.patch b/SOURCES/0073-fix-linstorvhdutil-fix-coalesce-with-VM-running-unde.patch index 092b11ec..8eb5817b 100644 --- a/SOURCES/0073-fix-linstorvhdutil-fix-coalesce-with-VM-running-unde.patch +++ b/SOURCES/0073-fix-linstorvhdutil-fix-coalesce-with-VM-running-unde.patch @@ -1,7 +1,7 @@ From bcfea8f64f43e8f8d074df3c191227d8410b0402 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 25 Aug 2022 10:54:56 +0200 -Subject: [PATCH 073/176] fix(linstorvhdutil): fix coalesce with VM running +Subject: [PATCH 073/178] fix(linstorvhdutil): fix coalesce with VM running under specific scenario: When a VM is running, we can't coalesce without this patch with a long chain diff --git a/SOURCES/0074-fix-linstorvolumemanager-_get_volumes_info-doesn-t-r.patch b/SOURCES/0074-fix-linstorvolumemanager-_get_volumes_info-doesn-t-r.patch index 38cb754f..761f5530 100644 --- a/SOURCES/0074-fix-linstorvolumemanager-_get_volumes_info-doesn-t-r.patch +++ b/SOURCES/0074-fix-linstorvolumemanager-_get_volumes_info-doesn-t-r.patch @@ -1,7 +1,7 @@ From e98d435ba2b95672803cd15c5ba6cd89209743d0 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 5 Sep 2022 15:09:17 +0200 -Subject: [PATCH 074/176] fix(linstorvolumemanager): `_get_volumes_info` +Subject: [PATCH 074/178] fix(linstorvolumemanager): `_get_volumes_info` doesn't raise with offline host Ensure this method doesn't raise an exception when a host is offline. diff --git a/SOURCES/0075-fix-linstorvolumemanager-remove-double-prefix-on-kv-.patch b/SOURCES/0075-fix-linstorvolumemanager-remove-double-prefix-on-kv-.patch index 8246f81f..72f6b15d 100644 --- a/SOURCES/0075-fix-linstorvolumemanager-remove-double-prefix-on-kv-.patch +++ b/SOURCES/0075-fix-linstorvolumemanager-remove-double-prefix-on-kv-.patch @@ -1,7 +1,7 @@ From 462cc34d48bfafc96dd042ae7ee97c5801b436a5 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 12 Sep 2022 15:56:09 +0200 -Subject: [PATCH 075/176] fix(linstorvolumemanager): remove double prefix on kv +Subject: [PATCH 075/178] fix(linstorvolumemanager): remove double prefix on kv group name - Before this patch, when the kv store was created/accessed, a double "xcp-sr-" prefix was used. diff --git a/SOURCES/0076-feat-LinstorSR-add-linstor-kv-dump-helper-to-print-k.patch b/SOURCES/0076-feat-LinstorSR-add-linstor-kv-dump-helper-to-print-k.patch index ad48290d..feec22b2 100644 --- a/SOURCES/0076-feat-LinstorSR-add-linstor-kv-dump-helper-to-print-k.patch +++ b/SOURCES/0076-feat-LinstorSR-add-linstor-kv-dump-helper-to-print-k.patch @@ -1,7 +1,7 @@ From f0413a9d9d7616aac2fe7394cdb0dc50fdaeb835 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 12 Sep 2022 17:54:57 +0200 -Subject: [PATCH 076/176] feat(LinstorSR): add linstor-kv-dump helper to print +Subject: [PATCH 076/178] feat(LinstorSR): add linstor-kv-dump helper to print kv store Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0077-fix-LinstorSR-disable-VHD-key-hash-usage-to-limit-ex.patch b/SOURCES/0077-fix-LinstorSR-disable-VHD-key-hash-usage-to-limit-ex.patch index 091fbd0c..d2ee2bad 100644 --- a/SOURCES/0077-fix-LinstorSR-disable-VHD-key-hash-usage-to-limit-ex.patch +++ b/SOURCES/0077-fix-LinstorSR-disable-VHD-key-hash-usage-to-limit-ex.patch @@ -1,7 +1,7 @@ From bb7d53d85fd4a28470d48b6bb1e2d75d23b73389 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 14 Sep 2022 10:17:18 +0200 -Subject: [PATCH 077/176] fix(LinstorSR): disable VHD key hash usage to limit +Subject: [PATCH 077/178] fix(LinstorSR): disable VHD key hash usage to limit exec time Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0078-fix-minidrbdcluster-ensure-SIGINT-is-handled-correct.patch b/SOURCES/0078-fix-minidrbdcluster-ensure-SIGINT-is-handled-correct.patch index 5d558e00..c6d31122 100644 --- a/SOURCES/0078-fix-minidrbdcluster-ensure-SIGINT-is-handled-correct.patch +++ b/SOURCES/0078-fix-minidrbdcluster-ensure-SIGINT-is-handled-correct.patch @@ -1,7 +1,7 @@ From 189b17a606d3f35bcc8bb8bf77f6e2ef71208a11 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 15 Sep 2022 11:34:25 +0200 -Subject: [PATCH 078/176] fix(minidrbdcluster): ensure SIGINT is handled +Subject: [PATCH 078/178] fix(minidrbdcluster): ensure SIGINT is handled correctly This patch is here to make sure no LINSTOR controller survives when diff --git a/SOURCES/0079-feat-minidrbdcluster-stop-resource-services-at-start.patch b/SOURCES/0079-feat-minidrbdcluster-stop-resource-services-at-start.patch index 4fbf24a2..c1b1c6d6 100644 --- a/SOURCES/0079-feat-minidrbdcluster-stop-resource-services-at-start.patch +++ b/SOURCES/0079-feat-minidrbdcluster-stop-resource-services-at-start.patch @@ -1,7 +1,7 @@ From 53dec398287a12e016abbe243311479f6a0d3efe Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 15 Sep 2022 11:49:34 +0200 -Subject: [PATCH 079/176] feat(minidrbdcluster): stop resource services at +Subject: [PATCH 079/178] feat(minidrbdcluster): stop resource services at startup - Ensure all services are stopped when minidrbcluster is started. diff --git a/SOURCES/0080-feat-linstor-manager-add-new-healthCheck-function-to.patch b/SOURCES/0080-feat-linstor-manager-add-new-healthCheck-function-to.patch index e61cf241..871763bf 100644 --- a/SOURCES/0080-feat-linstor-manager-add-new-healthCheck-function-to.patch +++ b/SOURCES/0080-feat-linstor-manager-add-new-healthCheck-function-to.patch @@ -1,7 +1,7 @@ From efa609510d724b3aacfe144517ad34fa2b854b8d Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 23 Sep 2022 17:45:08 +0200 -Subject: [PATCH 080/176] feat(linstor-manager): add new `healthCheck` function +Subject: [PATCH 080/178] feat(linstor-manager): add new `healthCheck` function to monitor pool (#26) Print a JSON output to monitor state of LINSTOR SRs: diff --git a/SOURCES/0081-fix-LinstorSR-fix-xha-conf-parsing-return-host-ip-no.patch b/SOURCES/0081-fix-LinstorSR-fix-xha-conf-parsing-return-host-ip-no.patch index 81e6bcde..8a5ed748 100644 --- a/SOURCES/0081-fix-LinstorSR-fix-xha-conf-parsing-return-host-ip-no.patch +++ b/SOURCES/0081-fix-LinstorSR-fix-xha-conf-parsing-return-host-ip-no.patch @@ -1,7 +1,7 @@ From b477bf0c0779fbbf5cd600029a9b7bf6b73520a9 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 4 Oct 2022 11:01:33 +0200 -Subject: [PATCH 081/176] fix(LinstorSR): fix xha conf parsing => return host +Subject: [PATCH 081/178] fix(LinstorSR): fix xha conf parsing => return host ip, not the UUID Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0082-fix-LinstorSR-start-correctly-HA-servers-HTTP-NBD-af.patch b/SOURCES/0082-fix-LinstorSR-start-correctly-HA-servers-HTTP-NBD-af.patch index ca6278aa..71f058c8 100644 --- a/SOURCES/0082-fix-LinstorSR-start-correctly-HA-servers-HTTP-NBD-af.patch +++ b/SOURCES/0082-fix-LinstorSR-start-correctly-HA-servers-HTTP-NBD-af.patch @@ -1,7 +1,7 @@ From 9869614ead6245808ca8f0763a07a00ebe3ac6b8 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 4 Oct 2022 18:48:09 +0200 -Subject: [PATCH 082/176] fix(LinstorSR): start correctly HA servers (HTTP/NBD) +Subject: [PATCH 082/178] fix(LinstorSR): start correctly HA servers (HTTP/NBD) after reboot Use a timeout call after a reboot to get a XAPI session because diff --git a/SOURCES/0083-fix-linstorvolumemanager-use-an-array-to-store-diskf.patch b/SOURCES/0083-fix-linstorvolumemanager-use-an-array-to-store-diskf.patch index cb5fa0a3..e884ca5e 100644 --- a/SOURCES/0083-fix-linstorvolumemanager-use-an-array-to-store-diskf.patch +++ b/SOURCES/0083-fix-linstorvolumemanager-use-an-array-to-store-diskf.patch @@ -1,7 +1,7 @@ From 03c55a736769042775bd8da2ebc71377c04050a6 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 5 Oct 2022 10:45:50 +0200 -Subject: [PATCH 083/176] fix(linstorvolumemanager): use an array to store +Subject: [PATCH 083/178] fix(linstorvolumemanager): use an array to store diskful volumes info Otherwise the `is_diskful` attr only reflects the info of one host diff --git a/SOURCES/0084-feat-linstorvolumemanager-support-snaps-when-a-host-.patch b/SOURCES/0084-feat-linstorvolumemanager-support-snaps-when-a-host-.patch index 250dbd53..228421b2 100644 --- a/SOURCES/0084-feat-linstorvolumemanager-support-snaps-when-a-host-.patch +++ b/SOURCES/0084-feat-linstorvolumemanager-support-snaps-when-a-host-.patch @@ -1,7 +1,7 @@ From f750cc76f61fb75711176c444c3a89b9a3cbcc4f Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 6 Oct 2022 17:54:10 +0200 -Subject: [PATCH 084/176] feat(linstorvolumemanager): support snaps when a host +Subject: [PATCH 084/178] feat(linstorvolumemanager): support snaps when a host is offline - Don't create diskless volumes during clone, delay it. diff --git a/SOURCES/0085-fix-linstorvolumemanager-support-offline-hosts-when-.patch b/SOURCES/0085-fix-linstorvolumemanager-support-offline-hosts-when-.patch index ab7ca344..8ec147a2 100644 --- a/SOURCES/0085-fix-linstorvolumemanager-support-offline-hosts-when-.patch +++ b/SOURCES/0085-fix-linstorvolumemanager-support-offline-hosts-when-.patch @@ -1,7 +1,7 @@ From 604dd18a16f87188bc6a6ca0a69c31cd68ac6f77 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 7 Oct 2022 17:18:37 +0200 -Subject: [PATCH 085/176] fix(linstorvolumemanager): support offline hosts when +Subject: [PATCH 085/178] fix(linstorvolumemanager): support offline hosts when plugins are called - Robustify plugin calls diff --git a/SOURCES/0086-fix-linstorvolumemanager-define-_base_group_name-mem.patch b/SOURCES/0086-fix-linstorvolumemanager-define-_base_group_name-mem.patch index a846df3a..12bb3762 100644 --- a/SOURCES/0086-fix-linstorvolumemanager-define-_base_group_name-mem.patch +++ b/SOURCES/0086-fix-linstorvolumemanager-define-_base_group_name-mem.patch @@ -1,7 +1,7 @@ From 6f4af2ac0ddcff854e58ae8fb927035ad4a79ede Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 7 Oct 2022 17:45:26 +0200 -Subject: [PATCH 086/176] fix(linstorvolumemanager): define _base_group_name +Subject: [PATCH 086/178] fix(linstorvolumemanager): define _base_group_name member at SR creation Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0087-feat-linstorvhdutil-modify-logic-of-local-vhdutil-ca.patch b/SOURCES/0087-feat-linstorvhdutil-modify-logic-of-local-vhdutil-ca.patch index 910e8393..b947cde9 100644 --- a/SOURCES/0087-feat-linstorvhdutil-modify-logic-of-local-vhdutil-ca.patch +++ b/SOURCES/0087-feat-linstorvhdutil-modify-logic-of-local-vhdutil-ca.patch @@ -1,7 +1,7 @@ From f99e317510721cac568bae6b854b4622b8525999 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 10 Oct 2022 14:33:24 +0200 -Subject: [PATCH 087/176] feat(linstorvhdutil): modify logic of local vhdutil +Subject: [PATCH 087/178] feat(linstorvhdutil): modify logic of local vhdutil calls - Always log openers when we can't call vhdutil locally diff --git a/SOURCES/0088-fix-linstorvolumemanager-robustify-failed-snapshots.patch b/SOURCES/0088-fix-linstorvolumemanager-robustify-failed-snapshots.patch index ef6f6332..3e4a3ceb 100644 --- a/SOURCES/0088-fix-linstorvolumemanager-robustify-failed-snapshots.patch +++ b/SOURCES/0088-fix-linstorvolumemanager-robustify-failed-snapshots.patch @@ -1,7 +1,7 @@ From 0fe8a97bc5c810ca0d58248c59055c801728da26 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 17 Oct 2022 18:14:16 +0200 -Subject: [PATCH 088/176] fix(linstorvolumemanager): robustify failed snapshots +Subject: [PATCH 088/178] fix(linstorvolumemanager): robustify failed snapshots - Ensure we can always rename a failed snap, so we must check if we have metadata in the KV-store. Otherwise an error is triggered diff --git a/SOURCES/0089-fix-linstorvolumemanager-use-a-namespace-for-volumes.patch b/SOURCES/0089-fix-linstorvolumemanager-use-a-namespace-for-volumes.patch index a774c2b9..b04d4a18 100644 --- a/SOURCES/0089-fix-linstorvolumemanager-use-a-namespace-for-volumes.patch +++ b/SOURCES/0089-fix-linstorvolumemanager-use-a-namespace-for-volumes.patch @@ -1,7 +1,7 @@ From b0059113393273e375d95c0a70fee4e5fa9f97bd Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 8 Nov 2022 17:31:45 +0100 -Subject: [PATCH 089/176] fix(linstorvolumemanager): use a namespace for +Subject: [PATCH 089/178] fix(linstorvolumemanager): use a namespace for volumes - This change is not compatible with existing LINSTOR SR instances! diff --git a/SOURCES/0090-feat-linstor-kv-dump-rename-to-linstor-kv-tool-add-r.patch b/SOURCES/0090-feat-linstor-kv-dump-rename-to-linstor-kv-tool-add-r.patch index c54e1125..dee26311 100644 --- a/SOURCES/0090-feat-linstor-kv-dump-rename-to-linstor-kv-tool-add-r.patch +++ b/SOURCES/0090-feat-linstor-kv-dump-rename-to-linstor-kv-tool-add-r.patch @@ -1,7 +1,7 @@ From e31e75852287028db29348575e4fcc116c96f768 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 14 Nov 2022 17:18:48 +0100 -Subject: [PATCH 090/176] feat(linstor-kv-dump): rename to linstor-kv-tool + +Subject: [PATCH 090/178] feat(linstor-kv-dump): rename to linstor-kv-tool + add remove volume helpers --- diff --git a/SOURCES/0091-fix-LinstorSR-handle-correctly-localhost-during-star.patch b/SOURCES/0091-fix-LinstorSR-handle-correctly-localhost-during-star.patch index 3b8c1e61..e75fe74f 100644 --- a/SOURCES/0091-fix-LinstorSR-handle-correctly-localhost-during-star.patch +++ b/SOURCES/0091-fix-LinstorSR-handle-correctly-localhost-during-star.patch @@ -1,7 +1,7 @@ From 655e79b7e58d322cdb6ac46816939d26ffbbbd46 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 16 Nov 2022 12:12:12 +0100 -Subject: [PATCH 091/176] fix(LinstorSR): handle correctly localhost during +Subject: [PATCH 091/178] fix(LinstorSR): handle correctly localhost during start/stop of minidrbdcluster Otherwise another controller can be started during `xe sr-destroy` call. diff --git a/SOURCES/0092-fix-cleanup.py-call-repair-on-another-host-when-EROF.patch b/SOURCES/0092-fix-cleanup.py-call-repair-on-another-host-when-EROF.patch index 633fa3ed..27ccd1eb 100644 --- a/SOURCES/0092-fix-cleanup.py-call-repair-on-another-host-when-EROF.patch +++ b/SOURCES/0092-fix-cleanup.py-call-repair-on-another-host-when-EROF.patch @@ -1,7 +1,7 @@ From a26ad7fd840e9fcd8a03f6cfc9da8f4ac4628013 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 17 Nov 2022 15:43:25 +0100 -Subject: [PATCH 092/176] fix(cleanup.py): call repair on another host when +Subject: [PATCH 092/178] fix(cleanup.py): call repair on another host when EROFS is returned (DRBD) Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0093-fix-LinstorSR-avoid-introduction-of-DELETED-volumes.patch b/SOURCES/0093-fix-LinstorSR-avoid-introduction-of-DELETED-volumes.patch index dced4d0d..6505e587 100644 --- a/SOURCES/0093-fix-LinstorSR-avoid-introduction-of-DELETED-volumes.patch +++ b/SOURCES/0093-fix-LinstorSR-avoid-introduction-of-DELETED-volumes.patch @@ -1,7 +1,7 @@ From 545433b159c70e922529e9af199c9e3c5e756598 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 17 Nov 2022 15:46:02 +0100 -Subject: [PATCH 093/176] fix(LinstorSR): avoid introduction of DELETED volumes +Subject: [PATCH 093/178] fix(LinstorSR): avoid introduction of DELETED volumes Signed-off-by: Ronan Abhamon --- diff --git a/SOURCES/0094-feat-linstor-kv-tool-remove-all-volumes-supports-jou.patch b/SOURCES/0094-feat-linstor-kv-tool-remove-all-volumes-supports-jou.patch index 65331959..cf635577 100644 --- a/SOURCES/0094-feat-linstor-kv-tool-remove-all-volumes-supports-jou.patch +++ b/SOURCES/0094-feat-linstor-kv-tool-remove-all-volumes-supports-jou.patch @@ -1,7 +1,7 @@ From 95e513e7de43ef9e16996bdb309ac0823eb25e71 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 18 Nov 2022 10:40:58 +0100 -Subject: [PATCH 094/176] feat(linstor-kv-tool): remove-all-volumes supports +Subject: [PATCH 094/178] feat(linstor-kv-tool): remove-all-volumes supports journals now Not yet supported for remove-volume, not sure about the consequences diff --git a/SOURCES/0095-fix-linstorvhdutil-due-to-bad-refactoring-check-call.patch b/SOURCES/0095-fix-linstorvhdutil-due-to-bad-refactoring-check-call.patch index bf61bfc3..ce9059fc 100644 --- a/SOURCES/0095-fix-linstorvhdutil-due-to-bad-refactoring-check-call.patch +++ b/SOURCES/0095-fix-linstorvhdutil-due-to-bad-refactoring-check-call.patch @@ -1,7 +1,7 @@ From 282e1585023068f1fcdefa01ce2848169b562d22 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 23 Nov 2022 15:26:51 +0100 -Subject: [PATCH 095/176] fix(linstorvhdutil): due to bad refactoring, check +Subject: [PATCH 095/178] fix(linstorvhdutil): due to bad refactoring, check call was broken Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0096-feat-linstorvhdutil-ensure-we-use-VHD-parent-to-find.patch b/SOURCES/0096-feat-linstorvhdutil-ensure-we-use-VHD-parent-to-find.patch index 1823b52c..1ed8c4f9 100644 --- a/SOURCES/0096-feat-linstorvhdutil-ensure-we-use-VHD-parent-to-find.patch +++ b/SOURCES/0096-feat-linstorvhdutil-ensure-we-use-VHD-parent-to-find.patch @@ -1,7 +1,7 @@ From 6f90401e51c222f526f3f2d90828c9f918d56519 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 23 Nov 2022 15:28:23 +0100 -Subject: [PATCH 096/176] feat(linstorvhdutil): ensure we use VHD parent to +Subject: [PATCH 096/178] feat(linstorvhdutil): ensure we use VHD parent to find host where to coalesce Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0097-feat-linstorvolumemanager-force-DRBD-demote-after-fa.patch b/SOURCES/0097-feat-linstorvolumemanager-force-DRBD-demote-after-fa.patch index 77a59b92..2f684e79 100644 --- a/SOURCES/0097-feat-linstorvolumemanager-force-DRBD-demote-after-fa.patch +++ b/SOURCES/0097-feat-linstorvolumemanager-force-DRBD-demote-after-fa.patch @@ -1,7 +1,7 @@ From d4d49f0c55b9d07e4f2315e4985800c8ae2f1a32 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 5 Dec 2022 18:40:11 +0100 -Subject: [PATCH 097/176] feat(linstorvolumemanager): force DRBD demote after +Subject: [PATCH 097/178] feat(linstorvolumemanager): force DRBD demote after failed volume creation/clone Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0098-fix-linstorvhdutil-ensure-we-retry-creation-in-all-s.patch b/SOURCES/0098-fix-linstorvhdutil-ensure-we-retry-creation-in-all-s.patch index 06e303b9..415b25c5 100644 --- a/SOURCES/0098-fix-linstorvhdutil-ensure-we-retry-creation-in-all-s.patch +++ b/SOURCES/0098-fix-linstorvhdutil-ensure-we-retry-creation-in-all-s.patch @@ -1,7 +1,7 @@ From 8b614c3baa05acbe822ace1a3b09676f8042a137 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 6 Dec 2022 11:22:15 +0100 -Subject: [PATCH 098/176] fix(linstorvhdutil): ensure we retry creation in all +Subject: [PATCH 098/178] fix(linstorvhdutil): ensure we retry creation in all situations Without this patch, a basic resource creation is never restarted diff --git a/SOURCES/0099-fix-linstorvhdutil-don-t-retry-local-vhdutil-call-wh.patch b/SOURCES/0099-fix-linstorvhdutil-don-t-retry-local-vhdutil-call-wh.patch index 3dd64fef..b4e6c305 100644 --- a/SOURCES/0099-fix-linstorvhdutil-don-t-retry-local-vhdutil-call-wh.patch +++ b/SOURCES/0099-fix-linstorvhdutil-don-t-retry-local-vhdutil-call-wh.patch @@ -1,7 +1,7 @@ From afb50b27131b0b7a22e0a92731831a1beb975024 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 7 Dec 2022 17:56:39 +0100 -Subject: [PATCH 099/176] fix(linstorvhdutil): don't retry local vhdutil call +Subject: [PATCH 099/178] fix(linstorvhdutil): don't retry local vhdutil call when EROFS is detected Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0100-feat-fork-log-daemon-ignore-SIGTERM.patch b/SOURCES/0100-feat-fork-log-daemon-ignore-SIGTERM.patch index ab4c611d..c544f8a2 100644 --- a/SOURCES/0100-feat-fork-log-daemon-ignore-SIGTERM.patch +++ b/SOURCES/0100-feat-fork-log-daemon-ignore-SIGTERM.patch @@ -1,7 +1,7 @@ From 62142a4d7d2934b20e08fc8dc49876d5cb5eba5a Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 15 Dec 2022 14:36:04 +0100 -Subject: [PATCH 100/176] feat(fork-log-daemon): ignore SIGTERM +Subject: [PATCH 100/178] feat(fork-log-daemon): ignore SIGTERM Without this patch, the output logs of the fork-log-daemon child are never displayed when SIGTERM is sent to the PGID. diff --git a/SOURCES/0101-feat-LinstorSR-wait-for-http-disk-server-startup.patch b/SOURCES/0101-feat-LinstorSR-wait-for-http-disk-server-startup.patch index 29a0f4aa..55cac3c6 100644 --- a/SOURCES/0101-feat-LinstorSR-wait-for-http-disk-server-startup.patch +++ b/SOURCES/0101-feat-LinstorSR-wait-for-http-disk-server-startup.patch @@ -1,7 +1,7 @@ From a5b4176e1894dc8f87b1ba1710d3fad936e9b4c1 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 16 Dec 2022 16:52:50 +0100 -Subject: [PATCH 101/176] feat(LinstorSR): wait for http-disk-server startup +Subject: [PATCH 101/178] feat(LinstorSR): wait for http-disk-server startup Avoid a race condition with NBD server. We must be sure the HTTP server is reachable before the NBD server execution, diff --git a/SOURCES/0102-fix-LinstorSR-handle-inflate-resize-actions-correctl.patch b/SOURCES/0102-fix-LinstorSR-handle-inflate-resize-actions-correctl.patch index af11fd04..17e95690 100644 --- a/SOURCES/0102-fix-LinstorSR-handle-inflate-resize-actions-correctl.patch +++ b/SOURCES/0102-fix-LinstorSR-handle-inflate-resize-actions-correctl.patch @@ -1,7 +1,7 @@ From b4856d1ba2aa3611c4f3b2fec2eb2e8651f52722 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 16 Jan 2023 17:58:51 +0100 -Subject: [PATCH 102/176] fix(LinstorSR): handle inflate + resize actions +Subject: [PATCH 102/178] fix(LinstorSR): handle inflate + resize actions correctly - Ensure LINSTOR set the expected new volume size when inflate is executed, diff --git a/SOURCES/0103-fix-linstor-manager-add-a-static-iptables-rule-for-D.patch b/SOURCES/0103-fix-linstor-manager-add-a-static-iptables-rule-for-D.patch index def0e20a..c5465bb7 100644 --- a/SOURCES/0103-fix-linstor-manager-add-a-static-iptables-rule-for-D.patch +++ b/SOURCES/0103-fix-linstor-manager-add-a-static-iptables-rule-for-D.patch @@ -1,7 +1,7 @@ From cd0a324a1a1652b5632c77a6f8757e45021ac8b5 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 17 Jan 2023 11:55:00 +0100 -Subject: [PATCH 103/176] fix(linstor-manager): add a static iptables rule for +Subject: [PATCH 103/178] fix(linstor-manager): add a static iptables rule for DRBD volumes Using the XAPI iptables firewall may drop DRBD packets when the connection diff --git a/SOURCES/0104-feat-LinstorSR-sync-with-last-http-nbd-transfer-vers.patch b/SOURCES/0104-feat-LinstorSR-sync-with-last-http-nbd-transfer-vers.patch index af8e4970..5c06e6c6 100644 --- a/SOURCES/0104-feat-LinstorSR-sync-with-last-http-nbd-transfer-vers.patch +++ b/SOURCES/0104-feat-LinstorSR-sync-with-last-http-nbd-transfer-vers.patch @@ -1,7 +1,7 @@ From 77fec3e18231511672dd0472d30bb2070e4cfc3f Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 3 Feb 2023 16:38:49 +0100 -Subject: [PATCH 104/176] feat(LinstorSR): sync with last http-nbd-transfer +Subject: [PATCH 104/178] feat(LinstorSR): sync with last http-nbd-transfer version - Increase auto promote timeout of heartbeat VDI to reduce CPU usage diff --git a/SOURCES/0105-fix-LinstorSR-don-t-check-VDI-metadata-while-listing.patch b/SOURCES/0105-fix-LinstorSR-don-t-check-VDI-metadata-while-listing.patch index 1426b615..244334f6 100644 --- a/SOURCES/0105-fix-LinstorSR-don-t-check-VDI-metadata-while-listing.patch +++ b/SOURCES/0105-fix-LinstorSR-don-t-check-VDI-metadata-while-listing.patch @@ -1,7 +1,7 @@ From babbfe1b1aee6a23a8bc560e2e145a7c76e3a0ce Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 13 Feb 2023 17:24:16 +0100 -Subject: [PATCH 105/176] fix(LinstorSR): don't check VDI metadata while +Subject: [PATCH 105/178] fix(LinstorSR): don't check VDI metadata while listing VDIs if it's deleted Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0106-fix-LinstorSR-don-t-check-metadata-when-destroying-s.patch b/SOURCES/0106-fix-LinstorSR-don-t-check-metadata-when-destroying-s.patch index 8714864b..37734889 100644 --- a/SOURCES/0106-fix-LinstorSR-don-t-check-metadata-when-destroying-s.patch +++ b/SOURCES/0106-fix-LinstorSR-don-t-check-metadata-when-destroying-s.patch @@ -1,7 +1,7 @@ From 5a145c627171a9a8bc528b39af425b6a568f59f2 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 13 Feb 2023 17:27:43 +0100 -Subject: [PATCH 106/176] fix(LinstorSR): don't check metadata when destroying +Subject: [PATCH 106/178] fix(LinstorSR): don't check metadata when destroying snap in undo_clone Remove useless check in the snap rollback helper when there is an error diff --git a/SOURCES/0107-fix-linstorvhdutil-handle-correctly-generic-exceptio.patch b/SOURCES/0107-fix-linstorvhdutil-handle-correctly-generic-exceptio.patch index 8c01fe5a..ea966609 100644 --- a/SOURCES/0107-fix-linstorvhdutil-handle-correctly-generic-exceptio.patch +++ b/SOURCES/0107-fix-linstorvhdutil-handle-correctly-generic-exceptio.patch @@ -1,7 +1,7 @@ From 54b428be28d1836220f2ba42081c01acc64350b0 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 15 Feb 2023 11:34:54 +0100 -Subject: [PATCH 107/176] fix(linstorvhdutil): handle correctly generic +Subject: [PATCH 107/178] fix(linstorvhdutil): handle correctly generic exceptions in _raise_openers_exception Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0108-fix-minidrbdcluster-robustify-to-unmount-correctly-L.patch b/SOURCES/0108-fix-minidrbdcluster-robustify-to-unmount-correctly-L.patch index 84918917..7533296d 100644 --- a/SOURCES/0108-fix-minidrbdcluster-robustify-to-unmount-correctly-L.patch +++ b/SOURCES/0108-fix-minidrbdcluster-robustify-to-unmount-correctly-L.patch @@ -1,7 +1,7 @@ From 7655e04fca6a7b79a43515327e875e41cc95c018 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 16 Feb 2023 14:24:07 +0100 -Subject: [PATCH 108/176] fix(minidrbdcluster): robustify to unmount correctly +Subject: [PATCH 108/178] fix(minidrbdcluster): robustify to unmount correctly LINSTOR DB There is a small delay during which the database may not be unmounted diff --git a/SOURCES/0109-fix-minidrbdcluster-handle-correctly-KeyboardInterru.patch b/SOURCES/0109-fix-minidrbdcluster-handle-correctly-KeyboardInterru.patch index 4bb417c1..d47a4a66 100644 --- a/SOURCES/0109-fix-minidrbdcluster-handle-correctly-KeyboardInterru.patch +++ b/SOURCES/0109-fix-minidrbdcluster-handle-correctly-KeyboardInterru.patch @@ -1,7 +1,7 @@ From 52c4db7630977dc5ce1127e4ac14ee55a0edb0f5 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 20 Feb 2023 19:30:18 +0100 -Subject: [PATCH 109/176] fix(minidrbdcluster): handle correctly +Subject: [PATCH 109/178] fix(minidrbdcluster): handle correctly KeyboardInterrupt with systemd units It's necessary to always add systemd services in the running list before diff --git a/SOURCES/0110-feat-LinstorSR-use-drbd-reactor-instead-of-minidrbdc.patch b/SOURCES/0110-feat-LinstorSR-use-drbd-reactor-instead-of-minidrbdc.patch index e0a10389..e20ec452 100644 --- a/SOURCES/0110-feat-LinstorSR-use-drbd-reactor-instead-of-minidrbdc.patch +++ b/SOURCES/0110-feat-LinstorSR-use-drbd-reactor-instead-of-minidrbdc.patch @@ -1,7 +1,7 @@ From b07a2ef5f210e9f3dd8f4d8f4d8d71895ee99ab4 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 24 Feb 2023 14:28:29 +0100 -Subject: [PATCH 110/176] feat(LinstorSR): use drbd-reactor instead of +Subject: [PATCH 110/178] feat(LinstorSR): use drbd-reactor instead of minidrbdcluster Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0111-fix-LinstorSR-ensure-vhdutil-calls-are-correctly-exe.patch b/SOURCES/0111-fix-LinstorSR-ensure-vhdutil-calls-are-correctly-exe.patch index e0e59ade..fa473655 100644 --- a/SOURCES/0111-fix-LinstorSR-ensure-vhdutil-calls-are-correctly-exe.patch +++ b/SOURCES/0111-fix-LinstorSR-ensure-vhdutil-calls-are-correctly-exe.patch @@ -1,7 +1,7 @@ From 68885c56099d7e6e623789b4d49c54faa5075e45 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 1 Mar 2023 10:56:43 +0100 -Subject: [PATCH 111/176] fix(LinstorSR): ensure vhdutil calls are correctly +Subject: [PATCH 111/178] fix(LinstorSR): ensure vhdutil calls are correctly executed on pools with > 3 hosts Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0112-fix-LinstorSR-replace-bad-param-in-detach_thin-impl.patch b/SOURCES/0112-fix-LinstorSR-replace-bad-param-in-detach_thin-impl.patch index 5aa6c7e6..d33df0e0 100644 --- a/SOURCES/0112-fix-LinstorSR-replace-bad-param-in-detach_thin-impl.patch +++ b/SOURCES/0112-fix-LinstorSR-replace-bad-param-in-detach_thin-impl.patch @@ -1,7 +1,7 @@ From 8642904e23c8818458f6112d52df60cd5a351331 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 9 Mar 2023 17:06:59 +0100 -Subject: [PATCH 112/176] fix(LinstorSR): replace bad param in detach_thin impl +Subject: [PATCH 112/178] fix(LinstorSR): replace bad param in detach_thin impl To get the physical size, the volume UUID must be used, not the path. diff --git a/SOURCES/0113-fix-linstorvolumemanager-remove-usage-of-realpath.patch b/SOURCES/0113-fix-linstorvolumemanager-remove-usage-of-realpath.patch index c4e3a1d0..9705b3ad 100644 --- a/SOURCES/0113-fix-linstorvolumemanager-remove-usage-of-realpath.patch +++ b/SOURCES/0113-fix-linstorvolumemanager-remove-usage-of-realpath.patch @@ -1,7 +1,7 @@ From 358f096a8343367d50c161d48f08055e07c4836f Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 10 Mar 2023 18:11:10 +0100 -Subject: [PATCH 113/176] fix(linstorvolumemanager): remove usage of realpath +Subject: [PATCH 113/178] fix(linstorvolumemanager): remove usage of realpath Because a diskless DRBD path not always exist, get_volume_name_from_device_path can fail. It's easy to reproduce using > 4 hosts and with a call to linstorvhdutil.get_vhd_info: diff --git a/SOURCES/0114-fix-linstorvhdutil-avoid-parent-path-resolution.patch b/SOURCES/0114-fix-linstorvhdutil-avoid-parent-path-resolution.patch index 9b2e00c0..001961c4 100644 --- a/SOURCES/0114-fix-linstorvhdutil-avoid-parent-path-resolution.patch +++ b/SOURCES/0114-fix-linstorvhdutil-avoid-parent-path-resolution.patch @@ -1,7 +1,7 @@ From 229fefbe7164db97136ea9cf1c3e8c2d4c19235c Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 16 Mar 2023 18:54:46 +0100 -Subject: [PATCH 114/176] fix(linstorvhdutil): avoid parent path resolution +Subject: [PATCH 114/178] fix(linstorvhdutil): avoid parent path resolution When many hosts are used (>= 4), we can fail to get VHD info (with parent option) because the local parent VDI diff --git a/SOURCES/0115-fix-LinstorSR-create-parent-path-during-attach.patch b/SOURCES/0115-fix-LinstorSR-create-parent-path-during-attach.patch index 25c8a751..ea8cddb7 100644 --- a/SOURCES/0115-fix-LinstorSR-create-parent-path-during-attach.patch +++ b/SOURCES/0115-fix-LinstorSR-create-parent-path-during-attach.patch @@ -1,7 +1,7 @@ From 7cf6a3b784d098a8a7b40fb7082a8dabbd029157 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 17 Mar 2023 12:06:08 +0100 -Subject: [PATCH 115/176] fix(LinstorSR): create parent path during attach +Subject: [PATCH 115/178] fix(LinstorSR): create parent path during attach It's necessary to force DRBD diskless path creation when a VDI is attached. Otherwise the attach can fail on pool with diff --git a/SOURCES/0116-fix-LinstorSR-retry-if-we-can-t-build-volume-cache.patch b/SOURCES/0116-fix-LinstorSR-retry-if-we-can-t-build-volume-cache.patch index 15ff4880..1902be13 100644 --- a/SOURCES/0116-fix-LinstorSR-retry-if-we-can-t-build-volume-cache.patch +++ b/SOURCES/0116-fix-LinstorSR-retry-if-we-can-t-build-volume-cache.patch @@ -1,7 +1,7 @@ From b95191cf0e28705a2f92b73d42d252d81ae6e158 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 3 Apr 2023 10:03:57 +0200 -Subject: [PATCH 116/176] fix(LinstorSR): retry if we can't build volume cache +Subject: [PATCH 116/178] fix(LinstorSR): retry if we can't build volume cache Otherwise after SR creation, the master PBD can be unplugged. See: https://xcp-ng.org/forum/post/60726 diff --git a/SOURCES/0117-fix-linstorvolumemanager-reduce-peer-slots-param-to-.patch b/SOURCES/0117-fix-linstorvolumemanager-reduce-peer-slots-param-to-.patch index ca8f080b..22bed3b2 100644 --- a/SOURCES/0117-fix-linstorvolumemanager-reduce-peer-slots-param-to-.patch +++ b/SOURCES/0117-fix-linstorvolumemanager-reduce-peer-slots-param-to-.patch @@ -1,7 +1,7 @@ From df37baf1baf365a247931efb759320bfcef6bfed Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 25 Apr 2023 10:46:00 +0200 -Subject: [PATCH 117/176] fix(linstorvolumemanager): reduce peer-slots param to +Subject: [PATCH 117/178] fix(linstorvolumemanager): reduce peer-slots param to 3 Because we use 3 backing disks at most, it's useless to increase the default linstor limit (8). diff --git a/SOURCES/0118-fix-LinstorSR-attach-a-valid-XAPI-session-is_open-is.patch b/SOURCES/0118-fix-LinstorSR-attach-a-valid-XAPI-session-is_open-is.patch index 102808c7..facd3da8 100644 --- a/SOURCES/0118-fix-LinstorSR-attach-a-valid-XAPI-session-is_open-is.patch +++ b/SOURCES/0118-fix-LinstorSR-attach-a-valid-XAPI-session-is_open-is.patch @@ -1,7 +1,7 @@ From 2ba830e5083bcc1376344da20949368b0129d294 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 25 Apr 2023 11:20:55 +0200 -Subject: [PATCH 118/176] fix(LinstorSR): attach a valid XAPI session is_open +Subject: [PATCH 118/178] fix(LinstorSR): attach a valid XAPI session is_open is called Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0119-fix-LinstorSR-ensure-we-always-have-a-DRBD-path-to-s.patch b/SOURCES/0119-fix-LinstorSR-ensure-we-always-have-a-DRBD-path-to-s.patch index 148086d8..d3ee16da 100644 --- a/SOURCES/0119-fix-LinstorSR-ensure-we-always-have-a-DRBD-path-to-s.patch +++ b/SOURCES/0119-fix-LinstorSR-ensure-we-always-have-a-DRBD-path-to-s.patch @@ -1,7 +1,7 @@ From 9e6203c5d245e14816f2cadd66fdeceb53595ade Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 28 Apr 2023 10:43:27 +0200 -Subject: [PATCH 119/176] fix(LinstorSR): ensure we always have a DRBD path to +Subject: [PATCH 119/178] fix(LinstorSR): ensure we always have a DRBD path to snap Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0120-fix-LinstorSR-remove-hosts-ips-param.patch b/SOURCES/0120-fix-LinstorSR-remove-hosts-ips-param.patch index 54dde8c9..9c7a5500 100644 --- a/SOURCES/0120-fix-LinstorSR-remove-hosts-ips-param.patch +++ b/SOURCES/0120-fix-LinstorSR-remove-hosts-ips-param.patch @@ -1,7 +1,7 @@ From ce7503b8489735c12b3bb5eb48c4e8937c1c4765 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 30 May 2023 11:19:13 +0200 -Subject: [PATCH 120/176] fix(LinstorSR): remove hosts/ips param +Subject: [PATCH 120/178] fix(LinstorSR): remove hosts/ips param --- drivers/LinstorSR.py | 47 +++++---------------------------- diff --git a/SOURCES/0121-fix-LinstorSR-compute-correctly-SR-size-using-pool-c.patch b/SOURCES/0121-fix-LinstorSR-compute-correctly-SR-size-using-pool-c.patch index 14ce0f71..2aabbbf4 100644 --- a/SOURCES/0121-fix-LinstorSR-compute-correctly-SR-size-using-pool-c.patch +++ b/SOURCES/0121-fix-LinstorSR-compute-correctly-SR-size-using-pool-c.patch @@ -1,7 +1,7 @@ From 55e92941365b6b39a78209d2d775e510a7a3ba32 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 1 Jun 2023 17:40:37 +0200 -Subject: [PATCH 121/176] fix(LinstorSR): compute correctly SR size using pool +Subject: [PATCH 121/178] fix(LinstorSR): compute correctly SR size using pool count Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0122-fix-blktap2-ensure-we-can-import-this-module-when-LI.patch b/SOURCES/0122-fix-blktap2-ensure-we-can-import-this-module-when-LI.patch index 0443e87a..f52a31a4 100644 --- a/SOURCES/0122-fix-blktap2-ensure-we-can-import-this-module-when-LI.patch +++ b/SOURCES/0122-fix-blktap2-ensure-we-can-import-this-module-when-LI.patch @@ -1,7 +1,7 @@ From 36dc495fb24764c5e1b7f4de379efc5568b105f0 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 6 Jun 2023 11:50:54 +0200 -Subject: [PATCH 122/176] fix(blktap2): ensure we can import this module when +Subject: [PATCH 122/178] fix(blktap2): ensure we can import this module when LINSTOR is not installed Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0123-fix-LinstorSR-ensure-volume-cache-can-be-recreated.patch b/SOURCES/0123-fix-LinstorSR-ensure-volume-cache-can-be-recreated.patch index a874f79f..161c400a 100644 --- a/SOURCES/0123-fix-LinstorSR-ensure-volume-cache-can-be-recreated.patch +++ b/SOURCES/0123-fix-LinstorSR-ensure-volume-cache-can-be-recreated.patch @@ -1,7 +1,7 @@ From 9ac47f3a66ba8b232d0940cc84b63708df04fdea Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 21 Jun 2023 14:10:18 +0200 -Subject: [PATCH 123/176] fix(LinstorSR): ensure volume cache can be recreated +Subject: [PATCH 123/178] fix(LinstorSR): ensure volume cache can be recreated After SR creation we may fail to load volumes with this exception: "Failed to get usable size of..." and so we can't plug the master PBD. diff --git a/SOURCES/0124-fix-linstor-manager-remove-dead-useless-code-in-add-.patch b/SOURCES/0124-fix-linstor-manager-remove-dead-useless-code-in-add-.patch index 9877df57..8e58a381 100644 --- a/SOURCES/0124-fix-linstor-manager-remove-dead-useless-code-in-add-.patch +++ b/SOURCES/0124-fix-linstor-manager-remove-dead-useless-code-in-add-.patch @@ -1,7 +1,7 @@ From 6cc5256d1eb193eed6eee76b2b9b68445eaa78c7 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 20 Jul 2023 10:46:33 +0200 -Subject: [PATCH 124/176] fix(linstor-manager): remove dead/useless code in +Subject: [PATCH 124/178] fix(linstor-manager): remove dead/useless code in add/remove_host helpers Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0125-fix-LinstorSR-Ensure-we-always-have-a-device-path-du.patch b/SOURCES/0125-fix-LinstorSR-Ensure-we-always-have-a-device-path-du.patch index ea510727..33e4fa87 100644 --- a/SOURCES/0125-fix-LinstorSR-Ensure-we-always-have-a-device-path-du.patch +++ b/SOURCES/0125-fix-LinstorSR-Ensure-we-always-have-a-device-path-du.patch @@ -1,7 +1,7 @@ From 6b8eff2089024d5a675a34a978d95bde365c1296 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 1 Aug 2023 15:16:17 +0200 -Subject: [PATCH 125/176] fix(LinstorSR): Ensure we always have a device path +Subject: [PATCH 125/178] fix(LinstorSR): Ensure we always have a device path during leaf-coalesce calls So we must not verify that we have a valid DRBD path in the load step, diff --git a/SOURCES/0126-fix-LinstorSR-always-use-lock.acquire-during-attach-.patch b/SOURCES/0126-fix-LinstorSR-always-use-lock.acquire-during-attach-.patch index 1d3689ed..2cb55adb 100644 --- a/SOURCES/0126-fix-LinstorSR-always-use-lock.acquire-during-attach-.patch +++ b/SOURCES/0126-fix-LinstorSR-always-use-lock.acquire-during-attach-.patch @@ -1,7 +1,7 @@ From f3a1c26b46601c5bbcaeda3ef494a7f59ce7c6c6 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 16 Aug 2023 12:04:01 +0200 -Subject: [PATCH 126/176] fix(LinstorSR): always use lock.acquire() during +Subject: [PATCH 126/178] fix(LinstorSR): always use lock.acquire() during attach/detach We can't use a retry range on the lock because we can trigger a bad situation diff --git a/SOURCES/0127-fix-LinstorSR-mare-sure-hostnames-are-unique-at-SR-c.patch b/SOURCES/0127-fix-LinstorSR-mare-sure-hostnames-are-unique-at-SR-c.patch index 5399fb99..d9c2b6b2 100644 --- a/SOURCES/0127-fix-LinstorSR-mare-sure-hostnames-are-unique-at-SR-c.patch +++ b/SOURCES/0127-fix-LinstorSR-mare-sure-hostnames-are-unique-at-SR-c.patch @@ -1,7 +1,7 @@ From abda6f13ca112aa1a8f142e290377982f76f060a Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 17 Aug 2023 14:52:13 +0200 -Subject: [PATCH 127/176] fix(LinstorSR): mare sure hostnames are unique at SR +Subject: [PATCH 127/178] fix(LinstorSR): mare sure hostnames are unique at SR creation Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0128-fix-LinstorSR-ensure-we-can-attach-non-special-stati.patch b/SOURCES/0128-fix-LinstorSR-ensure-we-can-attach-non-special-stati.patch index 11207884..9aa5f580 100644 --- a/SOURCES/0128-fix-LinstorSR-ensure-we-can-attach-non-special-stati.patch +++ b/SOURCES/0128-fix-LinstorSR-ensure-we-can-attach-non-special-stati.patch @@ -1,7 +1,7 @@ From a2dd4de7e8e512297a332c270070a62bc75aca55 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 18 Aug 2023 11:06:56 +0200 -Subject: [PATCH 128/176] fix(LinstorSR): ensure we can attach non-special +Subject: [PATCH 128/178] fix(LinstorSR): ensure we can attach non-special static VDIs Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0129-fix-LinstorSR-ensure-we-can-detach-when-deflate-call.patch b/SOURCES/0129-fix-LinstorSR-ensure-we-can-detach-when-deflate-call.patch index 4b76f8b2..b193d140 100644 --- a/SOURCES/0129-fix-LinstorSR-ensure-we-can-detach-when-deflate-call.patch +++ b/SOURCES/0129-fix-LinstorSR-ensure-we-can-detach-when-deflate-call.patch @@ -1,7 +1,7 @@ From 3cf1041ce9802829651010063c3d8eebe969ba26 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 31 Aug 2023 18:00:27 +0200 -Subject: [PATCH 129/176] fix(LinstorSR): ensure we can detach when deflate +Subject: [PATCH 129/178] fix(LinstorSR): ensure we can detach when deflate call is not possible Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0130-fix-LinstorSR-assume-VDI-is-always-a-VHD-when-the-in.patch b/SOURCES/0130-fix-LinstorSR-assume-VDI-is-always-a-VHD-when-the-in.patch index caeb7ef7..e0b85073 100644 --- a/SOURCES/0130-fix-LinstorSR-assume-VDI-is-always-a-VHD-when-the-in.patch +++ b/SOURCES/0130-fix-LinstorSR-assume-VDI-is-always-a-VHD-when-the-in.patch @@ -1,7 +1,7 @@ From 10f62cd78f1ce950b4f1527ab5baa227192a88ed Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 28 Sep 2023 16:00:02 +0200 -Subject: [PATCH 130/176] fix(LinstorSR): assume VDI is always a VHD when the +Subject: [PATCH 130/178] fix(LinstorSR): assume VDI is always a VHD when the info is missing during cleanup Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0131-fix-LinstorSR-remove-SR-lock-during-thin-attach-deta.patch b/SOURCES/0131-fix-LinstorSR-remove-SR-lock-during-thin-attach-deta.patch index 2cbc93b2..58e63c11 100644 --- a/SOURCES/0131-fix-LinstorSR-remove-SR-lock-during-thin-attach-deta.patch +++ b/SOURCES/0131-fix-LinstorSR-remove-SR-lock-during-thin-attach-deta.patch @@ -1,7 +1,7 @@ From 5c8c56aea83a2cd4e2ffe57ba54aaf21474f68be Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 2 Oct 2023 16:48:49 +0200 -Subject: [PATCH 131/176] fix(LinstorSR): remove SR lock during thin +Subject: [PATCH 131/178] fix(LinstorSR): remove SR lock during thin attach/detach This lock is normally useless and can create a dead lock when thin mode is activated: diff --git a/SOURCES/0132-fix-LinstorSR-ensure-database-is-mounted-during-scan.patch b/SOURCES/0132-fix-LinstorSR-ensure-database-is-mounted-during-scan.patch index dfdf9b8c..a84fc518 100644 --- a/SOURCES/0132-fix-LinstorSR-ensure-database-is-mounted-during-scan.patch +++ b/SOURCES/0132-fix-LinstorSR-ensure-database-is-mounted-during-scan.patch @@ -1,7 +1,7 @@ From af4c39361fa080e170eb2d9ae58cd839d2b7b550 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 3 Oct 2023 18:42:42 +0200 -Subject: [PATCH 132/176] fix(LinstorSR): ensure database is mounted during +Subject: [PATCH 132/178] fix(LinstorSR): ensure database is mounted during scan Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0133-fix-LinstorSR-restart-drbd-reactor-in-case-of-failur.patch b/SOURCES/0133-fix-LinstorSR-restart-drbd-reactor-in-case-of-failur.patch index f279dbf8..f89244da 100644 --- a/SOURCES/0133-fix-LinstorSR-restart-drbd-reactor-in-case-of-failur.patch +++ b/SOURCES/0133-fix-LinstorSR-restart-drbd-reactor-in-case-of-failur.patch @@ -1,7 +1,7 @@ From 8154937eec169d7d7e9d9f00ff401ea279e5741c Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 4 Oct 2023 14:30:36 +0200 -Subject: [PATCH 133/176] fix(LinstorSR): restart drbd-reactor in case of +Subject: [PATCH 133/178] fix(LinstorSR): restart drbd-reactor in case of failure Otherwise we can have all hosts unusable after a massive reboot: diff --git a/SOURCES/0134-fix-linstorvolumemanager-retry-in-case-of-failure-du.patch b/SOURCES/0134-fix-linstorvolumemanager-retry-in-case-of-failure-du.patch index 48e4eff2..4ecab4e7 100644 --- a/SOURCES/0134-fix-linstorvolumemanager-retry-in-case-of-failure-du.patch +++ b/SOURCES/0134-fix-linstorvolumemanager-retry-in-case-of-failure-du.patch @@ -1,7 +1,7 @@ From 17f5732413d7c5d95173ae36600a66f917981f1a Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 9 Oct 2023 10:37:32 +0200 -Subject: [PATCH 134/176] fix(linstorvolumemanager): retry in case of failure +Subject: [PATCH 134/178] fix(linstorvolumemanager): retry in case of failure during mkfs call on database The device is not always ready after creation. diff --git a/SOURCES/0135-fix-linstorvolumemanager-avoid-diskless-creation-whe.patch b/SOURCES/0135-fix-linstorvolumemanager-avoid-diskless-creation-whe.patch index 373dae23..a265793f 100644 --- a/SOURCES/0135-fix-linstorvolumemanager-avoid-diskless-creation-whe.patch +++ b/SOURCES/0135-fix-linstorvolumemanager-avoid-diskless-creation-whe.patch @@ -1,7 +1,7 @@ From bef526786b135beef522a40b571044dbd0922e58 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 26 Sep 2023 11:48:38 +0200 -Subject: [PATCH 135/176] fix(linstorvolumemanager): avoid diskless creation +Subject: [PATCH 135/178] fix(linstorvolumemanager): avoid diskless creation when a new resource is added Like said in this discussion https://github.com/xcp-ng/sm/pull/34 : diff --git a/SOURCES/0136-fix-LinstorSR-remove-diskless-after-VDI.detach-calls.patch b/SOURCES/0136-fix-LinstorSR-remove-diskless-after-VDI.detach-calls.patch index 56452ad5..207cd9c8 100644 --- a/SOURCES/0136-fix-LinstorSR-remove-diskless-after-VDI.detach-calls.patch +++ b/SOURCES/0136-fix-LinstorSR-remove-diskless-after-VDI.detach-calls.patch @@ -1,7 +1,7 @@ From efbfea0c312d112122346f3a1e6efea952d6f96d Mon Sep 17 00:00:00 2001 From: Rene Peinthor Date: Tue, 25 Jul 2023 11:19:39 +0200 -Subject: [PATCH 136/176] fix(LinstorSR): remove diskless after VDI.detach +Subject: [PATCH 136/178] fix(LinstorSR): remove diskless after VDI.detach calls Signed-off-by: Rene Peinthor diff --git a/SOURCES/0137-fix-LinstorSR-robustify-_load_vdi_info-in-cleanup.py.patch b/SOURCES/0137-fix-LinstorSR-robustify-_load_vdi_info-in-cleanup.py.patch index cf886e6f..3c03b7d8 100644 --- a/SOURCES/0137-fix-LinstorSR-robustify-_load_vdi_info-in-cleanup.py.patch +++ b/SOURCES/0137-fix-LinstorSR-robustify-_load_vdi_info-in-cleanup.py.patch @@ -1,7 +1,7 @@ From 427909f25d2ff571c5e0e165b20e3303883403a5 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 11 Oct 2023 12:39:56 +0200 -Subject: [PATCH 137/176] fix(LinstorSR): robustify _load_vdi_info in +Subject: [PATCH 137/178] fix(LinstorSR): robustify _load_vdi_info in cleanup.py After a failed snapshot like that: diff --git a/SOURCES/0138-fix-LinstorSR-ensure-detach-never-fails-on-plugin-fa.patch b/SOURCES/0138-fix-LinstorSR-ensure-detach-never-fails-on-plugin-fa.patch index 09cfeb6c..9469f5db 100644 --- a/SOURCES/0138-fix-LinstorSR-ensure-detach-never-fails-on-plugin-fa.patch +++ b/SOURCES/0138-fix-LinstorSR-ensure-detach-never-fails-on-plugin-fa.patch @@ -1,7 +1,7 @@ From 4fdaf148c813d3b1b380deabcf246f74b8993a59 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 23 Oct 2023 14:31:27 +0200 -Subject: [PATCH 138/176] fix(LinstorSR): ensure detach never fails on plugin +Subject: [PATCH 138/178] fix(LinstorSR): ensure detach never fails on plugin failure Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0139-fix-LinstorSR-ensure-we-coalesce-only-volumes-with-a.patch b/SOURCES/0139-fix-LinstorSR-ensure-we-coalesce-only-volumes-with-a.patch index b7bddd2d..0b8da4b5 100644 --- a/SOURCES/0139-fix-LinstorSR-ensure-we-coalesce-only-volumes-with-a.patch +++ b/SOURCES/0139-fix-LinstorSR-ensure-we-coalesce-only-volumes-with-a.patch @@ -1,7 +1,7 @@ From 5981f334d3fa7fff186446d094b9b83a92d20cb1 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 23 Oct 2023 15:52:23 +0200 -Subject: [PATCH 139/176] fix(LinstorSR): ensure we coalesce only volumes with +Subject: [PATCH 139/178] fix(LinstorSR): ensure we coalesce only volumes with a valid size --- diff --git a/SOURCES/0140-fix-LinstorSR-don-t-try-to-repair-persistent-volumes.patch b/SOURCES/0140-fix-LinstorSR-don-t-try-to-repair-persistent-volumes.patch index a3f2791e..8357e198 100644 --- a/SOURCES/0140-fix-LinstorSR-don-t-try-to-repair-persistent-volumes.patch +++ b/SOURCES/0140-fix-LinstorSR-don-t-try-to-repair-persistent-volumes.patch @@ -1,7 +1,7 @@ From b7a02cef58da7eb734cfa1c876593a43946300c1 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 24 Oct 2023 11:57:40 +0200 -Subject: [PATCH 140/176] fix(LinstorSR): don't try to repair persistent +Subject: [PATCH 140/178] fix(LinstorSR): don't try to repair persistent volumes in GC Use constants to simplify maintenance. diff --git a/SOURCES/0141-fix-linstorvhdutil-format-correctly-message-if-vhd-u.patch b/SOURCES/0141-fix-linstorvhdutil-format-correctly-message-if-vhd-u.patch index 9c7bde7c..2cf86356 100644 --- a/SOURCES/0141-fix-linstorvhdutil-format-correctly-message-if-vhd-u.patch +++ b/SOURCES/0141-fix-linstorvhdutil-format-correctly-message-if-vhd-u.patch @@ -1,7 +1,7 @@ From a600cd8fb9c29b709459b7446fc7fd0ac362bbdf Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 14 Nov 2023 18:21:53 +0100 -Subject: [PATCH 141/176] fix(linstorvhdutil): format correctly message if +Subject: [PATCH 141/178] fix(linstorvhdutil): format correctly message if vhd-util cannot be run Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0142-fix-LinstorSR-wait-during-attach-to-open-DRBD-path.patch b/SOURCES/0142-fix-LinstorSR-wait-during-attach-to-open-DRBD-path.patch index db8472be..042f8da7 100644 --- a/SOURCES/0142-fix-LinstorSR-wait-during-attach-to-open-DRBD-path.patch +++ b/SOURCES/0142-fix-LinstorSR-wait-during-attach-to-open-DRBD-path.patch @@ -1,7 +1,7 @@ From ed9e6189aa9e86c7c32ec88baa9b8023cfd250d6 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 24 Oct 2023 23:07:23 +0200 -Subject: [PATCH 142/176] fix(LinstorSR): wait during attach to open DRBD path +Subject: [PATCH 142/178] fix(LinstorSR): wait during attach to open DRBD path ENODATA and other errors like EROFS can be raised when a new DRBD path is created on the fly. So ensure to block before tapdisk starts. diff --git a/SOURCES/0143-fix-LinstorSR-support-different-volume-sizes-in-clea.patch b/SOURCES/0143-fix-LinstorSR-support-different-volume-sizes-in-clea.patch index a5abf507..be6150aa 100644 --- a/SOURCES/0143-fix-LinstorSR-support-different-volume-sizes-in-clea.patch +++ b/SOURCES/0143-fix-LinstorSR-support-different-volume-sizes-in-clea.patch @@ -1,7 +1,7 @@ From 8ff35099e65e28f4a7ae4883606efc8f2f0b72f8 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 14 Nov 2023 18:08:26 +0100 -Subject: [PATCH 143/176] fix(LinstorSR): support different volume sizes in +Subject: [PATCH 143/178] fix(LinstorSR): support different volume sizes in cleanup.py Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0144-fix-LinstorSR-remove-useless-IPS_XHA_CACHE-var.patch b/SOURCES/0144-fix-LinstorSR-remove-useless-IPS_XHA_CACHE-var.patch index 4ba282e4..9b6b36cf 100644 --- a/SOURCES/0144-fix-LinstorSR-remove-useless-IPS_XHA_CACHE-var.patch +++ b/SOURCES/0144-fix-LinstorSR-remove-useless-IPS_XHA_CACHE-var.patch @@ -1,7 +1,7 @@ From 66cb40e1203a06cb1561f28225ba53a449bae79f Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 20 Nov 2023 10:52:27 +0100 -Subject: [PATCH 144/176] fix(LinstorSR): remove useless IPS_XHA_CACHE var +Subject: [PATCH 144/178] fix(LinstorSR): remove useless IPS_XHA_CACHE var Signed-off-by: Ronan Abhamon --- diff --git a/SOURCES/0145-fix-LinstorSR-ensure-we-can-deflate-on-any-host-afte.patch b/SOURCES/0145-fix-LinstorSR-ensure-we-can-deflate-on-any-host-afte.patch index b99f750d..fc04ca32 100644 --- a/SOURCES/0145-fix-LinstorSR-ensure-we-can-deflate-on-any-host-afte.patch +++ b/SOURCES/0145-fix-LinstorSR-ensure-we-can-deflate-on-any-host-afte.patch @@ -1,7 +1,7 @@ From 0941f0f67e86099523d389dfd3caffc09f848444 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 21 Nov 2023 13:50:24 +0100 -Subject: [PATCH 145/176] fix(LinstorSR): ensure we can deflate on any host +Subject: [PATCH 145/178] fix(LinstorSR): ensure we can deflate on any host after a journal rollback Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0146-fix-LinstorSR-ensure-we-always-use-real-DRBD-VHD-siz.patch b/SOURCES/0146-fix-LinstorSR-ensure-we-always-use-real-DRBD-VHD-siz.patch index bc3aad89..ace6197a 100644 --- a/SOURCES/0146-fix-LinstorSR-ensure-we-always-use-real-DRBD-VHD-siz.patch +++ b/SOURCES/0146-fix-LinstorSR-ensure-we-always-use-real-DRBD-VHD-siz.patch @@ -1,7 +1,7 @@ From 7aa1cd3e4e2539f424ec193fe599c51da9d63a0e Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 27 Nov 2023 12:15:43 +0100 -Subject: [PATCH 146/176] fix(LinstorSR): ensure we always use real DRBD/VHD +Subject: [PATCH 146/178] fix(LinstorSR): ensure we always use real DRBD/VHD sizes in inflate/deflate GC calls --- diff --git a/SOURCES/0147-feat-linstor-kv-tool-If-no-controller-uri-option-is-.patch b/SOURCES/0147-feat-linstor-kv-tool-If-no-controller-uri-option-is-.patch index 2b710488..40cda6ee 100644 --- a/SOURCES/0147-feat-linstor-kv-tool-If-no-controller-uri-option-is-.patch +++ b/SOURCES/0147-feat-linstor-kv-tool-If-no-controller-uri-option-is-.patch @@ -1,7 +1,7 @@ From f440e05248e5201289b5c7dfc25f3a4867912317 Mon Sep 17 00:00:00 2001 From: BenjiReis Date: Mon, 27 Nov 2023 14:23:57 +0100 -Subject: [PATCH 147/176] feat(linstor-kv-tool): If no controller uri option is +Subject: [PATCH 147/178] feat(linstor-kv-tool): If no controller uri option is provided fetch it (#48) Signed-off-by: BenjiReis diff --git a/SOURCES/0148-fix-linstorvolumemanager-robustify-SR-destroy-46.patch b/SOURCES/0148-fix-linstorvolumemanager-robustify-SR-destroy-46.patch index 0ddb448f..68763842 100644 --- a/SOURCES/0148-fix-linstorvolumemanager-robustify-SR-destroy-46.patch +++ b/SOURCES/0148-fix-linstorvolumemanager-robustify-SR-destroy-46.patch @@ -1,7 +1,7 @@ From 163521a5851d6cf808acd8e68e8b6905a9487300 Mon Sep 17 00:00:00 2001 From: BenjiReis Date: Wed, 29 Nov 2023 15:45:32 +0100 -Subject: [PATCH 148/176] fix(linstorvolumemanager): robustify SR destroy (#46) +Subject: [PATCH 148/178] fix(linstorvolumemanager): robustify SR destroy (#46) Signed-off-by: Ronan Abhamon Co-authored-by: BenjiReis diff --git a/SOURCES/0149-feat-linstor-manager-extend-API-with-createNodeInter.patch b/SOURCES/0149-feat-linstor-manager-extend-API-with-createNodeInter.patch index 5c17c55f..46d4d959 100644 --- a/SOURCES/0149-feat-linstor-manager-extend-API-with-createNodeInter.patch +++ b/SOURCES/0149-feat-linstor-manager-extend-API-with-createNodeInter.patch @@ -1,7 +1,7 @@ From 695baec632e137b6fbab34b826f4c3224fddf2b3 Mon Sep 17 00:00:00 2001 From: BenjiReis Date: Wed, 29 Nov 2023 16:54:30 +0100 -Subject: [PATCH 149/176] feat(linstor-manager): extend API with +Subject: [PATCH 149/178] feat(linstor-manager): extend API with createNodeInterface and setNodePreferredInterface (#47) Signed-off-by: BenjiReis diff --git a/SOURCES/0150-fix-LinstorSR-support-VDI.resize-on-thick-volumes.patch b/SOURCES/0150-fix-LinstorSR-support-VDI.resize-on-thick-volumes.patch index b0ff2c4b..6eab74ea 100644 --- a/SOURCES/0150-fix-LinstorSR-support-VDI.resize-on-thick-volumes.patch +++ b/SOURCES/0150-fix-LinstorSR-support-VDI.resize-on-thick-volumes.patch @@ -1,7 +1,7 @@ From 2eccb722153fe6c903839c0fe5ed329533c4c1c3 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 1 Dec 2023 11:55:12 +0100 -Subject: [PATCH 150/176] fix(LinstorSR): support VDI.resize on thick volumes +Subject: [PATCH 150/178] fix(LinstorSR): support VDI.resize on thick volumes --- drivers/LinstorSR.py | 3 +++ diff --git a/SOURCES/0151-fix-linstorvolumemanager-format-correctly-exception-.patch b/SOURCES/0151-fix-linstorvolumemanager-format-correctly-exception-.patch index 767ad207..3d431f17 100644 --- a/SOURCES/0151-fix-linstorvolumemanager-format-correctly-exception-.patch +++ b/SOURCES/0151-fix-linstorvolumemanager-format-correctly-exception-.patch @@ -1,7 +1,7 @@ From af598434fde6668d79bbab53810f316e63d502a1 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 4 Dec 2023 16:36:55 +0100 -Subject: [PATCH 151/176] fix(linstorvolumemanager): format correctly exception +Subject: [PATCH 151/178] fix(linstorvolumemanager): format correctly exception during db mount Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0152-fix-LinstorSR-ensure-we-can-skip-coalesces-if-device.patch b/SOURCES/0152-fix-LinstorSR-ensure-we-can-skip-coalesces-if-device.patch index 1471435d..b9eccd56 100644 --- a/SOURCES/0152-fix-LinstorSR-ensure-we-can-skip-coalesces-if-device.patch +++ b/SOURCES/0152-fix-LinstorSR-ensure-we-can-skip-coalesces-if-device.patch @@ -1,7 +1,7 @@ From dc34dd73b75ccfc06e85382114ea23da77834801 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 4 Dec 2023 18:57:08 +0100 -Subject: [PATCH 152/176] fix(LinstorSR): ensure we can skip coalesces if +Subject: [PATCH 152/178] fix(LinstorSR): ensure we can skip coalesces if device path can't be fetched Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0153-feat-linstor-manager-add-methods-to-modify-destroy-l.patch b/SOURCES/0153-feat-linstor-manager-add-methods-to-modify-destroy-l.patch index ea3f3fb1..32ec1d29 100644 --- a/SOURCES/0153-feat-linstor-manager-add-methods-to-modify-destroy-l.patch +++ b/SOURCES/0153-feat-linstor-manager-add-methods-to-modify-destroy-l.patch @@ -1,7 +1,7 @@ From 334eddd740c2d9891f7671799f9c8f55a51c1a8a Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 19 Dec 2023 14:49:33 +0100 -Subject: [PATCH 153/176] feat(linstor-manager): add methods to +Subject: [PATCH 153/178] feat(linstor-manager): add methods to modify/destroy/list net interfaces Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0154-fix-LinstorSR-force-a-defined-volume-prefix-if-we-ca.patch b/SOURCES/0154-fix-LinstorSR-force-a-defined-volume-prefix-if-we-ca.patch index 5cc7dfc5..5c2940a7 100644 --- a/SOURCES/0154-fix-LinstorSR-force-a-defined-volume-prefix-if-we-ca.patch +++ b/SOURCES/0154-fix-LinstorSR-force-a-defined-volume-prefix-if-we-ca.patch @@ -1,7 +1,7 @@ From 1f5d49121421691a9dabbbb4e0d44025e3abde27 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 12 Jan 2024 10:28:20 +0100 -Subject: [PATCH 154/176] fix(LinstorSR): force a defined volume prefix if we +Subject: [PATCH 154/178] fix(LinstorSR): force a defined volume prefix if we can't import libs Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0155-fix-LinstorSR-explicit-error-message-when-a-group-is.patch b/SOURCES/0155-fix-LinstorSR-explicit-error-message-when-a-group-is.patch index c3d24820..00c6ef0e 100644 --- a/SOURCES/0155-fix-LinstorSR-explicit-error-message-when-a-group-is.patch +++ b/SOURCES/0155-fix-LinstorSR-explicit-error-message-when-a-group-is.patch @@ -1,7 +1,7 @@ From 4ddcc31d0695b66e6135c2fe9d671d3059bfe720 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 18 Jan 2024 10:24:01 +0100 -Subject: [PATCH 155/176] fix(LinstorSR): explicit error message when a group +Subject: [PATCH 155/178] fix(LinstorSR): explicit error message when a group is not unique during SR creation Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0156-fix-LinstorSR-make-sure-VDI.delete-doesn-t-throw-und.patch b/SOURCES/0156-fix-LinstorSR-make-sure-VDI.delete-doesn-t-throw-und.patch index 5d836931..cf27340c 100644 --- a/SOURCES/0156-fix-LinstorSR-make-sure-VDI.delete-doesn-t-throw-und.patch +++ b/SOURCES/0156-fix-LinstorSR-make-sure-VDI.delete-doesn-t-throw-und.patch @@ -1,7 +1,7 @@ From 8656be850cc50c29a8d9cfd17c9e9258c7809467 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 18 Jan 2024 11:18:11 +0100 -Subject: [PATCH 156/176] fix(LinstorSR): make sure VDI.delete doesn't throw +Subject: [PATCH 156/178] fix(LinstorSR): make sure VDI.delete doesn't throw under specific conditions If we can update the volume state in the KV-store, there is no reason to raise diff --git a/SOURCES/0157-fix-LinstorSR-add-drbd-in-the-blacklist-of-multipath.patch b/SOURCES/0157-fix-LinstorSR-add-drbd-in-the-blacklist-of-multipath.patch index 25bd82f7..02666a64 100644 --- a/SOURCES/0157-fix-LinstorSR-add-drbd-in-the-blacklist-of-multipath.patch +++ b/SOURCES/0157-fix-LinstorSR-add-drbd-in-the-blacklist-of-multipath.patch @@ -1,7 +1,7 @@ From 35d2cfa162cb00a67d444a3ba8427842954523fe Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 19 Jan 2024 14:39:17 +0100 -Subject: [PATCH 157/176] fix(LinstorSR): add drbd in the blacklist of +Subject: [PATCH 157/178] fix(LinstorSR): add drbd in the blacklist of multipath.conf If DRBD is installed for the first time, and if the multipathd diff --git a/SOURCES/0158-fix-linstorvolumemanager-create-cloned-volumes-on-ho.patch b/SOURCES/0158-fix-linstorvolumemanager-create-cloned-volumes-on-ho.patch index 6ecf1e6f..08c852f1 100644 --- a/SOURCES/0158-fix-linstorvolumemanager-create-cloned-volumes-on-ho.patch +++ b/SOURCES/0158-fix-linstorvolumemanager-create-cloned-volumes-on-ho.patch @@ -1,7 +1,7 @@ From c14781d38cd6d00fbb0ac9511a9e5a4440698b6d Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 22 Jan 2024 11:25:25 +0100 -Subject: [PATCH 158/176] fix(linstorvolumemanager): create cloned volumes on +Subject: [PATCH 158/178] fix(linstorvolumemanager): create cloned volumes on host selected by LINSTOR Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0159-fix-linstorvolumemanager-don-t-align-volumes-on-LVM-.patch b/SOURCES/0159-fix-linstorvolumemanager-don-t-align-volumes-on-LVM-.patch index d9485566..a6353268 100644 --- a/SOURCES/0159-fix-linstorvolumemanager-don-t-align-volumes-on-LVM-.patch +++ b/SOURCES/0159-fix-linstorvolumemanager-don-t-align-volumes-on-LVM-.patch @@ -1,7 +1,7 @@ From 7edbc090f1dcfa2bcc63e669af81e14c11addc05 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 26 Jan 2024 15:29:21 +0100 -Subject: [PATCH 159/176] fix(linstorvolumemanager): don't align volumes on LVM +Subject: [PATCH 159/178] fix(linstorvolumemanager): don't align volumes on LVM sector size It's the goal of the LINSTOR stack to align properly on the LVM layer. diff --git a/SOURCES/0160-fix-linstorvolumemanager-assert-with-message-after-l.patch b/SOURCES/0160-fix-linstorvolumemanager-assert-with-message-after-l.patch index 2997aa66..574164cb 100644 --- a/SOURCES/0160-fix-linstorvolumemanager-assert-with-message-after-l.patch +++ b/SOURCES/0160-fix-linstorvolumemanager-assert-with-message-after-l.patch @@ -1,7 +1,7 @@ From 181e82b231f0abdb51594ec9c362c90dde80b31c Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 5 Feb 2024 18:01:22 +0100 -Subject: [PATCH 160/176] fix(linstorvolumemanager): assert with message after +Subject: [PATCH 160/178] fix(linstorvolumemanager): assert with message after log in update_volume_uuid Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0161-fix-linstorvolumemanager-retry-resize-if-volume-is-n.patch b/SOURCES/0161-fix-linstorvolumemanager-retry-resize-if-volume-is-n.patch index 80bb4bbe..381f010e 100644 --- a/SOURCES/0161-fix-linstorvolumemanager-retry-resize-if-volume-is-n.patch +++ b/SOURCES/0161-fix-linstorvolumemanager-retry-resize-if-volume-is-n.patch @@ -1,7 +1,7 @@ From 0481bcd2232e87b4458ffaabeff3c9f40d4362f4 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 5 Feb 2024 23:13:06 +0100 -Subject: [PATCH 161/176] fix(linstorvolumemanager): retry resize if volume is +Subject: [PATCH 161/178] fix(linstorvolumemanager): retry resize if volume is not up to date Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0162-fix-LinstorSR-create-DRBD-diskless-if-necessary-for-.patch b/SOURCES/0162-fix-LinstorSR-create-DRBD-diskless-if-necessary-for-.patch index 8bbd6568..00596163 100644 --- a/SOURCES/0162-fix-LinstorSR-create-DRBD-diskless-if-necessary-for-.patch +++ b/SOURCES/0162-fix-LinstorSR-create-DRBD-diskless-if-necessary-for-.patch @@ -1,7 +1,7 @@ From eae3f5a79684319a75f65514d5b6c65e73ea4aee Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 6 Feb 2024 00:10:32 +0100 -Subject: [PATCH 162/176] fix(LinstorSR): create DRBD diskless if necessary for +Subject: [PATCH 162/178] fix(LinstorSR): create DRBD diskless if necessary for each VHD parent It's necessary to have all parents during snapshot to create a new VHD child. diff --git a/SOURCES/0163-fix-LinstorSR-fix-bad-call-to-vhdutil.inflate-bad-ex.patch b/SOURCES/0163-fix-LinstorSR-fix-bad-call-to-vhdutil.inflate-bad-ex.patch index 4f8fd0a1..e8fffafc 100644 --- a/SOURCES/0163-fix-LinstorSR-fix-bad-call-to-vhdutil.inflate-bad-ex.patch +++ b/SOURCES/0163-fix-LinstorSR-fix-bad-call-to-vhdutil.inflate-bad-ex.patch @@ -1,7 +1,7 @@ From 71f177ba5e1ddc71bd9acaad301849b62d719642 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 6 Feb 2024 00:14:11 +0100 -Subject: [PATCH 163/176] fix(LinstorSR): fix bad call to vhdutil.inflate + bad +Subject: [PATCH 163/178] fix(LinstorSR): fix bad call to vhdutil.inflate + bad exception Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0164-fix-LinstorSR-activate-VG-if-attach-from-config-is-a.patch b/SOURCES/0164-fix-LinstorSR-activate-VG-if-attach-from-config-is-a.patch index b338cd8b..678f9e75 100644 --- a/SOURCES/0164-fix-LinstorSR-activate-VG-if-attach-from-config-is-a.patch +++ b/SOURCES/0164-fix-LinstorSR-activate-VG-if-attach-from-config-is-a.patch @@ -1,7 +1,7 @@ From 1340ce2e1ab70d2077294304a7de626cedef1302 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 12 Feb 2024 20:54:06 +0100 -Subject: [PATCH 164/176] fix(LinstorSR): activate VG if attach from config is +Subject: [PATCH 164/178] fix(LinstorSR): activate VG if attach from config is asked Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0165-feat-LinstorSR-use-a-specific-resource-group-for-DB-.patch b/SOURCES/0165-feat-LinstorSR-use-a-specific-resource-group-for-DB-.patch index 10471c6a..436cdfbc 100644 --- a/SOURCES/0165-feat-LinstorSR-use-a-specific-resource-group-for-DB-.patch +++ b/SOURCES/0165-feat-LinstorSR-use-a-specific-resource-group-for-DB-.patch @@ -1,7 +1,7 @@ From e3a1524d69685f7c48e3efc16cdfb69ae722d7cc Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 19 Mar 2024 23:09:54 +0100 -Subject: [PATCH 165/176] feat(LinstorSR): use a specific resource group for DB +Subject: [PATCH 165/178] feat(LinstorSR): use a specific resource group for DB and HA Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0166-feat-linstor-manager-add-getNodePreferredInterface-h.patch b/SOURCES/0166-feat-linstor-manager-add-getNodePreferredInterface-h.patch index 65802499..a7b01928 100644 --- a/SOURCES/0166-feat-linstor-manager-add-getNodePreferredInterface-h.patch +++ b/SOURCES/0166-feat-linstor-manager-add-getNodePreferredInterface-h.patch @@ -1,7 +1,7 @@ From 3d704956a9624303b4258e9e9954396bdeb1a0c5 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 15 Apr 2024 11:22:18 +0200 -Subject: [PATCH 166/176] feat(linstor-manager): add +Subject: [PATCH 166/178] feat(linstor-manager): add `getNodePreferredInterface` helper Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0167-fix-linstorvolumemanager-blocks-deletion-of-default-.patch b/SOURCES/0167-fix-linstorvolumemanager-blocks-deletion-of-default-.patch index fcad5147..c8c2cb8c 100644 --- a/SOURCES/0167-fix-linstorvolumemanager-blocks-deletion-of-default-.patch +++ b/SOURCES/0167-fix-linstorvolumemanager-blocks-deletion-of-default-.patch @@ -1,7 +1,7 @@ From db37c5c68d38416de88a64c4cc1b70fd6971f8fb Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 15 Apr 2024 11:26:00 +0200 -Subject: [PATCH 167/176] fix(linstorvolumemanager): blocks deletion of default +Subject: [PATCH 167/178] fix(linstorvolumemanager): blocks deletion of default network interface Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0168-feat-linstorvolumemanager-change-logic-of-get_resour.patch b/SOURCES/0168-feat-linstorvolumemanager-change-logic-of-get_resour.patch index eada3036..e75b291d 100644 --- a/SOURCES/0168-feat-linstorvolumemanager-change-logic-of-get_resour.patch +++ b/SOURCES/0168-feat-linstorvolumemanager-change-logic-of-get_resour.patch @@ -1,7 +1,7 @@ From 91794049e90cbfa6997c27e1aa81dac3f460d0f3 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 15 Apr 2024 17:56:47 +0200 -Subject: [PATCH 168/176] feat(linstorvolumemanager): change logic of +Subject: [PATCH 168/178] feat(linstorvolumemanager): change logic of `get_resources_info`: - Add a nested level "nodes" for each resource - Add a "uuid" attr on resources - Rename LINSTOR "uuid" to "linstor-uuid" - Optimize code diff --git a/SOURCES/0169-feat-linstor-manager-add-error-codes-to-healthCheck-.patch b/SOURCES/0169-feat-linstor-manager-add-error-codes-to-healthCheck-.patch index 56eb77d4..9a6a4266 100644 --- a/SOURCES/0169-feat-linstor-manager-add-error-codes-to-healthCheck-.patch +++ b/SOURCES/0169-feat-linstor-manager-add-error-codes-to-healthCheck-.patch @@ -1,7 +1,7 @@ From a160b11630ccea5ce2d4799c98cc4fa3949d7ab7 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 18 Apr 2024 13:57:37 +0200 -Subject: [PATCH 169/176] feat(linstor-manager): add error codes to healthCheck +Subject: [PATCH 169/178] feat(linstor-manager): add error codes to healthCheck helper Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0170-fix-LinstorSR-fix-bad-exception-reference-during-sna.patch b/SOURCES/0170-fix-LinstorSR-fix-bad-exception-reference-during-sna.patch index 5c00a966..f64f511e 100644 --- a/SOURCES/0170-fix-LinstorSR-fix-bad-exception-reference-during-sna.patch +++ b/SOURCES/0170-fix-LinstorSR-fix-bad-exception-reference-during-sna.patch @@ -1,7 +1,7 @@ From 20a4fa3fc5932216a30a7b0e6e8fad292ae73859 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 24 Apr 2024 15:10:49 +0200 -Subject: [PATCH 170/176] fix(LinstorSR): fix bad exception reference during +Subject: [PATCH 170/178] fix(LinstorSR): fix bad exception reference during snapshot Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0171-fix-tapdisk-pause-ensure-LINSTOR-VHD-chain-is-availa.patch b/SOURCES/0171-fix-tapdisk-pause-ensure-LINSTOR-VHD-chain-is-availa.patch index be90a828..3df67920 100644 --- a/SOURCES/0171-fix-tapdisk-pause-ensure-LINSTOR-VHD-chain-is-availa.patch +++ b/SOURCES/0171-fix-tapdisk-pause-ensure-LINSTOR-VHD-chain-is-availa.patch @@ -1,7 +1,7 @@ From d701a62618ab66606731ce6db0424849ed8cdf9f Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 24 Apr 2024 17:29:26 +0200 -Subject: [PATCH 171/176] fix(tapdisk-pause): ensure LINSTOR VHD chain is +Subject: [PATCH 171/178] fix(tapdisk-pause): ensure LINSTOR VHD chain is available Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0172-fix-LVHDoISCSISR-disable-restart-of-ISCSI-daemon.patch b/SOURCES/0172-fix-LVHDoISCSISR-disable-restart-of-ISCSI-daemon.patch index b50738e2..880f6131 100644 --- a/SOURCES/0172-fix-LVHDoISCSISR-disable-restart-of-ISCSI-daemon.patch +++ b/SOURCES/0172-fix-LVHDoISCSISR-disable-restart-of-ISCSI-daemon.patch @@ -1,7 +1,7 @@ From 09a03ec264af5ca874380c89aa9efaf6d6fe1b7e Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 26 Apr 2024 14:20:04 +0200 -Subject: [PATCH 172/176] fix(LVHDoISCSISR): disable restart of ISCSI daemon +Subject: [PATCH 172/178] fix(LVHDoISCSISR): disable restart of ISCSI daemon Signed-off-by: Ronan Abhamon --- diff --git a/SOURCES/0173-fix-linstorvhdutil-retry-check-on-another-machine-in.patch b/SOURCES/0173-fix-linstorvhdutil-retry-check-on-another-machine-in.patch index c4dc5f27..a1fed1cd 100644 --- a/SOURCES/0173-fix-linstorvhdutil-retry-check-on-another-machine-in.patch +++ b/SOURCES/0173-fix-linstorvhdutil-retry-check-on-another-machine-in.patch @@ -1,7 +1,7 @@ From fa482bd8394f3ebd72f87aa1bae76b03c14ca120 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 6 May 2024 18:15:00 +0200 -Subject: [PATCH 173/176] fix(linstorvhdutil): retry check on another machine +Subject: [PATCH 173/178] fix(linstorvhdutil): retry check on another machine in case of failure (#54) Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0174-fix-LinstorSR-explicit-errors-when-database-path-is-.patch b/SOURCES/0174-fix-LinstorSR-explicit-errors-when-database-path-is-.patch index c9e7d967..fccb363a 100644 --- a/SOURCES/0174-fix-LinstorSR-explicit-errors-when-database-path-is-.patch +++ b/SOURCES/0174-fix-LinstorSR-explicit-errors-when-database-path-is-.patch @@ -1,7 +1,7 @@ From cbd05b772d0510be31296bfc09cda7389dc796fd Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 6 May 2024 21:35:36 +0200 -Subject: [PATCH 174/176] fix(LinstorSR): explicit errors when database path is +Subject: [PATCH 174/178] fix(LinstorSR): explicit errors when database path is fetched --- diff --git a/SOURCES/0175-fix-LinstorSR-Misc-fixes-on-destroy.patch b/SOURCES/0175-fix-LinstorSR-Misc-fixes-on-destroy.patch index bca3d63e..a1482987 100644 --- a/SOURCES/0175-fix-LinstorSR-Misc-fixes-on-destroy.patch +++ b/SOURCES/0175-fix-LinstorSR-Misc-fixes-on-destroy.patch @@ -1,7 +1,7 @@ From 318460ff8dfccafc928dfc12de211b2336da3386 Mon Sep 17 00:00:00 2001 From: Damien Thenot Date: Tue, 30 Apr 2024 15:38:34 +0200 -Subject: [PATCH 175/176] fix(LinstorSR): Misc fixes on destroy +Subject: [PATCH 175/178] fix(LinstorSR): Misc fixes on destroy linstor-manager: - fix on get_drbd_volumes diff --git a/SOURCES/0176-fix-LinstorSR-open-non-leaf-volumes-in-RO-mode-creat.patch b/SOURCES/0176-fix-LinstorSR-open-non-leaf-volumes-in-RO-mode-creat.patch index 4c8f0317..cb8f32a9 100644 --- a/SOURCES/0176-fix-LinstorSR-open-non-leaf-volumes-in-RO-mode-creat.patch +++ b/SOURCES/0176-fix-LinstorSR-open-non-leaf-volumes-in-RO-mode-creat.patch @@ -1,7 +1,7 @@ From 8c6fe4981a647aa087a91d76ecc9fe5d4f94b082 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 20 Jun 2024 22:37:40 +0200 -Subject: [PATCH 176/176] fix(LinstorSR): open non-leaf volumes in RO mode +Subject: [PATCH 176/178] fix(LinstorSR): open non-leaf volumes in RO mode (create_chain_paths) We must never open non-leaf volumes with the write option. diff --git a/SOURCES/0177-fix-LinstorSR-ensure-_is_master-is-always-set.patch b/SOURCES/0177-fix-LinstorSR-ensure-_is_master-is-always-set.patch new file mode 100644 index 00000000..5fcbd761 --- /dev/null +++ b/SOURCES/0177-fix-LinstorSR-ensure-_is_master-is-always-set.patch @@ -0,0 +1,158 @@ +From 56fd6bfd862670262c52d2722ac506c276a12d56 Mon Sep 17 00:00:00 2001 +From: Ronan Abhamon +Date: Fri, 26 Jul 2024 11:32:20 +0200 +Subject: [PATCH 177/178] fix(LinstorSR): ensure `_is_master` is always set + +`_is_master` is not always initialized, and more precisely +in the case of detach where LinstorSR.load method is not called. + +Still in this same situation, this can lead to the deletion of DRBD diskless +on the master while we try to always have one so as not to needlessly +recreate one later. + +Signed-off-by: Ronan Abhamon +--- + drivers/LinstorSR.py | 36 +++++++++++++++++++++--------------- + 1 file changed, 21 insertions(+), 15 deletions(-) + +diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py +index 2127057..fdcad17 100755 +--- a/drivers/LinstorSR.py ++++ b/drivers/LinstorSR.py +@@ -362,9 +362,6 @@ class LinstorSR(SR.SR): + self._linstor = None # Ensure that LINSTOR attribute exists. + self._journaler = None + +- self._is_master = False +- if 'SRmaster' in self.dconf and self.dconf['SRmaster'] == 'true': +- self._is_master = True + self._group_name = self.dconf['group-name'] + + self._vdi_shared_time = 0 +@@ -437,7 +434,7 @@ class LinstorSR(SR.SR): + + return wrapped_method(self, *args, **kwargs) + +- if not self._is_master: ++ if not self.is_master(): + if self.cmd in [ + 'sr_create', 'sr_delete', 'sr_update', 'sr_probe', + 'sr_scan', 'vdi_create', 'vdi_delete', 'vdi_resize', +@@ -472,7 +469,7 @@ class LinstorSR(SR.SR): + + # Ensure we use a non-locked volume when vhdutil is called. + if ( +- self._is_master and self.cmd.startswith('vdi_') and ++ self.is_master() and self.cmd.startswith('vdi_') and + self.cmd != 'vdi_create' + ): + self._linstor.ensure_volume_is_not_locked( +@@ -487,7 +484,7 @@ class LinstorSR(SR.SR): + # + # If the command is a SR command we want at least to remove + # resourceless volumes. +- if self._is_master and self.cmd not in [ ++ if self.is_master() and self.cmd not in [ + 'vdi_attach', 'vdi_detach', + 'vdi_activate', 'vdi_deactivate', + 'vdi_epoch_begin', 'vdi_epoch_end', +@@ -783,6 +780,15 @@ class LinstorSR(SR.SR): + self._kick_gc() + return ret + ++ def is_master(self): ++ if not hasattr(self, '_is_master'): ++ if 'SRmaster' not in self.dconf: ++ self._is_master = self.session is not None and util.is_master(self.session) ++ else: ++ self._is_master = self.dconf['SRmaster'] == 'true' ++ ++ return self._is_master ++ + @_locked_load + def vdi(self, uuid): + return LinstorVDI(self, uuid) +@@ -968,7 +974,7 @@ class LinstorSR(SR.SR): + ) + + def _synchronize_metadata(self): +- if not self._is_master: ++ if not self.is_master(): + return + + util.SMlog('Synchronize metadata...') +@@ -1015,7 +1021,7 @@ class LinstorSR(SR.SR): + if self._vdis_loaded: + return + +- assert self._is_master ++ assert self.is_master() + + # We use a cache to avoid repeated JSON parsing. + # The performance gain is not big but we can still +@@ -1494,7 +1500,7 @@ class LinstorSR(SR.SR): + controller_uri, + self._group_name, + repair=( +- self._is_master and ++ self.is_master() and + self.srcmd.cmd in self.ops_exclusive + ), + logger=util.SMlog +@@ -1796,7 +1802,7 @@ class LinstorVDI(VDI.VDI): + writable = 'args' not in self.sr.srcmd.params or \ + self.sr.srcmd.params['args'][0] == 'true' + +- if not attach_from_config or self.sr._is_master: ++ if not attach_from_config or self.sr.is_master(): + # We need to inflate the volume if we don't have enough place + # to mount the VHD image. I.e. the volume capacity must be greater + # than the VHD size + bitmap size. +@@ -1878,7 +1884,7 @@ class LinstorVDI(VDI.VDI): + ) + + # We remove only on slaves because the volume can be used by the GC. +- if self.sr._is_master: ++ if self.sr.is_master(): + return + + while vdi_uuid: +@@ -1899,7 +1905,7 @@ class LinstorVDI(VDI.VDI): + + def resize(self, sr_uuid, vdi_uuid, size): + util.SMlog('LinstorVDI.resize for {}'.format(self.uuid)) +- if not self.sr._is_master: ++ if not self.sr.is_master(): + raise xs_errors.XenError( + 'VDISize', + opterr='resize on slave not allowed' +@@ -2158,7 +2164,7 @@ class LinstorVDI(VDI.VDI): + # -------------------------------------------------------------------------- + + def _prepare_thin(self, attach): +- if self.sr._is_master: ++ if self.sr.is_master(): + if attach: + attach_thin( + self.session, self.sr._journaler, self._linstor, +@@ -2747,7 +2753,7 @@ class LinstorVDI(VDI.VDI): + + # 0. Fetch drbd path. + must_get_device_path = True +- if not self.sr._is_master: ++ if not self.sr.is_master(): + # We are on a slave, we must try to find a diskful locally. + try: + volume_info = self._linstor.get_volume_info(self.uuid) +@@ -2762,7 +2768,7 @@ class LinstorVDI(VDI.VDI): + must_get_device_path = hostname in volume_info.diskful + + drbd_path = None +- if must_get_device_path or self.sr._is_master: ++ if must_get_device_path or self.sr.is_master(): + # If we are master, we must ensure we have a diskless + # or diskful available to init HA. + # It also avoid this error in xensource.log +-- +2.45.2 + diff --git a/SOURCES/0178-fix-linstor-check-if-resource-is-tiebreaker-62.patch b/SOURCES/0178-fix-linstor-check-if-resource-is-tiebreaker-62.patch new file mode 100644 index 00000000..0fbf0fb6 --- /dev/null +++ b/SOURCES/0178-fix-linstor-check-if-resource-is-tiebreaker-62.patch @@ -0,0 +1,35 @@ +From 35038d57307463634f18aab89c0c5716184ba9ee Mon Sep 17 00:00:00 2001 +From: Damien Thenot +Date: Fri, 26 Jul 2024 14:13:05 +0200 +Subject: [PATCH 178/178] fix(linstor): check if resource is tiebreaker (#62) + +We check if a resource is already a tiebreaker before trying to delete +the resource. +If it is, we do not delete it. + +Signed-off-by: Damien Thenot +--- + drivers/linstorvolumemanager.py | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 103f91b..8bfd1c1 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -812,6 +812,13 @@ class LinstorVolumeManager(object): + volume_name = volume_properties.get(self.PROP_VOLUME_NAME) + + node_name = socket.gethostname() ++ ++ for resource in self._get_resource_cache().resources: ++ if resource.name == volume_name and resource.node_name == node_name: ++ if linstor.consts.FLAG_TIE_BREAKER in resource.flags: ++ return ++ break ++ + result = self._linstor.resource_delete_if_diskless( + node_name=node_name, rsc_name=volume_name + ) +-- +2.45.2 + diff --git a/SPECS/sm.spec b/SPECS/sm.spec index 5150f326..3a4909db 100644 --- a/SPECS/sm.spec +++ b/SPECS/sm.spec @@ -11,7 +11,7 @@ Summary: sm - XCP storage managers Name: sm Version: 2.30.8 -Release: %{?xsrel}.1.0.linstor.3%{?dist} +Release: %{?xsrel}.1.0.linstor.4%{?dist} Group: System/Hypervisor License: LGPL URL: https://github.com/xapi-project/sm @@ -272,6 +272,8 @@ Patch1173: 0173-fix-linstorvhdutil-retry-check-on-another-machine-in.patch Patch1174: 0174-fix-LinstorSR-explicit-errors-when-database-path-is-.patch Patch1175: 0175-fix-LinstorSR-Misc-fixes-on-destroy.patch Patch1176: 0176-fix-LinstorSR-open-non-leaf-volumes-in-RO-mode-creat.patch +Patch1177: 0177-fix-LinstorSR-ensure-_is_master-is-always-set.patch +Patch1178: 0178-fix-linstor-check-if-resource-is-tiebreaker-62.patch %description This package contains storage backends used in XCP @@ -688,6 +690,10 @@ cp -r htmlcov %{buildroot}/htmlcov %{_unitdir}/linstor-monitor.service %changelog +* Fri Jul 26 2024 Ronan Abhamon 2.30.8-12.1.0.linstor.4 +- Add 0177-fix-LinstorSR-ensure-_is_master-is-always-set.patch +- Add 0178-fix-linstor-check-if-resource-is-tiebreaker-62.patch + * Fri Jun 28 2024 Ronan Abhamon 2.30.8-12.1.0.linstor.3 - Add 0176-fix-LinstorSR-open-non-leaf-volumes-in-RO-mode-creat.patch From 7c0721c0d02b96d64728f8ba0d4f47070105bfb8 Mon Sep 17 00:00:00 2001 From: Damien Thenot Date: Wed, 7 Aug 2024 14:23:49 +0200 Subject: [PATCH 5/8] Sync patches with our latest 8.2 branch (#53) Signed-off-by: Damien Thenot --- ...21cc248d79b749a63d4ad099e6d5f4b8b588.patch | 2 +- ...-sm.service-s-description-for-XCP-ng.patch | 2 +- .../0003-Add-TrueNAS-multipath-config.patch | 2 +- ...add-CephFS-GlusterFS-and-XFS-drivers.patch | 2 +- ...-ZFS-driver-to-avoid-losing-VDI-meta.patch | 2 +- ...driver-for-users-who-need-to-transit.patch | 2 +- ...07-feat-drivers-add-LinstorSR-driver.patch | 14 +- ...nit-tests-concerning-ZFS-close-xcp-n.patch | 4 +- ...no-NFS-ACLs-provided-assume-everyone.patch | 4 +- .../0010-Added-SM-Driver-for-MooseFS.patch | 4 +- ...mount-in-ISOSR-when-legacy_mode-is-u.patch | 4 +- ...SR-uses-now-UUID-subdirs-for-each-SR.patch | 4 +- ...Fix-is_open-call-for-many-drivers-25.patch | 4 +- ...HING-capability-for-many-SR-types-24.patch | 4 +- ...ve-SR_PROBE-from-ZFS-capabilities-37.patch | 4 +- ...ix-vdi-ref-when-static-vdis-are-used.patch | 4 +- ...-not-to-edit-multipath.conf-directly.patch | 4 +- ...om.conf-multipath-configuration-file.patch | 4 +- ...all-etc-multipath-conf.d-custom.conf.patch | 4 +- SOURCES/0020-Backport-NFS4-only-support.patch | 4 +- ...or-NFS4-when-rpcinfo-does-not-includ.patch | 4 +- ...Block-backport-of-largeblocksr-51-55.patch | 4 +- ...dd-a-way-to-modify-config-of-LVMs-56.patch | 4 +- ...-check-for-missing-iSCSI-sessions-an.patch | 1039 +++++++++++++++++ ...alarm-must-be-reset-in-case-of-succ.patch} | 6 +- ...rns-the-result-of-user-function-now.patch} | 6 +- ...-pause-tag-from-VDIs-in-case-of-fai.patch} | 6 +- ...air-volumes-only-if-an-exclusive-co.patch} | 6 +- ...nstorSR-Improve-LINSTOR-performance.patch} | 6 +- ...bustify-scan-to-avoid-losing-VDIs-i.patch} | 6 +- ...splay-a-correctly-readable-size-for.patch} | 6 +- ...tord-scan-all-LINSTOR-SRs-every-12-.patch} | 6 +- ...l-correctly-method-in-_locked_load-.patch} | 6 +- ...SR-integrate-minidrbdcluster-daemon.patch} | 20 +- ...sure-heartbeat-and-redo_log-VDIs-ar.patch} | 6 +- ...otect-sr-commands-to-avoid-forgetti.patch} | 6 +- ...ler-ensure-uri-is-not-None-during-l.patch} | 6 +- ...d-an-option-to-disable-auto-quorum-.patch} | 6 +- ...Manager-add-a-workaround-to-create-.patch} | 6 +- ...instorSR-add-optional-ips-parameter.patch} | 6 +- ...d-a-helper-log_drbd_erofs-to-trace-.patch} | 6 +- ...-to-restart-the-services-again-if-t.patch} | 6 +- ...ustify-linstor-manager-to-never-inc.patch} | 6 +- ...vent-starting-controller-during-fai.patch} | 6 +- ...eManager-increase-peer-slots-limit-.patch} | 6 +- ...eManager-add-a-fallback-to-find-con.patch} | 6 +- ...or.mount-ensure-we-always-mount-dat.patch} | 10 +- ...eManager-add-a-fallback-to-find-nod.patch} | 6 +- ...plain-on-which-host-plugins-command.patch} | 6 +- ...ate-diskless-path-if-necessary-duri.patch} | 6 +- ...e-HTTP-NBD-instead-of-DRBD-directly.patch} | 10 +- ...d-controller-when-XAPI-unreachable-.patch} | 6 +- ...-IPs-instead-of-hostnames-in-NBD-se.patch} | 6 +- ...Manager-ensure-we-always-use-IPs-in.patch} | 6 +- ...ger-add-methods-to-add-remove-host-.patch} | 6 +- ...eManager-support-SR-creation-with-d.patch} | 6 +- ...d-a-config-var-to-disable-HTTP-NBD-.patch} | 6 +- ...sure-LVM-group-is-activated-during-.patch} | 6 +- ...ger-add-method-to-create-LinstorSR-.patch} | 6 +- ...ays-set-vdi_path-in-generate_config.patch} | 6 +- ...er-supports-new-properties-like-for.patch} | 6 +- ...bled-disable-minidrbcluster-with-fi.patch} | 6 +- ...er-change-linstor-satellite-start-b.patch} | 6 +- ...0064-Fix-is_open-call-for-LinstorSR.patch} | 6 +- ...il-fix-boolean-params-of-check-call.patch} | 6 +- ...or-manager-robustify-exec_create_sr.patch} | 6 +- ...-LINSTOR-VDI-UUID-if-error-during-i.patch} | 6 +- ...e-and-dump-DRBD-openers-in-case-of-.patch} | 6 +- ...il-trace-DRBD-openers-in-case-of-ER.patch} | 6 +- ...manager-compute-correctly-size-in-a.patch} | 6 +- ...e-DRBD-openers-instead-of-lsof-to-l.patch} | 6 +- ...pport-cProfile-to-trace-calls-when-.patch} | 6 +- ...ler-reset-namespace-when-get-is-cal.patch} | 6 +- ...l-fix-coalesce-with-VM-running-unde.patch} | 6 +- ...manager-_get_volumes_info-doesn-t-r.patch} | 6 +- ...manager-remove-double-prefix-on-kv-.patch} | 6 +- ...d-linstor-kv-dump-helper-to-print-k.patch} | 10 +- ...able-VHD-key-hash-usage-to-limit-ex.patch} | 6 +- ...er-ensure-SIGINT-is-handled-correct.patch} | 6 +- ...ter-stop-resource-services-at-start.patch} | 6 +- ...ger-add-new-healthCheck-function-to.patch} | 6 +- ...-xha-conf-parsing-return-host-ip-no.patch} | 6 +- ...rt-correctly-HA-servers-HTTP-NBD-af.patch} | 6 +- ...manager-use-an-array-to-store-diskf.patch} | 6 +- ...emanager-support-snaps-when-a-host-.patch} | 6 +- ...manager-support-offline-hosts-when-.patch} | 6 +- ...manager-define-_base_group_name-mem.patch} | 6 +- ...il-modify-logic-of-local-vhdutil-ca.patch} | 6 +- ...emanager-robustify-failed-snapshots.patch} | 6 +- ...manager-use-a-namespace-for-volumes.patch} | 6 +- ...ump-rename-to-linstor-kv-tool-add-r.patch} | 10 +- ...dle-correctly-localhost-during-star.patch} | 6 +- ...ll-repair-on-another-host-when-EROF.patch} | 6 +- ...oid-introduction-of-DELETED-volumes.patch} | 6 +- ...ool-remove-all-volumes-supports-jou.patch} | 6 +- ...l-due-to-bad-refactoring-check-call.patch} | 6 +- ...il-ensure-we-use-VHD-parent-to-find.patch} | 6 +- ...emanager-force-DRBD-demote-after-fa.patch} | 6 +- ...l-ensure-we-retry-creation-in-all-s.patch} | 6 +- ...l-don-t-retry-local-vhdutil-call-wh.patch} | 6 +- ...feat-fork-log-daemon-ignore-SIGTERM.patch} | 6 +- ...R-wait-for-http-disk-server-startup.patch} | 6 +- ...dle-inflate-resize-actions-correctl.patch} | 6 +- ...er-add-a-static-iptables-rule-for-D.patch} | 6 +- ...nc-with-last-http-nbd-transfer-vers.patch} | 6 +- ...-t-check-VDI-metadata-while-listing.patch} | 6 +- ...-t-check-metadata-when-destroying-s.patch} | 6 +- ...l-handle-correctly-generic-exceptio.patch} | 6 +- ...er-robustify-to-unmount-correctly-L.patch} | 10 +- ...er-handle-correctly-KeyboardInterru.patch} | 6 +- ...e-drbd-reactor-instead-of-minidrbdc.patch} | 18 +- ...ure-vhdutil-calls-are-correctly-exe.patch} | 6 +- ...place-bad-param-in-detach_thin-impl.patch} | 6 +- ...umemanager-remove-usage-of-realpath.patch} | 6 +- ...hdutil-avoid-parent-path-resolution.patch} | 6 +- ...SR-create-parent-path-during-attach.patch} | 6 +- ...etry-if-we-can-t-build-volume-cache.patch} | 6 +- ...manager-reduce-peer-slots-param-to-.patch} | 6 +- ...ach-a-valid-XAPI-session-is_open-is.patch} | 6 +- ...ure-we-always-have-a-DRBD-path-to-s.patch} | 6 +- ...ix-LinstorSR-remove-hosts-ips-param.patch} | 6 +- ...pute-correctly-SR-size-using-pool-c.patch} | 6 +- ...e-we-can-import-this-module-when-LI.patch} | 6 +- ...nsure-volume-cache-can-be-recreated.patch} | 6 +- ...er-remove-dead-useless-code-in-add-.patch} | 6 +- ...ure-we-always-have-a-device-path-du.patch} | 6 +- ...ays-use-lock.acquire-during-attach-.patch} | 6 +- ...e-sure-hostnames-are-unique-at-SR-c.patch} | 6 +- ...ure-we-can-attach-non-special-stati.patch} | 6 +- ...ure-we-can-detach-when-deflate-call.patch} | 6 +- ...ume-VDI-is-always-a-VHD-when-the-in.patch} | 6 +- ...ove-SR-lock-during-thin-attach-deta.patch} | 6 +- ...ure-database-is-mounted-during-scan.patch} | 6 +- ...tart-drbd-reactor-in-case-of-failur.patch} | 12 +- ...manager-retry-in-case-of-failure-du.patch} | 6 +- ...manager-avoid-diskless-creation-whe.patch} | 6 +- ...ove-diskless-after-VDI.detach-calls.patch} | 6 +- ...ustify-_load_vdi_info-in-cleanup.py.patch} | 6 +- ...ure-detach-never-fails-on-plugin-fa.patch} | 6 +- ...ure-we-coalesce-only-volumes-with-a.patch} | 6 +- ...-t-try-to-repair-persistent-volumes.patch} | 6 +- ...l-format-correctly-message-if-vhd-u.patch} | 6 +- ...ait-during-attach-to-open-DRBD-path.patch} | 6 +- ...port-different-volume-sizes-in-clea.patch} | 6 +- ...SR-remove-useless-IPS_XHA_CACHE-var.patch} | 6 +- ...ure-we-can-deflate-on-any-host-afte.patch} | 6 +- ...ure-we-always-use-real-DRBD-VHD-siz.patch} | 6 +- ...ool-If-no-controller-uri-option-is-.patch} | 6 +- ...lumemanager-robustify-SR-destroy-46.patch} | 6 +- ...ger-extend-API-with-createNodeInter.patch} | 6 +- ...support-VDI.resize-on-thick-volumes.patch} | 6 +- ...manager-format-correctly-exception-.patch} | 6 +- ...ure-we-can-skip-coalesces-if-device.patch} | 6 +- ...ger-add-methods-to-modify-destroy-l.patch} | 6 +- ...ce-a-defined-volume-prefix-if-we-ca.patch} | 6 +- ...licit-error-message-when-a-group-is.patch} | 6 +- ...e-sure-VDI.delete-doesn-t-throw-und.patch} | 6 +- ...-drbd-in-the-blacklist-of-multipath.patch} | 6 +- ...manager-create-cloned-volumes-on-ho.patch} | 6 +- ...manager-don-t-align-volumes-on-LVM-.patch} | 6 +- ...manager-assert-with-message-after-l.patch} | 6 +- ...manager-retry-resize-if-volume-is-n.patch} | 6 +- ...ate-DRBD-diskless-if-necessary-for-.patch} | 6 +- ...-bad-call-to-vhdutil.inflate-bad-ex.patch} | 6 +- ...ivate-VG-if-attach-from-config-is-a.patch} | 6 +- ...e-a-specific-resource-group-for-DB-.patch} | 6 +- ...ger-add-getNodePreferredInterface-h.patch} | 6 +- ...manager-blocks-deletion-of-default-.patch} | 6 +- ...emanager-change-logic-of-get_resour.patch} | 6 +- ...ger-add-error-codes-to-healthCheck-.patch} | 6 +- ...-bad-exception-reference-during-sna.patch} | 6 +- ...SISR-disable-restart-of-ISCSI-daemon.patch | 96 -- ...-ensure-LINSTOR-VHD-chain-is-availa.patch} | 6 +- ...il-retry-check-on-another-machine-in.patch | 4 +- ...plicit-errors-when-database-path-is-.patch | 4 +- ...-fix-LinstorSR-Misc-fixes-on-destroy.patch | 4 +- ...en-non-leaf-volumes-in-RO-mode-creat.patch | 4 +- ...orSR-ensure-_is_master-is-always-set.patch | 4 +- ...r-check-if-resource-is-tiebreaker-62.patch | 4 +- SOURCES/stormi.patch | 37 - SPECS/sm.spec | 320 +++-- 181 files changed, 1722 insertions(+), 824 deletions(-) create mode 100644 SOURCES/0024-Revert-CA-379329-check-for-missing-iSCSI-sessions-an.patch rename SOURCES/{0024-Fix-timeout_call-alarm-must-be-reset-in-case-of-succ.patch => 0025-Fix-timeout_call-alarm-must-be-reset-in-case-of-succ.patch} (84%) rename SOURCES/{0025-timeout_call-returns-the-result-of-user-function-now.patch => 0026-timeout_call-returns-the-result-of-user-function-now.patch} (82%) rename SOURCES/{0026-Always-remove-the-pause-tag-from-VDIs-in-case-of-fai.patch => 0027-Always-remove-the-pause-tag-from-VDIs-in-case-of-fai.patch} (94%) rename SOURCES/{0027-fix-LinstorSR-repair-volumes-only-if-an-exclusive-co.patch => 0028-fix-LinstorSR-repair-volumes-only-if-an-exclusive-co.patch} (90%) rename SOURCES/{0028-feat-LinstorSR-Improve-LINSTOR-performance.patch => 0029-feat-LinstorSR-Improve-LINSTOR-performance.patch} (99%) rename SOURCES/{0029-feat-LinstorSR-robustify-scan-to-avoid-losing-VDIs-i.patch => 0030-feat-LinstorSR-robustify-scan-to-avoid-losing-VDIs-i.patch} (95%) rename SOURCES/{0030-feat-LinstorSR-display-a-correctly-readable-size-for.patch => 0031-feat-LinstorSR-display-a-correctly-readable-size-for.patch} (98%) rename SOURCES/{0031-feat-linstor-monitord-scan-all-LINSTOR-SRs-every-12-.patch => 0032-feat-linstor-monitord-scan-all-LINSTOR-SRs-every-12-.patch} (98%) rename SOURCES/{0032-fix-LinstorSR-call-correctly-method-in-_locked_load-.patch => 0033-fix-LinstorSR-call-correctly-method-in-_locked_load-.patch} (91%) rename SOURCES/{0033-feat-LinstorSR-integrate-minidrbdcluster-daemon.patch => 0034-feat-LinstorSR-integrate-minidrbdcluster-daemon.patch} (99%) rename SOURCES/{0034-feat-LinstorSR-ensure-heartbeat-and-redo_log-VDIs-ar.patch => 0035-feat-LinstorSR-ensure-heartbeat-and-redo_log-VDIs-ar.patch} (97%) rename SOURCES/{0035-feat-LinstorSR-protect-sr-commands-to-avoid-forgetti.patch => 0036-feat-LinstorSR-protect-sr-commands-to-avoid-forgetti.patch} (97%) rename SOURCES/{0036-fix-LinstorJournaler-ensure-uri-is-not-None-during-l.patch => 0037-fix-LinstorJournaler-ensure-uri-is-not-None-during-l.patch} (92%) rename SOURCES/{0037-feat-LinstorSR-add-an-option-to-disable-auto-quorum-.patch => 0038-feat-LinstorSR-add-an-option-to-disable-auto-quorum-.patch} (97%) rename SOURCES/{0038-fix-LinstorVolumeManager-add-a-workaround-to-create-.patch => 0039-fix-LinstorVolumeManager-add-a-workaround-to-create-.patch} (90%) rename SOURCES/{0039-feat-LinstorSR-add-optional-ips-parameter.patch => 0040-feat-LinstorSR-add-optional-ips-parameter.patch} (97%) rename SOURCES/{0040-feat-LinstorSR-add-a-helper-log_drbd_erofs-to-trace-.patch => 0041-feat-LinstorSR-add-a-helper-log_drbd_erofs-to-trace-.patch} (98%) rename SOURCES/{0041-fix-LinstorSR-try-to-restart-the-services-again-if-t.patch => 0042-fix-LinstorSR-try-to-restart-the-services-again-if-t.patch} (94%) rename SOURCES/{0042-fix-LinstorSR-robustify-linstor-manager-to-never-inc.patch => 0043-fix-LinstorSR-robustify-linstor-manager-to-never-inc.patch} (89%) rename SOURCES/{0043-fix-LinstorSR-prevent-starting-controller-during-fai.patch => 0044-fix-LinstorSR-prevent-starting-controller-during-fai.patch} (93%) rename SOURCES/{0044-feat-LinstorVolumeManager-increase-peer-slots-limit-.patch => 0045-feat-LinstorVolumeManager-increase-peer-slots-limit-.patch} (97%) rename SOURCES/{0045-feat-LinstorVolumeManager-add-a-fallback-to-find-con.patch => 0046-feat-LinstorVolumeManager-add-a-fallback-to-find-con.patch} (96%) rename SOURCES/{0046-fix-var-lib-linstor.mount-ensure-we-always-mount-dat.patch => 0047-fix-var-lib-linstor.mount-ensure-we-always-mount-dat.patch} (95%) rename SOURCES/{0047-feat-LinstorVolumeManager-add-a-fallback-to-find-nod.patch => 0048-feat-LinstorVolumeManager-add-a-fallback-to-find-nod.patch} (92%) rename SOURCES/{0048-feat-LinstorSR-explain-on-which-host-plugins-command.patch => 0049-feat-LinstorSR-explain-on-which-host-plugins-command.patch} (92%) rename SOURCES/{0049-fix-LinstorSR-create-diskless-path-if-necessary-duri.patch => 0050-fix-LinstorSR-create-diskless-path-if-necessary-duri.patch} (90%) rename SOURCES/{0050-feat-LinstorSR-use-HTTP-NBD-instead-of-DRBD-directly.patch => 0051-feat-LinstorSR-use-HTTP-NBD-instead-of-DRBD-directly.patch} (99%) rename SOURCES/{0051-fix-LinstorSR-find-controller-when-XAPI-unreachable-.patch => 0052-fix-LinstorSR-find-controller-when-XAPI-unreachable-.patch} (98%) rename SOURCES/{0052-fix-LinstorSR-use-IPs-instead-of-hostnames-in-NBD-se.patch => 0053-fix-LinstorSR-use-IPs-instead-of-hostnames-in-NBD-se.patch} (98%) rename SOURCES/{0053-fix-LinstorVolumeManager-ensure-we-always-use-IPs-in.patch => 0054-fix-LinstorVolumeManager-ensure-we-always-use-IPs-in.patch} (87%) rename SOURCES/{0054-feat-linstor-manager-add-methods-to-add-remove-host-.patch => 0055-feat-linstor-manager-add-methods-to-add-remove-host-.patch} (99%) rename SOURCES/{0055-feat-LinstorVolumeManager-support-SR-creation-with-d.patch => 0056-feat-LinstorVolumeManager-support-SR-creation-with-d.patch} (97%) rename SOURCES/{0056-feat-LinstorSR-add-a-config-var-to-disable-HTTP-NBD-.patch => 0057-feat-LinstorSR-add-a-config-var-to-disable-HTTP-NBD-.patch} (93%) rename SOURCES/{0057-feat-LinstorSr-ensure-LVM-group-is-activated-during-.patch => 0058-feat-LinstorSr-ensure-LVM-group-is-activated-during-.patch} (95%) rename SOURCES/{0058-feat-linstor-manager-add-method-to-create-LinstorSR-.patch => 0059-feat-linstor-manager-add-method-to-create-LinstorSR-.patch} (98%) rename SOURCES/{0059-fix-LinstorSR-always-set-vdi_path-in-generate_config.patch => 0060-fix-LinstorSR-always-set-vdi_path-in-generate_config.patch} (87%) rename SOURCES/{0060-fix-minidrbdcluster-supports-new-properties-like-for.patch => 0061-fix-minidrbdcluster-supports-new-properties-like-for.patch} (89%) rename SOURCES/{0061-fix-LinstorSR-enabled-disable-minidrbcluster-with-fi.patch => 0062-fix-LinstorSR-enabled-disable-minidrbcluster-with-fi.patch} (95%) rename SOURCES/{0062-fix-linstor-manager-change-linstor-satellite-start-b.patch => 0063-fix-linstor-manager-change-linstor-satellite-start-b.patch} (90%) rename SOURCES/{0063-Fix-is_open-call-for-LinstorSR.patch => 0064-Fix-is_open-call-for-LinstorSR.patch} (96%) rename SOURCES/{0064-fix-linstorvhdutil-fix-boolean-params-of-check-call.patch => 0065-fix-linstorvhdutil-fix-boolean-params-of-check-call.patch} (92%) rename SOURCES/{0065-feat-linstor-manager-robustify-exec_create_sr.patch => 0066-feat-linstor-manager-robustify-exec_create_sr.patch} (98%) rename SOURCES/{0066-fix-cleanup-print-LINSTOR-VDI-UUID-if-error-during-i.patch => 0067-fix-cleanup-print-LINSTOR-VDI-UUID-if-error-during-i.patch} (84%) rename SOURCES/{0067-feat-cleanup-raise-and-dump-DRBD-openers-in-case-of-.patch => 0068-feat-cleanup-raise-and-dump-DRBD-openers-in-case-of-.patch} (97%) rename SOURCES/{0068-feat-linstorvhdutil-trace-DRBD-openers-in-case-of-ER.patch => 0069-feat-linstorvhdutil-trace-DRBD-openers-in-case-of-ER.patch} (97%) rename SOURCES/{0069-fix-linstorvolumemanager-compute-correctly-size-in-a.patch => 0070-fix-linstorvolumemanager-compute-correctly-size-in-a.patch} (96%) rename SOURCES/{0070-feat-LinstorSR-use-DRBD-openers-instead-of-lsof-to-l.patch => 0071-feat-LinstorSR-use-DRBD-openers-instead-of-lsof-to-l.patch} (98%) rename SOURCES/{0071-feat-LinstorSR-support-cProfile-to-trace-calls-when-.patch => 0072-feat-LinstorSR-support-cProfile-to-trace-calls-when-.patch} (94%) rename SOURCES/{0072-fix-LinstorJournaler-reset-namespace-when-get-is-cal.patch => 0073-fix-LinstorJournaler-reset-namespace-when-get-is-cal.patch} (83%) rename SOURCES/{0073-fix-linstorvhdutil-fix-coalesce-with-VM-running-unde.patch => 0074-fix-linstorvhdutil-fix-coalesce-with-VM-running-unde.patch} (99%) rename SOURCES/{0074-fix-linstorvolumemanager-_get_volumes_info-doesn-t-r.patch => 0075-fix-linstorvolumemanager-_get_volumes_info-doesn-t-r.patch} (93%) rename SOURCES/{0075-fix-linstorvolumemanager-remove-double-prefix-on-kv-.patch => 0076-fix-linstorvolumemanager-remove-double-prefix-on-kv-.patch} (90%) rename SOURCES/{0076-feat-LinstorSR-add-linstor-kv-dump-helper-to-print-k.patch => 0077-feat-LinstorSR-add-linstor-kv-dump-helper-to-print-k.patch} (92%) rename SOURCES/{0077-fix-LinstorSR-disable-VHD-key-hash-usage-to-limit-ex.patch => 0078-fix-LinstorSR-disable-VHD-key-hash-usage-to-limit-ex.patch} (89%) rename SOURCES/{0078-fix-minidrbdcluster-ensure-SIGINT-is-handled-correct.patch => 0079-fix-minidrbdcluster-ensure-SIGINT-is-handled-correct.patch} (95%) rename SOURCES/{0079-feat-minidrbdcluster-stop-resource-services-at-start.patch => 0080-feat-minidrbdcluster-stop-resource-services-at-start.patch} (97%) rename SOURCES/{0080-feat-linstor-manager-add-new-healthCheck-function-to.patch => 0081-feat-linstor-manager-add-new-healthCheck-function-to.patch} (98%) rename SOURCES/{0081-fix-LinstorSR-fix-xha-conf-parsing-return-host-ip-no.patch => 0082-fix-LinstorSR-fix-xha-conf-parsing-return-host-ip-no.patch} (91%) rename SOURCES/{0082-fix-LinstorSR-start-correctly-HA-servers-HTTP-NBD-af.patch => 0083-fix-LinstorSR-start-correctly-HA-servers-HTTP-NBD-af.patch} (92%) rename SOURCES/{0083-fix-linstorvolumemanager-use-an-array-to-store-diskf.patch => 0084-fix-linstorvolumemanager-use-an-array-to-store-diskf.patch} (95%) rename SOURCES/{0084-feat-linstorvolumemanager-support-snaps-when-a-host-.patch => 0085-feat-linstorvolumemanager-support-snaps-when-a-host-.patch} (87%) rename SOURCES/{0085-fix-linstorvolumemanager-support-offline-hosts-when-.patch => 0086-fix-linstorvolumemanager-support-offline-hosts-when-.patch} (96%) rename SOURCES/{0086-fix-linstorvolumemanager-define-_base_group_name-mem.patch => 0087-fix-linstorvolumemanager-define-_base_group_name-mem.patch} (89%) rename SOURCES/{0087-feat-linstorvhdutil-modify-logic-of-local-vhdutil-ca.patch => 0088-feat-linstorvhdutil-modify-logic-of-local-vhdutil-ca.patch} (97%) rename SOURCES/{0088-fix-linstorvolumemanager-robustify-failed-snapshots.patch => 0089-fix-linstorvolumemanager-robustify-failed-snapshots.patch} (94%) rename SOURCES/{0089-fix-linstorvolumemanager-use-a-namespace-for-volumes.patch => 0090-fix-linstorvolumemanager-use-a-namespace-for-volumes.patch} (84%) rename SOURCES/{0090-feat-linstor-kv-dump-rename-to-linstor-kv-tool-add-r.patch => 0091-feat-linstor-kv-dump-rename-to-linstor-kv-tool-add-r.patch} (93%) rename SOURCES/{0091-fix-LinstorSR-handle-correctly-localhost-during-star.patch => 0092-fix-LinstorSR-handle-correctly-localhost-during-star.patch} (95%) rename SOURCES/{0092-fix-cleanup.py-call-repair-on-another-host-when-EROF.patch => 0093-fix-cleanup.py-call-repair-on-another-host-when-EROF.patch} (93%) rename SOURCES/{0093-fix-LinstorSR-avoid-introduction-of-DELETED-volumes.patch => 0094-fix-LinstorSR-avoid-introduction-of-DELETED-volumes.patch} (84%) rename SOURCES/{0094-feat-linstor-kv-tool-remove-all-volumes-supports-jou.patch => 0095-feat-linstor-kv-tool-remove-all-volumes-supports-jou.patch} (86%) rename SOURCES/{0095-fix-linstorvhdutil-due-to-bad-refactoring-check-call.patch => 0096-fix-linstorvhdutil-due-to-bad-refactoring-check-call.patch} (88%) rename SOURCES/{0096-feat-linstorvhdutil-ensure-we-use-VHD-parent-to-find.patch => 0097-feat-linstorvhdutil-ensure-we-use-VHD-parent-to-find.patch} (95%) rename SOURCES/{0097-feat-linstorvolumemanager-force-DRBD-demote-after-fa.patch => 0098-feat-linstorvolumemanager-force-DRBD-demote-after-fa.patch} (98%) rename SOURCES/{0098-fix-linstorvhdutil-ensure-we-retry-creation-in-all-s.patch => 0099-fix-linstorvhdutil-ensure-we-retry-creation-in-all-s.patch} (97%) rename SOURCES/{0099-fix-linstorvhdutil-don-t-retry-local-vhdutil-call-wh.patch => 0100-fix-linstorvhdutil-don-t-retry-local-vhdutil-call-wh.patch} (98%) rename SOURCES/{0100-feat-fork-log-daemon-ignore-SIGTERM.patch => 0101-feat-fork-log-daemon-ignore-SIGTERM.patch} (86%) rename SOURCES/{0101-feat-LinstorSR-wait-for-http-disk-server-startup.patch => 0102-feat-LinstorSR-wait-for-http-disk-server-startup.patch} (96%) rename SOURCES/{0102-fix-LinstorSR-handle-inflate-resize-actions-correctl.patch => 0103-fix-LinstorSR-handle-inflate-resize-actions-correctl.patch} (97%) rename SOURCES/{0103-fix-linstor-manager-add-a-static-iptables-rule-for-D.patch => 0104-fix-linstor-manager-add-a-static-iptables-rule-for-D.patch} (97%) rename SOURCES/{0104-feat-LinstorSR-sync-with-last-http-nbd-transfer-vers.patch => 0105-feat-LinstorSR-sync-with-last-http-nbd-transfer-vers.patch} (97%) rename SOURCES/{0105-fix-LinstorSR-don-t-check-VDI-metadata-while-listing.patch => 0106-fix-LinstorSR-don-t-check-VDI-metadata-while-listing.patch} (88%) rename SOURCES/{0106-fix-LinstorSR-don-t-check-metadata-when-destroying-s.patch => 0107-fix-LinstorSR-don-t-check-metadata-when-destroying-s.patch} (89%) rename SOURCES/{0107-fix-linstorvhdutil-handle-correctly-generic-exceptio.patch => 0108-fix-linstorvhdutil-handle-correctly-generic-exceptio.patch} (94%) rename SOURCES/{0108-fix-minidrbdcluster-robustify-to-unmount-correctly-L.patch => 0109-fix-minidrbdcluster-robustify-to-unmount-correctly-L.patch} (93%) rename SOURCES/{0109-fix-minidrbdcluster-handle-correctly-KeyboardInterru.patch => 0110-fix-minidrbdcluster-handle-correctly-KeyboardInterru.patch} (91%) rename SOURCES/{0110-feat-LinstorSR-use-drbd-reactor-instead-of-minidrbdc.patch => 0111-feat-LinstorSR-use-drbd-reactor-instead-of-minidrbdc.patch} (98%) rename SOURCES/{0111-fix-LinstorSR-ensure-vhdutil-calls-are-correctly-exe.patch => 0112-fix-LinstorSR-ensure-vhdutil-calls-are-correctly-exe.patch} (97%) rename SOURCES/{0112-fix-LinstorSR-replace-bad-param-in-detach_thin-impl.patch => 0113-fix-LinstorSR-replace-bad-param-in-detach_thin-impl.patch} (88%) rename SOURCES/{0113-fix-linstorvolumemanager-remove-usage-of-realpath.patch => 0114-fix-linstorvolumemanager-remove-usage-of-realpath.patch} (93%) rename SOURCES/{0114-fix-linstorvhdutil-avoid-parent-path-resolution.patch => 0115-fix-linstorvhdutil-avoid-parent-path-resolution.patch} (96%) rename SOURCES/{0115-fix-LinstorSR-create-parent-path-during-attach.patch => 0116-fix-LinstorSR-create-parent-path-during-attach.patch} (91%) rename SOURCES/{0116-fix-LinstorSR-retry-if-we-can-t-build-volume-cache.patch => 0117-fix-LinstorSR-retry-if-we-can-t-build-volume-cache.patch} (88%) rename SOURCES/{0117-fix-linstorvolumemanager-reduce-peer-slots-param-to-.patch => 0118-fix-linstorvolumemanager-reduce-peer-slots-param-to-.patch} (94%) rename SOURCES/{0118-fix-LinstorSR-attach-a-valid-XAPI-session-is_open-is.patch => 0119-fix-LinstorSR-attach-a-valid-XAPI-session-is_open-is.patch} (86%) rename SOURCES/{0119-fix-LinstorSR-ensure-we-always-have-a-DRBD-path-to-s.patch => 0120-fix-LinstorSR-ensure-we-always-have-a-DRBD-path-to-s.patch} (85%) rename SOURCES/{0120-fix-LinstorSR-remove-hosts-ips-param.patch => 0121-fix-LinstorSR-remove-hosts-ips-param.patch} (97%) rename SOURCES/{0121-fix-LinstorSR-compute-correctly-SR-size-using-pool-c.patch => 0122-fix-LinstorSR-compute-correctly-SR-size-using-pool-c.patch} (96%) rename SOURCES/{0122-fix-blktap2-ensure-we-can-import-this-module-when-LI.patch => 0123-fix-blktap2-ensure-we-can-import-this-module-when-LI.patch} (91%) rename SOURCES/{0123-fix-LinstorSR-ensure-volume-cache-can-be-recreated.patch => 0124-fix-LinstorSR-ensure-volume-cache-can-be-recreated.patch} (96%) rename SOURCES/{0124-fix-linstor-manager-remove-dead-useless-code-in-add-.patch => 0125-fix-linstor-manager-remove-dead-useless-code-in-add-.patch} (98%) rename SOURCES/{0125-fix-LinstorSR-Ensure-we-always-have-a-device-path-du.patch => 0126-fix-LinstorSR-Ensure-we-always-have-a-device-path-du.patch} (93%) rename SOURCES/{0126-fix-LinstorSR-always-use-lock.acquire-during-attach-.patch => 0127-fix-LinstorSR-always-use-lock.acquire-during-attach-.patch} (93%) rename SOURCES/{0127-fix-LinstorSR-mare-sure-hostnames-are-unique-at-SR-c.patch => 0128-fix-LinstorSR-mare-sure-hostnames-are-unique-at-SR-c.patch} (86%) rename SOURCES/{0128-fix-LinstorSR-ensure-we-can-attach-non-special-stati.patch => 0129-fix-LinstorSR-ensure-we-can-attach-non-special-stati.patch} (86%) rename SOURCES/{0129-fix-LinstorSR-ensure-we-can-detach-when-deflate-call.patch => 0130-fix-LinstorSR-ensure-we-can-detach-when-deflate-call.patch} (96%) rename SOURCES/{0130-fix-LinstorSR-assume-VDI-is-always-a-VHD-when-the-in.patch => 0131-fix-LinstorSR-assume-VDI-is-always-a-VHD-when-the-in.patch} (89%) rename SOURCES/{0131-fix-LinstorSR-remove-SR-lock-during-thin-attach-deta.patch => 0132-fix-LinstorSR-remove-SR-lock-during-thin-attach-deta.patch} (97%) rename SOURCES/{0132-fix-LinstorSR-ensure-database-is-mounted-during-scan.patch => 0133-fix-LinstorSR-ensure-database-is-mounted-during-scan.patch} (94%) rename SOURCES/{0133-fix-LinstorSR-restart-drbd-reactor-in-case-of-failur.patch => 0134-fix-LinstorSR-restart-drbd-reactor-in-case-of-failur.patch} (88%) rename SOURCES/{0134-fix-linstorvolumemanager-retry-in-case-of-failure-du.patch => 0135-fix-linstorvolumemanager-retry-in-case-of-failure-du.patch} (88%) rename SOURCES/{0135-fix-linstorvolumemanager-avoid-diskless-creation-whe.patch => 0136-fix-linstorvolumemanager-avoid-diskless-creation-whe.patch} (97%) rename SOURCES/{0136-fix-LinstorSR-remove-diskless-after-VDI.detach-calls.patch => 0137-fix-LinstorSR-remove-diskless-after-VDI.detach-calls.patch} (96%) rename SOURCES/{0137-fix-LinstorSR-robustify-_load_vdi_info-in-cleanup.py.patch => 0138-fix-LinstorSR-robustify-_load_vdi_info-in-cleanup.py.patch} (97%) rename SOURCES/{0138-fix-LinstorSR-ensure-detach-never-fails-on-plugin-fa.patch => 0139-fix-LinstorSR-ensure-detach-never-fails-on-plugin-fa.patch} (87%) rename SOURCES/{0139-fix-LinstorSR-ensure-we-coalesce-only-volumes-with-a.patch => 0140-fix-LinstorSR-ensure-we-coalesce-only-volumes-with-a.patch} (97%) rename SOURCES/{0140-fix-LinstorSR-don-t-try-to-repair-persistent-volumes.patch => 0141-fix-LinstorSR-don-t-try-to-repair-persistent-volumes.patch} (98%) rename SOURCES/{0141-fix-linstorvhdutil-format-correctly-message-if-vhd-u.patch => 0142-fix-linstorvhdutil-format-correctly-message-if-vhd-u.patch} (87%) rename SOURCES/{0142-fix-LinstorSR-wait-during-attach-to-open-DRBD-path.patch => 0143-fix-LinstorSR-wait-during-attach-to-open-DRBD-path.patch} (92%) rename SOURCES/{0143-fix-LinstorSR-support-different-volume-sizes-in-clea.patch => 0144-fix-LinstorSR-support-different-volume-sizes-in-clea.patch} (99%) rename SOURCES/{0144-fix-LinstorSR-remove-useless-IPS_XHA_CACHE-var.patch => 0145-fix-LinstorSR-remove-useless-IPS_XHA_CACHE-var.patch} (83%) rename SOURCES/{0145-fix-LinstorSR-ensure-we-can-deflate-on-any-host-afte.patch => 0146-fix-LinstorSR-ensure-we-can-deflate-on-any-host-afte.patch} (98%) rename SOURCES/{0146-fix-LinstorSR-ensure-we-always-use-real-DRBD-VHD-siz.patch => 0147-fix-LinstorSR-ensure-we-always-use-real-DRBD-VHD-siz.patch} (97%) rename SOURCES/{0147-feat-linstor-kv-tool-If-no-controller-uri-option-is-.patch => 0148-feat-linstor-kv-tool-If-no-controller-uri-option-is-.patch} (93%) rename SOURCES/{0148-fix-linstorvolumemanager-robustify-SR-destroy-46.patch => 0149-fix-linstorvolumemanager-robustify-SR-destroy-46.patch} (98%) rename SOURCES/{0149-feat-linstor-manager-extend-API-with-createNodeInter.patch => 0150-feat-linstor-manager-extend-API-with-createNodeInter.patch} (96%) rename SOURCES/{0150-fix-LinstorSR-support-VDI.resize-on-thick-volumes.patch => 0151-fix-LinstorSR-support-VDI.resize-on-thick-volumes.patch} (88%) rename SOURCES/{0151-fix-linstorvolumemanager-format-correctly-exception-.patch => 0152-fix-linstorvolumemanager-format-correctly-exception-.patch} (88%) rename SOURCES/{0152-fix-LinstorSR-ensure-we-can-skip-coalesces-if-device.patch => 0153-fix-LinstorSR-ensure-we-can-skip-coalesces-if-device.patch} (87%) rename SOURCES/{0153-feat-linstor-manager-add-methods-to-modify-destroy-l.patch => 0154-feat-linstor-manager-add-methods-to-modify-destroy-l.patch} (98%) rename SOURCES/{0154-fix-LinstorSR-force-a-defined-volume-prefix-if-we-ca.patch => 0155-fix-LinstorSR-force-a-defined-volume-prefix-if-we-ca.patch} (80%) rename SOURCES/{0155-fix-LinstorSR-explicit-error-message-when-a-group-is.patch => 0156-fix-LinstorSR-explicit-error-message-when-a-group-is.patch} (86%) rename SOURCES/{0156-fix-LinstorSR-make-sure-VDI.delete-doesn-t-throw-und.patch => 0157-fix-LinstorSR-make-sure-VDI.delete-doesn-t-throw-und.patch} (94%) rename SOURCES/{0157-fix-LinstorSR-add-drbd-in-the-blacklist-of-multipath.patch => 0158-fix-LinstorSR-add-drbd-in-the-blacklist-of-multipath.patch} (88%) rename SOURCES/{0158-fix-linstorvolumemanager-create-cloned-volumes-on-ho.patch => 0159-fix-linstorvolumemanager-create-cloned-volumes-on-ho.patch} (97%) rename SOURCES/{0159-fix-linstorvolumemanager-don-t-align-volumes-on-LVM-.patch => 0160-fix-linstorvolumemanager-don-t-align-volumes-on-LVM-.patch} (87%) rename SOURCES/{0160-fix-linstorvolumemanager-assert-with-message-after-l.patch => 0161-fix-linstorvolumemanager-assert-with-message-after-l.patch} (87%) rename SOURCES/{0161-fix-linstorvolumemanager-retry-resize-if-volume-is-n.patch => 0162-fix-linstorvolumemanager-retry-resize-if-volume-is-n.patch} (93%) rename SOURCES/{0162-fix-LinstorSR-create-DRBD-diskless-if-necessary-for-.patch => 0163-fix-LinstorSR-create-DRBD-diskless-if-necessary-for-.patch} (96%) rename SOURCES/{0163-fix-LinstorSR-fix-bad-call-to-vhdutil.inflate-bad-ex.patch => 0164-fix-LinstorSR-fix-bad-call-to-vhdutil.inflate-bad-ex.patch} (89%) rename SOURCES/{0164-fix-LinstorSR-activate-VG-if-attach-from-config-is-a.patch => 0165-fix-LinstorSR-activate-VG-if-attach-from-config-is-a.patch} (84%) rename SOURCES/{0165-feat-LinstorSR-use-a-specific-resource-group-for-DB-.patch => 0166-feat-LinstorSR-use-a-specific-resource-group-for-DB-.patch} (99%) rename SOURCES/{0166-feat-linstor-manager-add-getNodePreferredInterface-h.patch => 0167-feat-linstor-manager-add-getNodePreferredInterface-h.patch} (95%) rename SOURCES/{0167-fix-linstorvolumemanager-blocks-deletion-of-default-.patch => 0168-fix-linstorvolumemanager-blocks-deletion-of-default-.patch} (87%) rename SOURCES/{0168-feat-linstorvolumemanager-change-logic-of-get_resour.patch => 0169-feat-linstorvolumemanager-change-logic-of-get_resour.patch} (96%) rename SOURCES/{0169-feat-linstor-manager-add-error-codes-to-healthCheck-.patch => 0170-feat-linstor-manager-add-error-codes-to-healthCheck-.patch} (98%) rename SOURCES/{0170-fix-LinstorSR-fix-bad-exception-reference-during-sna.patch => 0171-fix-LinstorSR-fix-bad-exception-reference-during-sna.patch} (90%) delete mode 100644 SOURCES/0172-fix-LVHDoISCSISR-disable-restart-of-ISCSI-daemon.patch rename SOURCES/{0171-fix-tapdisk-pause-ensure-LINSTOR-VHD-chain-is-availa.patch => 0172-fix-tapdisk-pause-ensure-LINSTOR-VHD-chain-is-availa.patch} (97%) delete mode 100644 SOURCES/stormi.patch diff --git a/SOURCES/0001-backport-of-ccd121cc248d79b749a63d4ad099e6d5f4b8b588.patch b/SOURCES/0001-backport-of-ccd121cc248d79b749a63d4ad099e6d5f4b8b588.patch index 08d41663..224c9f4d 100644 --- a/SOURCES/0001-backport-of-ccd121cc248d79b749a63d4ad099e6d5f4b8b588.patch +++ b/SOURCES/0001-backport-of-ccd121cc248d79b749a63d4ad099e6d5f4b8b588.patch @@ -87,5 +87,5 @@ index aa5a6b1..c752863 100755 def registerSR(SRClass): """Register SR with handler. All SR subclasses should call this in -- -2.45.2 +2.46.0 diff --git a/SOURCES/0002-Update-xs-sm.service-s-description-for-XCP-ng.patch b/SOURCES/0002-Update-xs-sm.service-s-description-for-XCP-ng.patch index 3b588691..49a6d8ab 100644 --- a/SOURCES/0002-Update-xs-sm.service-s-description-for-XCP-ng.patch +++ b/SOURCES/0002-Update-xs-sm.service-s-description-for-XCP-ng.patch @@ -21,5 +21,5 @@ index 99cb313..609c6ef 100644 Conflicts=shutdown.target RefuseManualStop=yes -- -2.45.2 +2.46.0 diff --git a/SOURCES/0003-Add-TrueNAS-multipath-config.patch b/SOURCES/0003-Add-TrueNAS-multipath-config.patch index 3d409dff..8490f577 100644 --- a/SOURCES/0003-Add-TrueNAS-multipath-config.patch +++ b/SOURCES/0003-Add-TrueNAS-multipath-config.patch @@ -26,5 +26,5 @@ index 9f3dfa7..f63506d 100644 + } } -- -2.45.2 +2.46.0 diff --git a/SOURCES/0004-feat-drivers-add-CephFS-GlusterFS-and-XFS-drivers.patch b/SOURCES/0004-feat-drivers-add-CephFS-GlusterFS-and-XFS-drivers.patch index 433867a4..f69f8c9b 100644 --- a/SOURCES/0004-feat-drivers-add-CephFS-GlusterFS-and-XFS-drivers.patch +++ b/SOURCES/0004-feat-drivers-add-CephFS-GlusterFS-and-XFS-drivers.patch @@ -888,5 +888,5 @@ index dce460e..aff51ae 100755 if not type in SR.TYPES: raise util.SMException("Unsupported SR type: %s" % type) -- -2.45.2 +2.46.0 diff --git a/SOURCES/0005-feat-drivers-add-ZFS-driver-to-avoid-losing-VDI-meta.patch b/SOURCES/0005-feat-drivers-add-ZFS-driver-to-avoid-losing-VDI-meta.patch index 17c4b95b..da98c5ed 100644 --- a/SOURCES/0005-feat-drivers-add-ZFS-driver-to-avoid-losing-VDI-meta.patch +++ b/SOURCES/0005-feat-drivers-add-ZFS-driver-to-avoid-losing-VDI-meta.patch @@ -201,5 +201,5 @@ index aff51ae..feb7c18 100755 type = SR.TYPE_FILE if not type in SR.TYPES: -- -2.45.2 +2.46.0 diff --git a/SOURCES/0006-Re-add-the-ext4-driver-for-users-who-need-to-transit.patch b/SOURCES/0006-Re-add-the-ext4-driver-for-users-who-need-to-transit.patch index 3ef5a693..bc193fb8 100644 --- a/SOURCES/0006-Re-add-the-ext4-driver-for-users-who-need-to-transit.patch +++ b/SOURCES/0006-Re-add-the-ext4-driver-for-users-who-need-to-transit.patch @@ -288,5 +288,5 @@ index feb7c18..12e4428 100755 type = SR.TYPE_FILE if not type in SR.TYPES: -- -2.45.2 +2.46.0 diff --git a/SOURCES/0007-feat-drivers-add-LinstorSR-driver.patch b/SOURCES/0007-feat-drivers-add-LinstorSR-driver.patch index 9f011a88..b827c19b 100644 --- a/SOURCES/0007-feat-drivers-add-LinstorSR-driver.patch +++ b/SOURCES/0007-feat-drivers-add-LinstorSR-driver.patch @@ -1,4 +1,4 @@ -From 3b19f4d691a10f0023d936a0328e4a7684b4d3fa Mon Sep 17 00:00:00 2001 +From 2c71c3ce33cd02573824a57bd4b3917b45c890b0 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 16 Mar 2020 15:39:44 +0100 Subject: [PATCH 007/178] feat(drivers): add LinstorSR driver @@ -64,8 +64,8 @@ module imports are protected by try.. except... blocks. drivers/util.py | 46 +- linstor/Makefile | 22 + linstor/linstor-monitord.c | 402 ++++++ - mocks/linstor/__init__.py | 0 systemd/linstor-monitor.service | 13 + + tests/mocks/linstor/__init__.py | 0 14 files changed, 5361 insertions(+), 30 deletions(-) create mode 100755 drivers/LinstorSR.py create mode 100755 drivers/linstor-manager @@ -74,8 +74,8 @@ module imports are protected by try.. except... blocks. create mode 100755 drivers/linstorvolumemanager.py create mode 100644 linstor/Makefile create mode 100644 linstor/linstor-monitord.c - create mode 100644 mocks/linstor/__init__.py create mode 100644 systemd/linstor-monitor.service + create mode 100644 tests/mocks/linstor/__init__.py diff --git a/Makefile b/Makefile index 9bc0a9d..609e182 100755 @@ -5657,9 +5657,6 @@ index 0000000..8161813 + close(inotifyFd); + return -ret; +} -diff --git a/mocks/linstor/__init__.py b/mocks/linstor/__init__.py -new file mode 100644 -index 0000000..e69de29 diff --git a/systemd/linstor-monitor.service b/systemd/linstor-monitor.service new file mode 100644 index 0000000..5f8f0a7 @@ -5679,6 +5676,9 @@ index 0000000..5f8f0a7 + +[Install] +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 -- -2.45.2 +2.46.0 diff --git a/SOURCES/0008-feat-tests-add-unit-tests-concerning-ZFS-close-xcp-n.patch b/SOURCES/0008-feat-tests-add-unit-tests-concerning-ZFS-close-xcp-n.patch index f7e78d5a..1338beb1 100644 --- a/SOURCES/0008-feat-tests-add-unit-tests-concerning-ZFS-close-xcp-n.patch +++ b/SOURCES/0008-feat-tests-add-unit-tests-concerning-ZFS-close-xcp-n.patch @@ -1,4 +1,4 @@ -From c43a4dbdff827fe7a65f93a4fa4b817344c854aa Mon Sep 17 00:00:00 2001 +From 89cee57b097a681edc800be05d1dfc7d97aec995 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 27 Oct 2020 15:04:36 +0100 Subject: [PATCH 008/178] feat(tests): add unit tests concerning ZFS (close @@ -205,5 +205,5 @@ index 0000000..6f8040d + failed = True + self.assertTrue(failed) -- -2.45.2 +2.46.0 diff --git a/SOURCES/0009-If-no-NFS-ACLs-provided-assume-everyone.patch b/SOURCES/0009-If-no-NFS-ACLs-provided-assume-everyone.patch index b1bf15a0..51e5bf9c 100644 --- a/SOURCES/0009-If-no-NFS-ACLs-provided-assume-everyone.patch +++ b/SOURCES/0009-If-no-NFS-ACLs-provided-assume-everyone.patch @@ -1,4 +1,4 @@ -From c1f90914648fc31104ebc535f653c9b70d27fc47 Mon Sep 17 00:00:00 2001 +From c338e356dcad6ad17b2f2248ff45fcf983173e0e Mon Sep 17 00:00:00 2001 From: BenjiReis Date: Thu, 25 Feb 2021 09:54:52 +0100 Subject: [PATCH 009/178] If no NFS ACLs provided, assume everyone: @@ -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.45.2 +2.46.0 diff --git a/SOURCES/0010-Added-SM-Driver-for-MooseFS.patch b/SOURCES/0010-Added-SM-Driver-for-MooseFS.patch index 63ead726..3a5f9ff3 100644 --- a/SOURCES/0010-Added-SM-Driver-for-MooseFS.patch +++ b/SOURCES/0010-Added-SM-Driver-for-MooseFS.patch @@ -1,4 +1,4 @@ -From 46f4c9f02e0c0bacecf4fba09bdf94a419955d10 Mon Sep 17 00:00:00 2001 +From 359dd15436b153bedf32af7768973febc2b84c2f Mon Sep 17 00:00:00 2001 From: Aleksander Wieliczko Date: Fri, 29 Jan 2021 15:21:23 +0100 Subject: [PATCH 010/178] Added SM Driver for MooseFS @@ -386,5 +386,5 @@ index 0000000..5a61cf5 + mfssr.detach('asr_uuid') + self.assertTrue(mfssr.attached) -- -2.45.2 +2.46.0 diff --git a/SOURCES/0011-Avoid-usage-of-umount-in-ISOSR-when-legacy_mode-is-u.patch b/SOURCES/0011-Avoid-usage-of-umount-in-ISOSR-when-legacy_mode-is-u.patch index b5a245fe..8e8b06d2 100644 --- a/SOURCES/0011-Avoid-usage-of-umount-in-ISOSR-when-legacy_mode-is-u.patch +++ b/SOURCES/0011-Avoid-usage-of-umount-in-ISOSR-when-legacy_mode-is-u.patch @@ -1,4 +1,4 @@ -From 78e02205515d1926448d9148e07190278f192fe1 Mon Sep 17 00:00:00 2001 +From c984a5c3510b12c44a9fd2d0297cdb21111d20f7 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 2 Dec 2021 09:28:37 +0100 Subject: [PATCH 011/178] Avoid usage of `umount` in `ISOSR` when `legacy_mode` @@ -103,5 +103,5 @@ index 7655f14..03c8851 100644 class TestISOSR_overNFS(unittest.TestCase): -- -2.45.2 +2.46.0 diff --git a/SOURCES/0012-MooseFS-SR-uses-now-UUID-subdirs-for-each-SR.patch b/SOURCES/0012-MooseFS-SR-uses-now-UUID-subdirs-for-each-SR.patch index 1ef1122c..f5db7613 100644 --- a/SOURCES/0012-MooseFS-SR-uses-now-UUID-subdirs-for-each-SR.patch +++ b/SOURCES/0012-MooseFS-SR-uses-now-UUID-subdirs-for-each-SR.patch @@ -1,4 +1,4 @@ -From 96777e1aebf0b4bf800d71c03a87908282669971 Mon Sep 17 00:00:00 2001 +From c701f410bdac559ac8384da2f8b40833e5e89866 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 18 May 2022 17:28:09 +0200 Subject: [PATCH 012/178] MooseFS SR uses now UUID subdirs for each SR @@ -126,5 +126,5 @@ index be5112c..ab72f4e 100755 self.detach(sr_uuid) if inst.code != errno.ENOENT: -- -2.45.2 +2.46.0 diff --git a/SOURCES/0013-Fix-is_open-call-for-many-drivers-25.patch b/SOURCES/0013-Fix-is_open-call-for-many-drivers-25.patch index c823663c..455ea091 100644 --- a/SOURCES/0013-Fix-is_open-call-for-many-drivers-25.patch +++ b/SOURCES/0013-Fix-is_open-call-for-many-drivers-25.patch @@ -1,4 +1,4 @@ -From ebb716f123eb8b6c4e8b2ff1147926211af183db Mon Sep 17 00:00:00 2001 +From cba6bde2b5243bac634b5e5e910db685355ba83e Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 23 Jun 2022 10:36:36 +0200 Subject: [PATCH 013/178] Fix is_open call for many drivers (#25) @@ -104,5 +104,5 @@ index 0d60d96..534e6c9 100755 driver = SR.driver(srType) -- -2.45.2 +2.46.0 diff --git a/SOURCES/0014-Remove-SR_CACHING-capability-for-many-SR-types-24.patch b/SOURCES/0014-Remove-SR_CACHING-capability-for-many-SR-types-24.patch index 644890cc..c56c5f16 100644 --- a/SOURCES/0014-Remove-SR_CACHING-capability-for-many-SR-types-24.patch +++ b/SOURCES/0014-Remove-SR_CACHING-capability-for-many-SR-types-24.patch @@ -1,4 +1,4 @@ -From 658d391b17fa66a312401e43b22cefb897ea3b57 Mon Sep 17 00:00:00 2001 +From bf7577ff65e882686af8e7ca1748cfb0b7934a14 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 23 Jun 2022 10:37:07 +0200 Subject: [PATCH 014/178] Remove SR_CACHING capability for many SR types (#24) @@ -56,5 +56,5 @@ index ab72f4e..212f1ad 100755 "VDI_UPDATE", "VDI_CLONE", "VDI_SNAPSHOT", "VDI_RESIZE", "VDI_MIRROR", "VDI_GENERATE_CONFIG", -- -2.45.2 +2.46.0 diff --git a/SOURCES/0015-Remove-SR_PROBE-from-ZFS-capabilities-37.patch b/SOURCES/0015-Remove-SR_PROBE-from-ZFS-capabilities-37.patch index bfd849fa..3fffabb0 100644 --- a/SOURCES/0015-Remove-SR_PROBE-from-ZFS-capabilities-37.patch +++ b/SOURCES/0015-Remove-SR_PROBE-from-ZFS-capabilities-37.patch @@ -1,4 +1,4 @@ -From 7263d70aa77dbc18b40b000811be3cf01ab8f4ad Mon Sep 17 00:00:00 2001 +From 1a7496b75ae96edf79f2da481b54b80e8d2925f8 Mon Sep 17 00:00:00 2001 From: BenjiReis Date: Fri, 4 Aug 2023 12:10:08 +0200 Subject: [PATCH 015/178] Remove `SR_PROBE` from ZFS capabilities (#37) @@ -24,5 +24,5 @@ index d375210..b803211 100644 'VDI_CREATE', 'VDI_DELETE', -- -2.45.2 +2.46.0 diff --git a/SOURCES/0016-Fix-vdi-ref-when-static-vdis-are-used.patch b/SOURCES/0016-Fix-vdi-ref-when-static-vdis-are-used.patch index 40e8d09b..0b6816b9 100644 --- a/SOURCES/0016-Fix-vdi-ref-when-static-vdis-are-used.patch +++ b/SOURCES/0016-Fix-vdi-ref-when-static-vdis-are-used.patch @@ -1,4 +1,4 @@ -From 85c1fa8737facb51f419b0539661f8fffcc36d8d Mon Sep 17 00:00:00 2001 +From 37c79431e2c6654c5afdb6cde6e23c4c321c4cda Mon Sep 17 00:00:00 2001 From: Guillaume Date: Wed, 16 Aug 2023 13:42:21 +0200 Subject: [PATCH 016/178] Fix vdi-ref when static vdis are used @@ -32,5 +32,5 @@ index dd8e20b..6ac3f80 100755 if needDeflate: try: -- -2.45.2 +2.46.0 diff --git a/SOURCES/0017-Tell-users-not-to-edit-multipath.conf-directly.patch b/SOURCES/0017-Tell-users-not-to-edit-multipath.conf-directly.patch index d8f404fb..533f27eb 100644 --- a/SOURCES/0017-Tell-users-not-to-edit-multipath.conf-directly.patch +++ b/SOURCES/0017-Tell-users-not-to-edit-multipath.conf-directly.patch @@ -1,4 +1,4 @@ -From 0d635eac00e89fcfa16856f53947511f0911e2bc Mon Sep 17 00:00:00 2001 +From 9bfcb0be3ff34354c9299bf6e0a90e691f14e813 Mon Sep 17 00:00:00 2001 From: Samuel Verschelde Date: Fri, 27 Jan 2023 12:03:15 +0100 Subject: [PATCH 017/178] Tell users not to edit multipath.conf directly @@ -30,5 +30,5 @@ index f63506d..c854b57 100644 # multipathd. # For information on the syntax refer to `man multipath.conf` and the examples -- -2.45.2 +2.46.0 diff --git a/SOURCES/0018-Add-custom.conf-multipath-configuration-file.patch b/SOURCES/0018-Add-custom.conf-multipath-configuration-file.patch index 359b0ee2..f4eef0e6 100644 --- a/SOURCES/0018-Add-custom.conf-multipath-configuration-file.patch +++ b/SOURCES/0018-Add-custom.conf-multipath-configuration-file.patch @@ -1,4 +1,4 @@ -From 6fc44ae6ca8bf73c576ec9f74b53de0ed51cd5de Mon Sep 17 00:00:00 2001 +From 383f9128fb1a788074a5a6aca09a249bfeaa44f5 Mon Sep 17 00:00:00 2001 From: Samuel Verschelde Date: Fri, 27 Jan 2023 12:23:13 +0100 Subject: [PATCH 018/178] Add custom.conf multipath configuration file @@ -27,5 +27,5 @@ index 0000000..3c8583f + +# Refer to "man multipath.conf" -- -2.45.2 +2.46.0 diff --git a/SOURCES/0019-Install-etc-multipath-conf.d-custom.conf.patch b/SOURCES/0019-Install-etc-multipath-conf.d-custom.conf.patch index d7c071bf..445ace79 100644 --- a/SOURCES/0019-Install-etc-multipath-conf.d-custom.conf.patch +++ b/SOURCES/0019-Install-etc-multipath-conf.d-custom.conf.patch @@ -1,4 +1,4 @@ -From 17129f5341223dae7a0b38516e8b01990b61df1d Mon Sep 17 00:00:00 2001 +From 507c2f067878ee88765c5750d3e618c8c63208c7 Mon Sep 17 00:00:00 2001 From: Samuel Verschelde Date: Fri, 25 Aug 2023 17:47:34 +0200 Subject: [PATCH 019/178] Install /etc/multipath/conf.d/custom.conf @@ -48,5 +48,5 @@ index b0ae353..3357cbf 100755 $(SM_STAGING)/$(INIT_DIR) install -m 755 multipath/multipath-root-setup \ -- -2.45.2 +2.46.0 diff --git a/SOURCES/0020-Backport-NFS4-only-support.patch b/SOURCES/0020-Backport-NFS4-only-support.patch index c452ea8e..c16552f2 100644 --- a/SOURCES/0020-Backport-NFS4-only-support.patch +++ b/SOURCES/0020-Backport-NFS4-only-support.patch @@ -1,4 +1,4 @@ -From 8f5cd11745a54fcfb127a23494a1fc2af5ed723b Mon Sep 17 00:00:00 2001 +From 2d197ca1c046dce44579f77f4e2ac23397edb9c1 Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Mon, 18 Dec 2023 10:22:26 +0100 Subject: [PATCH 020/178] Backport NFS4 only support @@ -426,5 +426,5 @@ index cef414f..9ea807f 100644 expected = """ -- -2.45.2 +2.46.0 diff --git a/SOURCES/0021-Backport-probe-for-NFS4-when-rpcinfo-does-not-includ.patch b/SOURCES/0021-Backport-probe-for-NFS4-when-rpcinfo-does-not-includ.patch index 697cc047..c3543117 100644 --- a/SOURCES/0021-Backport-probe-for-NFS4-when-rpcinfo-does-not-includ.patch +++ b/SOURCES/0021-Backport-probe-for-NFS4-when-rpcinfo-does-not-includ.patch @@ -1,4 +1,4 @@ -From ee88d74e603d364e0fb958ce867dc38ea61281db Mon Sep 17 00:00:00 2001 +From bcebd6854894ddd9cc6af7d41a54daab7a45f7be Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Mon, 18 Dec 2023 10:35:46 +0100 Subject: [PATCH 021/178] Backport probe for NFS4 when rpcinfo does not include @@ -164,5 +164,5 @@ index 9ea807f..3874d8e 100644 return ([binary, 'remoteserver:remotepath', 'mountpoint', '-o', 'soft,proto=transport,vers=%s,acdirmin=0,acdirmax=0' % vers]) -- -2.45.2 +2.46.0 diff --git a/SOURCES/0022-feat-LargeBlock-backport-of-largeblocksr-51-55.patch b/SOURCES/0022-feat-LargeBlock-backport-of-largeblocksr-51-55.patch index 9fdb27b6..00f38f07 100644 --- a/SOURCES/0022-feat-LargeBlock-backport-of-largeblocksr-51-55.patch +++ b/SOURCES/0022-feat-LargeBlock-backport-of-largeblocksr-51-55.patch @@ -1,4 +1,4 @@ -From 86d936b5359bfaee5a3d392daed5c9199839901f Mon Sep 17 00:00:00 2001 +From 52d495879ebf8c1caee78f3e10f7febd65d8ccd3 Mon Sep 17 00:00:00 2001 From: Damien Thenot Date: Tue, 7 May 2024 15:20:22 +0200 Subject: [PATCH 022/178] feat(LargeBlock): backport of largeblocksr (#51) @@ -396,5 +396,5 @@ index 534e6c9..3c7bd34 100755 import LVHDSR import MooseFSSR -- -2.45.2 +2.46.0 diff --git a/SOURCES/0023-feat-LVHDSR-add-a-way-to-modify-config-of-LVMs-56.patch b/SOURCES/0023-feat-LVHDSR-add-a-way-to-modify-config-of-LVMs-56.patch index 7438e1c2..924eb4ec 100644 --- a/SOURCES/0023-feat-LVHDSR-add-a-way-to-modify-config-of-LVMs-56.patch +++ b/SOURCES/0023-feat-LVHDSR-add-a-way-to-modify-config-of-LVMs-56.patch @@ -1,4 +1,4 @@ -From 906aede91ac5b450e6e11332ab070d0ec7b71dbb Mon Sep 17 00:00:00 2001 +From ec5c7c6cd4732e7f70122ccdb8ccdaf6711e5f31 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 28 May 2024 15:17:21 +0200 Subject: [PATCH 023/178] feat(LVHDSR): add a way to modify config of LVMs @@ -106,5 +106,5 @@ index ea0bc17..54930b4 100644 self._removeTag(lvName, tag) del self.lvs[lvName] -- -2.45.2 +2.46.0 diff --git a/SOURCES/0024-Revert-CA-379329-check-for-missing-iSCSI-sessions-an.patch b/SOURCES/0024-Revert-CA-379329-check-for-missing-iSCSI-sessions-an.patch new file mode 100644 index 00000000..4b18934d --- /dev/null +++ b/SOURCES/0024-Revert-CA-379329-check-for-missing-iSCSI-sessions-an.patch @@ -0,0 +1,1039 @@ +From 4ffea27c739e2a02c78438bfb2d281259afad615 Mon Sep 17 00:00:00 2001 +From: Benjamin Reis +Date: Thu, 27 Jun 2024 17:55:10 +0200 +Subject: [PATCH 024/178] Revert "CA-379329: check for missing iSCSI sessions + and reconnect" + +This reverts commit d28dcc1341166ed4839dbea8ef6d1a24e981f461. + +Prevent bad disconnection of ISCSi targets + +In practice the commit that we revert is useful in the case where ISCSI connections are no longer valid, +but sometimes even without any config change or bad connections, +a disconnect/connect is launched preventing the correct use of the SR. + +This change is a workaround, we don't have a better solution at this time. + +Signed-off-by: Benjamin Reis +--- + Makefile | 7 +- + drivers/BaseISCSI.py | 2 +- + drivers/LVHDoISCSISR.py | 499 ++++++++++++++++---------------- + drivers/SR.py | 4 - + systemd/sr_health_check.service | 8 - + systemd/sr_health_check.timer | 13 - + tests/test_LVHDoISCSISR.py | 195 ------------- + tests/test_sr_health_check.py | 95 ------ + 8 files changed, 246 insertions(+), 577 deletions(-) + delete mode 100644 systemd/sr_health_check.service + delete mode 100644 systemd/sr_health_check.timer + delete mode 100644 tests/test_sr_health_check.py + +diff --git a/Makefile b/Makefile +index 284b9a3..c746fcf 100755 +--- a/Makefile ++++ b/Makefile +@@ -74,7 +74,6 @@ SM_LIBS += pluginutil + SM_LIBS += fcoelib + SM_LIBS += constants + SM_LIBS += cbtutil +-SM_LIBS += sr_health_check + + UDEV_RULES = 65-multipath 55-xs-mpath-scsidev 57-usb 58-xapi + MPATH_DAEMON = sm-multipath +@@ -107,7 +106,7 @@ SM_PY_FILES = $(foreach LIB, $(SM_LIBS), drivers/$(LIB).py) $(foreach DRIVER, $( + + .PHONY: build + build: +- make -C dcopy ++ make -C dcopy + make -C linstor + + .PHONY: precommit +@@ -187,10 +186,6 @@ install: precheck + $(SM_STAGING)/$(SYSTEMD_SERVICE_DIR) + install -m 644 systemd/storage-init.service \ + $(SM_STAGING)/$(SYSTEMD_SERVICE_DIR) +- install -m 644 systemd/sr_health_check.service \ +- $(SM_STAGING)/$(SYSTEMD_SERVICE_DIR) +- install -m 644 systemd/sr_health_check.timer \ +- $(SM_STAGING)/$(SYSTEMD_SERVICE_DIR) + install -m 644 systemd/linstor-monitor.service \ + $(SM_STAGING)/$(SYSTEMD_SERVICE_DIR) + for i in $(UDEV_RULES); do \ +diff --git a/drivers/BaseISCSI.py b/drivers/BaseISCSI.py +index 652387f..72d1728 100755 +--- a/drivers/BaseISCSI.py ++++ b/drivers/BaseISCSI.py +@@ -136,7 +136,7 @@ class BaseISCSISR(SR.SR): + self.default_vdi_visibility = False + + # Required parameters +- if 'target' not in self.dconf or not self.dconf['target']: ++ if 'target' not in self.dconf or not self.dconf['target']: + raise xs_errors.XenError('ConfigTargetMissing') + + # we are no longer putting hconf in the xml. +diff --git a/drivers/LVHDoISCSISR.py b/drivers/LVHDoISCSISR.py +index 1fa6f6f..8f5eecf 100755 +--- a/drivers/LVHDoISCSISR.py ++++ b/drivers/LVHDoISCSISR.py +@@ -2,13 +2,13 @@ + # + # Copyright (C) Citrix Systems Inc. + # +-# This program is free software; you can redistribute it and/or modify +-# it under the terms of the GNU Lesser General Public License as published ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU Lesser General Public License as published + # by the Free Software Foundation; version 2.1 only. + # +-# This program is distributed in the hope that it will be useful, +-# but WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU Lesser General Public License for more details. + # + # You should have received a copy of the GNU Lesser General Public License +@@ -32,7 +32,7 @@ CAPABILITIES = ["SR_PROBE", "SR_UPDATE", "SR_METADATA", "SR_TRIM", + "VDI_CREATE", "VDI_DELETE", "VDI_ATTACH", "VDI_DETACH", + "VDI_GENERATE_CONFIG", "VDI_CLONE", "VDI_SNAPSHOT", + "VDI_RESIZE", "ATOMIC_PAUSE", "VDI_RESET_ON_BOOT/2", +- "VDI_UPDATE", "VDI_MIRROR", "VDI_CONFIG_CBT", ++ "VDI_UPDATE", "VDI_MIRROR", "VDI_CONFIG_CBT", + "VDI_ACTIVATE", "VDI_DEACTIVATE"] + + CONFIGURATION = [ [ 'SCSIid', 'The scsi_id of the destination LUN' ], \ +@@ -61,7 +61,7 @@ DRIVER_INFO = { + class LVHDoISCSISR(LVHDSR.LVHDSR): + """LVHD over ISCSI storage repository""" + def handles(type): +- if __name__ == '__main__': ++ if __name__ == '__main__': + name = sys.argv[0] + else: + name = __name__ +@@ -81,131 +81,243 @@ class LVHDoISCSISR(LVHDSR.LVHDSR): + if util.isVDICommand(self.original_srcmd.cmd): + self.SCSIid = self.dconf['SCSIid'] + else: +- self.create_iscsi_sessions(sr_uuid) +- +- LVHDSR.LVHDSR.load(self, sr_uuid) +- +- def create_iscsi_sessions(self, sr_uuid): +- if 'target' in self.original_srcmd.dconf: +- self.original_srcmd.dconf['targetlist'] = self.original_srcmd.dconf['target'] +- iscsi = BaseISCSI.BaseISCSISR(self.original_srcmd, sr_uuid) +- self.iscsiSRs = [] +- self.iscsiSRs.append(iscsi) +- saved_exc = None +- if self.dconf['target'].find(',') == 0 or self.dconf['targetIQN'] == "*": +- # Instantiate multiple sessions ++ if 'target' in self.original_srcmd.dconf: ++ self.original_srcmd.dconf['targetlist'] = self.original_srcmd.dconf['target'] ++ iscsi = BaseISCSI.BaseISCSISR(self.original_srcmd, sr_uuid) + self.iscsiSRs = [] +- if self.dconf['targetIQN'] == "*": +- IQN = "any" +- else: +- IQN = self.dconf['targetIQN'] +- dict = {} +- IQNstring = "" +- IQNs = [] +- try: +- if 'multiSession' in self.dconf: +- IQNs = self.dconf['multiSession'].split("|") +- for IQN in IQNs: +- if IQN: +- dict[IQN] = "" +- else: ++ self.iscsiSRs.append(iscsi) ++ ++ saved_exc = None ++ if self.dconf['target'].find(',') == 0 or self.dconf['targetIQN'] == "*": ++ # Instantiate multiple sessions ++ self.iscsiSRs = [] ++ if self.dconf['targetIQN'] == "*": ++ IQN = "any" ++ else: ++ IQN = self.dconf['targetIQN'] ++ dict = {} ++ IQNstring = "" ++ IQNs = [] ++ try: ++ if 'multiSession' in self.dconf: ++ IQNs = self.dconf['multiSession'].split("|") ++ for IQN in IQNs: ++ if IQN: ++ dict[IQN] = "" ++ else: ++ try: ++ IQNs.remove(IQN) ++ except: ++ # Exceptions are not expected but just in case ++ pass ++ # Order in multiSession must be preserved. It is important for dual-controllers. ++ # IQNstring cannot be built with a dictionary iteration because of this ++ IQNstring = self.dconf['multiSession'] ++ else: ++ for tgt in self.dconf['target'].split(','): + try: +- IQNs.remove(IQN) ++ tgt_ip = util._convertDNS(tgt) + except: +- # Exceptions are not expected but just in case +- pass +- # Order in multiSession must be preserved. It is important for dual-controllers. +- # IQNstring cannot be built with a dictionary iteration because of this +- IQNstring = self.dconf['multiSession'] ++ raise xs_errors.XenError('DNSError') ++ iscsilib.ensure_daemon_running_ok(iscsi.localIQN) ++ map = iscsilib.discovery(tgt_ip, iscsi.port, iscsi.chapuser, iscsi.chappassword, targetIQN=IQN) ++ util.SMlog("Discovery for IP %s returned %s" % (tgt, map)) ++ for i in range(0, len(map)): ++ (portal, tpgt, iqn) = map[i] ++ (ipaddr, port) = iscsilib.parse_IP_port(portal) ++ try: ++ util._testHost(ipaddr, int(port), 'ISCSITarget') ++ except: ++ util.SMlog("Target Not reachable: (%s:%s)" % (ipaddr, port)) ++ continue ++ key = "%s,%s,%s" % (ipaddr, port, iqn) ++ dict[key] = "" ++ # Again, do not mess up with IQNs order. Dual controllers will benefit from that ++ if IQNstring == "": ++ # Compose the IQNstring first ++ for key in dict.keys(): ++ IQNstring += "%s|" % key ++ # Reinitialize and store iterator ++ key_iterator = iter(dict.keys()) ++ else: ++ key_iterator = IQNs ++ ++ # Now load the individual iSCSI base classes ++ for key in key_iterator: ++ (ipaddr, port, iqn) = key.split(',') ++ srcmd_copy = copy.deepcopy(self.original_srcmd) ++ srcmd_copy.dconf['target'] = ipaddr ++ srcmd_copy.dconf['targetIQN'] = iqn ++ srcmd_copy.dconf['multiSession'] = IQNstring ++ util.SMlog("Setting targetlist: %s" % srcmd_copy.dconf['targetlist']) ++ self.iscsiSRs.append(BaseISCSI.BaseISCSISR(srcmd_copy, sr_uuid)) ++ pbd = util.find_my_pbd(self.session, self.host_ref, self.sr_ref) ++ if pbd is not None and 'multiSession' not in self.dconf: ++ dconf = self.session.xenapi.PBD.get_device_config(pbd) ++ dconf['multiSession'] = IQNstring ++ self.session.xenapi.PBD.set_device_config(pbd, dconf) ++ except Exception as exc: ++ util.logException("LVHDoISCSISR.load") ++ saved_exc = exc ++ try: ++ self.iscsi = self.iscsiSRs[0] ++ except IndexError as exc: ++ if isinstance(saved_exc, SR.SROSError): ++ raise saved_exc # pylint: disable-msg=E0702 ++ elif isinstance(saved_exc, Exception): ++ raise xs_errors.XenError('SMGeneral', str(saved_exc)) + else: +- for tgt in self.dconf['target'].split(','): ++ raise xs_errors.XenError('SMGeneral', str(exc)) ++ ++ # Be extremely careful not to throw exceptions here since this function ++ # is the main one used by all operations including probing and creating ++ pbd = None ++ try: ++ pbd = util.find_my_pbd(self.session, self.host_ref, self.sr_ref) ++ except: ++ pass ++ ++ # Apart from the upgrade case, user must specify a SCSIid ++ if 'SCSIid' not in self.dconf: ++ # Dual controller issue ++ self.LUNs = {} # Dict for LUNs from all the iscsi objects ++ for ii in range(0, len(self.iscsiSRs)): ++ self.iscsi = self.iscsiSRs[ii] ++ self._LUNprint(sr_uuid) ++ for key in self.iscsi.LUNs: ++ self.LUNs[key] = self.iscsi.LUNs[key] ++ self.print_LUNs_XML() ++ self.iscsi = self.iscsiSRs[0] # back to original value ++ raise xs_errors.XenError('ConfigSCSIid') ++ ++ self.SCSIid = self.dconf['SCSIid'] ++ ++ # This block checks if the first iscsi target contains the right SCSIid. ++ # If not it scans the other iscsi targets because chances are that more ++ # than one controller is present ++ dev_match = False ++ forced_login = False ++ # No need to check if only one iscsi target is present ++ if len(self.iscsiSRs) == 1: ++ pass ++ else: ++ target_success = False ++ attempt_discovery = False ++ for iii in range(0, len(self.iscsiSRs)): ++ # Check we didn't leave any iscsi session open ++ # If exceptions happened before, the cleanup function has worked on the right target. ++ if forced_login == True: + try: +- tgt_ip = util._convertDNS(tgt) ++ iscsilib.ensure_daemon_running_ok(self.iscsi.localIQN) ++ iscsilib.logout(self.iscsi.target, self.iscsi.targetIQN) ++ forced_login = False + except: +- raise xs_errors.XenError('DNSError') +- iscsilib.ensure_daemon_running_ok(iscsi.localIQN) +- map = iscsilib.discovery(tgt_ip, iscsi.port, iscsi.chapuser, iscsi.chappassword, targetIQN=IQN) +- util.SMlog("Discovery for IP %s returned %s" % (tgt, map)) +- for i in range(0, len(map)): +- (portal, tpgt, iqn) = map[i] +- (ipaddr, port) = iscsilib.parse_IP_port(portal) +- try: +- util._testHost(ipaddr, int(port), 'ISCSITarget') +- except: +- util.SMlog("Target Not reachable: (%s:%s)" % (ipaddr, port)) ++ raise xs_errors.XenError('ISCSILogout') ++ self.iscsi = self.iscsiSRs[iii] ++ util.SMlog("path %s" % self.iscsi.path) ++ util.SMlog("iscsci data: targetIQN %s, portal %s" % (self.iscsi.targetIQN, self.iscsi.target)) ++ iscsilib.ensure_daemon_running_ok(self.iscsi.localIQN) ++ if not iscsilib._checkTGT(self.iscsi.targetIQN): ++ attempt_discovery = True ++ try: ++ # Ensure iscsi db has been populated ++ map = iscsilib.discovery( ++ self.iscsi.target, ++ self.iscsi.port, ++ self.iscsi.chapuser, ++ self.iscsi.chappassword, ++ targetIQN=self.iscsi.targetIQN) ++ if len(map) == 0: ++ util.SMlog("Discovery for iscsi data targetIQN %s," ++ " portal %s returned empty list" ++ " Trying another path if available" % ++ (self.iscsi.targetIQN, ++ self.iscsi.target)) + continue ++ except: ++ util.SMlog("Discovery failed for iscsi data targetIQN" ++ " %s, portal %s. Trying another path if" ++ " available" % ++ (self.iscsi.targetIQN, self.iscsi.target)) ++ continue ++ try: ++ iscsilib.login(self.iscsi.target, ++ self.iscsi.targetIQN, ++ self.iscsi.chapuser, ++ self.iscsi.chappassword, ++ self.iscsi.incoming_chapuser, ++ self.iscsi.incoming_chappassword, ++ self.mpath == "true") ++ except: ++ util.SMlog("Login failed for iscsi data targetIQN %s," ++ " portal %s. Trying another path" ++ " if available" % ++ (self.iscsi.targetIQN, self.iscsi.target)) ++ continue ++ target_success = True ++ forced_login = True ++ # A session should be active. ++ if not util.wait_for_path(self.iscsi.path, BaseISCSI.MAX_TIMEOUT): ++ util.SMlog("%s has no associated LUNs" % self.iscsi.targetIQN) ++ continue ++ scsiid_path = "/dev/disk/by-id/scsi-" + self.SCSIid ++ if not util.wait_for_path(scsiid_path, BaseISCSI.MAX_TIMEOUT): ++ util.SMlog("%s not found" % scsiid_path) ++ continue ++ for file in filter(self.iscsi.match_lun, util.listdir(self.iscsi.path)): ++ lun_path = os.path.join(self.iscsi.path, file) ++ lun_dev = scsiutil.getdev(lun_path) ++ try: ++ lun_scsiid = scsiutil.getSCSIid(lun_dev) ++ except: ++ util.SMlog("getSCSIid failed on %s in iscsi %s: LUN" ++ " offline or iscsi path down" % ++ (lun_dev, self.iscsi.path)) ++ continue ++ util.SMlog("dev from lun %s %s" % (lun_dev, lun_scsiid)) ++ if lun_scsiid == self.SCSIid: ++ util.SMlog("lun match in %s" % self.iscsi.path) ++ dev_match = True ++ # No more need to raise ISCSITarget exception. ++ # Resetting attempt_discovery ++ attempt_discovery = False ++ break ++ if dev_match: ++ if iii == 0: ++ break ++ util.SMlog("IQN reordering needed") ++ new_iscsiSRs = [] ++ IQNs = {} ++ IQNstring = "" ++ # iscsiSRs can be seen as a circular buffer: the head now is the matching one ++ for kkk in list(range(iii, len(self.iscsiSRs))) + list(range(0, iii)): ++ new_iscsiSRs.append(self.iscsiSRs[kkk]) ++ ipaddr = self.iscsiSRs[kkk].target ++ port = self.iscsiSRs[kkk].port ++ iqn = self.iscsiSRs[kkk].targetIQN + key = "%s,%s,%s" % (ipaddr, port, iqn) +- dict[key] = "" +- # Again, do not mess up with IQNs order. Dual controllers will benefit from that +- if IQNstring == "": +- # Compose the IQNstring first +- for key in dict.keys(): +- IQNstring += "%s|" % key +- # Reinitialize and store iterator +- key_iterator = iter(dict.keys()) +- else: +- key_iterator = IQNs +- +- # Now load the individual iSCSI base classes +- for key in key_iterator: +- (ipaddr, port, iqn) = key.split(',') +- srcmd_copy = copy.deepcopy(self.original_srcmd) +- srcmd_copy.dconf['target'] = ipaddr +- srcmd_copy.dconf['targetIQN'] = iqn +- srcmd_copy.dconf['multiSession'] = IQNstring +- util.SMlog("Setting targetlist: %s" % srcmd_copy.dconf['targetlist']) +- self.iscsiSRs.append(BaseISCSI.BaseISCSISR(srcmd_copy, sr_uuid)) +- pbd = util.find_my_pbd(self.session, self.host_ref, self.sr_ref) +- if pbd is not None and 'multiSession' not in self.dconf: +- dconf = self.session.xenapi.PBD.get_device_config(pbd) +- dconf['multiSession'] = IQNstring +- self.session.xenapi.PBD.set_device_config(pbd, dconf) +- except Exception as exc: +- util.logException("LVHDoISCSISR.load") +- saved_exc = exc +- try: +- self.iscsi = self.iscsiSRs[0] +- except IndexError as exc: +- if isinstance(saved_exc, SR.SROSError): +- raise saved_exc # pylint: disable-msg=E0702 +- elif isinstance(saved_exc, Exception): +- raise xs_errors.XenError('SMGeneral', str(saved_exc)) +- else: +- raise xs_errors.XenError('SMGeneral', str(exc)) +- # Be extremely careful not to throw exceptions here since this function +- # is the main one used by all operations including probing and creating +- pbd = None +- try: +- pbd = util.find_my_pbd(self.session, self.host_ref, self.sr_ref) +- except: +- pass +- # Apart from the upgrade case, user must specify a SCSIid +- if 'SCSIid' not in self.dconf: +- # Dual controller issue +- self.LUNs = {} # Dict for LUNs from all the iscsi objects +- for ii in range(0, len(self.iscsiSRs)): +- self.iscsi = self.iscsiSRs[ii] +- self._LUNprint(sr_uuid) +- for key in self.iscsi.LUNs: +- self.LUNs[key] = self.iscsi.LUNs[key] +- self.print_LUNs_XML() +- self.iscsi = self.iscsiSRs[0] # back to original value +- raise xs_errors.XenError('ConfigSCSIid') +- self.SCSIid = self.dconf['SCSIid'] +- # This block checks if the first iscsi target contains the right SCSIid. +- # If not it scans the other iscsi targets because chances are that more +- # than one controller is present +- dev_match = False +- forced_login = False +- # No need to check if only one iscsi target is present +- if len(self.iscsiSRs) == 1: +- pass +- else: +- target_success = False +- attempt_discovery = False +- for iii in range(0, len(self.iscsiSRs)): +- # Check we didn't leave any iscsi session open +- # If exceptions happened before, the cleanup function has worked on the right target. ++ # The final string must preserve the order without repetition ++ if key not in IQNs: ++ IQNs[key] = "" ++ IQNstring += "%s|" % key ++ util.SMlog("IQNstring is now %s" % IQNstring) ++ self.iscsiSRs = new_iscsiSRs ++ util.SMlog("iqn %s is leading now" % self.iscsiSRs[0].targetIQN) ++ # Updating pbd entry, if any ++ try: ++ pbd = util.find_my_pbd(self.session, self.host_ref, self.sr_ref) ++ if pbd is not None and 'multiSession' in self.dconf: ++ util.SMlog("Updating multiSession in PBD") ++ dconf = self.session.xenapi.PBD.get_device_config(pbd) ++ dconf['multiSession'] = IQNstring ++ self.session.xenapi.PBD.set_device_config(pbd, dconf) ++ except: ++ pass ++ break ++ if not target_success and attempt_discovery: ++ raise xs_errors.XenError('ISCSITarget') ++ ++ # Check for any unneeded open iscsi sessions + if forced_login == True: + try: + iscsilib.ensure_daemon_running_ok(self.iscsi.localIQN) +@@ -213,118 +325,8 @@ class LVHDoISCSISR(LVHDSR.LVHDSR): + forced_login = False + except: + raise xs_errors.XenError('ISCSILogout') +- self.iscsi = self.iscsiSRs[iii] +- util.SMlog("path %s" % self.iscsi.path) +- util.SMlog("iscsci data: targetIQN %s, portal %s" % (self.iscsi.targetIQN, self.iscsi.target)) +- iscsilib.ensure_daemon_running_ok(self.iscsi.localIQN) +- if not iscsilib._checkTGT(self.iscsi.targetIQN, self.iscsi.target): +- attempt_discovery = True +- try: +- # Ensure iscsi db has been populated +- map = iscsilib.discovery( +- self.iscsi.target, +- self.iscsi.port, +- self.iscsi.chapuser, +- self.iscsi.chappassword, +- targetIQN=self.iscsi.targetIQN) +- if len(map) == 0: +- util.SMlog("Discovery for iscsi data targetIQN %s," +- " portal %s returned empty list" +- " Trying another path if available" % +- (self.iscsi.targetIQN, +- self.iscsi.target)) +- continue +- except: +- util.SMlog("Discovery failed for iscsi data targetIQN" +- " %s, portal %s. Trying another path if" +- " available" % +- (self.iscsi.targetIQN, self.iscsi.target)) +- continue +- try: +- iscsilib.login(self.iscsi.target, +- self.iscsi.targetIQN, +- self.iscsi.chapuser, +- self.iscsi.chappassword, +- self.iscsi.incoming_chapuser, +- self.iscsi.incoming_chappassword, +- self.mpath == "true") +- except: +- util.SMlog("Login failed for iscsi data targetIQN %s," +- " portal %s. Trying another path" +- " if available" % +- (self.iscsi.targetIQN, self.iscsi.target)) +- continue +- target_success = True +- forced_login = True +- # A session should be active. +- if not util.wait_for_path(self.iscsi.path, BaseISCSI.MAX_TIMEOUT): +- util.SMlog("%s has no associated LUNs" % self.iscsi.targetIQN) +- continue +- scsiid_path = "/dev/disk/by-id/scsi-" + self.SCSIid +- if not util.wait_for_path(scsiid_path, BaseISCSI.MAX_TIMEOUT): +- util.SMlog("%s not found" % scsiid_path) +- continue +- for file in filter(self.iscsi.match_lun, util.listdir(self.iscsi.path)): +- lun_path = os.path.join(self.iscsi.path, file) +- lun_dev = scsiutil.getdev(lun_path) +- try: +- lun_scsiid = scsiutil.getSCSIid(lun_dev) +- except: +- util.SMlog("getSCSIid failed on %s in iscsi %s: LUN" +- " offline or iscsi path down" % +- (lun_dev, self.iscsi.path)) +- continue +- util.SMlog("dev from lun %s %s" % (lun_dev, lun_scsiid)) +- if lun_scsiid == self.SCSIid: +- util.SMlog("lun match in %s" % self.iscsi.path) +- dev_match = True +- # No more need to raise ISCSITarget exception. +- # Resetting attempt_discovery +- attempt_discovery = False +- break +- if dev_match: +- if iii == 0: +- break +- util.SMlog("IQN reordering needed") +- new_iscsiSRs = [] +- IQNs = {} +- IQNstring = "" +- # iscsiSRs can be seen as a circular buffer: the head now is the matching one +- for kkk in list(range(iii, len(self.iscsiSRs))) + list(range(0, iii)): +- new_iscsiSRs.append(self.iscsiSRs[kkk]) +- ipaddr = self.iscsiSRs[kkk].target +- port = self.iscsiSRs[kkk].port +- iqn = self.iscsiSRs[kkk].targetIQN +- key = "%s,%s,%s" % (ipaddr, port, iqn) +- # The final string must preserve the order without repetition +- if key not in IQNs: +- IQNs[key] = "" +- IQNstring += "%s|" % key +- util.SMlog("IQNstring is now %s" % IQNstring) +- self.iscsiSRs = new_iscsiSRs +- util.SMlog("iqn %s is leading now" % self.iscsiSRs[0].targetIQN) +- # Updating pbd entry, if any +- try: +- pbd = util.find_my_pbd(self.session, self.host_ref, self.sr_ref) +- if pbd is not None and 'multiSession' in self.dconf: +- util.SMlog("Updating multiSession in PBD") +- dconf = self.session.xenapi.PBD.get_device_config(pbd) +- dconf['multiSession'] = IQNstring +- self.session.xenapi.PBD.set_device_config(pbd, dconf) +- except: +- pass +- break +- if not target_success and attempt_discovery: +- raise xs_errors.XenError('ISCSITarget') + +- # Check for any unneeded open iscsi sessions +- if forced_login == True: +- try: +- iscsilib.ensure_daemon_running_ok(self.iscsi.localIQN) +- iscsilib.logout(self.iscsi.target, self.iscsi.targetIQN) +- forced_login = False +- except: +- raise xs_errors.XenError('ISCSILogout') ++ LVHDSR.LVHDSR.load(self, sr_uuid) + + def print_LUNs_XML(self): + dom = xml.dom.minidom.Document() +@@ -386,7 +388,7 @@ class LVHDoISCSISR(LVHDSR.LVHDSR): + for i in devs: + sgdevs.append(int(i.split("LUN")[1])) + sgdevs.sort() +- sgdev = "%s/LUN%d" % (self.iscsi.path,sgdevs[0]) ++ sgdev = "%s/LUN%d" % (self.iscsi.path,sgdevs[0]) + + # issue a report luns: + luns=util.pread2(["/usr/bin/sg_luns","-q",sgdev]).split('\n') +@@ -395,7 +397,7 @@ class LVHDoISCSISR(LVHDSR.LVHDSR): + scsi_id = scsiutil.getSCSIid(sgdev) + + # make sure we've got that many sg devices present +- for i in range(0,30): ++ for i in range(0,30): + luns=scsiutil._dosgscan() + sgdevs=filter(lambda r: r[1]==adapter, luns) + if len(sgdevs)>=nluns: +@@ -414,8 +416,8 @@ class LVHDoISCSISR(LVHDSR.LVHDSR): + pass # Make sure we don't break the probe... + + self.iscsi.print_LUNs() +- self.iscsi.detach(sr_uuid) +- ++ self.iscsi.detach(sr_uuid) ++ + def create(self, sr_uuid, size): + # Check SCSIid not already in use by other PBDs + if util.test_SCSIid(self.session, sr_uuid, self.SCSIid): +@@ -448,7 +450,7 @@ class LVHDoISCSISR(LVHDSR.LVHDSR): + device_config['SCSIid'] = SCSIid + self.session.xenapi.PBD.set_device_config(pbd, device_config) + +- self.dconf['SCSIid'] = SCSIid ++ self.dconf['SCSIid'] = SCSIid + self.SCSIid = self.dconf['SCSIid'] + except: + continue +@@ -511,7 +513,7 @@ class LVHDoISCSISR(LVHDSR.LVHDSR): + i.detach(sr_uuid) + raise xs_errors.XenError("SRUnavailable", opterr=inst) + self._setMultipathableFlag(SCSIid=self.SCSIid) +- ++ + def detach(self, sr_uuid): + LVHDSR.LVHDSR.detach(self, sr_uuid) + for i in self.iscsiSRs: +@@ -552,22 +554,9 @@ class LVHDoISCSISR(LVHDSR.LVHDSR): + self.iscsi.detach(self.uuid) + return out + +- def check_sr(self, sr_uuid): +- """Hook to check SR health""" +- pbdref = util.find_my_pbd(self.session, self.host_ref, self.sr_ref) +- if pbdref: +- other_config = self.session.xenapi.PBD.get_other_config(pbdref) +- if util.sessions_less_than_targets(other_config, self.dconf): +- self.create_iscsi_sessions(sr_uuid) +- for iscsi in self.iscsiSRs: +- try: +- iscsi.attach(sr_uuid) +- except SR.SROSError: +- util.SMlog("Failed to attach iSCSI target") +- + def vdi(self, uuid): + return LVHDoISCSIVDI(self, uuid) +- ++ + class LVHDoISCSIVDI(LVHDSR.LVHDVDI): + def generate_config(self, sr_uuid, vdi_uuid): + util.SMlog("LVHDoISCSIVDI.generate_config") +diff --git a/drivers/SR.py b/drivers/SR.py +index c752863..d10d945 100755 +--- a/drivers/SR.py ++++ b/drivers/SR.py +@@ -364,10 +364,6 @@ class SR(object): + """Post-init hook""" + pass + +- def check_sr(self, sr_uuid): +- """Hook to check SR health""" +- pass +- + def vdi(self, uuid): + """Return VDI object owned by this repository""" + if not self.vdis.has_key(uuid): +diff --git a/systemd/sr_health_check.service b/systemd/sr_health_check.service +deleted file mode 100644 +index 3b82631..0000000 +--- a/systemd/sr_health_check.service ++++ /dev/null +@@ -1,8 +0,0 @@ +-[Unit] +-Description=Healthy Check service for Storage Repositories +-Wants=xapi-init-complete.target +- +-[Service] +-Type=oneshot +-ExecStart=/opt/xensource/sm/sr_health_check.py +- +diff --git a/systemd/sr_health_check.timer b/systemd/sr_health_check.timer +deleted file mode 100644 +index d5f5f59..0000000 +--- a/systemd/sr_health_check.timer ++++ /dev/null +@@ -1,13 +0,0 @@ +-[Unit] +-Description=Period SR health check +- +-[Timer] +-# Jitter it a bit +-RandomizedDelaySec=30 +-# Run 10 minutes after first activated... +-OnActiveSec=600 +-# ...and at 10-minute intervals thereafter +-OnUnitInactiveSec=600 +- +-[Install] +-WantedBy=timers.target +diff --git a/tests/test_LVHDoISCSISR.py b/tests/test_LVHDoISCSISR.py +index ba668d0..112a9b9 100644 +--- a/tests/test_LVHDoISCSISR.py ++++ b/tests/test_LVHDoISCSISR.py +@@ -4,22 +4,14 @@ import unittest + + import traceback + +-from uuid import uuid4 +- + import SR + import LVHDoISCSISR +-import iscsilib +-from BaseISCSI import BaseISCSISR +-import SRCommand +-import util + import xs_errors + + import testlib + from shared_iscsi_test_base import ISCSITestCase + from test_ISCSISR import NonInitingISCSISR + +-TEST_SR_UUID = 'test_uuid' +- + + class RandomError(Exception): + pass +@@ -126,190 +118,3 @@ class TestLVHDoISCSISR_load(unittest.TestCase): + str(cm.exception), + 'General backend error [opterr=Raise RandomError]' + ) +- +- +-class TestLVHDoISCSISR(ISCSITestCase): +- +- TEST_CLASS = 'LVHDoISCSISR' +- +- def setUp(self): +- util_patcher = mock.patch('LVHDoISCSISR.util', autospec=True) +- self.mock_util = util_patcher.start() +- # self.mock_util.SMlog.side_effect = print +- self.mock_util.isVDICommand = util.isVDICommand +- self.mock_util.sessions_less_than_targets = util.sessions_less_than_targets +- +- self.base_srs = set() +- baseiscsi_patcher = mock.patch('LVHDoISCSISR.BaseISCSI.BaseISCSISR', +- autospec=True) +- patched_baseiscsi = baseiscsi_patcher.start() +- patched_baseiscsi.side_effect = self.baseiscsi +- lvhdsr_patcher = mock.patch ('LVHDoISCSISR.LVHDSR') +- +- self.mock_lvhdsr = lvhdsr_patcher.start() +- self.mock_session = mock.MagicMock() +- xenapi_patcher = mock.patch('SR.XenAPI') +- mock_xenapi = xenapi_patcher.start() +- mock_xenapi.xapi_local.return_value = self.mock_session +- +- copy_patcher = mock.patch('LVHDoISCSISR.SR.copy.deepcopy') +- self.mock_copy = copy_patcher.start() +- +- def deepcopy(to_copy): +- return to_copy +- +- self.mock_copy.side_effect = deepcopy +- +- lock_patcher = mock.patch('LVHDSR.Lock') +- self.mock_lock = lock_patcher.start() +- +- self.addCleanup(mock.patch.stopall) +- +- super(TestLVHDoISCSISR, self).setUp() +- +- @property +- def mock_baseiscsi(self): +- assert len(self.base_srs) == 1 +- single_sr = None +- for sr in self.base_srs: +- single_sr = sr +- +- return single_sr +- +- def baseiscsi(self, srcmd, sr_uuid): +- new_baseiscsi = mock.create_autospec(BaseISCSISR) +- local_iqn = srcmd.dconf['localIQN'] +- target_iqn = srcmd.dconf['targetIQN'] +- target = srcmd.dconf['target'] +- new_baseiscsi.localIQN = local_iqn +- new_baseiscsi.targetIQN = target_iqn +- new_baseiscsi.target = target +- new_baseiscsi.path = os.path.join('/dev/iscsi', target_iqn, target) +- new_baseiscsi.port = 3260 +- new_baseiscsi.chapuser = srcmd.dconf.get('chapuser') +- new_baseiscsi.chappassword = srcmd.dconf.get('chappassword') +- new_baseiscsi.incoming_chapuser = srcmd.dconf.get('incoming_chapuser') +- new_baseiscsi.incoming_chappassword = srcmd.dconf.get('incoming_chappassword') +- self.base_srs.add(new_baseiscsi) +- +- return new_baseiscsi +- +- def create_test_sr(self, sr_cmd): +- self.sr_uuid = str(uuid4()) +- self.subject = LVHDoISCSISR.LVHDoISCSISR( +- sr_cmd, self.sr_uuid) +- +- def test_check_sr_pbd_not_found(self): +- # Arrange +- self.mock_util.find_my_pbd.return_value = None +- self.create_test_sr(self.create_sr_command()) +- +- # Act +- self.subject.check_sr(TEST_SR_UUID) +- +- # Assert +- self.mock_util.find_my_pbd.assert_called_with( +- self.mock_session, 'test_host', 'sr_ref') +- +- def test_check_sr_correct_sessions_count(self): +- # Arrange +- self.mock_util.find_my_pbd.return_value = 'my_pbd' +- self.mock_session.xenapi.PBD.get_other_config.return_value = { +- 'iscsi_sessions': 2 +- } +- self.create_test_sr(self.create_sr_command()) +- +- # Act +- self.subject.check_sr(TEST_SR_UUID) +- +- # Assert +- self.mock_session.xenapi.PBD.get_other_config.assert_called_with('my_pbd') +- +- def test_check_sr_not_enough_sessions(self): +- # Arrange +- self.mock_util.find_my_pbd.return_value = 'my_pbd' +- self.mock_session.xenapi.PBD.get_other_config.return_value = { +- 'iscsi_sessions': 1 +- } +- self.create_test_sr(self.create_sr_command()) +- +- # Act +- self.subject.check_sr(TEST_SR_UUID) +- +- # Assert +- self.mock_baseiscsi.attach.assert_called_with( +- TEST_SR_UUID +- ) +- +- def test_sr_attach_multi_session(self): +- # Arrange +- self.mock_util.find_my_pbd.return_value = 'my_pbd' +- additional_dconf = { +- 'multiSession': '10.207.6.60,3260,iqn.2009-11.com.infinidat:storage:infinibox-sn-3393|' +- '10.207.3.65,3260,iqn.2009-11.com.infinidat:storage:infinibox-sn-3394|' +- '10.207.3.61,3260,iqn.2009-11.com.infinidat:storage:infinibox-sn-3393|' +- '10.207.6.61,3260,iqn.2009-11.com.infinidat:storage:infinibox-sn-3393|' +- '10.207.3.63,3260,iqn.2009-11.com.infinidat:storage:infinibox-sn-3394|' +- '10.207.6.62,3260,iqn.2009-11.com.infinidat:storage:infinibox-sn-3393|' +- '10.207.3.62,3260,iqn.2009-11.com.infinidat:storage:infinibox-sn-3393|' +- '10.207.3.60,3260,iqn.2009-11.com.infinidat:storage:infinibox-sn-3393|' +- '10.207.6.64,3260,iqn.2009-11.com.infinidat:storage:infinibox-sn-3394|' +- '10.207.6.65,3260,iqn.2009-11.com.infinidat:storage:infinibox-sn-3394|' +- '10.207.3.64,3260,iqn.2009-11.com.infinidat:storage:infinibox-sn-3394|' +- '10.207.6.63,3260,iqn.2009-11.com.infinidat:storage:infinibox-sn-3394|' +- } +- +- tpg_data = [ +- [ +- ('10.207.3.60:3260', 1, 'iqn.2009-11.com.infinidat:storage:infinibox-sn-3393'), +- ('10.207.3.61:3260', 1, 'iqn.2009-11.com.infinidat:storage:infinibox-sn-3393'), +- ('10.207.3.62:3260', 1, 'iqn.2009-11.com.infinidat:storage:infinibox-sn-3393')], +- [ +- ('10.207.3.63:3260', 1, 'iqn.2009-11.com.infinidat:storage:infinibox-sn-3394'), +- ('10.207.3.64:3260', 1, 'iqn.2009-11.com.infinidat:storage:infinibox-sn-3394'), +- ('10.207.3.65:3260', 1, 'iqn.2009-11.com.infinidat:storage:infinibox-sn-3394')], +- [ +- ('10.207.6.60:3260', 2, 'iqn.2009-11.com.infinidat:storage:infinibox-sn-3393'), +- ('10.207.6.61:3260', 2, 'iqn.2009-11.com.infinidat:storage:infinibox-sn-3393'), +- ('10.207.6.62:3260', 2, 'iqn.2009-11.com.infinidat:storage:infinibox-sn-3393') +- ], +- [ +- ('10.207.6.63:3260', 2, 'iqn.2009-11.com.infinidat:storage:infinibox-sn-3394'), +- ('10.207.6.64:3260', 2, 'iqn.2009-11.com.infinidat:storage:infinibox-sn-3394'), +- ('10.207.6.65:3260', 2, 'iqn.2009-11.com.infinidat:storage:infinibox-sn-3394') +- ] +- ] +- +- self.discovery_data = { +- '10.207.3.60': tpg_data[0], +- '10.207.3.61': tpg_data[0], +- '10.207.3.62': tpg_data[0], +- '10.207.3.63': tpg_data[1], +- '10.207.3.64': tpg_data[1], +- '10.207.3.65': tpg_data[1], +- '10.207.6.60': tpg_data[2], +- '10.207.6.61': tpg_data[2], +- '10.207.6.62': tpg_data[2], +- '10.207.6.63': tpg_data[3], +- '10.207.6.64': tpg_data[3], +- '10.207.6.65': tpg_data[3] +- } +- +- # Create SR +- self.create_test_sr(self.create_sr_command( +- additional_dconf=additional_dconf, +- cmd='sr_attach', +- target_iqn='*')) +- +- # Act +- self.subject.attach(TEST_SR_UUID) +- +- # Assert +- # print(f"iscsilib calls {self.mock_iscsilib.mock_calls}") +- attach_count = 0 +- for sr in self.base_srs: +- attach_count += sr.attach.call_count +- +- self.assertEqual(12, attach_count) +- self.assertEqual(12, self.mock_iscsilib.discovery.call_count) +- self.assertEqual(12, self.mock_iscsilib.login.call_count) +diff --git a/tests/test_sr_health_check.py b/tests/test_sr_health_check.py +deleted file mode 100644 +index 2a59ac8..0000000 +--- a/tests/test_sr_health_check.py ++++ /dev/null +@@ -1,95 +0,0 @@ +-import mock +-import unittest +- +-import sr_health_check +-from SR import SR +- +-TEST_HOST = 'test_host' +- +-SR_UUID = 'sr uuid' +- +- +-class TestSrHealthCheck(unittest.TestCase): +- +- def setUp(self): +- util_patcher = mock.patch('sr_health_check.util') +- self.mock_util = util_patcher.start() +- self.mock_session = mock.MagicMock() +- self.mock_util.get_localAPI_session.return_value = self.mock_session +- sr_patcher = mock.patch('sr_health_check.SR.SR', autospec=True) +- self.mock_sr = sr_patcher.start() +- +- self.addCleanup(mock.patch.stopall) +- +- def expect_good_sr_record(self): +- self.mock_session.xenapi.SR.get_all_records_where.return_value = { +- "iscsi_ref": {'uuid': SR_UUID, 'host': TEST_HOST} +- } +- +- def expect_good_localhost(self): +- self.mock_util.get_localhost_uuid.return_value = TEST_HOST +- +- def expect_good_sm_types(self): +- self.mock_session.xenapi.SM.get_all_records_where.return_value = { +- 'lvmoiscsi_type_ref': {'type': 'lvmoiscsi'} +- } +- +- def test_health_check_no_srs(self): +- # Arrange +- self.expect_good_sm_types() +- self.mock_session.xenapi.SR.get_all_records_where.return_value = {} +- +- # Act +- sr_health_check.main() +- +- # Assert +- self.mock_session.xenapi.SR.get_all_records_where.assert_called() +- +- def test_health_check_no_local_pbd(self): +- # Arrange +- self.expect_good_localhost() +- self.expect_good_sm_types() +- self.expect_good_sr_record() +- self.mock_session.xenapi.PBD.get_all_records_where.return_value = {} +- +- # Act +- sr_health_check.main() +- +- # Assert +- self.mock_session.xenapi.PBD.get_all_records_where.assert_called_with( +- 'field "SR" = "iscsi_ref" and field "host" = "{TEST_HOST}"'.format( +- TEST_HOST=TEST_HOST)) +- +- def test_health_check_sr_not_plugged(self): +- # Arrange +- self.expect_good_localhost() +- self.expect_good_sm_types() +- self.expect_good_sr_record() +- self.mock_session.xenapi.PBD.get_all_records_where.return_value = { +- 'pbd_ref': {'currently_attached': False} +- } +- +- # Act +- sr_health_check.main() +- +- # Assert +- self.mock_session.xenapi.PBD.get_all_records_where.assert_called_with( +- 'field "SR" = "iscsi_ref" and field "host" = "{TEST_HOST}"'.format( +- TEST_HOST=TEST_HOST)) +- +- def test_health_check_run_sr_check(self): +- # Arrange +- self.expect_good_localhost() +- self.expect_good_sm_types() +- self.expect_good_sr_record() +- self.mock_session.xenapi.PBD.get_all_records_where.return_value = { +- 'pbd_ref': {'currently_attached': True} +- } +- mock_sr = mock.create_autospec(SR) +- self.mock_sr.from_uuid.return_value = mock_sr +- +- # Act +- sr_health_check.main() +- +- # Assert +- mock_sr.check_sr.assert_called_with(SR_UUID) +-- +2.46.0 + diff --git a/SOURCES/0024-Fix-timeout_call-alarm-must-be-reset-in-case-of-succ.patch b/SOURCES/0025-Fix-timeout_call-alarm-must-be-reset-in-case-of-succ.patch similarity index 84% rename from SOURCES/0024-Fix-timeout_call-alarm-must-be-reset-in-case-of-succ.patch rename to SOURCES/0025-Fix-timeout_call-alarm-must-be-reset-in-case-of-succ.patch index 3c50033f..62b7fa1c 100644 --- a/SOURCES/0024-Fix-timeout_call-alarm-must-be-reset-in-case-of-succ.patch +++ b/SOURCES/0025-Fix-timeout_call-alarm-must-be-reset-in-case-of-succ.patch @@ -1,7 +1,7 @@ -From b1bffda87658150032f68a59d90117eb8260ae14 Mon Sep 17 00:00:00 2001 +From 81233191b418528ff660f2dcc4f179db598eded5 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 16 Feb 2022 18:24:56 +0100 -Subject: [PATCH 024/178] Fix timeout_call: alarm must be reset in case of +Subject: [PATCH 025/178] Fix timeout_call: alarm must be reset in case of success Otherwise the SIGALRM signal can be emitted after the execution @@ -28,5 +28,5 @@ index 8bd3635..77f3f19 100755 def _incr_iscsiSR_refcount(targetIQN, uuid): -- -2.45.2 +2.46.0 diff --git a/SOURCES/0025-timeout_call-returns-the-result-of-user-function-now.patch b/SOURCES/0026-timeout_call-returns-the-result-of-user-function-now.patch similarity index 82% rename from SOURCES/0025-timeout_call-returns-the-result-of-user-function-now.patch rename to SOURCES/0026-timeout_call-returns-the-result-of-user-function-now.patch index 15c91a9e..821dcb9f 100644 --- a/SOURCES/0025-timeout_call-returns-the-result-of-user-function-now.patch +++ b/SOURCES/0026-timeout_call-returns-the-result-of-user-function-now.patch @@ -1,7 +1,7 @@ -From e4fa58e917a6d5e090778cfd654383e966abfe9e Mon Sep 17 00:00:00 2001 +From 608866667c3f834f5a8128f0e646b494dbfda73f Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 16 Feb 2022 18:28:06 +0100 -Subject: [PATCH 025/178] timeout_call returns the result of user function now +Subject: [PATCH 026/178] timeout_call returns the result of user function now Signed-off-by: Ronan Abhamon --- @@ -22,5 +22,5 @@ index 77f3f19..54fda46 100755 signal.alarm(0) -- -2.45.2 +2.46.0 diff --git a/SOURCES/0026-Always-remove-the-pause-tag-from-VDIs-in-case-of-fai.patch b/SOURCES/0027-Always-remove-the-pause-tag-from-VDIs-in-case-of-fai.patch similarity index 94% rename from SOURCES/0026-Always-remove-the-pause-tag-from-VDIs-in-case-of-fai.patch rename to SOURCES/0027-Always-remove-the-pause-tag-from-VDIs-in-case-of-fai.patch index eecb21a0..37c567a6 100644 --- a/SOURCES/0026-Always-remove-the-pause-tag-from-VDIs-in-case-of-fai.patch +++ b/SOURCES/0027-Always-remove-the-pause-tag-from-VDIs-in-case-of-fai.patch @@ -1,7 +1,7 @@ -From b32670416ce70d546b3569a6f4cb507c0d3507bf Mon Sep 17 00:00:00 2001 +From e2533c00ebd0e76502dd3b8e4b57bae3e271e19e Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 5 Feb 2024 23:16:16 +0100 -Subject: [PATCH 026/178] Always remove the pause tag from VDIs in case of +Subject: [PATCH 027/178] Always remove the pause tag from VDIs in case of failure During VDI activation in the blktap module and in case of failure @@ -54,5 +54,5 @@ index e1f75e9..e9305ce 100755 "blktap_activate_inject_failure", lambda: util.inject_failure()) -- -2.45.2 +2.46.0 diff --git a/SOURCES/0027-fix-LinstorSR-repair-volumes-only-if-an-exclusive-co.patch b/SOURCES/0028-fix-LinstorSR-repair-volumes-only-if-an-exclusive-co.patch similarity index 90% rename from SOURCES/0027-fix-LinstorSR-repair-volumes-only-if-an-exclusive-co.patch rename to SOURCES/0028-fix-LinstorSR-repair-volumes-only-if-an-exclusive-co.patch index 5b232993..0f61727f 100644 --- a/SOURCES/0027-fix-LinstorSR-repair-volumes-only-if-an-exclusive-co.patch +++ b/SOURCES/0028-fix-LinstorSR-repair-volumes-only-if-an-exclusive-co.patch @@ -1,7 +1,7 @@ -From 56bdcd5312a20c92f5a1683b506ce447fa1914fa Mon Sep 17 00:00:00 2001 +From 2f5bef7771d539e57b314ccb34a51fa91c62582c Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 20 Nov 2020 16:42:52 +0100 -Subject: [PATCH 027/178] fix(LinstorSR): repair volumes only if an exclusive +Subject: [PATCH 028/178] fix(LinstorSR): repair volumes only if an exclusive command is executed Signed-off-by: Ronan Abhamon @@ -32,5 +32,5 @@ index 8be1836..a5bf5ab 100755 ) self._vhdutil = LinstorVhdUtil(self.session, self._linstor) -- -2.45.2 +2.46.0 diff --git a/SOURCES/0028-feat-LinstorSR-Improve-LINSTOR-performance.patch b/SOURCES/0029-feat-LinstorSR-Improve-LINSTOR-performance.patch similarity index 99% rename from SOURCES/0028-feat-LinstorSR-Improve-LINSTOR-performance.patch rename to SOURCES/0029-feat-LinstorSR-Improve-LINSTOR-performance.patch index b42795dd..a18f9fa4 100644 --- a/SOURCES/0028-feat-LinstorSR-Improve-LINSTOR-performance.patch +++ b/SOURCES/0029-feat-LinstorSR-Improve-LINSTOR-performance.patch @@ -1,7 +1,7 @@ -From 7e1008189ee1d49545d65f14bf6bee65cec21d5c Mon Sep 17 00:00:00 2001 +From fa6b3dcb7cc88a68152282bd9943cbc71a8c8b97 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 10 Dec 2020 17:56:15 +0100 -Subject: [PATCH 028/178] feat(LinstorSR): Improve LINSTOR performance +Subject: [PATCH 029/178] feat(LinstorSR): Improve LINSTOR performance Details: - vdi_attach and vdi_detach are now exclusive @@ -1417,5 +1417,5 @@ index d400421..d617655 100755 return 'xcp-sr-{}'.format(self._group_name) -- -2.45.2 +2.46.0 diff --git a/SOURCES/0029-feat-LinstorSR-robustify-scan-to-avoid-losing-VDIs-i.patch b/SOURCES/0030-feat-LinstorSR-robustify-scan-to-avoid-losing-VDIs-i.patch similarity index 95% rename from SOURCES/0029-feat-LinstorSR-robustify-scan-to-avoid-losing-VDIs-i.patch rename to SOURCES/0030-feat-LinstorSR-robustify-scan-to-avoid-losing-VDIs-i.patch index f2de3f53..7087f603 100644 --- a/SOURCES/0029-feat-LinstorSR-robustify-scan-to-avoid-losing-VDIs-i.patch +++ b/SOURCES/0030-feat-LinstorSR-robustify-scan-to-avoid-losing-VDIs-i.patch @@ -1,7 +1,7 @@ -From 78f29568ef2faee1f7fd01888169e07336f26f46 Mon Sep 17 00:00:00 2001 +From 7492a4f950f109830dc7b48adee93f0fce76027d Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 7 Jan 2021 11:17:08 +0100 -Subject: [PATCH 029/178] feat(LinstorSR): robustify scan to avoid losing VDIs +Subject: [PATCH 030/178] feat(LinstorSR): robustify scan to avoid losing VDIs if function is called outside module Signed-off-by: Ronan Abhamon @@ -87,5 +87,5 @@ index 548f4b1..52131a5 100755 LinstorJournaler.CLONE ).items()) -- -2.45.2 +2.46.0 diff --git a/SOURCES/0030-feat-LinstorSR-display-a-correctly-readable-size-for.patch b/SOURCES/0031-feat-LinstorSR-display-a-correctly-readable-size-for.patch similarity index 98% rename from SOURCES/0030-feat-LinstorSR-display-a-correctly-readable-size-for.patch rename to SOURCES/0031-feat-LinstorSR-display-a-correctly-readable-size-for.patch index b80fc4f6..02ff3705 100644 --- a/SOURCES/0030-feat-LinstorSR-display-a-correctly-readable-size-for.patch +++ b/SOURCES/0031-feat-LinstorSR-display-a-correctly-readable-size-for.patch @@ -1,7 +1,7 @@ -From fe6494d475ef9c2ef612c1273cdf6dc57f1b876a Mon Sep 17 00:00:00 2001 +From 0569b8b07776f203532c856d8cf92e7fe4957300 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 8 Jan 2021 16:12:15 +0100 -Subject: [PATCH 030/178] feat(LinstorSR): display a correctly readable size +Subject: [PATCH 031/178] feat(LinstorSR): display a correctly readable size for the user Signed-off-by: Ronan Abhamon @@ -277,5 +277,5 @@ index d617655..a6f67d8 100755 self._volume_info_cache_dirty = False -- -2.45.2 +2.46.0 diff --git a/SOURCES/0031-feat-linstor-monitord-scan-all-LINSTOR-SRs-every-12-.patch b/SOURCES/0032-feat-linstor-monitord-scan-all-LINSTOR-SRs-every-12-.patch similarity index 98% rename from SOURCES/0031-feat-linstor-monitord-scan-all-LINSTOR-SRs-every-12-.patch rename to SOURCES/0032-feat-linstor-monitord-scan-all-LINSTOR-SRs-every-12-.patch index b644f0a1..cb6c8e64 100644 --- a/SOURCES/0031-feat-linstor-monitord-scan-all-LINSTOR-SRs-every-12-.patch +++ b/SOURCES/0032-feat-linstor-monitord-scan-all-LINSTOR-SRs-every-12-.patch @@ -1,7 +1,7 @@ -From 6b1de43b38cabd9adc9888136c9134e167876c15 Mon Sep 17 00:00:00 2001 +From e5d09d4036b314c4f2b3fbfa148d367ef319841e Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 12 Jan 2021 14:06:34 +0100 -Subject: [PATCH 031/178] feat(linstor-monitord): scan all LINSTOR SRs every 12 +Subject: [PATCH 032/178] feat(linstor-monitord): scan all LINSTOR SRs every 12 minutes to update allocated size stats Signed-off-by: Ronan Abhamon @@ -331,5 +331,5 @@ index 8161813..a1592fd 100644 const int inotifyFd = createInotifyInstance(); -- -2.45.2 +2.46.0 diff --git a/SOURCES/0032-fix-LinstorSR-call-correctly-method-in-_locked_load-.patch b/SOURCES/0033-fix-LinstorSR-call-correctly-method-in-_locked_load-.patch similarity index 91% rename from SOURCES/0032-fix-LinstorSR-call-correctly-method-in-_locked_load-.patch rename to SOURCES/0033-fix-LinstorSR-call-correctly-method-in-_locked_load-.patch index c4003b23..29ff1f32 100644 --- a/SOURCES/0032-fix-LinstorSR-call-correctly-method-in-_locked_load-.patch +++ b/SOURCES/0033-fix-LinstorSR-call-correctly-method-in-_locked_load-.patch @@ -1,7 +1,7 @@ -From 6cdc1b2a0b9f5a8ec880800fc4c8ca5244987733 Mon Sep 17 00:00:00 2001 +From 3fd04d9be881f7ea2c978ba93e4dae3695d3cb74 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 15 Jan 2021 17:01:05 +0100 -Subject: [PATCH 032/178] fix(LinstorSR): call correctly method in _locked_load +Subject: [PATCH 033/178] fix(LinstorSR): call correctly method in _locked_load when vdi_attach_from_config is executed Signed-off-by: Ronan Abhamon @@ -40,5 +40,5 @@ index 16cb0d6..2df2d68 100755 self._master_uri = 'linstor://{}'.format( util.get_master_rec(self.session)['address'] -- -2.45.2 +2.46.0 diff --git a/SOURCES/0033-feat-LinstorSR-integrate-minidrbdcluster-daemon.patch b/SOURCES/0034-feat-LinstorSR-integrate-minidrbdcluster-daemon.patch similarity index 99% rename from SOURCES/0033-feat-LinstorSR-integrate-minidrbdcluster-daemon.patch rename to SOURCES/0034-feat-LinstorSR-integrate-minidrbdcluster-daemon.patch index 604f9f03..b17acc50 100644 --- a/SOURCES/0033-feat-LinstorSR-integrate-minidrbdcluster-daemon.patch +++ b/SOURCES/0034-feat-LinstorSR-integrate-minidrbdcluster-daemon.patch @@ -1,7 +1,7 @@ -From 88914c19b02c38e05fe457e45f1d41431a0bde8b Mon Sep 17 00:00:00 2001 +From f815b2bde1959d8342c5e009e7d739b10b1845ed Mon Sep 17 00:00:00 2001 From: Wescoeur Date: Wed, 20 Jan 2021 18:04:26 +0100 -Subject: [PATCH 033/178] feat(LinstorSR): integrate minidrbdcluster daemon +Subject: [PATCH 034/178] feat(LinstorSR): integrate minidrbdcluster daemon Now, we can: - Start a controller on any node @@ -33,10 +33,10 @@ Signed-off-by: Ronan Abhamon create mode 100644 systemd/minidrbdcluster.service diff --git a/Makefile b/Makefile -index 284b9a3..43dd569 100755 +index c746fcf..2b4940f 100755 --- a/Makefile +++ b/Makefile -@@ -92,6 +92,7 @@ PLUGIN_SCRIPT_DEST := /etc/xapi.d/plugins/ +@@ -91,6 +91,7 @@ PLUGIN_SCRIPT_DEST := /etc/xapi.d/plugins/ LIBEXEC := /opt/xensource/libexec/ UDEV_RULES_DIR := /etc/udev/rules.d/ UDEV_SCRIPTS_DIR := /etc/udev/scripts/ @@ -44,7 +44,7 @@ index 284b9a3..43dd569 100755 SYSTEMD_SERVICE_DIR := /usr/lib/systemd/system/ INIT_DIR := /etc/rc.d/init.d/ MPATH_CONF_DIR := /etc/multipath.xenserver/ -@@ -99,6 +100,7 @@ MPATH_CUSTOM_CONF_DIR := /etc/multipath/conf.d/ +@@ -98,6 +99,7 @@ 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/ @@ -52,7 +52,7 @@ index 284b9a3..43dd569 100755 SM_STAGING := $(DESTDIR) SM_STAMP := $(MY_OBJ_DIR)/.staging_stamp -@@ -147,11 +149,14 @@ install: precheck +@@ -146,11 +148,14 @@ install: precheck mkdir -p $(SM_STAGING)$(UDEV_RULES_DIR) mkdir -p $(SM_STAGING)$(UDEV_SCRIPTS_DIR) mkdir -p $(SM_STAGING)$(INIT_DIR) @@ -67,7 +67,7 @@ index 284b9a3..43dd569 100755 mkdir -p $(SM_STAGING)$(DEBUG_DEST) mkdir -p $(SM_STAGING)$(BIN_DEST) mkdir -p $(SM_STAGING)$(MASTER_SCRIPT_DEST) -@@ -175,6 +180,12 @@ install: precheck +@@ -174,6 +179,12 @@ install: precheck $(SM_STAGING)/$(SM_DEST) install -m 644 etc/logrotate.d/$(SMLOG_CONF) \ $(SM_STAGING)/$(LOGROTATE_DIR) @@ -80,7 +80,7 @@ index 284b9a3..43dd569 100755 install -m 644 etc/make-dummy-sr.service \ $(SM_STAGING)/$(SYSTEMD_SERVICE_DIR) install -m 644 systemd/xs-sm.service \ -@@ -193,6 +204,8 @@ install: precheck +@@ -188,6 +199,8 @@ install: precheck $(SM_STAGING)/$(SYSTEMD_SERVICE_DIR) install -m 644 systemd/linstor-monitor.service \ $(SM_STAGING)/$(SYSTEMD_SERVICE_DIR) @@ -89,7 +89,7 @@ index 284b9a3..43dd569 100755 for i in $(UDEV_RULES); do \ install -m 644 udev/$$i.rules \ $(SM_STAGING)$(UDEV_RULES_DIR); done -@@ -242,6 +255,7 @@ install: precheck +@@ -237,6 +250,7 @@ install: precheck install -m 755 scripts/xe-getlunidentifier $(SM_STAGING)$(BIN_DEST) install -m 755 scripts/make-dummy-sr $(SM_STAGING)$(LIBEXEC) install -m 755 scripts/storage-init $(SM_STAGING)$(LIBEXEC) @@ -2065,5 +2065,5 @@ index 0000000..3de6ac4 +[Install] +WantedBy=multi-user.target -- -2.45.2 +2.46.0 diff --git a/SOURCES/0034-feat-LinstorSR-ensure-heartbeat-and-redo_log-VDIs-ar.patch b/SOURCES/0035-feat-LinstorSR-ensure-heartbeat-and-redo_log-VDIs-ar.patch similarity index 97% rename from SOURCES/0034-feat-LinstorSR-ensure-heartbeat-and-redo_log-VDIs-ar.patch rename to SOURCES/0035-feat-LinstorSR-ensure-heartbeat-and-redo_log-VDIs-ar.patch index a1c3a772..3be31a6f 100644 --- a/SOURCES/0034-feat-LinstorSR-ensure-heartbeat-and-redo_log-VDIs-ar.patch +++ b/SOURCES/0035-feat-LinstorSR-ensure-heartbeat-and-redo_log-VDIs-ar.patch @@ -1,7 +1,7 @@ -From 6e0d84cf900e9c41cba663093c911fa025debd34 Mon Sep 17 00:00:00 2001 +From 7eaa8b7d67bd1704b2c8d6537703ed30f5e4303d Mon Sep 17 00:00:00 2001 From: Wescoeur Date: Wed, 24 Feb 2021 11:17:23 +0100 -Subject: [PATCH 034/178] feat(LinstorSR): ensure heartbeat and redo_log VDIs +Subject: [PATCH 035/178] feat(LinstorSR): ensure heartbeat and redo_log VDIs are not diskless Signed-off-by: Ronan Abhamon @@ -164,5 +164,5 @@ index a383e32..d8d64b4 100755 assert volume_properties.namespace == \ -- -2.45.2 +2.46.0 diff --git a/SOURCES/0035-feat-LinstorSR-protect-sr-commands-to-avoid-forgetti.patch b/SOURCES/0036-feat-LinstorSR-protect-sr-commands-to-avoid-forgetti.patch similarity index 97% rename from SOURCES/0035-feat-LinstorSR-protect-sr-commands-to-avoid-forgetti.patch rename to SOURCES/0036-feat-LinstorSR-protect-sr-commands-to-avoid-forgetti.patch index d37b5f86..9672e481 100644 --- a/SOURCES/0035-feat-LinstorSR-protect-sr-commands-to-avoid-forgetti.patch +++ b/SOURCES/0036-feat-LinstorSR-protect-sr-commands-to-avoid-forgetti.patch @@ -1,7 +1,7 @@ -From 1039b9bb973e2911ae222cd40f4a683bc6fbb83b Mon Sep 17 00:00:00 2001 +From 957fb9efcf9e31071ce90563fae78ce17a5c6aa6 Mon Sep 17 00:00:00 2001 From: Wescoeur Date: Thu, 25 Feb 2021 17:52:57 +0100 -Subject: [PATCH 035/178] feat(LinstorSR): protect sr commands to avoid +Subject: [PATCH 036/178] feat(LinstorSR): protect sr commands to avoid forgetting LINSTOR volumes when master satellite is down Steps to reproduce: @@ -162,5 +162,5 @@ index d943d49..092f5e8 100755 def _load_vdis_ex(self): -- -2.45.2 +2.46.0 diff --git a/SOURCES/0036-fix-LinstorJournaler-ensure-uri-is-not-None-during-l.patch b/SOURCES/0037-fix-LinstorJournaler-ensure-uri-is-not-None-during-l.patch similarity index 92% rename from SOURCES/0036-fix-LinstorJournaler-ensure-uri-is-not-None-during-l.patch rename to SOURCES/0037-fix-LinstorJournaler-ensure-uri-is-not-None-during-l.patch index 0bcd3803..42bc422f 100644 --- a/SOURCES/0036-fix-LinstorJournaler-ensure-uri-is-not-None-during-l.patch +++ b/SOURCES/0037-fix-LinstorJournaler-ensure-uri-is-not-None-during-l.patch @@ -1,7 +1,7 @@ -From b49cf026ac1d098feec5dbc14898285a59c16011 Mon Sep 17 00:00:00 2001 +From 5e96c8a43e8a672bc1622ed10ba7bc8138caed91 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 8 Mar 2021 13:25:28 +0100 -Subject: [PATCH 036/178] fix(LinstorJournaler): ensure uri is not None during +Subject: [PATCH 037/178] fix(LinstorJournaler): ensure uri is not None during linstor.KV creation Signed-off-by: Ronan Abhamon @@ -53,5 +53,5 @@ index 285012c..3993f60 100755 @staticmethod -- -2.45.2 +2.46.0 diff --git a/SOURCES/0037-feat-LinstorSR-add-an-option-to-disable-auto-quorum-.patch b/SOURCES/0038-feat-LinstorSR-add-an-option-to-disable-auto-quorum-.patch similarity index 97% rename from SOURCES/0037-feat-LinstorSR-add-an-option-to-disable-auto-quorum-.patch rename to SOURCES/0038-feat-LinstorSR-add-an-option-to-disable-auto-quorum-.patch index b7821c4c..0515369c 100644 --- a/SOURCES/0037-feat-LinstorSR-add-an-option-to-disable-auto-quorum-.patch +++ b/SOURCES/0038-feat-LinstorSR-add-an-option-to-disable-auto-quorum-.patch @@ -1,7 +1,7 @@ -From cab8593814b9b741a20d218df673a58d98dc3a79 Mon Sep 17 00:00:00 2001 +From 4a5e7d4ee020c3e1fa1b07a2306dd6480003da43 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 22 Mar 2021 17:32:26 +0100 -Subject: [PATCH 037/178] feat(LinstorSR): add an option to disable auto-quorum +Subject: [PATCH 038/178] feat(LinstorSR): add an option to disable auto-quorum on volume DB + fix doc Signed-off-by: Ronan Abhamon @@ -141,5 +141,5 @@ index d8d64b4..27c8df5 100755 current_device_path = cls._request_database_path(lin, activate=True) -- -2.45.2 +2.46.0 diff --git a/SOURCES/0038-fix-LinstorVolumeManager-add-a-workaround-to-create-.patch b/SOURCES/0039-fix-LinstorVolumeManager-add-a-workaround-to-create-.patch similarity index 90% rename from SOURCES/0038-fix-LinstorVolumeManager-add-a-workaround-to-create-.patch rename to SOURCES/0039-fix-LinstorVolumeManager-add-a-workaround-to-create-.patch index 02be14d5..676a546d 100644 --- a/SOURCES/0038-fix-LinstorVolumeManager-add-a-workaround-to-create-.patch +++ b/SOURCES/0039-fix-LinstorVolumeManager-add-a-workaround-to-create-.patch @@ -1,7 +1,7 @@ -From 9e0f7c02ae9c09c9d3be6ab4bcec31325d95e719 Mon Sep 17 00:00:00 2001 +From 5a2642058762b8fa64c44b53e89618f5c7b77f3b Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 23 Mar 2021 14:49:39 +0100 -Subject: [PATCH 038/178] fix(LinstorVolumeManager): add a workaround to create +Subject: [PATCH 039/178] fix(LinstorVolumeManager): add a workaround to create properly SR with thin LVM Signed-off-by: Ronan Abhamon @@ -32,5 +32,5 @@ index 27c8df5..3aaffdf 100755 cls._check_volume_creation_errors(lin.resource_group_spawn( rsc_grp_name=group_name, -- -2.45.2 +2.46.0 diff --git a/SOURCES/0039-feat-LinstorSR-add-optional-ips-parameter.patch b/SOURCES/0040-feat-LinstorSR-add-optional-ips-parameter.patch similarity index 97% rename from SOURCES/0039-feat-LinstorSR-add-optional-ips-parameter.patch rename to SOURCES/0040-feat-LinstorSR-add-optional-ips-parameter.patch index bdc73815..b95e853c 100644 --- a/SOURCES/0039-feat-LinstorSR-add-optional-ips-parameter.patch +++ b/SOURCES/0040-feat-LinstorSR-add-optional-ips-parameter.patch @@ -1,7 +1,7 @@ -From 89daa5b5525c2636a624fa4cf583d5b43ca06aad Mon Sep 17 00:00:00 2001 +From 0940fe2bfcfc74d6252a07cf95d1f261bf77cfc8 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 24 Mar 2021 10:06:58 +0100 -Subject: [PATCH 039/178] feat(LinstorSR): add optional ips parameter +Subject: [PATCH 040/178] feat(LinstorSR): add optional ips parameter Signed-off-by: Ronan Abhamon --- @@ -119,5 +119,5 @@ index 3aaffdf..5c04d02 100755 group_name = cls._build_group_name(group_name) pools = lin.storage_pool_list_raise(filter_by_stor_pools=[group_name]) -- -2.45.2 +2.46.0 diff --git a/SOURCES/0040-feat-LinstorSR-add-a-helper-log_drbd_erofs-to-trace-.patch b/SOURCES/0041-feat-LinstorSR-add-a-helper-log_drbd_erofs-to-trace-.patch similarity index 98% rename from SOURCES/0040-feat-LinstorSR-add-a-helper-log_drbd_erofs-to-trace-.patch rename to SOURCES/0041-feat-LinstorSR-add-a-helper-log_drbd_erofs-to-trace-.patch index 5e0bd66b..f27f2ddf 100644 --- a/SOURCES/0040-feat-LinstorSR-add-a-helper-log_drbd_erofs-to-trace-.patch +++ b/SOURCES/0041-feat-LinstorSR-add-a-helper-log_drbd_erofs-to-trace-.patch @@ -1,7 +1,7 @@ -From fbe2c09a13bb93031b43b77a54cdb678e743654a Mon Sep 17 00:00:00 2001 +From f54ac1cef57268f0f7494af54fd4008a9aa67481 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 26 Mar 2021 16:13:20 +0100 -Subject: [PATCH 040/178] feat(LinstorSR): add a helper `log_drbd_erofs` to +Subject: [PATCH 041/178] feat(LinstorSR): add a helper `log_drbd_erofs` to trace EROFS errno code with DRBD resources + check EROFS error Signed-off-by: Ronan Abhamon @@ -213,5 +213,5 @@ index 422834e..0a8fe91 100755 def getVHDInfo(path, extractUuidFunction, includeParent = True): """Get the VHD info. The parent info may optionally be omitted: vhd-util -- -2.45.2 +2.46.0 diff --git a/SOURCES/0041-fix-LinstorSR-try-to-restart-the-services-again-if-t.patch b/SOURCES/0042-fix-LinstorSR-try-to-restart-the-services-again-if-t.patch similarity index 94% rename from SOURCES/0041-fix-LinstorSR-try-to-restart-the-services-again-if-t.patch rename to SOURCES/0042-fix-LinstorSR-try-to-restart-the-services-again-if-t.patch index 1664b03e..2fccdc94 100644 --- a/SOURCES/0041-fix-LinstorSR-try-to-restart-the-services-again-if-t.patch +++ b/SOURCES/0042-fix-LinstorSR-try-to-restart-the-services-again-if-t.patch @@ -1,7 +1,7 @@ -From c651376bea317652fd4e6bc53af741935126dc14 Mon Sep 17 00:00:00 2001 +From 70e19894b836132d11001dd506dc1f6b97c38a57 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 28 Apr 2021 15:15:58 +0200 -Subject: [PATCH 041/178] fix(LinstorSR): try to restart the services again if +Subject: [PATCH 042/178] fix(LinstorSR): try to restart the services again if there is a failure in linstor-manager Signed-off-by: Ronan Abhamon @@ -70,5 +70,5 @@ index a06ed20..dcd4bc6 100755 def stop_service(name): -- -2.45.2 +2.46.0 diff --git a/SOURCES/0042-fix-LinstorSR-robustify-linstor-manager-to-never-inc.patch b/SOURCES/0043-fix-LinstorSR-robustify-linstor-manager-to-never-inc.patch similarity index 89% rename from SOURCES/0042-fix-LinstorSR-robustify-linstor-manager-to-never-inc.patch rename to SOURCES/0043-fix-LinstorSR-robustify-linstor-manager-to-never-inc.patch index b53f2576..933e3dfc 100644 --- a/SOURCES/0042-fix-LinstorSR-robustify-linstor-manager-to-never-inc.patch +++ b/SOURCES/0043-fix-LinstorSR-robustify-linstor-manager-to-never-inc.patch @@ -1,7 +1,7 @@ -From 54f90dbbb0433346a2ce8bf2563ab24277085011 Mon Sep 17 00:00:00 2001 +From 00000e9bd493c60ff0fd29bd1ee0612188f14cba Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 26 Aug 2021 15:26:11 +0200 -Subject: [PATCH 042/178] fix(LinstorSR): robustify linstor-manager to never +Subject: [PATCH 043/178] fix(LinstorSR): robustify linstor-manager to never include from plugins path Signed-off-by: Ronan Abhamon @@ -35,5 +35,5 @@ index dcd4bc6..f12747f 100755 from linstorvolumemanager import get_controller_uri, LinstorVolumeManager from lock import Lock -- -2.45.2 +2.46.0 diff --git a/SOURCES/0043-fix-LinstorSR-prevent-starting-controller-during-fai.patch b/SOURCES/0044-fix-LinstorSR-prevent-starting-controller-during-fai.patch similarity index 93% rename from SOURCES/0043-fix-LinstorSR-prevent-starting-controller-during-fai.patch rename to SOURCES/0044-fix-LinstorSR-prevent-starting-controller-during-fai.patch index fc1f3d7f..41606748 100644 --- a/SOURCES/0043-fix-LinstorSR-prevent-starting-controller-during-fai.patch +++ b/SOURCES/0044-fix-LinstorSR-prevent-starting-controller-during-fai.patch @@ -1,7 +1,7 @@ -From 1f8ccb5783db73c690eb900d43ee79fccd0776ba Mon Sep 17 00:00:00 2001 +From 388927905668b5f4b577b2099ea95fcae1f62c57 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 26 Aug 2021 16:52:01 +0200 -Subject: [PATCH 043/178] fix(LinstorSR): prevent starting controller during +Subject: [PATCH 044/178] fix(LinstorSR): prevent starting controller during fail in linstor manager destroy method Signed-off-by: Ronan Abhamon @@ -61,5 +61,5 @@ index 0357b92..e9b7c2f 100755 def _is_mounted(mountpoint): (ret, out, err) = util.doexec(['mountpoint', '-q', mountpoint]) -- -2.45.2 +2.46.0 diff --git a/SOURCES/0044-feat-LinstorVolumeManager-increase-peer-slots-limit-.patch b/SOURCES/0045-feat-LinstorVolumeManager-increase-peer-slots-limit-.patch similarity index 97% rename from SOURCES/0044-feat-LinstorVolumeManager-increase-peer-slots-limit-.patch rename to SOURCES/0045-feat-LinstorVolumeManager-increase-peer-slots-limit-.patch index 1306e8d8..fb67162c 100644 --- a/SOURCES/0044-feat-LinstorVolumeManager-increase-peer-slots-limit-.patch +++ b/SOURCES/0045-feat-LinstorVolumeManager-increase-peer-slots-limit-.patch @@ -1,7 +1,7 @@ -From 8284e3d6bac01e92fe0fd1f3594ae34b60749ee0 Mon Sep 17 00:00:00 2001 +From 7bbb8e4cb68122d9e2a784dae2359edbe8a16445 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 19 Oct 2021 14:48:17 +0200 -Subject: [PATCH 044/178] feat(LinstorVolumeManager): increase peer slots limit +Subject: [PATCH 045/178] feat(LinstorVolumeManager): increase peer slots limit (support 31 connections to a DRBD) - Also, create diskless devices when db is created @@ -166,5 +166,5 @@ index e9b7c2f..553e2f5 100755 # /dev/drbd/by-res/. expected_device_path = cls.build_device_path(DATABASE_VOLUME_NAME) -- -2.45.2 +2.46.0 diff --git a/SOURCES/0045-feat-LinstorVolumeManager-add-a-fallback-to-find-con.patch b/SOURCES/0046-feat-LinstorVolumeManager-add-a-fallback-to-find-con.patch similarity index 96% rename from SOURCES/0045-feat-LinstorVolumeManager-add-a-fallback-to-find-con.patch rename to SOURCES/0046-feat-LinstorVolumeManager-add-a-fallback-to-find-con.patch index fa48e348..15f6bba4 100644 --- a/SOURCES/0045-feat-LinstorVolumeManager-add-a-fallback-to-find-con.patch +++ b/SOURCES/0046-feat-LinstorVolumeManager-add-a-fallback-to-find-con.patch @@ -1,7 +1,7 @@ -From c12c3f0de5c9fc0c9330263a452509697e86ec6e Mon Sep 17 00:00:00 2001 +From c96f969e228b789d1ac28ae17eb35255cfee0aa0 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 20 Oct 2021 14:33:04 +0200 -Subject: [PATCH 045/178] feat(LinstorVolumeManager): add a fallback to find +Subject: [PATCH 046/178] feat(LinstorVolumeManager): add a fallback to find controller uri (when len(hosts) >= 4) Signed-off-by: Ronan Abhamon @@ -113,5 +113,5 @@ index 553e2f5..821ef42 100755 def get_controller_uri(): -- -2.45.2 +2.46.0 diff --git a/SOURCES/0046-fix-var-lib-linstor.mount-ensure-we-always-mount-dat.patch b/SOURCES/0047-fix-var-lib-linstor.mount-ensure-we-always-mount-dat.patch similarity index 95% rename from SOURCES/0046-fix-var-lib-linstor.mount-ensure-we-always-mount-dat.patch rename to SOURCES/0047-fix-var-lib-linstor.mount-ensure-we-always-mount-dat.patch index 72aa4cd2..27db1348 100644 --- a/SOURCES/0046-fix-var-lib-linstor.mount-ensure-we-always-mount-dat.patch +++ b/SOURCES/0047-fix-var-lib-linstor.mount-ensure-we-always-mount-dat.patch @@ -1,7 +1,7 @@ -From c532e3550512008db3ba7fd5dcb1367d18d73578 Mon Sep 17 00:00:00 2001 +From 1911a8c147f036f0e57062cb3134c6798a468e30 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 21 Oct 2021 11:13:07 +0200 -Subject: [PATCH 046/178] fix(var-lib-linstor.mount): ensure we always mount +Subject: [PATCH 047/178] fix(var-lib-linstor.mount): ensure we always mount database with RW flags Sometimes systemd fallback to read only FS if the volume can't be mounted, we must @@ -19,10 +19,10 @@ Signed-off-by: Ronan Abhamon create mode 100644 etc/systemd/system/var-lib-linstor.service diff --git a/Makefile b/Makefile -index 43dd569..2eb6a86 100755 +index 2b4940f..056b299 100755 --- a/Makefile +++ b/Makefile -@@ -182,7 +182,7 @@ install: precheck +@@ -181,7 +181,7 @@ install: precheck $(SM_STAGING)/$(LOGROTATE_DIR) install -m 644 etc/systemd/system/linstor-satellite.service.d/override.conf \ $(SM_STAGING)/$(SYSTEMD_CONF_DIR)/linstor-satellite.service.d/ @@ -106,5 +106,5 @@ index 0000000..d230d04 +ExecStop=/bin/umount /var/lib/linstor +RemainAfterExit=true -- -2.45.2 +2.46.0 diff --git a/SOURCES/0047-feat-LinstorVolumeManager-add-a-fallback-to-find-nod.patch b/SOURCES/0048-feat-LinstorVolumeManager-add-a-fallback-to-find-nod.patch similarity index 92% rename from SOURCES/0047-feat-LinstorVolumeManager-add-a-fallback-to-find-nod.patch rename to SOURCES/0048-feat-LinstorVolumeManager-add-a-fallback-to-find-nod.patch index 328595b7..b757fa1b 100644 --- a/SOURCES/0047-feat-LinstorVolumeManager-add-a-fallback-to-find-nod.patch +++ b/SOURCES/0048-feat-LinstorVolumeManager-add-a-fallback-to-find-nod.patch @@ -1,7 +1,7 @@ -From a7aeadb712732b37f7dc8857d3999bfc01751308 Mon Sep 17 00:00:00 2001 +From 53850ec1f126a68485c20d01a81da2529ba19d90 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 21 Oct 2021 11:51:32 +0200 -Subject: [PATCH 047/178] feat(LinstorVolumeManager): add a fallback to find +Subject: [PATCH 048/178] feat(LinstorVolumeManager): add a fallback to find node name (when len(hosts) >= 4) Signed-off-by: Ronan Abhamon @@ -48,5 +48,5 @@ index 821ef42..e497afa 100755 # ============================================================================== -- -2.45.2 +2.46.0 diff --git a/SOURCES/0048-feat-LinstorSR-explain-on-which-host-plugins-command.patch b/SOURCES/0049-feat-LinstorSR-explain-on-which-host-plugins-command.patch similarity index 92% rename from SOURCES/0048-feat-LinstorSR-explain-on-which-host-plugins-command.patch rename to SOURCES/0049-feat-LinstorSR-explain-on-which-host-plugins-command.patch index 62513821..8acc15de 100644 --- a/SOURCES/0048-feat-LinstorSR-explain-on-which-host-plugins-command.patch +++ b/SOURCES/0049-feat-LinstorSR-explain-on-which-host-plugins-command.patch @@ -1,7 +1,7 @@ -From 7747dc7656e0291ac3233d74157d7703671b0b06 Mon Sep 17 00:00:00 2001 +From a719956530bd08539fa58f1cfd0043779cc7c0d9 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 26 Oct 2021 10:44:00 +0200 -Subject: [PATCH 048/178] feat(LinstorSR): explain on which host, plugins +Subject: [PATCH 049/178] feat(LinstorSR): explain on which host, plugins commands are executed Signed-off-by: Ronan Abhamon @@ -46,5 +46,5 @@ index 4b761b5..519afb2 100755 ) if ret == 'False': -- -2.45.2 +2.46.0 diff --git a/SOURCES/0049-fix-LinstorSR-create-diskless-path-if-necessary-duri.patch b/SOURCES/0050-fix-LinstorSR-create-diskless-path-if-necessary-duri.patch similarity index 90% rename from SOURCES/0049-fix-LinstorSR-create-diskless-path-if-necessary-duri.patch rename to SOURCES/0050-fix-LinstorSR-create-diskless-path-if-necessary-duri.patch index 1e9d4df3..53db14c1 100644 --- a/SOURCES/0049-fix-LinstorSR-create-diskless-path-if-necessary-duri.patch +++ b/SOURCES/0050-fix-LinstorSR-create-diskless-path-if-necessary-duri.patch @@ -1,7 +1,7 @@ -From 0f3667547a0b1c68a96ff12e49dc2fa8edc52da7 Mon Sep 17 00:00:00 2001 +From ea6fa3de772d60b15718834e0510e47bedb334fc Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 3 Nov 2021 14:59:31 +0100 -Subject: [PATCH 049/178] fix(LinstorSR): create diskless path if necessary +Subject: [PATCH 050/178] fix(LinstorSR): create diskless path if necessary during VDI loading Signed-off-by: Ronan Abhamon @@ -32,5 +32,5 @@ index 519afb2..15b9dda 100755 self.size = vhd_info.sizeVirt self.parent = vhd_info.parentUuid -- -2.45.2 +2.46.0 diff --git a/SOURCES/0050-feat-LinstorSR-use-HTTP-NBD-instead-of-DRBD-directly.patch b/SOURCES/0051-feat-LinstorSR-use-HTTP-NBD-instead-of-DRBD-directly.patch similarity index 99% rename from SOURCES/0050-feat-LinstorSR-use-HTTP-NBD-instead-of-DRBD-directly.patch rename to SOURCES/0051-feat-LinstorSR-use-HTTP-NBD-instead-of-DRBD-directly.patch index 94295b99..0b51b002 100644 --- a/SOURCES/0050-feat-LinstorSR-use-HTTP-NBD-instead-of-DRBD-directly.patch +++ b/SOURCES/0051-feat-LinstorSR-use-HTTP-NBD-instead-of-DRBD-directly.patch @@ -1,7 +1,7 @@ -From d0c2d229c7119e53f1675388c6f2d07afdcafb45 Mon Sep 17 00:00:00 2001 +From 38960f4621164640ed1c4423959e0fd195569403 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 12 May 2022 17:52:35 +0200 -Subject: [PATCH 050/178] feat(LinstorSR): use HTTP/NBD instead of DRBD +Subject: [PATCH 051/178] feat(LinstorSR): use HTTP/NBD instead of DRBD directly with heartbeat VDI Signed-off-by: Ronan Abhamon @@ -17,10 +17,10 @@ Signed-off-by: Ronan Abhamon create mode 100755 scripts/fork-log-daemon diff --git a/Makefile b/Makefile -index 2eb6a86..af1011a 100755 +index 056b299..992d9ef 100755 --- a/Makefile +++ b/Makefile -@@ -239,6 +239,7 @@ install: precheck +@@ -234,6 +234,7 @@ install: precheck install -m 755 drivers/iscsilib.py $(SM_STAGING)$(SM_DEST) install -m 755 drivers/fcoelib.py $(SM_STAGING)$(SM_DEST) mkdir -p $(SM_STAGING)$(LIBEXEC) @@ -759,5 +759,5 @@ index 0000000..eb0f0b0 + finally: + syslog.syslog(sys.argv[1] + ' is now terminated!') -- -2.45.2 +2.46.0 diff --git a/SOURCES/0051-fix-LinstorSR-find-controller-when-XAPI-unreachable-.patch b/SOURCES/0052-fix-LinstorSR-find-controller-when-XAPI-unreachable-.patch similarity index 98% rename from SOURCES/0051-fix-LinstorSR-find-controller-when-XAPI-unreachable-.patch rename to SOURCES/0052-fix-LinstorSR-find-controller-when-XAPI-unreachable-.patch index 22c8143b..a75c5010 100644 --- a/SOURCES/0051-fix-LinstorSR-find-controller-when-XAPI-unreachable-.patch +++ b/SOURCES/0052-fix-LinstorSR-find-controller-when-XAPI-unreachable-.patch @@ -1,7 +1,7 @@ -From 8ae218c2942ac22a017a9cc880ab631f5aa69c36 Mon Sep 17 00:00:00 2001 +From 43cdaa51754d3e397f17e2092a64919daf6e4a05 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 3 Mar 2022 15:02:17 +0100 -Subject: [PATCH 051/178] fix(LinstorSR): find controller when XAPI unreachable +Subject: [PATCH 052/178] fix(LinstorSR): find controller when XAPI unreachable (XHA) Signed-off-by: Ronan Abhamon @@ -183,5 +183,5 @@ index da98e0b..b4ee783 100755 linstor.errors.LinstorNetworkError, LinstorVolumeManagerError -- -2.45.2 +2.46.0 diff --git a/SOURCES/0052-fix-LinstorSR-use-IPs-instead-of-hostnames-in-NBD-se.patch b/SOURCES/0053-fix-LinstorSR-use-IPs-instead-of-hostnames-in-NBD-se.patch similarity index 98% rename from SOURCES/0052-fix-LinstorSR-use-IPs-instead-of-hostnames-in-NBD-se.patch rename to SOURCES/0053-fix-LinstorSR-use-IPs-instead-of-hostnames-in-NBD-se.patch index 0e3d0fdc..fcdf5de2 100644 --- a/SOURCES/0052-fix-LinstorSR-use-IPs-instead-of-hostnames-in-NBD-se.patch +++ b/SOURCES/0053-fix-LinstorSR-use-IPs-instead-of-hostnames-in-NBD-se.patch @@ -1,7 +1,7 @@ -From db8a2032a451a16d6bb7a7cadd6fbc8ce4795443 Mon Sep 17 00:00:00 2001 +From a6d4a6ef809faeb91f4cd7c7f4e4bba8dc2d0b7f Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 24 Mar 2022 18:13:46 +0100 -Subject: [PATCH 052/178] fix(LinstorSR): use IPs instead of hostnames in NBD +Subject: [PATCH 053/178] fix(LinstorSR): use IPs instead of hostnames in NBD server Without this patch we can't use XCP-ng hosts configured with static IPS. @@ -204,5 +204,5 @@ index 6a9fc1a..7c52703 100755 host_uuid = get_this_host() host_ref = session.xenapi.host.get_by_uuid(host_uuid) -- -2.45.2 +2.46.0 diff --git a/SOURCES/0053-fix-LinstorVolumeManager-ensure-we-always-use-IPs-in.patch b/SOURCES/0054-fix-LinstorVolumeManager-ensure-we-always-use-IPs-in.patch similarity index 87% rename from SOURCES/0053-fix-LinstorVolumeManager-ensure-we-always-use-IPs-in.patch rename to SOURCES/0054-fix-LinstorVolumeManager-ensure-we-always-use-IPs-in.patch index 45dc54f2..9611e49e 100644 --- a/SOURCES/0053-fix-LinstorVolumeManager-ensure-we-always-use-IPs-in.patch +++ b/SOURCES/0054-fix-LinstorVolumeManager-ensure-we-always-use-IPs-in.patch @@ -1,7 +1,7 @@ -From e7ecc4da932107ccc26ec88b0dd37818222c6852 Mon Sep 17 00:00:00 2001 +From 5e39604cc13941a2d3fe20a2096e3553c1838dba Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 31 Mar 2022 11:21:19 +0200 -Subject: [PATCH 053/178] fix(LinstorVolumeManager): ensure we always use IPs +Subject: [PATCH 054/178] fix(LinstorVolumeManager): ensure we always use IPs in _get_controller_uri Otherwise if a hostname is returned, we can't use it if the XCP-ng pool @@ -26,5 +26,5 @@ index b4ee783..2d5c63e 100755 # Not found, maybe we are trying to create the SR... pass -- -2.45.2 +2.46.0 diff --git a/SOURCES/0054-feat-linstor-manager-add-methods-to-add-remove-host-.patch b/SOURCES/0055-feat-linstor-manager-add-methods-to-add-remove-host-.patch similarity index 99% rename from SOURCES/0054-feat-linstor-manager-add-methods-to-add-remove-host-.patch rename to SOURCES/0055-feat-linstor-manager-add-methods-to-add-remove-host-.patch index bd9798ac..176ac7b9 100644 --- a/SOURCES/0054-feat-linstor-manager-add-methods-to-add-remove-host-.patch +++ b/SOURCES/0055-feat-linstor-manager-add-methods-to-add-remove-host-.patch @@ -1,7 +1,7 @@ -From cf24400a72eca939c89f7896fe4235adab492b88 Mon Sep 17 00:00:00 2001 +From 28aba096541cca6fb8afcf8d0cb4789b8ef8575f Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 6 Apr 2022 17:53:02 +0200 -Subject: [PATCH 054/178] feat(linstor-manager): add methods to add remove/host +Subject: [PATCH 055/178] feat(linstor-manager): add methods to add remove/host from LINSTOR SR Signed-off-by: Ronan Abhamon @@ -421,5 +421,5 @@ index 2d5c63e..6c0d5aa 100755 def create_sr( cls, group_name, node_names, ips, redundancy, -- -2.45.2 +2.46.0 diff --git a/SOURCES/0055-feat-LinstorVolumeManager-support-SR-creation-with-d.patch b/SOURCES/0056-feat-LinstorVolumeManager-support-SR-creation-with-d.patch similarity index 97% rename from SOURCES/0055-feat-LinstorVolumeManager-support-SR-creation-with-d.patch rename to SOURCES/0056-feat-LinstorVolumeManager-support-SR-creation-with-d.patch index 01157232..096b0ba0 100644 --- a/SOURCES/0055-feat-LinstorVolumeManager-support-SR-creation-with-d.patch +++ b/SOURCES/0056-feat-LinstorVolumeManager-support-SR-creation-with-d.patch @@ -1,7 +1,7 @@ -From 737bf6cafdcabf0e4e675e6440488a13df703f51 Mon Sep 17 00:00:00 2001 +From 20097cdf57ee556867918c67505fe017d56e20a8 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 13 Apr 2022 15:56:42 +0200 -Subject: [PATCH 055/178] feat(LinstorVolumeManager): support SR creation with +Subject: [PATCH 056/178] feat(LinstorVolumeManager): support SR creation with diskless nodes Signed-off-by: Ronan Abhamon @@ -126,5 +126,5 @@ index 6c0d5aa..430e080 100755 node_name=node_name, rsc_name=DATABASE_VOLUME_NAME, -- -2.45.2 +2.46.0 diff --git a/SOURCES/0056-feat-LinstorSR-add-a-config-var-to-disable-HTTP-NBD-.patch b/SOURCES/0057-feat-LinstorSR-add-a-config-var-to-disable-HTTP-NBD-.patch similarity index 93% rename from SOURCES/0056-feat-LinstorSR-add-a-config-var-to-disable-HTTP-NBD-.patch rename to SOURCES/0057-feat-LinstorSR-add-a-config-var-to-disable-HTTP-NBD-.patch index 8aea78b4..98c61652 100644 --- a/SOURCES/0056-feat-LinstorSR-add-a-config-var-to-disable-HTTP-NBD-.patch +++ b/SOURCES/0057-feat-LinstorSR-add-a-config-var-to-disable-HTTP-NBD-.patch @@ -1,7 +1,7 @@ -From 8a4e120a3b9c03b8f44ebc5bc28c774e1fb13fea Mon Sep 17 00:00:00 2001 +From 95fd9bba2bffc7313f5d155779e14d3922974584 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 14 Apr 2022 10:30:23 +0200 -Subject: [PATCH 056/178] feat(LinstorSR): add a config var to disable HTTP/NBD +Subject: [PATCH 057/178] feat(LinstorSR): add a config var to disable HTTP/NBD servers Signed-off-by: Ronan Abhamon @@ -50,5 +50,5 @@ index 413c550..927e477 100755 ]: if not self.path or not util.pathexists(self.path): -- -2.45.2 +2.46.0 diff --git a/SOURCES/0057-feat-LinstorSr-ensure-LVM-group-is-activated-during-.patch b/SOURCES/0058-feat-LinstorSr-ensure-LVM-group-is-activated-during-.patch similarity index 95% rename from SOURCES/0057-feat-LinstorSr-ensure-LVM-group-is-activated-during-.patch rename to SOURCES/0058-feat-LinstorSr-ensure-LVM-group-is-activated-during-.patch index 553c0a44..f86173ad 100644 --- a/SOURCES/0057-feat-LinstorSr-ensure-LVM-group-is-activated-during-.patch +++ b/SOURCES/0058-feat-LinstorSr-ensure-LVM-group-is-activated-during-.patch @@ -1,7 +1,7 @@ -From 68128105b3464925de8959b6b57c436f7fafd2c7 Mon Sep 17 00:00:00 2001 +From dc48c3878151d9c23db4ca8c5a6247da70797d8c Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 14 Apr 2022 15:45:20 +0200 -Subject: [PATCH 057/178] feat(LinstorSr): ensure LVM group is activated during +Subject: [PATCH 058/178] feat(LinstorSr): ensure LVM group is activated during SR.attach/create Signed-off-by: Ronan Abhamon @@ -95,5 +95,5 @@ index 7e34ce6..91731b1 100755 # We don't want to enable and start minidrbdcluster daemon during # SR creation. -- -2.45.2 +2.46.0 diff --git a/SOURCES/0058-feat-linstor-manager-add-method-to-create-LinstorSR-.patch b/SOURCES/0059-feat-linstor-manager-add-method-to-create-LinstorSR-.patch similarity index 98% rename from SOURCES/0058-feat-linstor-manager-add-method-to-create-LinstorSR-.patch rename to SOURCES/0059-feat-linstor-manager-add-method-to-create-LinstorSR-.patch index 478f5ac9..44250d42 100644 --- a/SOURCES/0058-feat-linstor-manager-add-method-to-create-LinstorSR-.patch +++ b/SOURCES/0059-feat-linstor-manager-add-method-to-create-LinstorSR-.patch @@ -1,7 +1,7 @@ -From b2e5c8fe9e77c7691f65af4b5d90cc4359064254 Mon Sep 17 00:00:00 2001 +From 705841677140a8163c1ff3df384002e1e03c2678 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 25 Apr 2022 14:47:51 +0200 -Subject: [PATCH 058/178] feat(linstor-manager): add method to create LinstorSR +Subject: [PATCH 059/178] feat(linstor-manager): add method to create LinstorSR + to list/destroy DRBD volumes Signed-off-by: Ronan Abhamon @@ -243,5 +243,5 @@ index 91731b1..7893ebc 100755 + 'destroyDrbdVolumes': destroy_drbd_volumes }) -- -2.45.2 +2.46.0 diff --git a/SOURCES/0059-fix-LinstorSR-always-set-vdi_path-in-generate_config.patch b/SOURCES/0060-fix-LinstorSR-always-set-vdi_path-in-generate_config.patch similarity index 87% rename from SOURCES/0059-fix-LinstorSR-always-set-vdi_path-in-generate_config.patch rename to SOURCES/0060-fix-LinstorSR-always-set-vdi_path-in-generate_config.patch index 6fdf2046..96932fd4 100644 --- a/SOURCES/0059-fix-LinstorSR-always-set-vdi_path-in-generate_config.patch +++ b/SOURCES/0060-fix-LinstorSR-always-set-vdi_path-in-generate_config.patch @@ -1,7 +1,7 @@ -From 14e0b3c2bc3cbfccfa8356a953c51f38b20feb41 Mon Sep 17 00:00:00 2001 +From 136b46200c12aa90dd246559107e0f742ccb66a7 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 26 Apr 2022 11:20:08 +0200 -Subject: [PATCH 059/178] fix(LinstorSR): always set vdi_path in +Subject: [PATCH 060/178] fix(LinstorSR): always set vdi_path in generate_config If the volume of a generated config is not related to HTTP/NBD @@ -27,5 +27,5 @@ index e2d3d78..1855e3d 100755 # Axiom: DRBD device is present on at least one host. resp['vdi_path'] = '/dev/http-nbd/' + volume_name -- -2.45.2 +2.46.0 diff --git a/SOURCES/0060-fix-minidrbdcluster-supports-new-properties-like-for.patch b/SOURCES/0061-fix-minidrbdcluster-supports-new-properties-like-for.patch similarity index 89% rename from SOURCES/0060-fix-minidrbdcluster-supports-new-properties-like-for.patch rename to SOURCES/0061-fix-minidrbdcluster-supports-new-properties-like-for.patch index e8610274..de60de7c 100644 --- a/SOURCES/0060-fix-minidrbdcluster-supports-new-properties-like-for.patch +++ b/SOURCES/0061-fix-minidrbdcluster-supports-new-properties-like-for.patch @@ -1,7 +1,7 @@ -From 5ecce33563f1c19c3ac9b61b3a6656594e96dfee Mon Sep 17 00:00:00 2001 +From 49fad6ce14acee828ef7d5c90abbc1a4310b788c Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 13 May 2022 14:35:57 +0200 -Subject: [PATCH 060/178] fix(minidrbdcluster): supports new properties like +Subject: [PATCH 061/178] fix(minidrbdcluster): supports new properties like `force-io-failures` Signed-off-by: Ronan Abhamon @@ -33,5 +33,5 @@ index a04b6c1..fb4de09 100755 -- -2.45.2 +2.46.0 diff --git a/SOURCES/0061-fix-LinstorSR-enabled-disable-minidrbcluster-with-fi.patch b/SOURCES/0062-fix-LinstorSR-enabled-disable-minidrbcluster-with-fi.patch similarity index 95% rename from SOURCES/0061-fix-LinstorSR-enabled-disable-minidrbcluster-with-fi.patch rename to SOURCES/0062-fix-LinstorSR-enabled-disable-minidrbcluster-with-fi.patch index d67cdc2b..5b285872 100644 --- a/SOURCES/0061-fix-LinstorSR-enabled-disable-minidrbcluster-with-fi.patch +++ b/SOURCES/0062-fix-LinstorSR-enabled-disable-minidrbcluster-with-fi.patch @@ -1,7 +1,7 @@ -From 4d0a06570aced0a760f9dfdceec64fe5db257cd6 Mon Sep 17 00:00:00 2001 +From c72704cc8eeb8c7ee16b9ff919c012613e58e9b9 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 18 May 2022 17:28:33 +0200 -Subject: [PATCH 061/178] fix(LinstorSR): enabled/disable minidrbcluster with +Subject: [PATCH 062/178] fix(LinstorSR): enabled/disable minidrbcluster with fixed order Ensure we disable minidrbdcluster during SR destruction on all hosts @@ -80,5 +80,5 @@ index 1855e3d..57280e3 100755 # -------------------------------------------------------------------------- # Metadata. -- -2.45.2 +2.46.0 diff --git a/SOURCES/0062-fix-linstor-manager-change-linstor-satellite-start-b.patch b/SOURCES/0063-fix-linstor-manager-change-linstor-satellite-start-b.patch similarity index 90% rename from SOURCES/0062-fix-linstor-manager-change-linstor-satellite-start-b.patch rename to SOURCES/0063-fix-linstor-manager-change-linstor-satellite-start-b.patch index e42f1f48..cbbc3661 100644 --- a/SOURCES/0062-fix-linstor-manager-change-linstor-satellite-start-b.patch +++ b/SOURCES/0063-fix-linstor-manager-change-linstor-satellite-start-b.patch @@ -1,7 +1,7 @@ -From 94412eef0fcaf1b5ac5d0367e25b7ce54b33845c Mon Sep 17 00:00:00 2001 +From 753d654a5f81243b6c7a28880b5936ff0a4077c5 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 31 May 2022 14:01:45 +0200 -Subject: [PATCH 062/178] fix(linstor-manager): change linstor satellite start +Subject: [PATCH 063/178] fix(linstor-manager): change linstor satellite start behavior Ensure we don't have an invalid cache used by a satellite: @@ -37,5 +37,5 @@ index 7893ebc..c6d622f 100755 def update_minidrbdcluster_service(start): -- -2.45.2 +2.46.0 diff --git a/SOURCES/0063-Fix-is_open-call-for-LinstorSR.patch b/SOURCES/0064-Fix-is_open-call-for-LinstorSR.patch similarity index 96% rename from SOURCES/0063-Fix-is_open-call-for-LinstorSR.patch rename to SOURCES/0064-Fix-is_open-call-for-LinstorSR.patch index 62df6549..280d7a3d 100644 --- a/SOURCES/0063-Fix-is_open-call-for-LinstorSR.patch +++ b/SOURCES/0064-Fix-is_open-call-for-LinstorSR.patch @@ -1,7 +1,7 @@ -From 85411fa09ac82dcafe0ad600fcbfaa92d10380c5 Mon Sep 17 00:00:00 2001 +From 1a7b9177a0975ef6663607077797d3fe00b73bc6 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 2 Jun 2022 09:04:28 +0200 -Subject: [PATCH 063/178] Fix is_open call for LinstorSR +Subject: [PATCH 064/178] Fix is_open call for LinstorSR 1. Ensure LinstorSR driver is imported in `_is_open` definition to register it in the driver list. Otherwise this function always fails with a SRUnknownType exception. @@ -102,5 +102,5 @@ index 54ebcd3..4c12d90 100644 def fake_import(self, name, *args): print 'Asked to import {}'.format(name) -- -2.45.2 +2.46.0 diff --git a/SOURCES/0064-fix-linstorvhdutil-fix-boolean-params-of-check-call.patch b/SOURCES/0065-fix-linstorvhdutil-fix-boolean-params-of-check-call.patch similarity index 92% rename from SOURCES/0064-fix-linstorvhdutil-fix-boolean-params-of-check-call.patch rename to SOURCES/0065-fix-linstorvhdutil-fix-boolean-params-of-check-call.patch index a9e55866..8b21e2fe 100644 --- a/SOURCES/0064-fix-linstorvhdutil-fix-boolean-params-of-check-call.patch +++ b/SOURCES/0065-fix-linstorvhdutil-fix-boolean-params-of-check-call.patch @@ -1,7 +1,7 @@ -From 6006799b8f99c1b0bcd303543145ea602196f55a Mon Sep 17 00:00:00 2001 +From d03d8fb5ef8790e9de1229200c8cd5e873990026 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 2 Jun 2022 09:28:32 +0200 -Subject: [PATCH 064/178] fix(linstorvhdutil): fix boolean params of `check` +Subject: [PATCH 065/178] fix(linstorvhdutil): fix boolean params of `check` call `ignoreMissingFooter` and `fast` must be string types to be used with XAPI plugin API. @@ -46,5 +46,5 @@ index 9ba0ac3..f3d9870 100644 @linstorhostcall(vhdutil.check, 'check') -- -2.45.2 +2.46.0 diff --git a/SOURCES/0065-feat-linstor-manager-robustify-exec_create_sr.patch b/SOURCES/0066-feat-linstor-manager-robustify-exec_create_sr.patch similarity index 98% rename from SOURCES/0065-feat-linstor-manager-robustify-exec_create_sr.patch rename to SOURCES/0066-feat-linstor-manager-robustify-exec_create_sr.patch index 351aab2c..3eee1817 100644 --- a/SOURCES/0065-feat-linstor-manager-robustify-exec_create_sr.patch +++ b/SOURCES/0066-feat-linstor-manager-robustify-exec_create_sr.patch @@ -1,7 +1,7 @@ -From 04e8aff781147e433b56f68626e60a48daa48d8d Mon Sep 17 00:00:00 2001 +From 78820c47841ddce844286d12a590bd04c8b7f065 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 30 Jun 2022 17:09:51 +0200 -Subject: [PATCH 065/178] feat(linstor-manager): robustify exec_create_sr +Subject: [PATCH 066/178] feat(linstor-manager): robustify exec_create_sr - Use lvm.py XCP-ng xapi plugins instead of lvm (old name) - Check arguments to create the SR @@ -202,5 +202,5 @@ index 63c0e3e..2930a9e 100755 util.SMlog('linstor-manager:create_sr error: {}'.format(e)) raise -- -2.45.2 +2.46.0 diff --git a/SOURCES/0066-fix-cleanup-print-LINSTOR-VDI-UUID-if-error-during-i.patch b/SOURCES/0067-fix-cleanup-print-LINSTOR-VDI-UUID-if-error-during-i.patch similarity index 84% rename from SOURCES/0066-fix-cleanup-print-LINSTOR-VDI-UUID-if-error-during-i.patch rename to SOURCES/0067-fix-cleanup-print-LINSTOR-VDI-UUID-if-error-during-i.patch index 229ab9ca..81296324 100644 --- a/SOURCES/0066-fix-cleanup-print-LINSTOR-VDI-UUID-if-error-during-i.patch +++ b/SOURCES/0067-fix-cleanup-print-LINSTOR-VDI-UUID-if-error-during-i.patch @@ -1,7 +1,7 @@ -From a410c0926c90f086dfd75c8f0800f8340bd17b6c Mon Sep 17 00:00:00 2001 +From a4922a1709c39af0a7c1a9808bbf7bc03300fcd4 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 8 Jul 2022 14:52:25 +0200 -Subject: [PATCH 066/178] fix(cleanup): print LINSTOR VDI UUID if error during +Subject: [PATCH 067/178] fix(cleanup): print LINSTOR VDI UUID if error during info loading (not SR UUID) Signed-off-by: Ronan Abhamon @@ -23,5 +23,5 @@ index 9e3a5b0..7eeeee7 100755 info = vhdutil.VHDInfo(vdi_uuid) info.error = 1 -- -2.45.2 +2.46.0 diff --git a/SOURCES/0067-feat-cleanup-raise-and-dump-DRBD-openers-in-case-of-.patch b/SOURCES/0068-feat-cleanup-raise-and-dump-DRBD-openers-in-case-of-.patch similarity index 97% rename from SOURCES/0067-feat-cleanup-raise-and-dump-DRBD-openers-in-case-of-.patch rename to SOURCES/0068-feat-cleanup-raise-and-dump-DRBD-openers-in-case-of-.patch index d3e40ab6..16321499 100644 --- a/SOURCES/0067-feat-cleanup-raise-and-dump-DRBD-openers-in-case-of-.patch +++ b/SOURCES/0068-feat-cleanup-raise-and-dump-DRBD-openers-in-case-of-.patch @@ -1,7 +1,7 @@ -From 863142f5c55a0aa0d6c2a9d4f3df8b22d72ae830 Mon Sep 17 00:00:00 2001 +From 08c339d4c31048e5d979712dad5adb4cf82c95c7 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 21 Jul 2022 11:39:20 +0200 -Subject: [PATCH 067/178] feat(cleanup): raise and dump DRBD openers in case of +Subject: [PATCH 068/178] feat(cleanup): raise and dump DRBD openers in case of bad coalesce Signed-off-by: Ronan Abhamon @@ -142,5 +142,5 @@ index 430e080..d17845b 100755 """ Give a volume dictionnary that contains names actually owned. -- -2.45.2 +2.46.0 diff --git a/SOURCES/0068-feat-linstorvhdutil-trace-DRBD-openers-in-case-of-ER.patch b/SOURCES/0069-feat-linstorvhdutil-trace-DRBD-openers-in-case-of-ER.patch similarity index 97% rename from SOURCES/0068-feat-linstorvhdutil-trace-DRBD-openers-in-case-of-ER.patch rename to SOURCES/0069-feat-linstorvhdutil-trace-DRBD-openers-in-case-of-ER.patch index d0777784..64ec0f74 100644 --- a/SOURCES/0068-feat-linstorvhdutil-trace-DRBD-openers-in-case-of-ER.patch +++ b/SOURCES/0069-feat-linstorvhdutil-trace-DRBD-openers-in-case-of-ER.patch @@ -1,7 +1,7 @@ -From 0e339b0d445c78b6c7f5497d8ed1d3aefab91ff1 Mon Sep 17 00:00:00 2001 +From 0e6bde3144a0b8cf47aa5e569e6e42b39603bb00 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 22 Jul 2022 10:26:20 +0200 -Subject: [PATCH 068/178] feat(linstorvhdutil): trace DRBD openers in case of +Subject: [PATCH 069/178] feat(linstorvhdutil): trace DRBD openers in case of EROFS errors Signed-off-by: Ronan Abhamon @@ -131,5 +131,5 @@ index f3d9870..d6a21c2 100644 # -------------------------------------------------------------------------- # Helpers. -- -2.45.2 +2.46.0 diff --git a/SOURCES/0069-fix-linstorvolumemanager-compute-correctly-size-in-a.patch b/SOURCES/0070-fix-linstorvolumemanager-compute-correctly-size-in-a.patch similarity index 96% rename from SOURCES/0069-fix-linstorvolumemanager-compute-correctly-size-in-a.patch rename to SOURCES/0070-fix-linstorvolumemanager-compute-correctly-size-in-a.patch index 497d07f2..be2bce35 100644 --- a/SOURCES/0069-fix-linstorvolumemanager-compute-correctly-size-in-a.patch +++ b/SOURCES/0070-fix-linstorvolumemanager-compute-correctly-size-in-a.patch @@ -1,7 +1,7 @@ -From 68aacc7508fac8113652c6670d2ac5f2ea936a70 Mon Sep 17 00:00:00 2001 +From 4ac2809b987876231912df71bdc6aed6fb02822a Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 29 Jul 2022 17:25:48 +0200 -Subject: [PATCH 069/178] fix(linstorvolumemanager): compute correctly size in +Subject: [PATCH 070/178] fix(linstorvolumemanager): compute correctly size in allocated_volume_size Remove replication count in computation. @@ -94,5 +94,5 @@ index d17845b..3806cc9 100755 @property def metadata(self): -- -2.45.2 +2.46.0 diff --git a/SOURCES/0070-feat-LinstorSR-use-DRBD-openers-instead-of-lsof-to-l.patch b/SOURCES/0071-feat-LinstorSR-use-DRBD-openers-instead-of-lsof-to-l.patch similarity index 98% rename from SOURCES/0070-feat-LinstorSR-use-DRBD-openers-instead-of-lsof-to-l.patch rename to SOURCES/0071-feat-LinstorSR-use-DRBD-openers-instead-of-lsof-to-l.patch index 0741ffc1..14044189 100644 --- a/SOURCES/0070-feat-LinstorSR-use-DRBD-openers-instead-of-lsof-to-l.patch +++ b/SOURCES/0071-feat-LinstorSR-use-DRBD-openers-instead-of-lsof-to-l.patch @@ -1,7 +1,7 @@ -From 18ac9ddc0672f43c3139baa13a4f761b7876589c Mon Sep 17 00:00:00 2001 +From 40e0621614ab4334c1edc21e88ae24d5e72df7d6 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 9 Aug 2022 11:07:57 +0200 -Subject: [PATCH 070/178] feat(LinstorSR): use DRBD openers instead of lsof to +Subject: [PATCH 071/178] feat(LinstorSR): use DRBD openers instead of lsof to log in blktap2 Signed-off-by: Ronan Abhamon @@ -323,5 +323,5 @@ index 3806cc9..6f4c590 100755 + '`{}` is open: {}'.format(path, e) + ) -- -2.45.2 +2.46.0 diff --git a/SOURCES/0071-feat-LinstorSR-support-cProfile-to-trace-calls-when-.patch b/SOURCES/0072-feat-LinstorSR-support-cProfile-to-trace-calls-when-.patch similarity index 94% rename from SOURCES/0071-feat-LinstorSR-support-cProfile-to-trace-calls-when-.patch rename to SOURCES/0072-feat-LinstorSR-support-cProfile-to-trace-calls-when-.patch index c3a1cc30..2ffc5bc7 100644 --- a/SOURCES/0071-feat-LinstorSR-support-cProfile-to-trace-calls-when-.patch +++ b/SOURCES/0072-feat-LinstorSR-support-cProfile-to-trace-calls-when-.patch @@ -1,7 +1,7 @@ -From 3f729f3f7dde9406ef215145a4f6eefa81aae1f8 Mon Sep 17 00:00:00 2001 +From 2bf415703e247e502c8e036ce9a3216888ceab37 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 25 Aug 2022 12:11:18 +0200 -Subject: [PATCH 071/178] feat(LinstorSR): support cProfile to trace calls when +Subject: [PATCH 072/178] feat(LinstorSR): support cProfile to trace calls when a command is executed Signed-off-by: Ronan Abhamon @@ -89,5 +89,5 @@ index 7c52703..fe8e13d 100755 + finally: + SMlog('* End profiling of {} ({}) *'.format(name, filename)) -- -2.45.2 +2.46.0 diff --git a/SOURCES/0072-fix-LinstorJournaler-reset-namespace-when-get-is-cal.patch b/SOURCES/0073-fix-LinstorJournaler-reset-namespace-when-get-is-cal.patch similarity index 83% rename from SOURCES/0072-fix-LinstorJournaler-reset-namespace-when-get-is-cal.patch rename to SOURCES/0073-fix-LinstorJournaler-reset-namespace-when-get-is-cal.patch index 4fba9a40..823a1dc6 100644 --- a/SOURCES/0072-fix-LinstorJournaler-reset-namespace-when-get-is-cal.patch +++ b/SOURCES/0073-fix-LinstorJournaler-reset-namespace-when-get-is-cal.patch @@ -1,7 +1,7 @@ -From 59692503da25a54c146930e8d4d89b9630aedaa2 Mon Sep 17 00:00:00 2001 +From e2900bfd2689841a1230bfbbe9e5c34b735503ea Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 24 Aug 2022 17:09:11 +0200 -Subject: [PATCH 072/178] fix(LinstorJournaler): reset namespace when `get` is +Subject: [PATCH 073/178] fix(LinstorJournaler): reset namespace when `get` is called Otherwise, we can be in the wrong namespace and the key to find will be inaccessible. @@ -22,5 +22,5 @@ index 3993f60..1e85ec9 100755 def get_all(self, type): -- -2.45.2 +2.46.0 diff --git a/SOURCES/0073-fix-linstorvhdutil-fix-coalesce-with-VM-running-unde.patch b/SOURCES/0074-fix-linstorvhdutil-fix-coalesce-with-VM-running-unde.patch similarity index 99% rename from SOURCES/0073-fix-linstorvhdutil-fix-coalesce-with-VM-running-unde.patch rename to SOURCES/0074-fix-linstorvhdutil-fix-coalesce-with-VM-running-unde.patch index 8eb5817b..0a2040a9 100644 --- a/SOURCES/0073-fix-linstorvhdutil-fix-coalesce-with-VM-running-unde.patch +++ b/SOURCES/0074-fix-linstorvhdutil-fix-coalesce-with-VM-running-unde.patch @@ -1,7 +1,7 @@ -From bcfea8f64f43e8f8d074df3c191227d8410b0402 Mon Sep 17 00:00:00 2001 +From 640c28db2bd83893634fa8740abbbd1023cee0ab Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 25 Aug 2022 10:54:56 +0200 -Subject: [PATCH 073/178] fix(linstorvhdutil): fix coalesce with VM running +Subject: [PATCH 074/178] fix(linstorvhdutil): fix coalesce with VM running under specific scenario: When a VM is running, we can't coalesce without this patch with a long chain @@ -550,5 +550,5 @@ index 0a8fe91..d75edb1 100755 def getVHDInfo(path, extractUuidFunction, includeParent = True): """Get the VHD info. The parent info may optionally be omitted: vhd-util -- -2.45.2 +2.46.0 diff --git a/SOURCES/0074-fix-linstorvolumemanager-_get_volumes_info-doesn-t-r.patch b/SOURCES/0075-fix-linstorvolumemanager-_get_volumes_info-doesn-t-r.patch similarity index 93% rename from SOURCES/0074-fix-linstorvolumemanager-_get_volumes_info-doesn-t-r.patch rename to SOURCES/0075-fix-linstorvolumemanager-_get_volumes_info-doesn-t-r.patch index 761f5530..ed44f497 100644 --- a/SOURCES/0074-fix-linstorvolumemanager-_get_volumes_info-doesn-t-r.patch +++ b/SOURCES/0075-fix-linstorvolumemanager-_get_volumes_info-doesn-t-r.patch @@ -1,7 +1,7 @@ -From e98d435ba2b95672803cd15c5ba6cd89209743d0 Mon Sep 17 00:00:00 2001 +From af2068715b685b59877d80e2328c10c6dc14318b Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 5 Sep 2022 15:09:17 +0200 -Subject: [PATCH 074/178] fix(linstorvolumemanager): `_get_volumes_info` +Subject: [PATCH 075/178] fix(linstorvolumemanager): `_get_volumes_info` doesn't raise with offline host Ensure this method doesn't raise an exception when a host is offline. @@ -46,5 +46,5 @@ index 6f4c590..a1bc151 100755 for current in all_volume_info.values(): current.allocated_size *= 1024 -- -2.45.2 +2.46.0 diff --git a/SOURCES/0075-fix-linstorvolumemanager-remove-double-prefix-on-kv-.patch b/SOURCES/0076-fix-linstorvolumemanager-remove-double-prefix-on-kv-.patch similarity index 90% rename from SOURCES/0075-fix-linstorvolumemanager-remove-double-prefix-on-kv-.patch rename to SOURCES/0076-fix-linstorvolumemanager-remove-double-prefix-on-kv-.patch index 72f6b15d..e2bc6a51 100644 --- a/SOURCES/0075-fix-linstorvolumemanager-remove-double-prefix-on-kv-.patch +++ b/SOURCES/0076-fix-linstorvolumemanager-remove-double-prefix-on-kv-.patch @@ -1,7 +1,7 @@ -From 462cc34d48bfafc96dd042ae7ee97c5801b436a5 Mon Sep 17 00:00:00 2001 +From 43ecef813014a86cd92c70e0411f725c24714fe9 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 12 Sep 2022 15:56:09 +0200 -Subject: [PATCH 075/178] fix(linstorvolumemanager): remove double prefix on kv +Subject: [PATCH 076/178] fix(linstorvolumemanager): remove double prefix on kv group name - Before this patch, when the kv store was created/accessed, a double "xcp-sr-" prefix was used. @@ -36,5 +36,5 @@ index a1bc151..3ee5d24 100755 def _build_sr_namespace(cls): return '/{}/'.format(cls.NAMESPACE_SR) -- -2.45.2 +2.46.0 diff --git a/SOURCES/0076-feat-LinstorSR-add-linstor-kv-dump-helper-to-print-k.patch b/SOURCES/0077-feat-LinstorSR-add-linstor-kv-dump-helper-to-print-k.patch similarity index 92% rename from SOURCES/0076-feat-LinstorSR-add-linstor-kv-dump-helper-to-print-k.patch rename to SOURCES/0077-feat-LinstorSR-add-linstor-kv-dump-helper-to-print-k.patch index feec22b2..80f0d640 100644 --- a/SOURCES/0076-feat-LinstorSR-add-linstor-kv-dump-helper-to-print-k.patch +++ b/SOURCES/0077-feat-LinstorSR-add-linstor-kv-dump-helper-to-print-k.patch @@ -1,7 +1,7 @@ -From f0413a9d9d7616aac2fe7394cdb0dc50fdaeb835 Mon Sep 17 00:00:00 2001 +From 494ecc96c37cb01698c825c00f9ddb3e5c6f53c3 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 12 Sep 2022 17:54:57 +0200 -Subject: [PATCH 076/178] feat(LinstorSR): add linstor-kv-dump helper to print +Subject: [PATCH 077/178] feat(LinstorSR): add linstor-kv-dump helper to print kv store Signed-off-by: Ronan Abhamon @@ -12,10 +12,10 @@ Signed-off-by: Ronan Abhamon create mode 100755 scripts/linstor-kv-dump diff --git a/Makefile b/Makefile -index af1011a..aa71f80 100755 +index 992d9ef..5cdecab 100755 --- a/Makefile +++ b/Makefile -@@ -240,6 +240,7 @@ install: precheck +@@ -235,6 +235,7 @@ install: precheck install -m 755 drivers/fcoelib.py $(SM_STAGING)$(SM_DEST) mkdir -p $(SM_STAGING)$(LIBEXEC) install -m 755 scripts/fork-log-daemon $(SM_STAGING)$(LIBEXEC) @@ -68,5 +68,5 @@ index 0000000..93598d7 +if __name__ == '__main__': + main() -- -2.45.2 +2.46.0 diff --git a/SOURCES/0077-fix-LinstorSR-disable-VHD-key-hash-usage-to-limit-ex.patch b/SOURCES/0078-fix-LinstorSR-disable-VHD-key-hash-usage-to-limit-ex.patch similarity index 89% rename from SOURCES/0077-fix-LinstorSR-disable-VHD-key-hash-usage-to-limit-ex.patch rename to SOURCES/0078-fix-LinstorSR-disable-VHD-key-hash-usage-to-limit-ex.patch index d2ee2bad..f67bf36d 100644 --- a/SOURCES/0077-fix-LinstorSR-disable-VHD-key-hash-usage-to-limit-ex.patch +++ b/SOURCES/0078-fix-LinstorSR-disable-VHD-key-hash-usage-to-limit-ex.patch @@ -1,7 +1,7 @@ -From bb7d53d85fd4a28470d48b6bb1e2d75d23b73389 Mon Sep 17 00:00:00 2001 +From 59c9be98c2eeeb37e15c76874ca62071dab4c164 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 14 Sep 2022 10:17:18 +0200 -Subject: [PATCH 077/178] fix(LinstorSR): disable VHD key hash usage to limit +Subject: [PATCH 078/178] fix(LinstorSR): disable VHD key hash usage to limit exec time Signed-off-by: Ronan Abhamon @@ -33,5 +33,5 @@ index 47ac3c8..374d6cb 100755 # https://github.com/PyCQA/pylint/pull/2926 vdi.sm_config_override['key_hash'] = \ -- -2.45.2 +2.46.0 diff --git a/SOURCES/0078-fix-minidrbdcluster-ensure-SIGINT-is-handled-correct.patch b/SOURCES/0079-fix-minidrbdcluster-ensure-SIGINT-is-handled-correct.patch similarity index 95% rename from SOURCES/0078-fix-minidrbdcluster-ensure-SIGINT-is-handled-correct.patch rename to SOURCES/0079-fix-minidrbdcluster-ensure-SIGINT-is-handled-correct.patch index c6d31122..a894d010 100644 --- a/SOURCES/0078-fix-minidrbdcluster-ensure-SIGINT-is-handled-correct.patch +++ b/SOURCES/0079-fix-minidrbdcluster-ensure-SIGINT-is-handled-correct.patch @@ -1,7 +1,7 @@ -From 189b17a606d3f35bcc8bb8bf77f6e2ef71208a11 Mon Sep 17 00:00:00 2001 +From 730853aa446f399f3acecb0afa7783ea36ed5240 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 15 Sep 2022 11:34:25 +0200 -Subject: [PATCH 078/178] fix(minidrbdcluster): ensure SIGINT is handled +Subject: [PATCH 079/178] fix(minidrbdcluster): ensure SIGINT is handled correctly This patch is here to make sure no LINSTOR controller survives when @@ -95,5 +95,5 @@ index 3de6ac4..1ddf91f 100644 StandardError=journal SyslogIdentifier=minidrbdcluster -- -2.45.2 +2.46.0 diff --git a/SOURCES/0079-feat-minidrbdcluster-stop-resource-services-at-start.patch b/SOURCES/0080-feat-minidrbdcluster-stop-resource-services-at-start.patch similarity index 97% rename from SOURCES/0079-feat-minidrbdcluster-stop-resource-services-at-start.patch rename to SOURCES/0080-feat-minidrbdcluster-stop-resource-services-at-start.patch index c1b1c6d6..5ea7569e 100644 --- a/SOURCES/0079-feat-minidrbdcluster-stop-resource-services-at-start.patch +++ b/SOURCES/0080-feat-minidrbdcluster-stop-resource-services-at-start.patch @@ -1,7 +1,7 @@ -From 53dec398287a12e016abbe243311479f6a0d3efe Mon Sep 17 00:00:00 2001 +From d8a3fcab1752746435c599664efd7f4789e2c58f Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 15 Sep 2022 11:49:34 +0200 -Subject: [PATCH 079/178] feat(minidrbdcluster): stop resource services at +Subject: [PATCH 080/178] feat(minidrbdcluster): stop resource services at startup - Ensure all services are stopped when minidrbcluster is started. @@ -131,5 +131,5 @@ index 4cdc59e..eae7cbf 100755 if __name__ == '__main__': main() -- -2.45.2 +2.46.0 diff --git a/SOURCES/0080-feat-linstor-manager-add-new-healthCheck-function-to.patch b/SOURCES/0081-feat-linstor-manager-add-new-healthCheck-function-to.patch similarity index 98% rename from SOURCES/0080-feat-linstor-manager-add-new-healthCheck-function-to.patch rename to SOURCES/0081-feat-linstor-manager-add-new-healthCheck-function-to.patch index 871763bf..b84181d9 100644 --- a/SOURCES/0080-feat-linstor-manager-add-new-healthCheck-function-to.patch +++ b/SOURCES/0081-feat-linstor-manager-add-new-healthCheck-function-to.patch @@ -1,7 +1,7 @@ -From efa609510d724b3aacfe144517ad34fa2b854b8d Mon Sep 17 00:00:00 2001 +From ef9a22262f1cfb444bf01274bfbbf0b53607f341 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 23 Sep 2022 17:45:08 +0200 -Subject: [PATCH 080/178] feat(linstor-manager): add new `healthCheck` function +Subject: [PATCH 081/178] feat(linstor-manager): add new `healthCheck` function to monitor pool (#26) Print a JSON output to monitor state of LINSTOR SRs: @@ -357,5 +357,5 @@ index 3ee5d24..efe5d53 100755 def create_sr( cls, group_name, node_names, ips, redundancy, -- -2.45.2 +2.46.0 diff --git a/SOURCES/0081-fix-LinstorSR-fix-xha-conf-parsing-return-host-ip-no.patch b/SOURCES/0082-fix-LinstorSR-fix-xha-conf-parsing-return-host-ip-no.patch similarity index 91% rename from SOURCES/0081-fix-LinstorSR-fix-xha-conf-parsing-return-host-ip-no.patch rename to SOURCES/0082-fix-LinstorSR-fix-xha-conf-parsing-return-host-ip-no.patch index 8a5ed748..c98112c6 100644 --- a/SOURCES/0081-fix-LinstorSR-fix-xha-conf-parsing-return-host-ip-no.patch +++ b/SOURCES/0082-fix-LinstorSR-fix-xha-conf-parsing-return-host-ip-no.patch @@ -1,7 +1,7 @@ -From b477bf0c0779fbbf5cd600029a9b7bf6b73520a9 Mon Sep 17 00:00:00 2001 +From 42c75bb0a6f16360c87f0688ee38d93b3a66e2e2 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 4 Oct 2022 11:01:33 +0200 -Subject: [PATCH 081/178] fix(LinstorSR): fix xha conf parsing => return host +Subject: [PATCH 082/178] fix(LinstorSR): fix xha conf parsing => return host ip, not the UUID Signed-off-by: Ronan Abhamon @@ -50,5 +50,5 @@ index 374d6cb..d32771f 100755 def activate_lvm_group(group_name): -- -2.45.2 +2.46.0 diff --git a/SOURCES/0082-fix-LinstorSR-start-correctly-HA-servers-HTTP-NBD-af.patch b/SOURCES/0083-fix-LinstorSR-start-correctly-HA-servers-HTTP-NBD-af.patch similarity index 92% rename from SOURCES/0082-fix-LinstorSR-start-correctly-HA-servers-HTTP-NBD-af.patch rename to SOURCES/0083-fix-LinstorSR-start-correctly-HA-servers-HTTP-NBD-af.patch index 71f058c8..bb034c10 100644 --- a/SOURCES/0082-fix-LinstorSR-start-correctly-HA-servers-HTTP-NBD-af.patch +++ b/SOURCES/0083-fix-LinstorSR-start-correctly-HA-servers-HTTP-NBD-af.patch @@ -1,7 +1,7 @@ -From 9869614ead6245808ca8f0763a07a00ebe3ac6b8 Mon Sep 17 00:00:00 2001 +From 3847194acc3cf8769a71e85636d66f0eaacb0593 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 4 Oct 2022 18:48:09 +0200 -Subject: [PATCH 082/178] fix(LinstorSR): start correctly HA servers (HTTP/NBD) +Subject: [PATCH 083/178] fix(LinstorSR): start correctly HA servers (HTTP/NBD) after reboot Use a timeout call after a reboot to get a XAPI session because @@ -40,5 +40,5 @@ index d32771f..ae25385 100755 except Exception as e: _, ips = get_ips_from_xha_config_file() -- -2.45.2 +2.46.0 diff --git a/SOURCES/0083-fix-linstorvolumemanager-use-an-array-to-store-diskf.patch b/SOURCES/0084-fix-linstorvolumemanager-use-an-array-to-store-diskf.patch similarity index 95% rename from SOURCES/0083-fix-linstorvolumemanager-use-an-array-to-store-diskf.patch rename to SOURCES/0084-fix-linstorvolumemanager-use-an-array-to-store-diskf.patch index e884ca5e..44554e42 100644 --- a/SOURCES/0083-fix-linstorvolumemanager-use-an-array-to-store-diskf.patch +++ b/SOURCES/0084-fix-linstorvolumemanager-use-an-array-to-store-diskf.patch @@ -1,7 +1,7 @@ -From 03c55a736769042775bd8da2ebc71377c04050a6 Mon Sep 17 00:00:00 2001 +From 1af86e89ed07f4b0bce6e032f37f500fb58d0cee Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 5 Oct 2022 10:45:50 +0200 -Subject: [PATCH 083/178] fix(linstorvolumemanager): use an array to store +Subject: [PATCH 084/178] fix(linstorvolumemanager): use an array to store diskful volumes info Otherwise the `is_diskful` attr only reflects the info of one host @@ -74,5 +74,5 @@ index efe5d53..e577f63 100755 for volume in resource.volumes: # We ignore diskless pools of the form "DfltDisklessStorPool". -- -2.45.2 +2.46.0 diff --git a/SOURCES/0084-feat-linstorvolumemanager-support-snaps-when-a-host-.patch b/SOURCES/0085-feat-linstorvolumemanager-support-snaps-when-a-host-.patch similarity index 87% rename from SOURCES/0084-feat-linstorvolumemanager-support-snaps-when-a-host-.patch rename to SOURCES/0085-feat-linstorvolumemanager-support-snaps-when-a-host-.patch index 228421b2..6263f207 100644 --- a/SOURCES/0084-feat-linstorvolumemanager-support-snaps-when-a-host-.patch +++ b/SOURCES/0085-feat-linstorvolumemanager-support-snaps-when-a-host-.patch @@ -1,7 +1,7 @@ -From f750cc76f61fb75711176c444c3a89b9a3cbcc4f Mon Sep 17 00:00:00 2001 +From 414bc1efcd2fd9f1b8b41c690bcee46c8d550552 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 6 Oct 2022 17:54:10 +0200 -Subject: [PATCH 084/178] feat(linstorvolumemanager): support snaps when a host +Subject: [PATCH 085/178] feat(linstorvolumemanager): support snaps when a host is offline - Don't create diskless volumes during clone, delay it. @@ -29,5 +29,5 @@ index e577f63..09aad42 100755 # 5. Create resources! def clean(): -- -2.45.2 +2.46.0 diff --git a/SOURCES/0085-fix-linstorvolumemanager-support-offline-hosts-when-.patch b/SOURCES/0086-fix-linstorvolumemanager-support-offline-hosts-when-.patch similarity index 96% rename from SOURCES/0085-fix-linstorvolumemanager-support-offline-hosts-when-.patch rename to SOURCES/0086-fix-linstorvolumemanager-support-offline-hosts-when-.patch index 8ec147a2..ffe54782 100644 --- a/SOURCES/0085-fix-linstorvolumemanager-support-offline-hosts-when-.patch +++ b/SOURCES/0086-fix-linstorvolumemanager-support-offline-hosts-when-.patch @@ -1,7 +1,7 @@ -From 604dd18a16f87188bc6a6ca0a69c31cd68ac6f77 Mon Sep 17 00:00:00 2001 +From 32b338239370f6c3d0148723a3c2e6a61903daeb Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 7 Oct 2022 17:18:37 +0200 -Subject: [PATCH 085/178] fix(linstorvolumemanager): support offline hosts when +Subject: [PATCH 086/178] fix(linstorvolumemanager): support offline hosts when plugins are called - Robustify plugin calls @@ -111,5 +111,5 @@ index 09aad42..58c0238 100755 # ============================================================================== -- -2.45.2 +2.46.0 diff --git a/SOURCES/0086-fix-linstorvolumemanager-define-_base_group_name-mem.patch b/SOURCES/0087-fix-linstorvolumemanager-define-_base_group_name-mem.patch similarity index 89% rename from SOURCES/0086-fix-linstorvolumemanager-define-_base_group_name-mem.patch rename to SOURCES/0087-fix-linstorvolumemanager-define-_base_group_name-mem.patch index 12bb3762..79b7b925 100644 --- a/SOURCES/0086-fix-linstorvolumemanager-define-_base_group_name-mem.patch +++ b/SOURCES/0087-fix-linstorvolumemanager-define-_base_group_name-mem.patch @@ -1,7 +1,7 @@ -From 6f4af2ac0ddcff854e58ae8fb927035ad4a79ede Mon Sep 17 00:00:00 2001 +From 846da4170432a4be553ac1e98db146df069ce2ae Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 7 Oct 2022 17:45:26 +0200 -Subject: [PATCH 086/178] fix(linstorvolumemanager): define _base_group_name +Subject: [PATCH 087/178] fix(linstorvolumemanager): define _base_group_name member at SR creation Signed-off-by: Ronan Abhamon @@ -30,5 +30,5 @@ index 58c0238..d19effb 100755 instance._volumes = set() instance._storage_pools_time = 0 -- -2.45.2 +2.46.0 diff --git a/SOURCES/0087-feat-linstorvhdutil-modify-logic-of-local-vhdutil-ca.patch b/SOURCES/0088-feat-linstorvhdutil-modify-logic-of-local-vhdutil-ca.patch similarity index 97% rename from SOURCES/0087-feat-linstorvhdutil-modify-logic-of-local-vhdutil-ca.patch rename to SOURCES/0088-feat-linstorvhdutil-modify-logic-of-local-vhdutil-ca.patch index b947cde9..4ec59442 100644 --- a/SOURCES/0087-feat-linstorvhdutil-modify-logic-of-local-vhdutil-ca.patch +++ b/SOURCES/0088-feat-linstorvhdutil-modify-logic-of-local-vhdutil-ca.patch @@ -1,7 +1,7 @@ -From f99e317510721cac568bae6b854b4622b8525999 Mon Sep 17 00:00:00 2001 +From 76b0beee9ffa96cc6eb687408a94fde1034ecab7 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 10 Oct 2022 14:33:24 +0200 -Subject: [PATCH 087/178] feat(linstorvhdutil): modify logic of local vhdutil +Subject: [PATCH 088/178] feat(linstorvhdutil): modify logic of local vhdutil calls - Always log openers when we can't call vhdutil locally @@ -144,5 +144,5 @@ index 4d031e1..2687cad 100644 ) return util.retry(remote_call, 5, 2) -- -2.45.2 +2.46.0 diff --git a/SOURCES/0088-fix-linstorvolumemanager-robustify-failed-snapshots.patch b/SOURCES/0089-fix-linstorvolumemanager-robustify-failed-snapshots.patch similarity index 94% rename from SOURCES/0088-fix-linstorvolumemanager-robustify-failed-snapshots.patch rename to SOURCES/0089-fix-linstorvolumemanager-robustify-failed-snapshots.patch index 3e4a3ceb..c7705e87 100644 --- a/SOURCES/0088-fix-linstorvolumemanager-robustify-failed-snapshots.patch +++ b/SOURCES/0089-fix-linstorvolumemanager-robustify-failed-snapshots.patch @@ -1,7 +1,7 @@ -From 0fe8a97bc5c810ca0d58248c59055c801728da26 Mon Sep 17 00:00:00 2001 +From 5d2f1d8bbc0c46b8ea1096188b73bcddd8e519ff Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 17 Oct 2022 18:14:16 +0200 -Subject: [PATCH 088/178] fix(linstorvolumemanager): robustify failed snapshots +Subject: [PATCH 089/178] fix(linstorvolumemanager): robustify failed snapshots - Ensure we can always rename a failed snap, so we must check if we have metadata in the KV-store. Otherwise an error is triggered @@ -49,5 +49,5 @@ index d19effb..44b247e 100755 dest_namespace = self._build_volume_namespace(dest_uuid) -- -2.45.2 +2.46.0 diff --git a/SOURCES/0089-fix-linstorvolumemanager-use-a-namespace-for-volumes.patch b/SOURCES/0090-fix-linstorvolumemanager-use-a-namespace-for-volumes.patch similarity index 84% rename from SOURCES/0089-fix-linstorvolumemanager-use-a-namespace-for-volumes.patch rename to SOURCES/0090-fix-linstorvolumemanager-use-a-namespace-for-volumes.patch index b04d4a18..3167e1d8 100644 --- a/SOURCES/0089-fix-linstorvolumemanager-use-a-namespace-for-volumes.patch +++ b/SOURCES/0090-fix-linstorvolumemanager-use-a-namespace-for-volumes.patch @@ -1,7 +1,7 @@ -From b0059113393273e375d95c0a70fee4e5fa9f97bd Mon Sep 17 00:00:00 2001 +From 612f6ccde1042223048bf4f7dec8810bb86d8575 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 8 Nov 2022 17:31:45 +0100 -Subject: [PATCH 089/178] fix(linstorvolumemanager): use a namespace for +Subject: [PATCH 090/178] fix(linstorvolumemanager): use a namespace for volumes - This change is not compatible with existing LINSTOR SR instances! @@ -25,5 +25,5 @@ index 44b247e..8c253d4 100755 # Regex to match properties. REG_PROP = '^([^/]+)/{}$' -- -2.45.2 +2.46.0 diff --git a/SOURCES/0090-feat-linstor-kv-dump-rename-to-linstor-kv-tool-add-r.patch b/SOURCES/0091-feat-linstor-kv-dump-rename-to-linstor-kv-tool-add-r.patch similarity index 93% rename from SOURCES/0090-feat-linstor-kv-dump-rename-to-linstor-kv-tool-add-r.patch rename to SOURCES/0091-feat-linstor-kv-dump-rename-to-linstor-kv-tool-add-r.patch index dee26311..6ba7d151 100644 --- a/SOURCES/0090-feat-linstor-kv-dump-rename-to-linstor-kv-tool-add-r.patch +++ b/SOURCES/0091-feat-linstor-kv-dump-rename-to-linstor-kv-tool-add-r.patch @@ -1,7 +1,7 @@ -From e31e75852287028db29348575e4fcc116c96f768 Mon Sep 17 00:00:00 2001 +From 32b38dfdf74d01673c1e9ac177346145aa8a3518 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 14 Nov 2022 17:18:48 +0100 -Subject: [PATCH 090/178] feat(linstor-kv-dump): rename to linstor-kv-tool + +Subject: [PATCH 091/178] feat(linstor-kv-dump): rename to linstor-kv-tool + add remove volume helpers --- @@ -11,10 +11,10 @@ Subject: [PATCH 090/178] feat(linstor-kv-dump): rename to linstor-kv-tool + rename scripts/{linstor-kv-dump => linstor-kv-tool} (51%) diff --git a/Makefile b/Makefile -index aa71f80..42058c8 100755 +index 5cdecab..313f06c 100755 --- a/Makefile +++ b/Makefile -@@ -240,7 +240,7 @@ install: precheck +@@ -235,7 +235,7 @@ install: precheck install -m 755 drivers/fcoelib.py $(SM_STAGING)$(SM_DEST) mkdir -p $(SM_STAGING)$(LIBEXEC) install -m 755 scripts/fork-log-daemon $(SM_STAGING)$(LIBEXEC) @@ -93,5 +93,5 @@ index 93598d7..128d899 100755 if __name__ == '__main__': main() -- -2.45.2 +2.46.0 diff --git a/SOURCES/0091-fix-LinstorSR-handle-correctly-localhost-during-star.patch b/SOURCES/0092-fix-LinstorSR-handle-correctly-localhost-during-star.patch similarity index 95% rename from SOURCES/0091-fix-LinstorSR-handle-correctly-localhost-during-star.patch rename to SOURCES/0092-fix-LinstorSR-handle-correctly-localhost-during-star.patch index e75fe74f..2e323d93 100644 --- a/SOURCES/0091-fix-LinstorSR-handle-correctly-localhost-during-star.patch +++ b/SOURCES/0092-fix-LinstorSR-handle-correctly-localhost-during-star.patch @@ -1,7 +1,7 @@ -From 655e79b7e58d322cdb6ac46816939d26ffbbbd46 Mon Sep 17 00:00:00 2001 +From bcc899d36e498e15ec9e5860f1439fcc4be4622b Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 16 Nov 2022 12:12:12 +0100 -Subject: [PATCH 091/178] fix(LinstorSR): handle correctly localhost during +Subject: [PATCH 092/178] fix(LinstorSR): handle correctly localhost during start/stop of minidrbdcluster Otherwise another controller can be started during `xe sr-destroy` call. @@ -71,5 +71,5 @@ index b855807..ba28452 100755 # the controller host last. Why? Otherwise the linstor-controller # of other nodes can be started, and we don't want that. -- -2.45.2 +2.46.0 diff --git a/SOURCES/0092-fix-cleanup.py-call-repair-on-another-host-when-EROF.patch b/SOURCES/0093-fix-cleanup.py-call-repair-on-another-host-when-EROF.patch similarity index 93% rename from SOURCES/0092-fix-cleanup.py-call-repair-on-another-host-when-EROF.patch rename to SOURCES/0093-fix-cleanup.py-call-repair-on-another-host-when-EROF.patch index 27ccd1eb..68a57710 100644 --- a/SOURCES/0092-fix-cleanup.py-call-repair-on-another-host-when-EROF.patch +++ b/SOURCES/0093-fix-cleanup.py-call-repair-on-another-host-when-EROF.patch @@ -1,7 +1,7 @@ -From a26ad7fd840e9fcd8a03f6cfc9da8f4ac4628013 Mon Sep 17 00:00:00 2001 +From 228634f7d8cc5fa78203272269e114a209821356 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 17 Nov 2022 15:43:25 +0100 -Subject: [PATCH 092/178] fix(cleanup.py): call repair on another host when +Subject: [PATCH 093/178] fix(cleanup.py): call repair on another host when EROFS is returned (DRBD) Signed-off-by: Ronan Abhamon @@ -58,5 +58,5 @@ index 7329363..f6c4346 100755 abortFlag = IPCFlag(self.sr.uuid) for child in self.children: -- -2.45.2 +2.46.0 diff --git a/SOURCES/0093-fix-LinstorSR-avoid-introduction-of-DELETED-volumes.patch b/SOURCES/0094-fix-LinstorSR-avoid-introduction-of-DELETED-volumes.patch similarity index 84% rename from SOURCES/0093-fix-LinstorSR-avoid-introduction-of-DELETED-volumes.patch rename to SOURCES/0094-fix-LinstorSR-avoid-introduction-of-DELETED-volumes.patch index 6505e587..dcf713e5 100644 --- a/SOURCES/0093-fix-LinstorSR-avoid-introduction-of-DELETED-volumes.patch +++ b/SOURCES/0094-fix-LinstorSR-avoid-introduction-of-DELETED-volumes.patch @@ -1,7 +1,7 @@ -From 545433b159c70e922529e9af199c9e3c5e756598 Mon Sep 17 00:00:00 2001 +From a17925aa496b1814038ff6f998461b533f90d077 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 17 Nov 2022 15:46:02 +0100 -Subject: [PATCH 093/178] fix(LinstorSR): avoid introduction of DELETED volumes +Subject: [PATCH 094/178] fix(LinstorSR): avoid introduction of DELETED volumes Signed-off-by: Ronan Abhamon --- @@ -23,5 +23,5 @@ index ba28452..9e5b3cd 100755 'Trying to introduce VDI {} as it is present in ' 'LINSTOR and not in XAPI...' -- -2.45.2 +2.46.0 diff --git a/SOURCES/0094-feat-linstor-kv-tool-remove-all-volumes-supports-jou.patch b/SOURCES/0095-feat-linstor-kv-tool-remove-all-volumes-supports-jou.patch similarity index 86% rename from SOURCES/0094-feat-linstor-kv-tool-remove-all-volumes-supports-jou.patch rename to SOURCES/0095-feat-linstor-kv-tool-remove-all-volumes-supports-jou.patch index cf635577..c6e5ab02 100644 --- a/SOURCES/0094-feat-linstor-kv-tool-remove-all-volumes-supports-jou.patch +++ b/SOURCES/0095-feat-linstor-kv-tool-remove-all-volumes-supports-jou.patch @@ -1,7 +1,7 @@ -From 95e513e7de43ef9e16996bdb309ac0823eb25e71 Mon Sep 17 00:00:00 2001 +From e6ef1f66479ae68d5b0809f7a2158106aa1b3eec Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 18 Nov 2022 10:40:58 +0100 -Subject: [PATCH 094/178] feat(linstor-kv-tool): remove-all-volumes supports +Subject: [PATCH 095/178] feat(linstor-kv-tool): remove-all-volumes supports journals now Not yet supported for remove-volume, not sure about the consequences @@ -26,5 +26,5 @@ index 128d899..c907027 100755 kv.namespace = key[:size] del kv[key[size + 1:]] -- -2.45.2 +2.46.0 diff --git a/SOURCES/0095-fix-linstorvhdutil-due-to-bad-refactoring-check-call.patch b/SOURCES/0096-fix-linstorvhdutil-due-to-bad-refactoring-check-call.patch similarity index 88% rename from SOURCES/0095-fix-linstorvhdutil-due-to-bad-refactoring-check-call.patch rename to SOURCES/0096-fix-linstorvhdutil-due-to-bad-refactoring-check-call.patch index ce9059fc..7dd66ef5 100644 --- a/SOURCES/0095-fix-linstorvhdutil-due-to-bad-refactoring-check-call.patch +++ b/SOURCES/0096-fix-linstorvhdutil-due-to-bad-refactoring-check-call.patch @@ -1,7 +1,7 @@ -From 282e1585023068f1fcdefa01ce2848169b562d22 Mon Sep 17 00:00:00 2001 +From 5a94eadf986c919cee83780a9e6cdce167a6701c Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 23 Nov 2022 15:26:51 +0100 -Subject: [PATCH 095/178] fix(linstorvhdutil): due to bad refactoring, check +Subject: [PATCH 096/178] fix(linstorvhdutil): due to bad refactoring, check call was broken Signed-off-by: Ronan Abhamon @@ -29,5 +29,5 @@ index 2687cad..a883ca4 100644 def get_vhd_info(self, vdi_uuid, include_parent=True): kwargs = {'includeParent': str(include_parent)} -- -2.45.2 +2.46.0 diff --git a/SOURCES/0096-feat-linstorvhdutil-ensure-we-use-VHD-parent-to-find.patch b/SOURCES/0097-feat-linstorvhdutil-ensure-we-use-VHD-parent-to-find.patch similarity index 95% rename from SOURCES/0096-feat-linstorvhdutil-ensure-we-use-VHD-parent-to-find.patch rename to SOURCES/0097-feat-linstorvhdutil-ensure-we-use-VHD-parent-to-find.patch index 1ed8c4f9..2f334aef 100644 --- a/SOURCES/0096-feat-linstorvhdutil-ensure-we-use-VHD-parent-to-find.patch +++ b/SOURCES/0097-feat-linstorvhdutil-ensure-we-use-VHD-parent-to-find.patch @@ -1,7 +1,7 @@ -From 6f90401e51c222f526f3f2d90828c9f918d56519 Mon Sep 17 00:00:00 2001 +From 8390021e0aedb7ef2979ff9ac9c21fe3367a4f23 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 23 Nov 2022 15:28:23 +0100 -Subject: [PATCH 096/178] feat(linstorvhdutil): ensure we use VHD parent to +Subject: [PATCH 097/178] feat(linstorvhdutil): ensure we use VHD parent to find host where to coalesce Signed-off-by: Ronan Abhamon @@ -65,5 +65,5 @@ index a883ca4..c2e9665 100644 raise xs_errors.XenError( 'VDIUnavailable', -- -2.45.2 +2.46.0 diff --git a/SOURCES/0097-feat-linstorvolumemanager-force-DRBD-demote-after-fa.patch b/SOURCES/0098-feat-linstorvolumemanager-force-DRBD-demote-after-fa.patch similarity index 98% rename from SOURCES/0097-feat-linstorvolumemanager-force-DRBD-demote-after-fa.patch rename to SOURCES/0098-feat-linstorvolumemanager-force-DRBD-demote-after-fa.patch index 2f684e79..bab657c9 100644 --- a/SOURCES/0097-feat-linstorvolumemanager-force-DRBD-demote-after-fa.patch +++ b/SOURCES/0098-feat-linstorvolumemanager-force-DRBD-demote-after-fa.patch @@ -1,7 +1,7 @@ -From d4d49f0c55b9d07e4f2315e4985800c8ae2f1a32 Mon Sep 17 00:00:00 2001 +From b1355b13bc58003fa01f29fb31516f6b1fcc67e8 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 5 Dec 2022 18:40:11 +0100 -Subject: [PATCH 097/178] feat(linstorvolumemanager): force DRBD demote after +Subject: [PATCH 098/178] feat(linstorvolumemanager): force DRBD demote after failed volume creation/clone Signed-off-by: Ronan Abhamon @@ -235,5 +235,5 @@ index 8c253d4..2e2feb2 100755 # Assume this call is atomic. properties.clear() -- -2.45.2 +2.46.0 diff --git a/SOURCES/0098-fix-linstorvhdutil-ensure-we-retry-creation-in-all-s.patch b/SOURCES/0099-fix-linstorvhdutil-ensure-we-retry-creation-in-all-s.patch similarity index 97% rename from SOURCES/0098-fix-linstorvhdutil-ensure-we-retry-creation-in-all-s.patch rename to SOURCES/0099-fix-linstorvhdutil-ensure-we-retry-creation-in-all-s.patch index 415b25c5..54f0b592 100644 --- a/SOURCES/0098-fix-linstorvhdutil-ensure-we-retry-creation-in-all-s.patch +++ b/SOURCES/0099-fix-linstorvhdutil-ensure-we-retry-creation-in-all-s.patch @@ -1,7 +1,7 @@ -From 8b614c3baa05acbe822ace1a3b09676f8042a137 Mon Sep 17 00:00:00 2001 +From 33c9cbedb5e26d291dda3f020513db5154dac454 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 6 Dec 2022 11:22:15 +0100 -Subject: [PATCH 098/178] fix(linstorvhdutil): ensure we retry creation in all +Subject: [PATCH 099/178] fix(linstorvhdutil): ensure we retry creation in all situations Without this patch, a basic resource creation is never restarted @@ -117,5 +117,5 @@ index 2e2feb2..81cce80 100755 except LinstorVolumeManagerError as e: if e.code != LinstorVolumeManagerError.ERR_VOLUME_EXISTS: -- -2.45.2 +2.46.0 diff --git a/SOURCES/0099-fix-linstorvhdutil-don-t-retry-local-vhdutil-call-wh.patch b/SOURCES/0100-fix-linstorvhdutil-don-t-retry-local-vhdutil-call-wh.patch similarity index 98% rename from SOURCES/0099-fix-linstorvhdutil-don-t-retry-local-vhdutil-call-wh.patch rename to SOURCES/0100-fix-linstorvhdutil-don-t-retry-local-vhdutil-call-wh.patch index b4e6c305..13e0cad7 100644 --- a/SOURCES/0099-fix-linstorvhdutil-don-t-retry-local-vhdutil-call-wh.patch +++ b/SOURCES/0100-fix-linstorvhdutil-don-t-retry-local-vhdutil-call-wh.patch @@ -1,7 +1,7 @@ -From afb50b27131b0b7a22e0a92731831a1beb975024 Mon Sep 17 00:00:00 2001 +From e5dafb76bd0436d5d19d33e9d9ecdc9c958863b2 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 7 Dec 2022 17:56:39 +0100 -Subject: [PATCH 099/178] fix(linstorvhdutil): don't retry local vhdutil call +Subject: [PATCH 100/178] fix(linstorvhdutil): don't retry local vhdutil call when EROFS is detected Signed-off-by: Ronan Abhamon @@ -154,5 +154,5 @@ index c2e9665..63d59ab 100644 # B. Execute the command on another host. # B.1. Get host list. -- -2.45.2 +2.46.0 diff --git a/SOURCES/0100-feat-fork-log-daemon-ignore-SIGTERM.patch b/SOURCES/0101-feat-fork-log-daemon-ignore-SIGTERM.patch similarity index 86% rename from SOURCES/0100-feat-fork-log-daemon-ignore-SIGTERM.patch rename to SOURCES/0101-feat-fork-log-daemon-ignore-SIGTERM.patch index c544f8a2..53eb8dc9 100644 --- a/SOURCES/0100-feat-fork-log-daemon-ignore-SIGTERM.patch +++ b/SOURCES/0101-feat-fork-log-daemon-ignore-SIGTERM.patch @@ -1,7 +1,7 @@ -From 62142a4d7d2934b20e08fc8dc49876d5cb5eba5a Mon Sep 17 00:00:00 2001 +From 71e0f39881c539f3677089e103d1f7800fe4a99b Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 15 Dec 2022 14:36:04 +0100 -Subject: [PATCH 100/178] feat(fork-log-daemon): ignore SIGTERM +Subject: [PATCH 101/178] feat(fork-log-daemon): ignore SIGTERM Without this patch, the output logs of the fork-log-daemon child are never displayed when SIGTERM is sent to the PGID. @@ -31,5 +31,5 @@ index eb0f0b0..665a60b 100755 while process.poll() is None: -- -2.45.2 +2.46.0 diff --git a/SOURCES/0101-feat-LinstorSR-wait-for-http-disk-server-startup.patch b/SOURCES/0102-feat-LinstorSR-wait-for-http-disk-server-startup.patch similarity index 96% rename from SOURCES/0101-feat-LinstorSR-wait-for-http-disk-server-startup.patch rename to SOURCES/0102-feat-LinstorSR-wait-for-http-disk-server-startup.patch index 55cac3c6..638dc9fb 100644 --- a/SOURCES/0101-feat-LinstorSR-wait-for-http-disk-server-startup.patch +++ b/SOURCES/0102-feat-LinstorSR-wait-for-http-disk-server-startup.patch @@ -1,7 +1,7 @@ -From a5b4176e1894dc8f87b1ba1710d3fad936e9b4c1 Mon Sep 17 00:00:00 2001 +From 6eec8a19ce65fdcb3336367251901750df329027 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 16 Dec 2022 16:52:50 +0100 -Subject: [PATCH 101/178] feat(LinstorSR): wait for http-disk-server startup +Subject: [PATCH 102/178] feat(LinstorSR): wait for http-disk-server startup Avoid a race condition with NBD server. We must be sure the HTTP server is reachable before the NBD server execution, @@ -112,5 +112,5 @@ index 9e5b3cd..f336534 100755 @classmethod def _kill_persistent_server(self, type, volume_name, sig): -- -2.45.2 +2.46.0 diff --git a/SOURCES/0102-fix-LinstorSR-handle-inflate-resize-actions-correctl.patch b/SOURCES/0103-fix-LinstorSR-handle-inflate-resize-actions-correctl.patch similarity index 97% rename from SOURCES/0102-fix-LinstorSR-handle-inflate-resize-actions-correctl.patch rename to SOURCES/0103-fix-LinstorSR-handle-inflate-resize-actions-correctl.patch index 17e95690..5fb2da5b 100644 --- a/SOURCES/0102-fix-LinstorSR-handle-inflate-resize-actions-correctl.patch +++ b/SOURCES/0103-fix-LinstorSR-handle-inflate-resize-actions-correctl.patch @@ -1,7 +1,7 @@ -From b4856d1ba2aa3611c4f3b2fec2eb2e8651f52722 Mon Sep 17 00:00:00 2001 +From ec1278ddf7ba15e35410b6991354ff46deb71ca5 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 16 Jan 2023 17:58:51 +0100 -Subject: [PATCH 102/178] fix(LinstorSR): handle inflate + resize actions +Subject: [PATCH 103/178] fix(LinstorSR): handle inflate + resize actions correctly - Ensure LINSTOR set the expected new volume size when inflate is executed, @@ -130,5 +130,5 @@ index f336534..72ec9de 100755 # VDI is currently deflated, so keep it deflated. new_volume_size = old_volume_size -- -2.45.2 +2.46.0 diff --git a/SOURCES/0103-fix-linstor-manager-add-a-static-iptables-rule-for-D.patch b/SOURCES/0104-fix-linstor-manager-add-a-static-iptables-rule-for-D.patch similarity index 97% rename from SOURCES/0103-fix-linstor-manager-add-a-static-iptables-rule-for-D.patch rename to SOURCES/0104-fix-linstor-manager-add-a-static-iptables-rule-for-D.patch index c5465bb7..216eba6f 100644 --- a/SOURCES/0103-fix-linstor-manager-add-a-static-iptables-rule-for-D.patch +++ b/SOURCES/0104-fix-linstor-manager-add-a-static-iptables-rule-for-D.patch @@ -1,7 +1,7 @@ -From cd0a324a1a1652b5632c77a6f8757e45021ac8b5 Mon Sep 17 00:00:00 2001 +From 6524029ca094f5063a62a3d4ce42b0794f61fad1 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 17 Jan 2023 11:55:00 +0100 -Subject: [PATCH 103/178] fix(linstor-manager): add a static iptables rule for +Subject: [PATCH 104/178] fix(linstor-manager): add a static iptables rule for DRBD volumes Using the XAPI iptables firewall may drop DRBD packets when the connection @@ -121,5 +121,5 @@ index 5c4c5c9..6ee435c 100755 util.SMlog('Error while stopping services: {}'.format(e)) pass -- -2.45.2 +2.46.0 diff --git a/SOURCES/0104-feat-LinstorSR-sync-with-last-http-nbd-transfer-vers.patch b/SOURCES/0105-feat-LinstorSR-sync-with-last-http-nbd-transfer-vers.patch similarity index 97% rename from SOURCES/0104-feat-LinstorSR-sync-with-last-http-nbd-transfer-vers.patch rename to SOURCES/0105-feat-LinstorSR-sync-with-last-http-nbd-transfer-vers.patch index 5c06e6c6..657a0de5 100644 --- a/SOURCES/0104-feat-LinstorSR-sync-with-last-http-nbd-transfer-vers.patch +++ b/SOURCES/0105-feat-LinstorSR-sync-with-last-http-nbd-transfer-vers.patch @@ -1,7 +1,7 @@ -From 77fec3e18231511672dd0472d30bb2070e4cfc3f Mon Sep 17 00:00:00 2001 +From cc57e8036ee5cd993658fcf2bd2ac65ba36156b5 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 3 Feb 2023 16:38:49 +0100 -Subject: [PATCH 104/178] feat(LinstorSR): sync with last http-nbd-transfer +Subject: [PATCH 105/178] feat(LinstorSR): sync with last http-nbd-transfer version - Increase auto promote timeout of heartbeat VDI to reduce CPU usage @@ -118,5 +118,5 @@ index 81cce80..e0f39e7 100755 """ Get the volume info of a particular volume. -- -2.45.2 +2.46.0 diff --git a/SOURCES/0105-fix-LinstorSR-don-t-check-VDI-metadata-while-listing.patch b/SOURCES/0106-fix-LinstorSR-don-t-check-VDI-metadata-while-listing.patch similarity index 88% rename from SOURCES/0105-fix-LinstorSR-don-t-check-VDI-metadata-while-listing.patch rename to SOURCES/0106-fix-LinstorSR-don-t-check-VDI-metadata-while-listing.patch index 244334f6..c512ec5c 100644 --- a/SOURCES/0105-fix-LinstorSR-don-t-check-VDI-metadata-while-listing.patch +++ b/SOURCES/0106-fix-LinstorSR-don-t-check-VDI-metadata-while-listing.patch @@ -1,7 +1,7 @@ -From babbfe1b1aee6a23a8bc560e2e145a7c76e3a0ce Mon Sep 17 00:00:00 2001 +From 839eb7f719a3e3206b3d5d419b88a63c4d7a7a5d Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 13 Feb 2023 17:24:16 +0100 -Subject: [PATCH 105/178] fix(LinstorSR): don't check VDI metadata while +Subject: [PATCH 106/178] fix(LinstorSR): don't check VDI metadata while listing VDIs if it's deleted Signed-off-by: Ronan Abhamon @@ -34,5 +34,5 @@ index 31f4505..41ece82 100755 'Trying to introduce VDI {} as it is present in ' 'LINSTOR and not in XAPI...' -- -2.45.2 +2.46.0 diff --git a/SOURCES/0106-fix-LinstorSR-don-t-check-metadata-when-destroying-s.patch b/SOURCES/0107-fix-LinstorSR-don-t-check-metadata-when-destroying-s.patch similarity index 89% rename from SOURCES/0106-fix-LinstorSR-don-t-check-metadata-when-destroying-s.patch rename to SOURCES/0107-fix-LinstorSR-don-t-check-metadata-when-destroying-s.patch index 37734889..238cc1d9 100644 --- a/SOURCES/0106-fix-LinstorSR-don-t-check-metadata-when-destroying-s.patch +++ b/SOURCES/0107-fix-LinstorSR-don-t-check-metadata-when-destroying-s.patch @@ -1,7 +1,7 @@ -From 5a145c627171a9a8bc528b39af425b6a568f59f2 Mon Sep 17 00:00:00 2001 +From 5de99a76105212088f70b4a7a7daab4b1d5e3f49 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 13 Feb 2023 17:27:43 +0100 -Subject: [PATCH 106/178] fix(LinstorSR): don't check metadata when destroying +Subject: [PATCH 107/178] fix(LinstorSR): don't check metadata when destroying snap in undo_clone Remove useless check in the snap rollback helper when there is an error @@ -31,5 +31,5 @@ index 41ece82..94cf1b7 100755 try: self._linstor.destroy_volume(snap_uuid) -- -2.45.2 +2.46.0 diff --git a/SOURCES/0107-fix-linstorvhdutil-handle-correctly-generic-exceptio.patch b/SOURCES/0108-fix-linstorvhdutil-handle-correctly-generic-exceptio.patch similarity index 94% rename from SOURCES/0107-fix-linstorvhdutil-handle-correctly-generic-exceptio.patch rename to SOURCES/0108-fix-linstorvhdutil-handle-correctly-generic-exceptio.patch index ea966609..2ffb9c04 100644 --- a/SOURCES/0107-fix-linstorvhdutil-handle-correctly-generic-exceptio.patch +++ b/SOURCES/0108-fix-linstorvhdutil-handle-correctly-generic-exceptio.patch @@ -1,7 +1,7 @@ -From 54b428be28d1836220f2ba42081c01acc64350b0 Mon Sep 17 00:00:00 2001 +From 3aed3787570dae79cef8952cb87596aec8ff98df Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 15 Feb 2023 11:34:54 +0100 -Subject: [PATCH 107/178] fix(linstorvhdutil): handle correctly generic +Subject: [PATCH 108/178] fix(linstorvhdutil): handle correctly generic exceptions in _raise_openers_exception Signed-off-by: Ronan Abhamon @@ -59,5 +59,5 @@ index 63d59ab..05225e8 100644 def _call_vhd_util(self, local_method, remote_method, device_path, use_parent, *args, **kwargs): # Note: `use_parent` exists to know if the VHD parent is used by the local/remote method. -- -2.45.2 +2.46.0 diff --git a/SOURCES/0108-fix-minidrbdcluster-robustify-to-unmount-correctly-L.patch b/SOURCES/0109-fix-minidrbdcluster-robustify-to-unmount-correctly-L.patch similarity index 93% rename from SOURCES/0108-fix-minidrbdcluster-robustify-to-unmount-correctly-L.patch rename to SOURCES/0109-fix-minidrbdcluster-robustify-to-unmount-correctly-L.patch index 7533296d..33898a09 100644 --- a/SOURCES/0108-fix-minidrbdcluster-robustify-to-unmount-correctly-L.patch +++ b/SOURCES/0109-fix-minidrbdcluster-robustify-to-unmount-correctly-L.patch @@ -1,7 +1,7 @@ -From 7655e04fca6a7b79a43515327e875e41cc95c018 Mon Sep 17 00:00:00 2001 +From 1f41b0a39ce73787bf51a226d8bc515fc664f122 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 16 Feb 2023 14:24:07 +0100 -Subject: [PATCH 108/178] fix(minidrbdcluster): robustify to unmount correctly +Subject: [PATCH 109/178] fix(minidrbdcluster): robustify to unmount correctly LINSTOR DB There is a small delay during which the database may not be unmounted @@ -17,10 +17,10 @@ Signed-off-by: Ronan Abhamon create mode 100755 scripts/safe-umount diff --git a/Makefile b/Makefile -index 42058c8..72d7be3 100755 +index 313f06c..1b7188e 100755 --- a/Makefile +++ b/Makefile -@@ -241,6 +241,7 @@ install: precheck +@@ -236,6 +236,7 @@ install: precheck mkdir -p $(SM_STAGING)$(LIBEXEC) install -m 755 scripts/fork-log-daemon $(SM_STAGING)$(LIBEXEC) install -m 755 scripts/linstor-kv-tool $(SM_STAGING)$(BIN_DEST) @@ -85,5 +85,5 @@ index 0000000..9c1dcc4 + args = parser.parse_args() + sys.exit(safe_umount(args.path)) -- -2.45.2 +2.46.0 diff --git a/SOURCES/0109-fix-minidrbdcluster-handle-correctly-KeyboardInterru.patch b/SOURCES/0110-fix-minidrbdcluster-handle-correctly-KeyboardInterru.patch similarity index 91% rename from SOURCES/0109-fix-minidrbdcluster-handle-correctly-KeyboardInterru.patch rename to SOURCES/0110-fix-minidrbdcluster-handle-correctly-KeyboardInterru.patch index d47a4a66..838c5228 100644 --- a/SOURCES/0109-fix-minidrbdcluster-handle-correctly-KeyboardInterru.patch +++ b/SOURCES/0110-fix-minidrbdcluster-handle-correctly-KeyboardInterru.patch @@ -1,7 +1,7 @@ -From 52c4db7630977dc5ce1127e4ac14ee55a0edb0f5 Mon Sep 17 00:00:00 2001 +From cccde07e13727a1f03e47ed33f2487dfce1bdaed Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 20 Feb 2023 19:30:18 +0100 -Subject: [PATCH 109/178] fix(minidrbdcluster): handle correctly +Subject: [PATCH 110/178] fix(minidrbdcluster): handle correctly KeyboardInterrupt with systemd units It's necessary to always add systemd services in the running list before @@ -33,5 +33,5 @@ index eae7cbf..03d6b01 100755 if m: res_name, conn_name, role = m.groups() -- -2.45.2 +2.46.0 diff --git a/SOURCES/0110-feat-LinstorSR-use-drbd-reactor-instead-of-minidrbdc.patch b/SOURCES/0111-feat-LinstorSR-use-drbd-reactor-instead-of-minidrbdc.patch similarity index 98% rename from SOURCES/0110-feat-LinstorSR-use-drbd-reactor-instead-of-minidrbdc.patch rename to SOURCES/0111-feat-LinstorSR-use-drbd-reactor-instead-of-minidrbdc.patch index e20ec452..d794d5ec 100644 --- a/SOURCES/0110-feat-LinstorSR-use-drbd-reactor-instead-of-minidrbdc.patch +++ b/SOURCES/0111-feat-LinstorSR-use-drbd-reactor-instead-of-minidrbdc.patch @@ -1,7 +1,7 @@ -From b07a2ef5f210e9f3dd8f4d8f4d8d71895ee99ab4 Mon Sep 17 00:00:00 2001 +From 6da63ee78f16326dc8699706d58d58fe3a5c4ec3 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 24 Feb 2023 14:28:29 +0100 -Subject: [PATCH 110/178] feat(LinstorSR): use drbd-reactor instead of +Subject: [PATCH 111/178] feat(LinstorSR): use drbd-reactor instead of minidrbdcluster Signed-off-by: Ronan Abhamon @@ -19,10 +19,10 @@ Signed-off-by: Ronan Abhamon delete mode 100644 systemd/minidrbdcluster.service diff --git a/Makefile b/Makefile -index 72d7be3..bc3e97f 100755 +index 1b7188e..0ce6dfb 100755 --- a/Makefile +++ b/Makefile -@@ -100,7 +100,6 @@ MPATH_CUSTOM_CONF_DIR := /etc/multipath/conf.d/ +@@ -99,7 +99,6 @@ 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/ @@ -30,7 +30,7 @@ index 72d7be3..bc3e97f 100755 SM_STAGING := $(DESTDIR) SM_STAMP := $(MY_OBJ_DIR)/.staging_stamp -@@ -156,7 +155,6 @@ install: precheck +@@ -155,7 +154,6 @@ install: precheck mkdir -p $(SM_STAGING)$(MPATH_CUSTOM_CONF_DIR) mkdir -p $(SM_STAGING)$(MODPROBE_DIR) mkdir -p $(SM_STAGING)$(LOGROTATE_DIR) @@ -38,7 +38,7 @@ index 72d7be3..bc3e97f 100755 mkdir -p $(SM_STAGING)$(DEBUG_DEST) mkdir -p $(SM_STAGING)$(BIN_DEST) mkdir -p $(SM_STAGING)$(MASTER_SCRIPT_DEST) -@@ -184,8 +182,6 @@ install: precheck +@@ -183,8 +181,6 @@ install: precheck $(SM_STAGING)/$(SYSTEMD_CONF_DIR)/linstor-satellite.service.d/ install -m 644 etc/systemd/system/var-lib-linstor.service \ $(SM_STAGING)/$(SYSTEMD_CONF_DIR) @@ -47,7 +47,7 @@ index 72d7be3..bc3e97f 100755 install -m 644 etc/make-dummy-sr.service \ $(SM_STAGING)/$(SYSTEMD_SERVICE_DIR) install -m 644 systemd/xs-sm.service \ -@@ -204,8 +200,6 @@ install: precheck +@@ -199,8 +195,6 @@ install: precheck $(SM_STAGING)/$(SYSTEMD_SERVICE_DIR) install -m 644 systemd/linstor-monitor.service \ $(SM_STAGING)/$(SYSTEMD_SERVICE_DIR) @@ -56,7 +56,7 @@ index 72d7be3..bc3e97f 100755 for i in $(UDEV_RULES); do \ install -m 644 udev/$$i.rules \ $(SM_STAGING)$(UDEV_RULES_DIR); done -@@ -258,7 +252,6 @@ install: precheck +@@ -253,7 +247,6 @@ install: precheck install -m 755 scripts/xe-getlunidentifier $(SM_STAGING)$(BIN_DEST) install -m 755 scripts/make-dummy-sr $(SM_STAGING)$(LIBEXEC) install -m 755 scripts/storage-init $(SM_STAGING)$(LIBEXEC) @@ -617,5 +617,5 @@ index 1ddf91f..0000000 -[Install] -WantedBy=multi-user.target -- -2.45.2 +2.46.0 diff --git a/SOURCES/0111-fix-LinstorSR-ensure-vhdutil-calls-are-correctly-exe.patch b/SOURCES/0112-fix-LinstorSR-ensure-vhdutil-calls-are-correctly-exe.patch similarity index 97% rename from SOURCES/0111-fix-LinstorSR-ensure-vhdutil-calls-are-correctly-exe.patch rename to SOURCES/0112-fix-LinstorSR-ensure-vhdutil-calls-are-correctly-exe.patch index fa473655..ec370399 100644 --- a/SOURCES/0111-fix-LinstorSR-ensure-vhdutil-calls-are-correctly-exe.patch +++ b/SOURCES/0112-fix-LinstorSR-ensure-vhdutil-calls-are-correctly-exe.patch @@ -1,7 +1,7 @@ -From 68885c56099d7e6e623789b4d49c54faa5075e45 Mon Sep 17 00:00:00 2001 +From c27027a689f926d2a0235e1dc85d4891f0346815 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 1 Mar 2023 10:56:43 +0100 -Subject: [PATCH 111/178] fix(LinstorSR): ensure vhdutil calls are correctly +Subject: [PATCH 112/178] fix(LinstorSR): ensure vhdutil calls are correctly executed on pools with > 3 hosts Signed-off-by: Ronan Abhamon @@ -143,5 +143,5 @@ index 4662043..5ab83c4 100755 def invalidate_resource_cache(self): """ -- -2.45.2 +2.46.0 diff --git a/SOURCES/0112-fix-LinstorSR-replace-bad-param-in-detach_thin-impl.patch b/SOURCES/0113-fix-LinstorSR-replace-bad-param-in-detach_thin-impl.patch similarity index 88% rename from SOURCES/0112-fix-LinstorSR-replace-bad-param-in-detach_thin-impl.patch rename to SOURCES/0113-fix-LinstorSR-replace-bad-param-in-detach_thin-impl.patch index d33df0e0..85544d0b 100644 --- a/SOURCES/0112-fix-LinstorSR-replace-bad-param-in-detach_thin-impl.patch +++ b/SOURCES/0113-fix-LinstorSR-replace-bad-param-in-detach_thin-impl.patch @@ -1,7 +1,7 @@ -From 8642904e23c8818458f6112d52df60cd5a351331 Mon Sep 17 00:00:00 2001 +From 6da70e1e569db84a6220d5c568b0e18547011dd3 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 9 Mar 2023 17:06:59 +0100 -Subject: [PATCH 112/178] fix(LinstorSR): replace bad param in detach_thin impl +Subject: [PATCH 113/178] fix(LinstorSR): replace bad param in detach_thin impl To get the physical size, the volume UUID must be used, not the path. @@ -24,5 +24,5 @@ index 10e0f54..c42f07d 100755 volume_info = linstor.get_volume_info(vdi_uuid) -- -2.45.2 +2.46.0 diff --git a/SOURCES/0113-fix-linstorvolumemanager-remove-usage-of-realpath.patch b/SOURCES/0114-fix-linstorvolumemanager-remove-usage-of-realpath.patch similarity index 93% rename from SOURCES/0113-fix-linstorvolumemanager-remove-usage-of-realpath.patch rename to SOURCES/0114-fix-linstorvolumemanager-remove-usage-of-realpath.patch index 9705b3ad..96e68c9e 100644 --- a/SOURCES/0113-fix-linstorvolumemanager-remove-usage-of-realpath.patch +++ b/SOURCES/0114-fix-linstorvolumemanager-remove-usage-of-realpath.patch @@ -1,7 +1,7 @@ -From 358f096a8343367d50c161d48f08055e07c4836f Mon Sep 17 00:00:00 2001 +From 84f028a160d8cf7273dbe2c73f35e798b4ad0b9d Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 10 Mar 2023 18:11:10 +0100 -Subject: [PATCH 113/178] fix(linstorvolumemanager): remove usage of realpath +Subject: [PATCH 114/178] fix(linstorvolumemanager): remove usage of realpath Because a diskless DRBD path not always exist, get_volume_name_from_device_path can fail. It's easy to reproduce using > 4 hosts and with a call to linstorvhdutil.get_vhd_info: @@ -52,5 +52,5 @@ index 5ab83c4..8befb33 100755 def update_volume_uuid(self, volume_uuid, new_volume_uuid, force=False): """ -- -2.45.2 +2.46.0 diff --git a/SOURCES/0114-fix-linstorvhdutil-avoid-parent-path-resolution.patch b/SOURCES/0115-fix-linstorvhdutil-avoid-parent-path-resolution.patch similarity index 96% rename from SOURCES/0114-fix-linstorvhdutil-avoid-parent-path-resolution.patch rename to SOURCES/0115-fix-linstorvhdutil-avoid-parent-path-resolution.patch index 001961c4..40c0e1d4 100644 --- a/SOURCES/0114-fix-linstorvhdutil-avoid-parent-path-resolution.patch +++ b/SOURCES/0115-fix-linstorvhdutil-avoid-parent-path-resolution.patch @@ -1,7 +1,7 @@ -From 229fefbe7164db97136ea9cf1c3e8c2d4c19235c Mon Sep 17 00:00:00 2001 +From cc3f34ef376bcf1f5e036f830ffc3f68c64154c8 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 16 Mar 2023 18:54:46 +0100 -Subject: [PATCH 114/178] fix(linstorvhdutil): avoid parent path resolution +Subject: [PATCH 115/178] fix(linstorvhdutil): avoid parent path resolution When many hosts are used (>= 4), we can fail to get VHD info (with parent option) because the local parent VDI @@ -107,5 +107,5 @@ index d75edb1..48337f8 100755 ret = ioretry(cmd) fields = ret.strip().split('\n') -- -2.45.2 +2.46.0 diff --git a/SOURCES/0115-fix-LinstorSR-create-parent-path-during-attach.patch b/SOURCES/0116-fix-LinstorSR-create-parent-path-during-attach.patch similarity index 91% rename from SOURCES/0115-fix-LinstorSR-create-parent-path-during-attach.patch rename to SOURCES/0116-fix-LinstorSR-create-parent-path-during-attach.patch index ea8cddb7..e0e7f35f 100644 --- a/SOURCES/0115-fix-LinstorSR-create-parent-path-during-attach.patch +++ b/SOURCES/0116-fix-LinstorSR-create-parent-path-during-attach.patch @@ -1,7 +1,7 @@ -From 7cf6a3b784d098a8a7b40fb7082a8dabbd029157 Mon Sep 17 00:00:00 2001 +From 2201c29474b54183acb4b529a773c94a3571ca61 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 17 Mar 2023 12:06:08 +0100 -Subject: [PATCH 115/178] fix(LinstorSR): create parent path during attach +Subject: [PATCH 116/178] fix(LinstorSR): create parent path during attach It's necessary to force DRBD diskless path creation when a VDI is attached. Otherwise the attach can fail on pool with @@ -37,5 +37,5 @@ index c42f07d..48feec7 100755 self.attached = True return VDI.VDI.attach(self, self.sr.uuid, self.uuid) -- -2.45.2 +2.46.0 diff --git a/SOURCES/0116-fix-LinstorSR-retry-if-we-can-t-build-volume-cache.patch b/SOURCES/0117-fix-LinstorSR-retry-if-we-can-t-build-volume-cache.patch similarity index 88% rename from SOURCES/0116-fix-LinstorSR-retry-if-we-can-t-build-volume-cache.patch rename to SOURCES/0117-fix-LinstorSR-retry-if-we-can-t-build-volume-cache.patch index 1902be13..660d720a 100644 --- a/SOURCES/0116-fix-LinstorSR-retry-if-we-can-t-build-volume-cache.patch +++ b/SOURCES/0117-fix-LinstorSR-retry-if-we-can-t-build-volume-cache.patch @@ -1,7 +1,7 @@ -From b95191cf0e28705a2f92b73d42d252d81ae6e158 Mon Sep 17 00:00:00 2001 +From 71bbec844018985c25dc2c84ad9c1624065a8ca7 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 3 Apr 2023 10:03:57 +0200 -Subject: [PATCH 116/178] fix(LinstorSR): retry if we can't build volume cache +Subject: [PATCH 117/178] fix(LinstorSR): retry if we can't build volume cache Otherwise after SR creation, the master PBD can be unplugged. See: https://xcp-ng.org/forum/post/60726 @@ -29,5 +29,5 @@ index 48feec7..324033a 100755 def _destroy_linstor_cache(self): self._all_volume_info_cache = None -- -2.45.2 +2.46.0 diff --git a/SOURCES/0117-fix-linstorvolumemanager-reduce-peer-slots-param-to-.patch b/SOURCES/0118-fix-linstorvolumemanager-reduce-peer-slots-param-to-.patch similarity index 94% rename from SOURCES/0117-fix-linstorvolumemanager-reduce-peer-slots-param-to-.patch rename to SOURCES/0118-fix-linstorvolumemanager-reduce-peer-slots-param-to-.patch index 22bed3b2..c8c92e80 100644 --- a/SOURCES/0117-fix-linstorvolumemanager-reduce-peer-slots-param-to-.patch +++ b/SOURCES/0118-fix-linstorvolumemanager-reduce-peer-slots-param-to-.patch @@ -1,7 +1,7 @@ -From df37baf1baf365a247931efb759320bfcef6bfed Mon Sep 17 00:00:00 2001 +From d67af12145aaf807bee1e16ea4647bbbafef3666 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 25 Apr 2023 10:46:00 +0200 -Subject: [PATCH 117/178] fix(linstorvolumemanager): reduce peer-slots param to +Subject: [PATCH 118/178] fix(linstorvolumemanager): reduce peer-slots param to 3 Because we use 3 backing disks at most, it's useless to increase the default linstor limit (8). @@ -53,5 +53,5 @@ index 91db3d8..6f20c02 100755 # Create real resources on the first nodes. resources = [] -- -2.45.2 +2.46.0 diff --git a/SOURCES/0118-fix-LinstorSR-attach-a-valid-XAPI-session-is_open-is.patch b/SOURCES/0119-fix-LinstorSR-attach-a-valid-XAPI-session-is_open-is.patch similarity index 86% rename from SOURCES/0118-fix-LinstorSR-attach-a-valid-XAPI-session-is_open-is.patch rename to SOURCES/0119-fix-LinstorSR-attach-a-valid-XAPI-session-is_open-is.patch index facd3da8..1988dba6 100644 --- a/SOURCES/0118-fix-LinstorSR-attach-a-valid-XAPI-session-is_open-is.patch +++ b/SOURCES/0119-fix-LinstorSR-attach-a-valid-XAPI-session-is_open-is.patch @@ -1,7 +1,7 @@ -From 2ba830e5083bcc1376344da20949368b0129d294 Mon Sep 17 00:00:00 2001 +From ec5a6609241a382f5734577f35194911ec8a1876 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 25 Apr 2023 11:20:55 +0200 -Subject: [PATCH 118/178] fix(LinstorSR): attach a valid XAPI session is_open +Subject: [PATCH 119/178] fix(LinstorSR): attach a valid XAPI session is_open is called Signed-off-by: Ronan Abhamon @@ -27,5 +27,5 @@ index bbef4f7..a197660 100755 tapdisk = blktap2.Tapdisk.find_by_path(vdi.path) util.SMlog("Tapdisk for %s: %s" % (vdi.path, tapdisk)) -- -2.45.2 +2.46.0 diff --git a/SOURCES/0119-fix-LinstorSR-ensure-we-always-have-a-DRBD-path-to-s.patch b/SOURCES/0120-fix-LinstorSR-ensure-we-always-have-a-DRBD-path-to-s.patch similarity index 85% rename from SOURCES/0119-fix-LinstorSR-ensure-we-always-have-a-DRBD-path-to-s.patch rename to SOURCES/0120-fix-LinstorSR-ensure-we-always-have-a-DRBD-path-to-s.patch index d3ee16da..2ca015b7 100644 --- a/SOURCES/0119-fix-LinstorSR-ensure-we-always-have-a-DRBD-path-to-s.patch +++ b/SOURCES/0120-fix-LinstorSR-ensure-we-always-have-a-DRBD-path-to-s.patch @@ -1,7 +1,7 @@ -From 9e6203c5d245e14816f2cadd66fdeceb53595ade Mon Sep 17 00:00:00 2001 +From ec92e0b26035555a9492809c1cae1fed1425e01f Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 28 Apr 2023 10:43:27 +0200 -Subject: [PATCH 119/178] fix(LinstorSR): ensure we always have a DRBD path to +Subject: [PATCH 120/178] fix(LinstorSR): ensure we always have a DRBD path to snap Signed-off-by: Ronan Abhamon @@ -24,5 +24,5 @@ index 324033a..8c0b007 100755 if not util.pathexists(volume_path): raise xs_errors.XenError( -- -2.45.2 +2.46.0 diff --git a/SOURCES/0120-fix-LinstorSR-remove-hosts-ips-param.patch b/SOURCES/0121-fix-LinstorSR-remove-hosts-ips-param.patch similarity index 97% rename from SOURCES/0120-fix-LinstorSR-remove-hosts-ips-param.patch rename to SOURCES/0121-fix-LinstorSR-remove-hosts-ips-param.patch index 9c7a5500..9fbaf189 100644 --- a/SOURCES/0120-fix-LinstorSR-remove-hosts-ips-param.patch +++ b/SOURCES/0121-fix-LinstorSR-remove-hosts-ips-param.patch @@ -1,7 +1,7 @@ -From ce7503b8489735c12b3bb5eb48c4e8937c1c4765 Mon Sep 17 00:00:00 2001 +From 6afb9f195a5b3ce97d6f727337708ce536e19456 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 30 May 2023 11:19:13 +0200 -Subject: [PATCH 120/178] fix(LinstorSR): remove hosts/ips param +Subject: [PATCH 121/178] fix(LinstorSR): remove hosts/ips param --- drivers/LinstorSR.py | 47 +++++---------------------------- @@ -164,5 +164,5 @@ index 6f20c02..464ab2c 100755 # Try to create node. result = lin.node_create( -- -2.45.2 +2.46.0 diff --git a/SOURCES/0121-fix-LinstorSR-compute-correctly-SR-size-using-pool-c.patch b/SOURCES/0122-fix-LinstorSR-compute-correctly-SR-size-using-pool-c.patch similarity index 96% rename from SOURCES/0121-fix-LinstorSR-compute-correctly-SR-size-using-pool-c.patch rename to SOURCES/0122-fix-LinstorSR-compute-correctly-SR-size-using-pool-c.patch index 2aabbbf4..6fad327d 100644 --- a/SOURCES/0121-fix-LinstorSR-compute-correctly-SR-size-using-pool-c.patch +++ b/SOURCES/0122-fix-LinstorSR-compute-correctly-SR-size-using-pool-c.patch @@ -1,7 +1,7 @@ -From 55e92941365b6b39a78209d2d775e510a7a3ba32 Mon Sep 17 00:00:00 2001 +From 46d03cba7a491c03335a4ea5549df187c5c72806 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 1 Jun 2023 17:40:37 +0200 -Subject: [PATCH 121/178] fix(LinstorSR): compute correctly SR size using pool +Subject: [PATCH 122/178] fix(LinstorSR): compute correctly SR size using pool count Signed-off-by: Ronan Abhamon @@ -89,5 +89,5 @@ index 464ab2c..ee637ae 100755 def metadata(self): """ -- -2.45.2 +2.46.0 diff --git a/SOURCES/0122-fix-blktap2-ensure-we-can-import-this-module-when-LI.patch b/SOURCES/0123-fix-blktap2-ensure-we-can-import-this-module-when-LI.patch similarity index 91% rename from SOURCES/0122-fix-blktap2-ensure-we-can-import-this-module-when-LI.patch rename to SOURCES/0123-fix-blktap2-ensure-we-can-import-this-module-when-LI.patch index f52a31a4..6ae5e9a5 100644 --- a/SOURCES/0122-fix-blktap2-ensure-we-can-import-this-module-when-LI.patch +++ b/SOURCES/0123-fix-blktap2-ensure-we-can-import-this-module-when-LI.patch @@ -1,7 +1,7 @@ -From 36dc495fb24764c5e1b7f4de379efc5568b105f0 Mon Sep 17 00:00:00 2001 +From d3c6b68c18e910c1defbdfa815718e16e9323bca Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 6 Jun 2023 11:50:54 +0200 -Subject: [PATCH 122/178] fix(blktap2): ensure we can import this module when +Subject: [PATCH 123/178] fix(blktap2): ensure we can import this module when LINSTOR is not installed Signed-off-by: Ronan Abhamon @@ -44,5 +44,5 @@ index 370f7fb..fd7c643 100755 raise try: -- -2.45.2 +2.46.0 diff --git a/SOURCES/0123-fix-LinstorSR-ensure-volume-cache-can-be-recreated.patch b/SOURCES/0124-fix-LinstorSR-ensure-volume-cache-can-be-recreated.patch similarity index 96% rename from SOURCES/0123-fix-LinstorSR-ensure-volume-cache-can-be-recreated.patch rename to SOURCES/0124-fix-LinstorSR-ensure-volume-cache-can-be-recreated.patch index 161c400a..a5267eea 100644 --- a/SOURCES/0123-fix-LinstorSR-ensure-volume-cache-can-be-recreated.patch +++ b/SOURCES/0124-fix-LinstorSR-ensure-volume-cache-can-be-recreated.patch @@ -1,7 +1,7 @@ -From 9ac47f3a66ba8b232d0940cc84b63708df04fdea Mon Sep 17 00:00:00 2001 +From 99788730369ee3eb883d76b53b61a195f95c885d Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 21 Jun 2023 14:10:18 +0200 -Subject: [PATCH 123/178] fix(LinstorSR): ensure volume cache can be recreated +Subject: [PATCH 124/178] fix(LinstorSR): ensure volume cache can be recreated After SR creation we may fail to load volumes with this exception: "Failed to get usable size of..." and so we can't plug the master PBD. @@ -108,5 +108,5 @@ index f6c4356..0bccc16 100755 space_available = self._linstor.max_volume_size_allowed if (space_available < amount_needed): -- -2.45.2 +2.46.0 diff --git a/SOURCES/0124-fix-linstor-manager-remove-dead-useless-code-in-add-.patch b/SOURCES/0125-fix-linstor-manager-remove-dead-useless-code-in-add-.patch similarity index 98% rename from SOURCES/0124-fix-linstor-manager-remove-dead-useless-code-in-add-.patch rename to SOURCES/0125-fix-linstor-manager-remove-dead-useless-code-in-add-.patch index 8e58a381..5ef43886 100644 --- a/SOURCES/0124-fix-linstor-manager-remove-dead-useless-code-in-add-.patch +++ b/SOURCES/0125-fix-linstor-manager-remove-dead-useless-code-in-add-.patch @@ -1,7 +1,7 @@ -From 6cc5256d1eb193eed6eee76b2b9b68445eaa78c7 Mon Sep 17 00:00:00 2001 +From c341a4047f34b35b128fd5555eeffe62b6a8977a Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 20 Jul 2023 10:46:33 +0200 -Subject: [PATCH 124/178] fix(linstor-manager): remove dead/useless code in +Subject: [PATCH 125/178] fix(linstor-manager): remove dead/useless code in add/remove_host helpers Signed-off-by: Ronan Abhamon @@ -205,5 +205,5 @@ index 9e96aac..45201ee 100755 # 3. Stop services. try: -- -2.45.2 +2.46.0 diff --git a/SOURCES/0125-fix-LinstorSR-Ensure-we-always-have-a-device-path-du.patch b/SOURCES/0126-fix-LinstorSR-Ensure-we-always-have-a-device-path-du.patch similarity index 93% rename from SOURCES/0125-fix-LinstorSR-Ensure-we-always-have-a-device-path-du.patch rename to SOURCES/0126-fix-LinstorSR-Ensure-we-always-have-a-device-path-du.patch index 33e4fa87..9bba4c29 100644 --- a/SOURCES/0125-fix-LinstorSR-Ensure-we-always-have-a-device-path-du.patch +++ b/SOURCES/0126-fix-LinstorSR-Ensure-we-always-have-a-device-path-du.patch @@ -1,7 +1,7 @@ -From 6b8eff2089024d5a675a34a978d95bde365c1296 Mon Sep 17 00:00:00 2001 +From b63d80afb41d5cc1d053a3eb9cb12fe9d7c5cfee Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 1 Aug 2023 15:16:17 +0200 -Subject: [PATCH 125/178] fix(LinstorSR): Ensure we always have a device path +Subject: [PATCH 126/178] fix(LinstorSR): Ensure we always have a device path during leaf-coalesce calls So we must not verify that we have a valid DRBD path in the load step, @@ -55,5 +55,5 @@ index f6c4346..19d03d9 100755 entries = self.journaler.get_all(VDI.JRN_LEAF) for uuid, parentUuid in entries.iteritems(): -- -2.45.2 +2.46.0 diff --git a/SOURCES/0126-fix-LinstorSR-always-use-lock.acquire-during-attach-.patch b/SOURCES/0127-fix-LinstorSR-always-use-lock.acquire-during-attach-.patch similarity index 93% rename from SOURCES/0126-fix-LinstorSR-always-use-lock.acquire-during-attach-.patch rename to SOURCES/0127-fix-LinstorSR-always-use-lock.acquire-during-attach-.patch index 2cb55adb..06b634b8 100644 --- a/SOURCES/0126-fix-LinstorSR-always-use-lock.acquire-during-attach-.patch +++ b/SOURCES/0127-fix-LinstorSR-always-use-lock.acquire-during-attach-.patch @@ -1,7 +1,7 @@ -From f3a1c26b46601c5bbcaeda3ef494a7f59ce7c6c6 Mon Sep 17 00:00:00 2001 +From 859ddf7beed5f4c8967879a1815ba408b5990db1 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 16 Aug 2023 12:04:01 +0200 -Subject: [PATCH 126/178] fix(LinstorSR): always use lock.acquire() during +Subject: [PATCH 127/178] fix(LinstorSR): always use lock.acquire() during attach/detach We can't use a retry range on the lock because we can trigger a bad situation @@ -55,5 +55,5 @@ index 0bccc16..98919a4 100755 vdi_ref = session.xenapi.VDI.get_by_uuid(vdi_uuid) vbds = session.xenapi.VBD.get_all_records_where( -- -2.45.2 +2.46.0 diff --git a/SOURCES/0127-fix-LinstorSR-mare-sure-hostnames-are-unique-at-SR-c.patch b/SOURCES/0128-fix-LinstorSR-mare-sure-hostnames-are-unique-at-SR-c.patch similarity index 86% rename from SOURCES/0127-fix-LinstorSR-mare-sure-hostnames-are-unique-at-SR-c.patch rename to SOURCES/0128-fix-LinstorSR-mare-sure-hostnames-are-unique-at-SR-c.patch index d9c2b6b2..cb75bacf 100644 --- a/SOURCES/0127-fix-LinstorSR-mare-sure-hostnames-are-unique-at-SR-c.patch +++ b/SOURCES/0128-fix-LinstorSR-mare-sure-hostnames-are-unique-at-SR-c.patch @@ -1,7 +1,7 @@ -From abda6f13ca112aa1a8f142e290377982f76f060a Mon Sep 17 00:00:00 2001 +From 02b497c783fab888e8127ab5d1dd8b58632d2995 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 17 Aug 2023 14:52:13 +0200 -Subject: [PATCH 127/178] fix(LinstorSR): mare sure hostnames are unique at SR +Subject: [PATCH 128/178] fix(LinstorSR): mare sure hostnames are unique at SR creation Signed-off-by: Ronan Abhamon @@ -27,5 +27,5 @@ index 98919a4..e512487 100755 # are activated. In the same time the drbd-reactor instances # must be stopped. -- -2.45.2 +2.46.0 diff --git a/SOURCES/0128-fix-LinstorSR-ensure-we-can-attach-non-special-stati.patch b/SOURCES/0129-fix-LinstorSR-ensure-we-can-attach-non-special-stati.patch similarity index 86% rename from SOURCES/0128-fix-LinstorSR-ensure-we-can-attach-non-special-stati.patch rename to SOURCES/0129-fix-LinstorSR-ensure-we-can-attach-non-special-stati.patch index 9aa5f580..1512e878 100644 --- a/SOURCES/0128-fix-LinstorSR-ensure-we-can-attach-non-special-stati.patch +++ b/SOURCES/0129-fix-LinstorSR-ensure-we-can-attach-non-special-stati.patch @@ -1,7 +1,7 @@ -From a2dd4de7e8e512297a332c270070a62bc75aca55 Mon Sep 17 00:00:00 2001 +From 6dff0030453b2031f625518f4e4fc6ae8a168eb9 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 18 Aug 2023 11:06:56 +0200 -Subject: [PATCH 128/178] fix(LinstorSR): ensure we can attach non-special +Subject: [PATCH 129/178] fix(LinstorSR): ensure we can attach non-special static VDIs Signed-off-by: Ronan Abhamon @@ -24,5 +24,5 @@ index e512487..1708370 100755 controller_uri = get_controller_uri() if controller_uri: -- -2.45.2 +2.46.0 diff --git a/SOURCES/0129-fix-LinstorSR-ensure-we-can-detach-when-deflate-call.patch b/SOURCES/0130-fix-LinstorSR-ensure-we-can-detach-when-deflate-call.patch similarity index 96% rename from SOURCES/0129-fix-LinstorSR-ensure-we-can-detach-when-deflate-call.patch rename to SOURCES/0130-fix-LinstorSR-ensure-we-can-detach-when-deflate-call.patch index b193d140..c18ee481 100644 --- a/SOURCES/0129-fix-LinstorSR-ensure-we-can-detach-when-deflate-call.patch +++ b/SOURCES/0130-fix-LinstorSR-ensure-we-can-detach-when-deflate-call.patch @@ -1,7 +1,7 @@ -From 3cf1041ce9802829651010063c3d8eebe969ba26 Mon Sep 17 00:00:00 2001 +From 0d58254293a08ee5f0b1c4b8529dc04a8ea161f2 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 31 Aug 2023 18:00:27 +0200 -Subject: [PATCH 129/178] fix(LinstorSR): ensure we can detach when deflate +Subject: [PATCH 130/178] fix(LinstorSR): ensure we can detach when deflate call is not possible Signed-off-by: Ronan Abhamon @@ -81,5 +81,5 @@ index 1708370..a6ca884 100755 # Only inflate if the LINSTOR volume capacity is not enough. new_size = LinstorVolumeManager.round_up_volume_size(new_size) -- -2.45.2 +2.46.0 diff --git a/SOURCES/0130-fix-LinstorSR-assume-VDI-is-always-a-VHD-when-the-in.patch b/SOURCES/0131-fix-LinstorSR-assume-VDI-is-always-a-VHD-when-the-in.patch similarity index 89% rename from SOURCES/0130-fix-LinstorSR-assume-VDI-is-always-a-VHD-when-the-in.patch rename to SOURCES/0131-fix-LinstorSR-assume-VDI-is-always-a-VHD-when-the-in.patch index e0b85073..4e77a648 100644 --- a/SOURCES/0130-fix-LinstorSR-assume-VDI-is-always-a-VHD-when-the-in.patch +++ b/SOURCES/0131-fix-LinstorSR-assume-VDI-is-always-a-VHD-when-the-in.patch @@ -1,7 +1,7 @@ -From 10f62cd78f1ce950b4f1527ab5baa227192a88ed Mon Sep 17 00:00:00 2001 +From 32ecbab86a91729a8b2d2f11830a8354d0a78a62 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 28 Sep 2023 16:00:02 +0200 -Subject: [PATCH 130/178] fix(LinstorSR): assume VDI is always a VHD when the +Subject: [PATCH 131/178] fix(LinstorSR): assume VDI is always a VHD when the info is missing during cleanup Signed-off-by: Ronan Abhamon @@ -30,5 +30,5 @@ index 19d03d9..5353e9a 100755 Util.log( ' [VDI {}: failed to load VDI info]: {}' -- -2.45.2 +2.46.0 diff --git a/SOURCES/0131-fix-LinstorSR-remove-SR-lock-during-thin-attach-deta.patch b/SOURCES/0132-fix-LinstorSR-remove-SR-lock-during-thin-attach-deta.patch similarity index 97% rename from SOURCES/0131-fix-LinstorSR-remove-SR-lock-during-thin-attach-deta.patch rename to SOURCES/0132-fix-LinstorSR-remove-SR-lock-during-thin-attach-deta.patch index 58e63c11..6d03653a 100644 --- a/SOURCES/0131-fix-LinstorSR-remove-SR-lock-during-thin-attach-deta.patch +++ b/SOURCES/0132-fix-LinstorSR-remove-SR-lock-during-thin-attach-deta.patch @@ -1,7 +1,7 @@ -From 5c8c56aea83a2cd4e2ffe57ba54aaf21474f68be Mon Sep 17 00:00:00 2001 +From 70ce954b27d64a8e6b7584270f9191409eef4161 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 2 Oct 2023 16:48:49 +0200 -Subject: [PATCH 131/178] fix(LinstorSR): remove SR lock during thin +Subject: [PATCH 132/178] fix(LinstorSR): remove SR lock during thin attach/detach This lock is normally useless and can create a dead lock when thin mode is activated: @@ -148,5 +148,5 @@ index a6ca884..ed41e77 100755 def detach_thin(session, linstor, sr_uuid, vdi_uuid): -- -2.45.2 +2.46.0 diff --git a/SOURCES/0132-fix-LinstorSR-ensure-database-is-mounted-during-scan.patch b/SOURCES/0133-fix-LinstorSR-ensure-database-is-mounted-during-scan.patch similarity index 94% rename from SOURCES/0132-fix-LinstorSR-ensure-database-is-mounted-during-scan.patch rename to SOURCES/0133-fix-LinstorSR-ensure-database-is-mounted-during-scan.patch index a84fc518..7443ba1b 100644 --- a/SOURCES/0132-fix-LinstorSR-ensure-database-is-mounted-during-scan.patch +++ b/SOURCES/0133-fix-LinstorSR-ensure-database-is-mounted-during-scan.patch @@ -1,7 +1,7 @@ -From af4c39361fa080e170eb2d9ae58cd839d2b7b550 Mon Sep 17 00:00:00 2001 +From c6079f164c87e87c519cd1eb1d9c79603bc19906 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 3 Oct 2023 18:42:42 +0200 -Subject: [PATCH 132/178] fix(LinstorSR): ensure database is mounted during +Subject: [PATCH 133/178] fix(LinstorSR): ensure database is mounted during scan Signed-off-by: Ronan Abhamon @@ -65,5 +65,5 @@ index ee637ae..f1f3bce 100755 def create_sr( cls, group_name, ips, redundancy, -- -2.45.2 +2.46.0 diff --git a/SOURCES/0133-fix-LinstorSR-restart-drbd-reactor-in-case-of-failur.patch b/SOURCES/0134-fix-LinstorSR-restart-drbd-reactor-in-case-of-failur.patch similarity index 88% rename from SOURCES/0133-fix-LinstorSR-restart-drbd-reactor-in-case-of-failur.patch rename to SOURCES/0134-fix-LinstorSR-restart-drbd-reactor-in-case-of-failur.patch index f89244da..b64f2a51 100644 --- a/SOURCES/0133-fix-LinstorSR-restart-drbd-reactor-in-case-of-failur.patch +++ b/SOURCES/0134-fix-LinstorSR-restart-drbd-reactor-in-case-of-failur.patch @@ -1,7 +1,7 @@ -From 8154937eec169d7d7e9d9f00ff401ea279e5741c Mon Sep 17 00:00:00 2001 +From 9f7664dbeb77485792a15db05e794e6f0c5edceb Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 4 Oct 2023 14:30:36 +0200 -Subject: [PATCH 133/178] fix(LinstorSR): restart drbd-reactor in case of +Subject: [PATCH 134/178] fix(LinstorSR): restart drbd-reactor in case of failure Otherwise we can have all hosts unusable after a massive reboot: @@ -16,10 +16,10 @@ Signed-off-by: Ronan Abhamon create mode 100644 etc/systemd/system/drbd-reactor.service.d/override.conf diff --git a/Makefile b/Makefile -index bc3e97f..7f7740c 100755 +index 0ce6dfb..088c2b7 100755 --- a/Makefile +++ b/Makefile -@@ -149,6 +149,7 @@ install: precheck +@@ -148,6 +148,7 @@ install: precheck mkdir -p $(SM_STAGING)$(UDEV_SCRIPTS_DIR) mkdir -p $(SM_STAGING)$(INIT_DIR) mkdir -p $(SM_STAGING)$(SYSTEMD_CONF_DIR) @@ -27,7 +27,7 @@ index bc3e97f..7f7740c 100755 mkdir -p $(SM_STAGING)$(SYSTEMD_CONF_DIR)/linstor-satellite.service.d mkdir -p $(SM_STAGING)$(SYSTEMD_SERVICE_DIR) mkdir -p $(SM_STAGING)$(MPATH_CONF_DIR) -@@ -178,6 +179,8 @@ install: precheck +@@ -177,6 +178,8 @@ install: precheck $(SM_STAGING)/$(SM_DEST) install -m 644 etc/logrotate.d/$(SMLOG_CONF) \ $(SM_STAGING)/$(LOGROTATE_DIR) @@ -49,5 +49,5 @@ index 0000000..2f99a46 +Restart=always +RestartSec=2 -- -2.45.2 +2.46.0 diff --git a/SOURCES/0134-fix-linstorvolumemanager-retry-in-case-of-failure-du.patch b/SOURCES/0135-fix-linstorvolumemanager-retry-in-case-of-failure-du.patch similarity index 88% rename from SOURCES/0134-fix-linstorvolumemanager-retry-in-case-of-failure-du.patch rename to SOURCES/0135-fix-linstorvolumemanager-retry-in-case-of-failure-du.patch index 4ecab4e7..b4971a07 100644 --- a/SOURCES/0134-fix-linstorvolumemanager-retry-in-case-of-failure-du.patch +++ b/SOURCES/0135-fix-linstorvolumemanager-retry-in-case-of-failure-du.patch @@ -1,7 +1,7 @@ -From 17f5732413d7c5d95173ae36600a66f917981f1a Mon Sep 17 00:00:00 2001 +From bdd5c9af875ffc62d413a29ce70d2408b78a1304 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 9 Oct 2023 10:37:32 +0200 -Subject: [PATCH 134/178] fix(linstorvolumemanager): retry in case of failure +Subject: [PATCH 135/178] fix(linstorvolumemanager): retry in case of failure during mkfs call on database The device is not always ready after creation. @@ -29,5 +29,5 @@ index f1f3bce..23e80d9 100755 raise LinstorVolumeManagerError( 'Failed to execute {} on database volume: {}' -- -2.45.2 +2.46.0 diff --git a/SOURCES/0135-fix-linstorvolumemanager-avoid-diskless-creation-whe.patch b/SOURCES/0136-fix-linstorvolumemanager-avoid-diskless-creation-whe.patch similarity index 97% rename from SOURCES/0135-fix-linstorvolumemanager-avoid-diskless-creation-whe.patch rename to SOURCES/0136-fix-linstorvolumemanager-avoid-diskless-creation-whe.patch index a265793f..dbe7ef2c 100644 --- a/SOURCES/0135-fix-linstorvolumemanager-avoid-diskless-creation-whe.patch +++ b/SOURCES/0136-fix-linstorvolumemanager-avoid-diskless-creation-whe.patch @@ -1,7 +1,7 @@ -From bef526786b135beef522a40b571044dbd0922e58 Mon Sep 17 00:00:00 2001 +From a6352f0f967b9f688240e3bd2928330fab772893 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 26 Sep 2023 11:48:38 +0200 -Subject: [PATCH 135/178] fix(linstorvolumemanager): avoid diskless creation +Subject: [PATCH 136/178] fix(linstorvolumemanager): avoid diskless creation when a new resource is added Like said in this discussion https://github.com/xcp-ng/sm/pull/34 : @@ -142,5 +142,5 @@ index 23e80d9..49ca83c 100755 assert volume_properties.namespace == \ -- -2.45.2 +2.46.0 diff --git a/SOURCES/0136-fix-LinstorSR-remove-diskless-after-VDI.detach-calls.patch b/SOURCES/0137-fix-LinstorSR-remove-diskless-after-VDI.detach-calls.patch similarity index 96% rename from SOURCES/0136-fix-LinstorSR-remove-diskless-after-VDI.detach-calls.patch rename to SOURCES/0137-fix-LinstorSR-remove-diskless-after-VDI.detach-calls.patch index 207cd9c8..d6788193 100644 --- a/SOURCES/0136-fix-LinstorSR-remove-diskless-after-VDI.detach-calls.patch +++ b/SOURCES/0137-fix-LinstorSR-remove-diskless-after-VDI.detach-calls.patch @@ -1,7 +1,7 @@ -From efbfea0c312d112122346f3a1e6efea952d6f96d Mon Sep 17 00:00:00 2001 +From e543a48ebf3139d6423b5273777592bfe172a58c Mon Sep 17 00:00:00 2001 From: Rene Peinthor Date: Tue, 25 Jul 2023 11:19:39 +0200 -Subject: [PATCH 136/178] fix(LinstorSR): remove diskless after VDI.detach +Subject: [PATCH 137/178] fix(LinstorSR): remove diskless after VDI.detach calls Signed-off-by: Rene Peinthor @@ -87,5 +87,5 @@ index 49ca83c..0f6fbcf 100755 return errors = linstor.Linstor.filter_api_call_response_errors(result) -- -2.45.2 +2.46.0 diff --git a/SOURCES/0137-fix-LinstorSR-robustify-_load_vdi_info-in-cleanup.py.patch b/SOURCES/0138-fix-LinstorSR-robustify-_load_vdi_info-in-cleanup.py.patch similarity index 97% rename from SOURCES/0137-fix-LinstorSR-robustify-_load_vdi_info-in-cleanup.py.patch rename to SOURCES/0138-fix-LinstorSR-robustify-_load_vdi_info-in-cleanup.py.patch index 3c03b7d8..607bb851 100644 --- a/SOURCES/0137-fix-LinstorSR-robustify-_load_vdi_info-in-cleanup.py.patch +++ b/SOURCES/0138-fix-LinstorSR-robustify-_load_vdi_info-in-cleanup.py.patch @@ -1,7 +1,7 @@ -From 427909f25d2ff571c5e0e165b20e3303883403a5 Mon Sep 17 00:00:00 2001 +From c3f1a7b62b9696cc6abb305a5164a75b49240de6 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 11 Oct 2023 12:39:56 +0200 -Subject: [PATCH 137/178] fix(LinstorSR): robustify _load_vdi_info in +Subject: [PATCH 138/178] fix(LinstorSR): robustify _load_vdi_info in cleanup.py After a failed snapshot like that: @@ -95,5 +95,5 @@ index 5353e9a..376da3e 100755 # TODO: Maybe implement _liveLeafCoalesce/_prepareCoalesceLeaf/ -- -2.45.2 +2.46.0 diff --git a/SOURCES/0138-fix-LinstorSR-ensure-detach-never-fails-on-plugin-fa.patch b/SOURCES/0139-fix-LinstorSR-ensure-detach-never-fails-on-plugin-fa.patch similarity index 87% rename from SOURCES/0138-fix-LinstorSR-ensure-detach-never-fails-on-plugin-fa.patch rename to SOURCES/0139-fix-LinstorSR-ensure-detach-never-fails-on-plugin-fa.patch index 9469f5db..e11b6690 100644 --- a/SOURCES/0138-fix-LinstorSR-ensure-detach-never-fails-on-plugin-fa.patch +++ b/SOURCES/0139-fix-LinstorSR-ensure-detach-never-fails-on-plugin-fa.patch @@ -1,7 +1,7 @@ -From 4fdaf148c813d3b1b380deabcf246f74b8993a59 Mon Sep 17 00:00:00 2001 +From f885dbd5d82b1af3ca70b38a0640580207d9bf5a Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 23 Oct 2023 14:31:27 +0200 -Subject: [PATCH 138/178] fix(LinstorSR): ensure detach never fails on plugin +Subject: [PATCH 139/178] fix(LinstorSR): ensure detach never fails on plugin failure Signed-off-by: Ronan Abhamon @@ -28,5 +28,5 @@ index 7b9a8e5..d0fc421 100755 # Reload size attrs after inflate or deflate! self._load_this() -- -2.45.2 +2.46.0 diff --git a/SOURCES/0139-fix-LinstorSR-ensure-we-coalesce-only-volumes-with-a.patch b/SOURCES/0140-fix-LinstorSR-ensure-we-coalesce-only-volumes-with-a.patch similarity index 97% rename from SOURCES/0139-fix-LinstorSR-ensure-we-coalesce-only-volumes-with-a.patch rename to SOURCES/0140-fix-LinstorSR-ensure-we-coalesce-only-volumes-with-a.patch index 0b8da4b5..fd4e6097 100644 --- a/SOURCES/0139-fix-LinstorSR-ensure-we-coalesce-only-volumes-with-a.patch +++ b/SOURCES/0140-fix-LinstorSR-ensure-we-coalesce-only-volumes-with-a.patch @@ -1,7 +1,7 @@ -From 5981f334d3fa7fff186446d094b9b83a92d20cb1 Mon Sep 17 00:00:00 2001 +From 3633eecad17dc34a65fbb127f11ec90c5934d2d4 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 23 Oct 2023 15:52:23 +0200 -Subject: [PATCH 139/178] fix(LinstorSR): ensure we coalesce only volumes with +Subject: [PATCH 140/178] fix(LinstorSR): ensure we coalesce only volumes with a valid size --- @@ -136,5 +136,5 @@ index 8b6985d..5f3ae08 100644 try: return self._call_local_vhd_util(local_method, device_path, *args, **kwargs) -- -2.45.2 +2.46.0 diff --git a/SOURCES/0140-fix-LinstorSR-don-t-try-to-repair-persistent-volumes.patch b/SOURCES/0141-fix-LinstorSR-don-t-try-to-repair-persistent-volumes.patch similarity index 98% rename from SOURCES/0140-fix-LinstorSR-don-t-try-to-repair-persistent-volumes.patch rename to SOURCES/0141-fix-LinstorSR-don-t-try-to-repair-persistent-volumes.patch index 8357e198..35f9c9df 100644 --- a/SOURCES/0140-fix-LinstorSR-don-t-try-to-repair-persistent-volumes.patch +++ b/SOURCES/0141-fix-LinstorSR-don-t-try-to-repair-persistent-volumes.patch @@ -1,7 +1,7 @@ -From b7a02cef58da7eb734cfa1c876593a43946300c1 Mon Sep 17 00:00:00 2001 +From 3be63d299ba706e86f1fbcac59d5173967860a2e Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 24 Oct 2023 11:57:40 +0200 -Subject: [PATCH 140/178] fix(LinstorSR): don't try to repair persistent +Subject: [PATCH 141/178] fix(LinstorSR): don't try to repair persistent volumes in GC Use constants to simplify maintenance. @@ -195,5 +195,5 @@ index 0f6fbcf..47ca4e8 100755 DATABASE_PATH = '/var/lib/linstor' DATABASE_MKFS = 'mkfs.ext4' -- -2.45.2 +2.46.0 diff --git a/SOURCES/0141-fix-linstorvhdutil-format-correctly-message-if-vhd-u.patch b/SOURCES/0142-fix-linstorvhdutil-format-correctly-message-if-vhd-u.patch similarity index 87% rename from SOURCES/0141-fix-linstorvhdutil-format-correctly-message-if-vhd-u.patch rename to SOURCES/0142-fix-linstorvhdutil-format-correctly-message-if-vhd-u.patch index 2cf86356..4b328cab 100644 --- a/SOURCES/0141-fix-linstorvhdutil-format-correctly-message-if-vhd-u.patch +++ b/SOURCES/0142-fix-linstorvhdutil-format-correctly-message-if-vhd-u.patch @@ -1,7 +1,7 @@ -From a600cd8fb9c29b709459b7446fc7fd0ac362bbdf Mon Sep 17 00:00:00 2001 +From 1230aa74fee21eabb70be27959d16a01b20dd747 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 14 Nov 2023 18:21:53 +0100 -Subject: [PATCH 141/178] fix(linstorvhdutil): format correctly message if +Subject: [PATCH 142/178] fix(linstorvhdutil): format correctly message if vhd-util cannot be run Signed-off-by: Ronan Abhamon @@ -24,5 +24,5 @@ index 5f3ae08..3ce7ab9 100644 ) return util.retry(remote_call, 5, 2) -- -2.45.2 +2.46.0 diff --git a/SOURCES/0142-fix-LinstorSR-wait-during-attach-to-open-DRBD-path.patch b/SOURCES/0143-fix-LinstorSR-wait-during-attach-to-open-DRBD-path.patch similarity index 92% rename from SOURCES/0142-fix-LinstorSR-wait-during-attach-to-open-DRBD-path.patch rename to SOURCES/0143-fix-LinstorSR-wait-during-attach-to-open-DRBD-path.patch index 042f8da7..897cc47e 100644 --- a/SOURCES/0142-fix-LinstorSR-wait-during-attach-to-open-DRBD-path.patch +++ b/SOURCES/0143-fix-LinstorSR-wait-during-attach-to-open-DRBD-path.patch @@ -1,7 +1,7 @@ -From ed9e6189aa9e86c7c32ec88baa9b8023cfd250d6 Mon Sep 17 00:00:00 2001 +From 7bfaf3d9be6f56fec13b0f8536e8748fc053620a Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 24 Oct 2023 23:07:23 +0200 -Subject: [PATCH 142/178] fix(LinstorSR): wait during attach to open DRBD path +Subject: [PATCH 143/178] fix(LinstorSR): wait during attach to open DRBD path ENODATA and other errors like EROFS can be raised when a new DRBD path is created on the fly. So ensure to block before tapdisk starts. @@ -42,5 +42,5 @@ index d0ce079..3063abf 100755 self.attached = True -- -2.45.2 +2.46.0 diff --git a/SOURCES/0143-fix-LinstorSR-support-different-volume-sizes-in-clea.patch b/SOURCES/0144-fix-LinstorSR-support-different-volume-sizes-in-clea.patch similarity index 99% rename from SOURCES/0143-fix-LinstorSR-support-different-volume-sizes-in-clea.patch rename to SOURCES/0144-fix-LinstorSR-support-different-volume-sizes-in-clea.patch index be6150aa..9d280f4b 100644 --- a/SOURCES/0143-fix-LinstorSR-support-different-volume-sizes-in-clea.patch +++ b/SOURCES/0144-fix-LinstorSR-support-different-volume-sizes-in-clea.patch @@ -1,7 +1,7 @@ -From 8ff35099e65e28f4a7ae4883606efc8f2f0b72f8 Mon Sep 17 00:00:00 2001 +From cbbfa5a864ea184ecfed516cf0948a5b5075dfda Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 14 Nov 2023 18:08:26 +0100 -Subject: [PATCH 143/178] fix(LinstorSR): support different volume sizes in +Subject: [PATCH 144/178] fix(LinstorSR): support different volume sizes in cleanup.py Signed-off-by: Ronan Abhamon @@ -513,5 +513,5 @@ index 3ce7ab9..239a10a 100644 # Helpers. # -------------------------------------------------------------------------- -- -2.45.2 +2.46.0 diff --git a/SOURCES/0144-fix-LinstorSR-remove-useless-IPS_XHA_CACHE-var.patch b/SOURCES/0145-fix-LinstorSR-remove-useless-IPS_XHA_CACHE-var.patch similarity index 83% rename from SOURCES/0144-fix-LinstorSR-remove-useless-IPS_XHA_CACHE-var.patch rename to SOURCES/0145-fix-LinstorSR-remove-useless-IPS_XHA_CACHE-var.patch index 9b6b36cf..7deb5b59 100644 --- a/SOURCES/0144-fix-LinstorSR-remove-useless-IPS_XHA_CACHE-var.patch +++ b/SOURCES/0145-fix-LinstorSR-remove-useless-IPS_XHA_CACHE-var.patch @@ -1,7 +1,7 @@ -From 66cb40e1203a06cb1561f28225ba53a449bae79f Mon Sep 17 00:00:00 2001 +From 1b324ce8a21ca4bf18125e43885683084a5a8c08 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 20 Nov 2023 10:52:27 +0100 -Subject: [PATCH 144/178] fix(LinstorSR): remove useless IPS_XHA_CACHE var +Subject: [PATCH 145/178] fix(LinstorSR): remove useless IPS_XHA_CACHE var Signed-off-by: Ronan Abhamon --- @@ -27,5 +27,5 @@ index 6802f49..c570925 100755 host_id = None try: -- -2.45.2 +2.46.0 diff --git a/SOURCES/0145-fix-LinstorSR-ensure-we-can-deflate-on-any-host-afte.patch b/SOURCES/0146-fix-LinstorSR-ensure-we-can-deflate-on-any-host-afte.patch similarity index 98% rename from SOURCES/0145-fix-LinstorSR-ensure-we-can-deflate-on-any-host-afte.patch rename to SOURCES/0146-fix-LinstorSR-ensure-we-can-deflate-on-any-host-afte.patch index fc04ca32..16ced1c8 100644 --- a/SOURCES/0145-fix-LinstorSR-ensure-we-can-deflate-on-any-host-afte.patch +++ b/SOURCES/0146-fix-LinstorSR-ensure-we-can-deflate-on-any-host-afte.patch @@ -1,7 +1,7 @@ -From 0941f0f67e86099523d389dfd3caffc09f848444 Mon Sep 17 00:00:00 2001 +From 4a7d088083167e073cf0149f3ad54aa0c31869c3 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 21 Nov 2023 13:50:24 +0100 -Subject: [PATCH 145/178] fix(LinstorSR): ensure we can deflate on any host +Subject: [PATCH 146/178] fix(LinstorSR): ensure we can deflate on any host after a journal rollback Signed-off-by: Ronan Abhamon @@ -314,5 +314,5 @@ index 239a10a..23d8b6a 100644 + opterr='Failed to zero out VHD footer {}'.format(path) + ) -- -2.45.2 +2.46.0 diff --git a/SOURCES/0146-fix-LinstorSR-ensure-we-always-use-real-DRBD-VHD-siz.patch b/SOURCES/0147-fix-LinstorSR-ensure-we-always-use-real-DRBD-VHD-siz.patch similarity index 97% rename from SOURCES/0146-fix-LinstorSR-ensure-we-always-use-real-DRBD-VHD-siz.patch rename to SOURCES/0147-fix-LinstorSR-ensure-we-always-use-real-DRBD-VHD-siz.patch index ace6197a..0e5ceb7d 100644 --- a/SOURCES/0146-fix-LinstorSR-ensure-we-always-use-real-DRBD-VHD-siz.patch +++ b/SOURCES/0147-fix-LinstorSR-ensure-we-always-use-real-DRBD-VHD-siz.patch @@ -1,7 +1,7 @@ -From 7aa1cd3e4e2539f424ec193fe599c51da9d63a0e Mon Sep 17 00:00:00 2001 +From 6fdfda1d9cc245c0227c7db49115f1ae689ae242 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 27 Nov 2023 12:15:43 +0100 -Subject: [PATCH 146/178] fix(LinstorSR): ensure we always use real DRBD/VHD +Subject: [PATCH 147/178] fix(LinstorSR): ensure we always use real DRBD/VHD sizes in inflate/deflate GC calls --- @@ -145,5 +145,5 @@ index 3c2810c..8635f48 100755 entries = self.journaler.get_all(VDI.JRN_LEAF) for uuid, parentUuid in entries.iteritems(): -- -2.45.2 +2.46.0 diff --git a/SOURCES/0147-feat-linstor-kv-tool-If-no-controller-uri-option-is-.patch b/SOURCES/0148-feat-linstor-kv-tool-If-no-controller-uri-option-is-.patch similarity index 93% rename from SOURCES/0147-feat-linstor-kv-tool-If-no-controller-uri-option-is-.patch rename to SOURCES/0148-feat-linstor-kv-tool-If-no-controller-uri-option-is-.patch index 40cda6ee..e8b2693a 100644 --- a/SOURCES/0147-feat-linstor-kv-tool-If-no-controller-uri-option-is-.patch +++ b/SOURCES/0148-feat-linstor-kv-tool-If-no-controller-uri-option-is-.patch @@ -1,7 +1,7 @@ -From f440e05248e5201289b5c7dfc25f3a4867912317 Mon Sep 17 00:00:00 2001 +From 620ca1abd996743be6096300df42230c23c35d9d Mon Sep 17 00:00:00 2001 From: BenjiReis Date: Mon, 27 Nov 2023 14:23:57 +0100 -Subject: [PATCH 147/178] feat(linstor-kv-tool): If no controller uri option is +Subject: [PATCH 148/178] feat(linstor-kv-tool): If no controller uri option is provided fetch it (#48) Signed-off-by: BenjiReis @@ -52,5 +52,5 @@ index c907027..b845ec2 100755 if __name__ == '__main__': -- -2.45.2 +2.46.0 diff --git a/SOURCES/0148-fix-linstorvolumemanager-robustify-SR-destroy-46.patch b/SOURCES/0149-fix-linstorvolumemanager-robustify-SR-destroy-46.patch similarity index 98% rename from SOURCES/0148-fix-linstorvolumemanager-robustify-SR-destroy-46.patch rename to SOURCES/0149-fix-linstorvolumemanager-robustify-SR-destroy-46.patch index 68763842..5881c5d0 100644 --- a/SOURCES/0148-fix-linstorvolumemanager-robustify-SR-destroy-46.patch +++ b/SOURCES/0149-fix-linstorvolumemanager-robustify-SR-destroy-46.patch @@ -1,7 +1,7 @@ -From 163521a5851d6cf808acd8e68e8b6905a9487300 Mon Sep 17 00:00:00 2001 +From 0ae964a043bf01824b38c23aef7c2360519fe38f Mon Sep 17 00:00:00 2001 From: BenjiReis Date: Wed, 29 Nov 2023 15:45:32 +0100 -Subject: [PATCH 148/178] fix(linstorvolumemanager): robustify SR destroy (#46) +Subject: [PATCH 149/178] fix(linstorvolumemanager): robustify SR destroy (#46) Signed-off-by: Ronan Abhamon Co-authored-by: BenjiReis @@ -206,5 +206,5 @@ index 47ca4e8..d27c84e 100755 def _get_filtered_properties(properties): return dict(properties.items()) -- -2.45.2 +2.46.0 diff --git a/SOURCES/0149-feat-linstor-manager-extend-API-with-createNodeInter.patch b/SOURCES/0150-feat-linstor-manager-extend-API-with-createNodeInter.patch similarity index 96% rename from SOURCES/0149-feat-linstor-manager-extend-API-with-createNodeInter.patch rename to SOURCES/0150-feat-linstor-manager-extend-API-with-createNodeInter.patch index 46d4d959..e60aaed3 100644 --- a/SOURCES/0149-feat-linstor-manager-extend-API-with-createNodeInter.patch +++ b/SOURCES/0150-feat-linstor-manager-extend-API-with-createNodeInter.patch @@ -1,7 +1,7 @@ -From 695baec632e137b6fbab34b826f4c3224fddf2b3 Mon Sep 17 00:00:00 2001 +From da9afe424c2ad652e7278af658c7b4b4c7d5d0e7 Mon Sep 17 00:00:00 2001 From: BenjiReis Date: Wed, 29 Nov 2023 16:54:30 +0100 -Subject: [PATCH 149/178] feat(linstor-manager): extend API with +Subject: [PATCH 150/178] feat(linstor-manager): extend API with createNodeInterface and setNodePreferredInterface (#47) Signed-off-by: BenjiReis @@ -104,5 +104,5 @@ index d27c84e..fef34d3 100755 """ Get all nodes + statuses, used or not by the pool. -- -2.45.2 +2.46.0 diff --git a/SOURCES/0150-fix-LinstorSR-support-VDI.resize-on-thick-volumes.patch b/SOURCES/0151-fix-LinstorSR-support-VDI.resize-on-thick-volumes.patch similarity index 88% rename from SOURCES/0150-fix-LinstorSR-support-VDI.resize-on-thick-volumes.patch rename to SOURCES/0151-fix-LinstorSR-support-VDI.resize-on-thick-volumes.patch index 6eab74ea..44ab7fcf 100644 --- a/SOURCES/0150-fix-LinstorSR-support-VDI.resize-on-thick-volumes.patch +++ b/SOURCES/0151-fix-LinstorSR-support-VDI.resize-on-thick-volumes.patch @@ -1,7 +1,7 @@ -From 2eccb722153fe6c903839c0fe5ed329533c4c1c3 Mon Sep 17 00:00:00 2001 +From 13f341c188dae35cc64dbcaf6197c47e23dd4bd2 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 1 Dec 2023 11:55:12 +0100 -Subject: [PATCH 150/178] fix(LinstorSR): support VDI.resize on thick volumes +Subject: [PATCH 151/178] fix(LinstorSR): support VDI.resize on thick volumes --- drivers/LinstorSR.py | 3 +++ @@ -27,5 +27,5 @@ index 1d1b51a..a524338 100755 space_needed = new_volume_size - old_volume_size -- -2.45.2 +2.46.0 diff --git a/SOURCES/0151-fix-linstorvolumemanager-format-correctly-exception-.patch b/SOURCES/0152-fix-linstorvolumemanager-format-correctly-exception-.patch similarity index 88% rename from SOURCES/0151-fix-linstorvolumemanager-format-correctly-exception-.patch rename to SOURCES/0152-fix-linstorvolumemanager-format-correctly-exception-.patch index 3d431f17..082c66bb 100644 --- a/SOURCES/0151-fix-linstorvolumemanager-format-correctly-exception-.patch +++ b/SOURCES/0152-fix-linstorvolumemanager-format-correctly-exception-.patch @@ -1,7 +1,7 @@ -From af598434fde6668d79bbab53810f316e63d502a1 Mon Sep 17 00:00:00 2001 +From fc7ee546007b745d8bf5fd96bb039b782e57908b Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 4 Dec 2023 16:36:55 +0100 -Subject: [PATCH 151/178] fix(linstorvolumemanager): format correctly exception +Subject: [PATCH 152/178] fix(linstorvolumemanager): format correctly exception during db mount Signed-off-by: Ronan Abhamon @@ -26,5 +26,5 @@ index fef34d3..a41314e 100755 ) except Exception as e: -- -2.45.2 +2.46.0 diff --git a/SOURCES/0152-fix-LinstorSR-ensure-we-can-skip-coalesces-if-device.patch b/SOURCES/0153-fix-LinstorSR-ensure-we-can-skip-coalesces-if-device.patch similarity index 87% rename from SOURCES/0152-fix-LinstorSR-ensure-we-can-skip-coalesces-if-device.patch rename to SOURCES/0153-fix-LinstorSR-ensure-we-can-skip-coalesces-if-device.patch index b9eccd56..afd13740 100644 --- a/SOURCES/0152-fix-LinstorSR-ensure-we-can-skip-coalesces-if-device.patch +++ b/SOURCES/0153-fix-LinstorSR-ensure-we-can-skip-coalesces-if-device.patch @@ -1,7 +1,7 @@ -From dc34dd73b75ccfc06e85382114ea23da77834801 Mon Sep 17 00:00:00 2001 +From 3199098e8780e80ed57ee610c0f82f07d10be6c5 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 4 Dec 2023 18:57:08 +0100 -Subject: [PATCH 152/178] fix(LinstorSR): ensure we can skip coalesces if +Subject: [PATCH 153/178] fix(LinstorSR): ensure we can skip coalesces if device path can't be fetched Signed-off-by: Ronan Abhamon @@ -28,5 +28,5 @@ index 8635f48..8c16f68 100755 def _setHidden(self, hidden=True): -- -2.45.2 +2.46.0 diff --git a/SOURCES/0153-feat-linstor-manager-add-methods-to-modify-destroy-l.patch b/SOURCES/0154-feat-linstor-manager-add-methods-to-modify-destroy-l.patch similarity index 98% rename from SOURCES/0153-feat-linstor-manager-add-methods-to-modify-destroy-l.patch rename to SOURCES/0154-feat-linstor-manager-add-methods-to-modify-destroy-l.patch index 32ec1d29..d5288f56 100644 --- a/SOURCES/0153-feat-linstor-manager-add-methods-to-modify-destroy-l.patch +++ b/SOURCES/0154-feat-linstor-manager-add-methods-to-modify-destroy-l.patch @@ -1,7 +1,7 @@ -From 334eddd740c2d9891f7671799f9c8f55a51c1a8a Mon Sep 17 00:00:00 2001 +From fd6a07a09507abbfd51564bea77415cef56472e8 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 19 Dec 2023 14:49:33 +0100 -Subject: [PATCH 153/178] feat(linstor-manager): add methods to +Subject: [PATCH 154/178] feat(linstor-manager): add methods to modify/destroy/list net interfaces Signed-off-by: Ronan Abhamon @@ -251,5 +251,5 @@ index a41314e..32d1533 100755 def get_nodes_info(self): """ -- -2.45.2 +2.46.0 diff --git a/SOURCES/0154-fix-LinstorSR-force-a-defined-volume-prefix-if-we-ca.patch b/SOURCES/0155-fix-LinstorSR-force-a-defined-volume-prefix-if-we-ca.patch similarity index 80% rename from SOURCES/0154-fix-LinstorSR-force-a-defined-volume-prefix-if-we-ca.patch rename to SOURCES/0155-fix-LinstorSR-force-a-defined-volume-prefix-if-we-ca.patch index 5c2940a7..2b7589da 100644 --- a/SOURCES/0154-fix-LinstorSR-force-a-defined-volume-prefix-if-we-ca.patch +++ b/SOURCES/0155-fix-LinstorSR-force-a-defined-volume-prefix-if-we-ca.patch @@ -1,7 +1,7 @@ -From 1f5d49121421691a9dabbbb4e0d44025e3abde27 Mon Sep 17 00:00:00 2001 +From ab68cd45f930d47f051911a7bdb7ca8aad7d09fb Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 12 Jan 2024 10:28:20 +0100 -Subject: [PATCH 154/178] fix(LinstorSR): force a defined volume prefix if we +Subject: [PATCH 155/178] fix(LinstorSR): force a defined volume prefix if we can't import libs Signed-off-by: Ronan Abhamon @@ -23,5 +23,5 @@ index a524338..a73ae5a 100755 from lock import Lock -- -2.45.2 +2.46.0 diff --git a/SOURCES/0155-fix-LinstorSR-explicit-error-message-when-a-group-is.patch b/SOURCES/0156-fix-LinstorSR-explicit-error-message-when-a-group-is.patch similarity index 86% rename from SOURCES/0155-fix-LinstorSR-explicit-error-message-when-a-group-is.patch rename to SOURCES/0156-fix-LinstorSR-explicit-error-message-when-a-group-is.patch index 00c6ef0e..eeb64e04 100644 --- a/SOURCES/0155-fix-LinstorSR-explicit-error-message-when-a-group-is.patch +++ b/SOURCES/0156-fix-LinstorSR-explicit-error-message-when-a-group-is.patch @@ -1,7 +1,7 @@ -From 4ddcc31d0695b66e6135c2fe9d671d3059bfe720 Mon Sep 17 00:00:00 2001 +From b83d372cdf4f424289f542ecfe71744c2d186859 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 18 Jan 2024 10:24:01 +0100 -Subject: [PATCH 155/178] fix(LinstorSR): explicit error message when a group +Subject: [PATCH 156/178] fix(LinstorSR): explicit error message when a group is not unique during SR creation Signed-off-by: Ronan Abhamon @@ -25,5 +25,5 @@ index a73ae5a..fed1de2 100755 if srs: -- -2.45.2 +2.46.0 diff --git a/SOURCES/0156-fix-LinstorSR-make-sure-VDI.delete-doesn-t-throw-und.patch b/SOURCES/0157-fix-LinstorSR-make-sure-VDI.delete-doesn-t-throw-und.patch similarity index 94% rename from SOURCES/0156-fix-LinstorSR-make-sure-VDI.delete-doesn-t-throw-und.patch rename to SOURCES/0157-fix-LinstorSR-make-sure-VDI.delete-doesn-t-throw-und.patch index cf27340c..93c9fa9d 100644 --- a/SOURCES/0156-fix-LinstorSR-make-sure-VDI.delete-doesn-t-throw-und.patch +++ b/SOURCES/0157-fix-LinstorSR-make-sure-VDI.delete-doesn-t-throw-und.patch @@ -1,7 +1,7 @@ -From 8656be850cc50c29a8d9cfd17c9e9258c7809467 Mon Sep 17 00:00:00 2001 +From ce96408a3dda9b8d321e2f12723d28043a251237 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 18 Jan 2024 11:18:11 +0100 -Subject: [PATCH 156/178] fix(LinstorSR): make sure VDI.delete doesn't throw +Subject: [PATCH 157/178] fix(LinstorSR): make sure VDI.delete doesn't throw under specific conditions If we can update the volume state in the KV-store, there is no reason to raise @@ -66,5 +66,5 @@ index 32d1533..97e5372 100755 def lock_volume(self, volume_uuid, locked=True): """ -- -2.45.2 +2.46.0 diff --git a/SOURCES/0157-fix-LinstorSR-add-drbd-in-the-blacklist-of-multipath.patch b/SOURCES/0158-fix-LinstorSR-add-drbd-in-the-blacklist-of-multipath.patch similarity index 88% rename from SOURCES/0157-fix-LinstorSR-add-drbd-in-the-blacklist-of-multipath.patch rename to SOURCES/0158-fix-LinstorSR-add-drbd-in-the-blacklist-of-multipath.patch index 02666a64..e6f978d8 100644 --- a/SOURCES/0157-fix-LinstorSR-add-drbd-in-the-blacklist-of-multipath.patch +++ b/SOURCES/0158-fix-LinstorSR-add-drbd-in-the-blacklist-of-multipath.patch @@ -1,7 +1,7 @@ -From 35d2cfa162cb00a67d444a3ba8427842954523fe Mon Sep 17 00:00:00 2001 +From 30a3692573e79f371c2cf2b79c19b7cc02bc693f Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 19 Jan 2024 14:39:17 +0100 -Subject: [PATCH 157/178] fix(LinstorSR): add drbd in the blacklist of +Subject: [PATCH 158/178] fix(LinstorSR): add drbd in the blacklist of multipath.conf If DRBD is installed for the first time, and if the multipathd @@ -30,5 +30,5 @@ index c854b57..309bf2a 100644 # Leave this section in place even if empty blacklist_exceptions { -- -2.45.2 +2.46.0 diff --git a/SOURCES/0158-fix-linstorvolumemanager-create-cloned-volumes-on-ho.patch b/SOURCES/0159-fix-linstorvolumemanager-create-cloned-volumes-on-ho.patch similarity index 97% rename from SOURCES/0158-fix-linstorvolumemanager-create-cloned-volumes-on-ho.patch rename to SOURCES/0159-fix-linstorvolumemanager-create-cloned-volumes-on-ho.patch index 08c852f1..16175a9c 100644 --- a/SOURCES/0158-fix-linstorvolumemanager-create-cloned-volumes-on-ho.patch +++ b/SOURCES/0159-fix-linstorvolumemanager-create-cloned-volumes-on-ho.patch @@ -1,7 +1,7 @@ -From c14781d38cd6d00fbb0ac9511a9e5a4440698b6d Mon Sep 17 00:00:00 2001 +From 4edb24b82089ace930eb68beb69a6ab57714b04e Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 22 Jan 2024 11:25:25 +0100 -Subject: [PATCH 158/178] fix(linstorvolumemanager): create cloned volumes on +Subject: [PATCH 159/178] fix(linstorvolumemanager): create cloned volumes on host selected by LINSTOR Signed-off-by: Ronan Abhamon @@ -122,5 +122,5 @@ index 97e5372..5de86a1 100755 def remove_resourceless_volumes(self): """ -- -2.45.2 +2.46.0 diff --git a/SOURCES/0159-fix-linstorvolumemanager-don-t-align-volumes-on-LVM-.patch b/SOURCES/0160-fix-linstorvolumemanager-don-t-align-volumes-on-LVM-.patch similarity index 87% rename from SOURCES/0159-fix-linstorvolumemanager-don-t-align-volumes-on-LVM-.patch rename to SOURCES/0160-fix-linstorvolumemanager-don-t-align-volumes-on-LVM-.patch index a6353268..8167586f 100644 --- a/SOURCES/0159-fix-linstorvolumemanager-don-t-align-volumes-on-LVM-.patch +++ b/SOURCES/0160-fix-linstorvolumemanager-don-t-align-volumes-on-LVM-.patch @@ -1,7 +1,7 @@ -From 7edbc090f1dcfa2bcc63e669af81e14c11addc05 Mon Sep 17 00:00:00 2001 +From 09a32aefb00ff510ee3197dba69f1dfe1c40c81b Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 26 Jan 2024 15:29:21 +0100 -Subject: [PATCH 159/178] fix(linstorvolumemanager): don't align volumes on LVM +Subject: [PATCH 160/178] fix(linstorvolumemanager): don't align volumes on LVM sector size It's the goal of the LINSTOR stack to align properly on the LVM layer. @@ -28,5 +28,5 @@ index 5de86a1..7410fd7 100755 # List of volume properties. PROP_METADATA = 'metadata' -- -2.45.2 +2.46.0 diff --git a/SOURCES/0160-fix-linstorvolumemanager-assert-with-message-after-l.patch b/SOURCES/0161-fix-linstorvolumemanager-assert-with-message-after-l.patch similarity index 87% rename from SOURCES/0160-fix-linstorvolumemanager-assert-with-message-after-l.patch rename to SOURCES/0161-fix-linstorvolumemanager-assert-with-message-after-l.patch index 574164cb..21b5065e 100644 --- a/SOURCES/0160-fix-linstorvolumemanager-assert-with-message-after-l.patch +++ b/SOURCES/0161-fix-linstorvolumemanager-assert-with-message-after-l.patch @@ -1,7 +1,7 @@ -From 181e82b231f0abdb51594ec9c362c90dde80b31c Mon Sep 17 00:00:00 2001 +From bd36d8cc1077b88bf5257a91f270f84cf5261e64 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 5 Feb 2024 18:01:22 +0100 -Subject: [PATCH 160/178] fix(linstorvolumemanager): assert with message after +Subject: [PATCH 161/178] fix(linstorvolumemanager): assert with message after log in update_volume_uuid Signed-off-by: Ronan Abhamon @@ -29,5 +29,5 @@ index 7410fd7..5f2e06e 100755 self._ensure_volume_exists(volume_uuid) self.ensure_volume_is_not_locked(volume_uuid) -- -2.45.2 +2.46.0 diff --git a/SOURCES/0161-fix-linstorvolumemanager-retry-resize-if-volume-is-n.patch b/SOURCES/0162-fix-linstorvolumemanager-retry-resize-if-volume-is-n.patch similarity index 93% rename from SOURCES/0161-fix-linstorvolumemanager-retry-resize-if-volume-is-n.patch rename to SOURCES/0162-fix-linstorvolumemanager-retry-resize-if-volume-is-n.patch index 381f010e..bd602cd2 100644 --- a/SOURCES/0161-fix-linstorvolumemanager-retry-resize-if-volume-is-n.patch +++ b/SOURCES/0162-fix-linstorvolumemanager-retry-resize-if-volume-is-n.patch @@ -1,7 +1,7 @@ -From 0481bcd2232e87b4458ffaabeff3c9f40d4362f4 Mon Sep 17 00:00:00 2001 +From af5c06ba9a7d679ce82ed7a2dc0df96301a4994b Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 5 Feb 2024 23:13:06 +0100 -Subject: [PATCH 161/178] fix(linstorvolumemanager): retry resize if volume is +Subject: [PATCH 162/178] fix(linstorvolumemanager): retry resize if volume is not up to date Signed-off-by: Ronan Abhamon @@ -54,5 +54,5 @@ index 5f2e06e..79ac84a 100755 'Could not resize volume `{}` from SR `{}`: {}' .format(volume_uuid, self._group_name, error_str) -- -2.45.2 +2.46.0 diff --git a/SOURCES/0162-fix-LinstorSR-create-DRBD-diskless-if-necessary-for-.patch b/SOURCES/0163-fix-LinstorSR-create-DRBD-diskless-if-necessary-for-.patch similarity index 96% rename from SOURCES/0162-fix-LinstorSR-create-DRBD-diskless-if-necessary-for-.patch rename to SOURCES/0163-fix-LinstorSR-create-DRBD-diskless-if-necessary-for-.patch index 00596163..527fd5c3 100644 --- a/SOURCES/0162-fix-LinstorSR-create-DRBD-diskless-if-necessary-for-.patch +++ b/SOURCES/0163-fix-LinstorSR-create-DRBD-diskless-if-necessary-for-.patch @@ -1,7 +1,7 @@ -From eae3f5a79684319a75f65514d5b6c65e73ea4aee Mon Sep 17 00:00:00 2001 +From a3859a63b34c6e888c07ea4e5ec070ad94fd0aa8 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 6 Feb 2024 00:10:32 +0100 -Subject: [PATCH 162/178] fix(LinstorSR): create DRBD diskless if necessary for +Subject: [PATCH 163/178] fix(LinstorSR): create DRBD diskless if necessary for each VHD parent It's necessary to have all parents during snapshot to create a new VHD child. @@ -97,5 +97,5 @@ index 1e09e9b..53afbef 100755 -- -2.45.2 +2.46.0 diff --git a/SOURCES/0163-fix-LinstorSR-fix-bad-call-to-vhdutil.inflate-bad-ex.patch b/SOURCES/0164-fix-LinstorSR-fix-bad-call-to-vhdutil.inflate-bad-ex.patch similarity index 89% rename from SOURCES/0163-fix-LinstorSR-fix-bad-call-to-vhdutil.inflate-bad-ex.patch rename to SOURCES/0164-fix-LinstorSR-fix-bad-call-to-vhdutil.inflate-bad-ex.patch index e8fffafc..8b345540 100644 --- a/SOURCES/0163-fix-LinstorSR-fix-bad-call-to-vhdutil.inflate-bad-ex.patch +++ b/SOURCES/0164-fix-LinstorSR-fix-bad-call-to-vhdutil.inflate-bad-ex.patch @@ -1,7 +1,7 @@ -From 71f177ba5e1ddc71bd9acaad301849b62d719642 Mon Sep 17 00:00:00 2001 +From e21d3bc7b517bb790517e494f9e2eed18e9f3290 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 6 Feb 2024 00:14:11 +0100 -Subject: [PATCH 163/178] fix(LinstorSR): fix bad call to vhdutil.inflate + bad +Subject: [PATCH 164/178] fix(LinstorSR): fix bad call to vhdutil.inflate + bad exception Signed-off-by: Ronan Abhamon @@ -32,5 +32,5 @@ index 53afbef..de10f42 100755 try: self.sr._handle_interrupted_clone( -- -2.45.2 +2.46.0 diff --git a/SOURCES/0164-fix-LinstorSR-activate-VG-if-attach-from-config-is-a.patch b/SOURCES/0165-fix-LinstorSR-activate-VG-if-attach-from-config-is-a.patch similarity index 84% rename from SOURCES/0164-fix-LinstorSR-activate-VG-if-attach-from-config-is-a.patch rename to SOURCES/0165-fix-LinstorSR-activate-VG-if-attach-from-config-is-a.patch index 678f9e75..4f561983 100644 --- a/SOURCES/0164-fix-LinstorSR-activate-VG-if-attach-from-config-is-a.patch +++ b/SOURCES/0165-fix-LinstorSR-activate-VG-if-attach-from-config-is-a.patch @@ -1,7 +1,7 @@ -From 1340ce2e1ab70d2077294304a7de626cedef1302 Mon Sep 17 00:00:00 2001 +From adea9c192b43f438da3732188ed0ad05751179e6 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 12 Feb 2024 20:54:06 +0100 -Subject: [PATCH 164/178] fix(LinstorSR): activate VG if attach from config is +Subject: [PATCH 165/178] fix(LinstorSR): activate VG if attach from config is asked Signed-off-by: Ronan Abhamon @@ -23,5 +23,5 @@ index de10f42..b6b1529 100755 if not self._has_session: -- -2.45.2 +2.46.0 diff --git a/SOURCES/0165-feat-LinstorSR-use-a-specific-resource-group-for-DB-.patch b/SOURCES/0166-feat-LinstorSR-use-a-specific-resource-group-for-DB-.patch similarity index 99% rename from SOURCES/0165-feat-LinstorSR-use-a-specific-resource-group-for-DB-.patch rename to SOURCES/0166-feat-LinstorSR-use-a-specific-resource-group-for-DB-.patch index 436cdfbc..54748071 100644 --- a/SOURCES/0165-feat-LinstorSR-use-a-specific-resource-group-for-DB-.patch +++ b/SOURCES/0166-feat-LinstorSR-use-a-specific-resource-group-for-DB-.patch @@ -1,7 +1,7 @@ -From e3a1524d69685f7c48e3efc16cdfb69ae722d7cc Mon Sep 17 00:00:00 2001 +From 3227a0c30b0a58e4431cb80ab1b188b89a004a41 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 19 Mar 2024 23:09:54 +0100 -Subject: [PATCH 165/178] feat(LinstorSR): use a specific resource group for DB +Subject: [PATCH 166/178] feat(LinstorSR): use a specific resource group for DB and HA Signed-off-by: Ronan Abhamon @@ -517,5 +517,5 @@ index 79ac84a..4118a28 100755 raise LinstorVolumeManagerError( 'Failed to create volume `{}` from SR `{}`: {}'.format( -- -2.45.2 +2.46.0 diff --git a/SOURCES/0166-feat-linstor-manager-add-getNodePreferredInterface-h.patch b/SOURCES/0167-feat-linstor-manager-add-getNodePreferredInterface-h.patch similarity index 95% rename from SOURCES/0166-feat-linstor-manager-add-getNodePreferredInterface-h.patch rename to SOURCES/0167-feat-linstor-manager-add-getNodePreferredInterface-h.patch index a7b01928..26020c58 100644 --- a/SOURCES/0166-feat-linstor-manager-add-getNodePreferredInterface-h.patch +++ b/SOURCES/0167-feat-linstor-manager-add-getNodePreferredInterface-h.patch @@ -1,7 +1,7 @@ -From 3d704956a9624303b4258e9e9954396bdeb1a0c5 Mon Sep 17 00:00:00 2001 +From 99997af6173a0bd6ed59a0242657f162245aef91 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 15 Apr 2024 11:22:18 +0200 -Subject: [PATCH 166/178] feat(linstor-manager): add +Subject: [PATCH 167/178] feat(linstor-manager): add `getNodePreferredInterface` helper Signed-off-by: Ronan Abhamon @@ -72,5 +72,5 @@ index 4118a28..46c3283 100755 """ Set the preferred interface to use on a node. -- -2.45.2 +2.46.0 diff --git a/SOURCES/0167-fix-linstorvolumemanager-blocks-deletion-of-default-.patch b/SOURCES/0168-fix-linstorvolumemanager-blocks-deletion-of-default-.patch similarity index 87% rename from SOURCES/0167-fix-linstorvolumemanager-blocks-deletion-of-default-.patch rename to SOURCES/0168-fix-linstorvolumemanager-blocks-deletion-of-default-.patch index c8c2cb8c..9c0e4051 100644 --- a/SOURCES/0167-fix-linstorvolumemanager-blocks-deletion-of-default-.patch +++ b/SOURCES/0168-fix-linstorvolumemanager-blocks-deletion-of-default-.patch @@ -1,7 +1,7 @@ -From db37c5c68d38416de88a64c4cc1b70fd6971f8fb Mon Sep 17 00:00:00 2001 +From 5491fbc0f245095e62f83b78e3afcd76745cbe5e Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 15 Apr 2024 11:26:00 +0200 -Subject: [PATCH 167/178] fix(linstorvolumemanager): blocks deletion of default +Subject: [PATCH 168/178] fix(linstorvolumemanager): blocks deletion of default network interface Signed-off-by: Ronan Abhamon @@ -27,5 +27,5 @@ index 46c3283..02059d8 100755 errors = self._filter_errors(result) if errors: -- -2.45.2 +2.46.0 diff --git a/SOURCES/0168-feat-linstorvolumemanager-change-logic-of-get_resour.patch b/SOURCES/0169-feat-linstorvolumemanager-change-logic-of-get_resour.patch similarity index 96% rename from SOURCES/0168-feat-linstorvolumemanager-change-logic-of-get_resour.patch rename to SOURCES/0169-feat-linstorvolumemanager-change-logic-of-get_resour.patch index e75b291d..c9f83f6e 100644 --- a/SOURCES/0168-feat-linstorvolumemanager-change-logic-of-get_resour.patch +++ b/SOURCES/0169-feat-linstorvolumemanager-change-logic-of-get_resour.patch @@ -1,7 +1,7 @@ -From 91794049e90cbfa6997c27e1aa81dac3f460d0f3 Mon Sep 17 00:00:00 2001 +From 21788b7143fd9add8681f1a909c4eca1b18d2919 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 15 Apr 2024 17:56:47 +0200 -Subject: [PATCH 168/178] feat(linstorvolumemanager): change logic of +Subject: [PATCH 169/178] feat(linstorvolumemanager): change logic of `get_resources_info`: - Add a nested level "nodes" for each resource - Add a "uuid" attr on resources - Rename LINSTOR "uuid" to "linstor-uuid" - Optimize code @@ -100,5 +100,5 @@ index 02059d8..25c226a 100755 def get_database_path(self): -- -2.45.2 +2.46.0 diff --git a/SOURCES/0169-feat-linstor-manager-add-error-codes-to-healthCheck-.patch b/SOURCES/0170-feat-linstor-manager-add-error-codes-to-healthCheck-.patch similarity index 98% rename from SOURCES/0169-feat-linstor-manager-add-error-codes-to-healthCheck-.patch rename to SOURCES/0170-feat-linstor-manager-add-error-codes-to-healthCheck-.patch index 9a6a4266..06601a9e 100644 --- a/SOURCES/0169-feat-linstor-manager-add-error-codes-to-healthCheck-.patch +++ b/SOURCES/0170-feat-linstor-manager-add-error-codes-to-healthCheck-.patch @@ -1,7 +1,7 @@ -From a160b11630ccea5ce2d4799c98cc4fa3949d7ab7 Mon Sep 17 00:00:00 2001 +From d325b4d57656cb4e57225898dbe09c19d3a05737 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 18 Apr 2024 13:57:37 +0200 -Subject: [PATCH 169/178] feat(linstor-manager): add error codes to healthCheck +Subject: [PATCH 170/178] feat(linstor-manager): add error codes to healthCheck helper Signed-off-by: Ronan Abhamon @@ -247,5 +247,5 @@ index 25c226a..94d5c51 100755 'free-size': size, 'capacity': capacity -- -2.45.2 +2.46.0 diff --git a/SOURCES/0170-fix-LinstorSR-fix-bad-exception-reference-during-sna.patch b/SOURCES/0171-fix-LinstorSR-fix-bad-exception-reference-during-sna.patch similarity index 90% rename from SOURCES/0170-fix-LinstorSR-fix-bad-exception-reference-during-sna.patch rename to SOURCES/0171-fix-LinstorSR-fix-bad-exception-reference-during-sna.patch index f64f511e..46d89e73 100644 --- a/SOURCES/0170-fix-LinstorSR-fix-bad-exception-reference-during-sna.patch +++ b/SOURCES/0171-fix-LinstorSR-fix-bad-exception-reference-during-sna.patch @@ -1,7 +1,7 @@ -From 20a4fa3fc5932216a30a7b0e6e8fad292ae73859 Mon Sep 17 00:00:00 2001 +From d690c2a413af2e41bb81f55d32b646a7c48476ec Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 24 Apr 2024 15:10:49 +0200 -Subject: [PATCH 170/178] fix(LinstorSR): fix bad exception reference during +Subject: [PATCH 171/178] fix(LinstorSR): fix bad exception reference during snapshot Signed-off-by: Ronan Abhamon @@ -35,5 +35,5 @@ index 3421f79..3bd31e9 100755 raise xs_errors.XenError('VDIClone', opterr=str(e)) -- -2.45.2 +2.46.0 diff --git a/SOURCES/0172-fix-LVHDoISCSISR-disable-restart-of-ISCSI-daemon.patch b/SOURCES/0172-fix-LVHDoISCSISR-disable-restart-of-ISCSI-daemon.patch deleted file mode 100644 index 880f6131..00000000 --- a/SOURCES/0172-fix-LVHDoISCSISR-disable-restart-of-ISCSI-daemon.patch +++ /dev/null @@ -1,96 +0,0 @@ -From 09a03ec264af5ca874380c89aa9efaf6d6fe1b7e Mon Sep 17 00:00:00 2001 -From: Ronan Abhamon -Date: Fri, 26 Apr 2024 14:20:04 +0200 -Subject: [PATCH 172/178] fix(LVHDoISCSISR): disable restart of ISCSI daemon - -Signed-off-by: Ronan Abhamon ---- - drivers/LVHDoISCSISR.py | 2 ++ - tests/test_LVHDoISCSISR.py | 51 -------------------------------------- - 2 files changed, 2 insertions(+), 51 deletions(-) - -diff --git a/drivers/LVHDoISCSISR.py b/drivers/LVHDoISCSISR.py -index 1fa6f6f..da2c9ed 100755 ---- a/drivers/LVHDoISCSISR.py -+++ b/drivers/LVHDoISCSISR.py -@@ -553,6 +553,8 @@ class LVHDoISCSISR(LVHDSR.LVHDSR): - return out - - def check_sr(self, sr_uuid): -+ # Disable to prevent daemon restart. -+ return - """Hook to check SR health""" - pbdref = util.find_my_pbd(self.session, self.host_ref, self.sr_ref) - if pbdref: -diff --git a/tests/test_LVHDoISCSISR.py b/tests/test_LVHDoISCSISR.py -index ba668d0..c876ed8 100644 ---- a/tests/test_LVHDoISCSISR.py -+++ b/tests/test_LVHDoISCSISR.py -@@ -167,15 +167,6 @@ class TestLVHDoISCSISR(ISCSITestCase): - - super(TestLVHDoISCSISR, self).setUp() - -- @property -- def mock_baseiscsi(self): -- assert len(self.base_srs) == 1 -- single_sr = None -- for sr in self.base_srs: -- single_sr = sr -- -- return single_sr -- - def baseiscsi(self, srcmd, sr_uuid): - new_baseiscsi = mock.create_autospec(BaseISCSISR) - local_iqn = srcmd.dconf['localIQN'] -@@ -199,48 +190,6 @@ class TestLVHDoISCSISR(ISCSITestCase): - self.subject = LVHDoISCSISR.LVHDoISCSISR( - sr_cmd, self.sr_uuid) - -- def test_check_sr_pbd_not_found(self): -- # Arrange -- self.mock_util.find_my_pbd.return_value = None -- self.create_test_sr(self.create_sr_command()) -- -- # Act -- self.subject.check_sr(TEST_SR_UUID) -- -- # Assert -- self.mock_util.find_my_pbd.assert_called_with( -- self.mock_session, 'test_host', 'sr_ref') -- -- def test_check_sr_correct_sessions_count(self): -- # Arrange -- self.mock_util.find_my_pbd.return_value = 'my_pbd' -- self.mock_session.xenapi.PBD.get_other_config.return_value = { -- 'iscsi_sessions': 2 -- } -- self.create_test_sr(self.create_sr_command()) -- -- # Act -- self.subject.check_sr(TEST_SR_UUID) -- -- # Assert -- self.mock_session.xenapi.PBD.get_other_config.assert_called_with('my_pbd') -- -- def test_check_sr_not_enough_sessions(self): -- # Arrange -- self.mock_util.find_my_pbd.return_value = 'my_pbd' -- self.mock_session.xenapi.PBD.get_other_config.return_value = { -- 'iscsi_sessions': 1 -- } -- self.create_test_sr(self.create_sr_command()) -- -- # Act -- self.subject.check_sr(TEST_SR_UUID) -- -- # Assert -- self.mock_baseiscsi.attach.assert_called_with( -- TEST_SR_UUID -- ) -- - def test_sr_attach_multi_session(self): - # Arrange - self.mock_util.find_my_pbd.return_value = 'my_pbd' --- -2.45.2 - diff --git a/SOURCES/0171-fix-tapdisk-pause-ensure-LINSTOR-VHD-chain-is-availa.patch b/SOURCES/0172-fix-tapdisk-pause-ensure-LINSTOR-VHD-chain-is-availa.patch similarity index 97% rename from SOURCES/0171-fix-tapdisk-pause-ensure-LINSTOR-VHD-chain-is-availa.patch rename to SOURCES/0172-fix-tapdisk-pause-ensure-LINSTOR-VHD-chain-is-availa.patch index 3df67920..bbb9cd47 100644 --- a/SOURCES/0171-fix-tapdisk-pause-ensure-LINSTOR-VHD-chain-is-availa.patch +++ b/SOURCES/0172-fix-tapdisk-pause-ensure-LINSTOR-VHD-chain-is-availa.patch @@ -1,7 +1,7 @@ -From d701a62618ab66606731ce6db0424849ed8cdf9f Mon Sep 17 00:00:00 2001 +From e1343b31312142eced90f45ea0ade39a07e5a447 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 24 Apr 2024 17:29:26 +0200 -Subject: [PATCH 171/178] fix(tapdisk-pause): ensure LINSTOR VHD chain is +Subject: [PATCH 172/178] fix(tapdisk-pause): ensure LINSTOR VHD chain is available Signed-off-by: Ronan Abhamon @@ -155,5 +155,5 @@ index e0bca7b..c316cdf 100755 if realpath != device_path: util.SMlog( -- -2.45.2 +2.46.0 diff --git a/SOURCES/0173-fix-linstorvhdutil-retry-check-on-another-machine-in.patch b/SOURCES/0173-fix-linstorvhdutil-retry-check-on-another-machine-in.patch index a1fed1cd..4f39ecc1 100644 --- a/SOURCES/0173-fix-linstorvhdutil-retry-check-on-another-machine-in.patch +++ b/SOURCES/0173-fix-linstorvhdutil-retry-check-on-another-machine-in.patch @@ -1,4 +1,4 @@ -From fa482bd8394f3ebd72f87aa1bae76b03c14ca120 Mon Sep 17 00:00:00 2001 +From bee9bb828530924b8596135b70bb38092ef5cf8f Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 6 May 2024 18:15:00 +0200 Subject: [PATCH 173/178] fix(linstorvhdutil): retry check on another machine @@ -72,5 +72,5 @@ index 17b7790..fd2bc8b 100644 return distutils.util.strtobool(response) -- -2.45.2 +2.46.0 diff --git a/SOURCES/0174-fix-LinstorSR-explicit-errors-when-database-path-is-.patch b/SOURCES/0174-fix-LinstorSR-explicit-errors-when-database-path-is-.patch index fccb363a..9b5e01dc 100644 --- a/SOURCES/0174-fix-LinstorSR-explicit-errors-when-database-path-is-.patch +++ b/SOURCES/0174-fix-LinstorSR-explicit-errors-when-database-path-is-.patch @@ -1,4 +1,4 @@ -From cbd05b772d0510be31296bfc09cda7389dc796fd Mon Sep 17 00:00:00 2001 +From 3aba57e6ea4f6826b5164b97971099d8196c8d3e Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 6 May 2024 21:35:36 +0200 Subject: [PATCH 174/178] fix(LinstorSR): explicit errors when database path is @@ -45,5 +45,5 @@ index 94d5c51..948d45d 100755 ) -- -2.45.2 +2.46.0 diff --git a/SOURCES/0175-fix-LinstorSR-Misc-fixes-on-destroy.patch b/SOURCES/0175-fix-LinstorSR-Misc-fixes-on-destroy.patch index a1482987..9bbe3984 100644 --- a/SOURCES/0175-fix-LinstorSR-Misc-fixes-on-destroy.patch +++ b/SOURCES/0175-fix-LinstorSR-Misc-fixes-on-destroy.patch @@ -1,4 +1,4 @@ -From 318460ff8dfccafc928dfc12de211b2336da3386 Mon Sep 17 00:00:00 2001 +From e65ad0c6669174d90ab356f171d5aa121da8eca1 Mon Sep 17 00:00:00 2001 From: Damien Thenot Date: Tue, 30 Apr 2024 15:38:34 +0200 Subject: [PATCH 175/178] fix(LinstorSR): Misc fixes on destroy @@ -132,5 +132,5 @@ index 948d45d..103f91b 100755 util.SMlog( 'Ignoring failure after LINSTOR SR destruction: {}' -- -2.45.2 +2.46.0 diff --git a/SOURCES/0176-fix-LinstorSR-open-non-leaf-volumes-in-RO-mode-creat.patch b/SOURCES/0176-fix-LinstorSR-open-non-leaf-volumes-in-RO-mode-creat.patch index cb8f32a9..61a99441 100644 --- a/SOURCES/0176-fix-LinstorSR-open-non-leaf-volumes-in-RO-mode-creat.patch +++ b/SOURCES/0176-fix-LinstorSR-open-non-leaf-volumes-in-RO-mode-creat.patch @@ -1,4 +1,4 @@ -From 8c6fe4981a647aa087a91d76ecc9fe5d4f94b082 Mon Sep 17 00:00:00 2001 +From 8901bc318ee16f7eba20dc6ad2ea735610f73c41 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 20 Jun 2024 22:37:40 +0200 Subject: [PATCH 176/178] fix(LinstorSR): open non-leaf volumes in RO mode @@ -81,5 +81,5 @@ index fd2bc8b..7f8efa1 100644 return leaf_vdi_path -- -2.45.2 +2.46.0 diff --git a/SOURCES/0177-fix-LinstorSR-ensure-_is_master-is-always-set.patch b/SOURCES/0177-fix-LinstorSR-ensure-_is_master-is-always-set.patch index 5fcbd761..65e5df1f 100644 --- a/SOURCES/0177-fix-LinstorSR-ensure-_is_master-is-always-set.patch +++ b/SOURCES/0177-fix-LinstorSR-ensure-_is_master-is-always-set.patch @@ -1,4 +1,4 @@ -From 56fd6bfd862670262c52d2722ac506c276a12d56 Mon Sep 17 00:00:00 2001 +From 8434a428d51849320db4b42e528501d283d495ac Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 26 Jul 2024 11:32:20 +0200 Subject: [PATCH 177/178] fix(LinstorSR): ensure `_is_master` is always set @@ -154,5 +154,5 @@ index 2127057..fdcad17 100755 # or diskful available to init HA. # It also avoid this error in xensource.log -- -2.45.2 +2.46.0 diff --git a/SOURCES/0178-fix-linstor-check-if-resource-is-tiebreaker-62.patch b/SOURCES/0178-fix-linstor-check-if-resource-is-tiebreaker-62.patch index 0fbf0fb6..b5f83e7a 100644 --- a/SOURCES/0178-fix-linstor-check-if-resource-is-tiebreaker-62.patch +++ b/SOURCES/0178-fix-linstor-check-if-resource-is-tiebreaker-62.patch @@ -1,4 +1,4 @@ -From 35038d57307463634f18aab89c0c5716184ba9ee Mon Sep 17 00:00:00 2001 +From 9207abe1f2e1ff1795cdba1a0aeb76574412a583 Mon Sep 17 00:00:00 2001 From: Damien Thenot Date: Fri, 26 Jul 2024 14:13:05 +0200 Subject: [PATCH 178/178] fix(linstor): check if resource is tiebreaker (#62) @@ -31,5 +31,5 @@ index 103f91b..8bfd1c1 100755 node_name=node_name, rsc_name=volume_name ) -- -2.45.2 +2.46.0 diff --git a/SOURCES/stormi.patch b/SOURCES/stormi.patch deleted file mode 100644 index 9e5afd53..00000000 --- a/SOURCES/stormi.patch +++ /dev/null @@ -1,37 +0,0 @@ -diff --git a/Makefile b/Makefile -index e96e64e..3e06e51 100755 ---- a/Makefile -+++ b/Makefile -@@ -63,6 +63,7 @@ SM_LIBS += sr_health_check - 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 -@@ -78,6 +79,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/ -@@ -130,6 +132,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) -@@ -147,6 +150,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 \ diff --git a/SPECS/sm.spec b/SPECS/sm.spec index 3a4909db..debd1f04 100644 --- a/SPECS/sm.spec +++ b/SPECS/sm.spec @@ -11,7 +11,7 @@ Summary: sm - XCP storage managers Name: sm Version: 2.30.8 -Release: %{?xsrel}.1.0.linstor.4%{?dist} +Release: %{?xsrel}.2.0.linstor.1%{?dist} Group: System/Hypervisor License: LGPL URL: https://github.com/xapi-project/sm @@ -119,155 +119,155 @@ Patch1020: 0020-Backport-NFS4-only-support.patch Patch1021: 0021-Backport-probe-for-NFS4-when-rpcinfo-does-not-includ.patch Patch1022: 0022-feat-LargeBlock-backport-of-largeblocksr-51-55.patch Patch1023: 0023-feat-LVHDSR-add-a-way-to-modify-config-of-LVMs-56.patch -Patch1024: 0024-Fix-timeout_call-alarm-must-be-reset-in-case-of-succ.patch -Patch1025: 0025-timeout_call-returns-the-result-of-user-function-now.patch -Patch1026: 0026-Always-remove-the-pause-tag-from-VDIs-in-case-of-fai.patch -Patch1027: 0027-fix-LinstorSR-repair-volumes-only-if-an-exclusive-co.patch -Patch1028: 0028-feat-LinstorSR-Improve-LINSTOR-performance.patch -Patch1029: 0029-feat-LinstorSR-robustify-scan-to-avoid-losing-VDIs-i.patch -Patch1030: 0030-feat-LinstorSR-display-a-correctly-readable-size-for.patch -Patch1031: 0031-feat-linstor-monitord-scan-all-LINSTOR-SRs-every-12-.patch -Patch1032: 0032-fix-LinstorSR-call-correctly-method-in-_locked_load-.patch -Patch1033: 0033-feat-LinstorSR-integrate-minidrbdcluster-daemon.patch -Patch1034: 0034-feat-LinstorSR-ensure-heartbeat-and-redo_log-VDIs-ar.patch -Patch1035: 0035-feat-LinstorSR-protect-sr-commands-to-avoid-forgetti.patch -Patch1036: 0036-fix-LinstorJournaler-ensure-uri-is-not-None-during-l.patch -Patch1037: 0037-feat-LinstorSR-add-an-option-to-disable-auto-quorum-.patch -Patch1038: 0038-fix-LinstorVolumeManager-add-a-workaround-to-create-.patch -Patch1039: 0039-feat-LinstorSR-add-optional-ips-parameter.patch -Patch1040: 0040-feat-LinstorSR-add-a-helper-log_drbd_erofs-to-trace-.patch -Patch1041: 0041-fix-LinstorSR-try-to-restart-the-services-again-if-t.patch -Patch1042: 0042-fix-LinstorSR-robustify-linstor-manager-to-never-inc.patch -Patch1043: 0043-fix-LinstorSR-prevent-starting-controller-during-fai.patch -Patch1044: 0044-feat-LinstorVolumeManager-increase-peer-slots-limit-.patch -Patch1045: 0045-feat-LinstorVolumeManager-add-a-fallback-to-find-con.patch -Patch1046: 0046-fix-var-lib-linstor.mount-ensure-we-always-mount-dat.patch -Patch1047: 0047-feat-LinstorVolumeManager-add-a-fallback-to-find-nod.patch -Patch1048: 0048-feat-LinstorSR-explain-on-which-host-plugins-command.patch -Patch1049: 0049-fix-LinstorSR-create-diskless-path-if-necessary-duri.patch -Patch1050: 0050-feat-LinstorSR-use-HTTP-NBD-instead-of-DRBD-directly.patch -Patch1051: 0051-fix-LinstorSR-find-controller-when-XAPI-unreachable-.patch -Patch1052: 0052-fix-LinstorSR-use-IPs-instead-of-hostnames-in-NBD-se.patch -Patch1053: 0053-fix-LinstorVolumeManager-ensure-we-always-use-IPs-in.patch -Patch1054: 0054-feat-linstor-manager-add-methods-to-add-remove-host-.patch -Patch1055: 0055-feat-LinstorVolumeManager-support-SR-creation-with-d.patch -Patch1056: 0056-feat-LinstorSR-add-a-config-var-to-disable-HTTP-NBD-.patch -Patch1057: 0057-feat-LinstorSr-ensure-LVM-group-is-activated-during-.patch -Patch1058: 0058-feat-linstor-manager-add-method-to-create-LinstorSR-.patch -Patch1059: 0059-fix-LinstorSR-always-set-vdi_path-in-generate_config.patch -Patch1060: 0060-fix-minidrbdcluster-supports-new-properties-like-for.patch -Patch1061: 0061-fix-LinstorSR-enabled-disable-minidrbcluster-with-fi.patch -Patch1062: 0062-fix-linstor-manager-change-linstor-satellite-start-b.patch -Patch1063: 0063-Fix-is_open-call-for-LinstorSR.patch -Patch1064: 0064-fix-linstorvhdutil-fix-boolean-params-of-check-call.patch -Patch1065: 0065-feat-linstor-manager-robustify-exec_create_sr.patch -Patch1066: 0066-fix-cleanup-print-LINSTOR-VDI-UUID-if-error-during-i.patch -Patch1067: 0067-feat-cleanup-raise-and-dump-DRBD-openers-in-case-of-.patch -Patch1068: 0068-feat-linstorvhdutil-trace-DRBD-openers-in-case-of-ER.patch -Patch1069: 0069-fix-linstorvolumemanager-compute-correctly-size-in-a.patch -Patch1070: 0070-feat-LinstorSR-use-DRBD-openers-instead-of-lsof-to-l.patch -Patch1071: 0071-feat-LinstorSR-support-cProfile-to-trace-calls-when-.patch -Patch1072: 0072-fix-LinstorJournaler-reset-namespace-when-get-is-cal.patch -Patch1073: 0073-fix-linstorvhdutil-fix-coalesce-with-VM-running-unde.patch -Patch1074: 0074-fix-linstorvolumemanager-_get_volumes_info-doesn-t-r.patch -Patch1075: 0075-fix-linstorvolumemanager-remove-double-prefix-on-kv-.patch -Patch1076: 0076-feat-LinstorSR-add-linstor-kv-dump-helper-to-print-k.patch -Patch1077: 0077-fix-LinstorSR-disable-VHD-key-hash-usage-to-limit-ex.patch -Patch1078: 0078-fix-minidrbdcluster-ensure-SIGINT-is-handled-correct.patch -Patch1079: 0079-feat-minidrbdcluster-stop-resource-services-at-start.patch -Patch1080: 0080-feat-linstor-manager-add-new-healthCheck-function-to.patch -Patch1081: 0081-fix-LinstorSR-fix-xha-conf-parsing-return-host-ip-no.patch -Patch1082: 0082-fix-LinstorSR-start-correctly-HA-servers-HTTP-NBD-af.patch -Patch1083: 0083-fix-linstorvolumemanager-use-an-array-to-store-diskf.patch -Patch1084: 0084-feat-linstorvolumemanager-support-snaps-when-a-host-.patch -Patch1085: 0085-fix-linstorvolumemanager-support-offline-hosts-when-.patch -Patch1086: 0086-fix-linstorvolumemanager-define-_base_group_name-mem.patch -Patch1087: 0087-feat-linstorvhdutil-modify-logic-of-local-vhdutil-ca.patch -Patch1088: 0088-fix-linstorvolumemanager-robustify-failed-snapshots.patch -Patch1089: 0089-fix-linstorvolumemanager-use-a-namespace-for-volumes.patch -Patch1090: 0090-feat-linstor-kv-dump-rename-to-linstor-kv-tool-add-r.patch -Patch1091: 0091-fix-LinstorSR-handle-correctly-localhost-during-star.patch -Patch1092: 0092-fix-cleanup.py-call-repair-on-another-host-when-EROF.patch -Patch1093: 0093-fix-LinstorSR-avoid-introduction-of-DELETED-volumes.patch -Patch1094: 0094-feat-linstor-kv-tool-remove-all-volumes-supports-jou.patch -Patch1095: 0095-fix-linstorvhdutil-due-to-bad-refactoring-check-call.patch -Patch1096: 0096-feat-linstorvhdutil-ensure-we-use-VHD-parent-to-find.patch -Patch1097: 0097-feat-linstorvolumemanager-force-DRBD-demote-after-fa.patch -Patch1098: 0098-fix-linstorvhdutil-ensure-we-retry-creation-in-all-s.patch -Patch1099: 0099-fix-linstorvhdutil-don-t-retry-local-vhdutil-call-wh.patch -Patch1100: 0100-feat-fork-log-daemon-ignore-SIGTERM.patch -Patch1101: 0101-feat-LinstorSR-wait-for-http-disk-server-startup.patch -Patch1102: 0102-fix-LinstorSR-handle-inflate-resize-actions-correctl.patch -Patch1103: 0103-fix-linstor-manager-add-a-static-iptables-rule-for-D.patch -Patch1104: 0104-feat-LinstorSR-sync-with-last-http-nbd-transfer-vers.patch -Patch1105: 0105-fix-LinstorSR-don-t-check-VDI-metadata-while-listing.patch -Patch1106: 0106-fix-LinstorSR-don-t-check-metadata-when-destroying-s.patch -Patch1107: 0107-fix-linstorvhdutil-handle-correctly-generic-exceptio.patch -Patch1108: 0108-fix-minidrbdcluster-robustify-to-unmount-correctly-L.patch -Patch1109: 0109-fix-minidrbdcluster-handle-correctly-KeyboardInterru.patch -Patch1110: 0110-feat-LinstorSR-use-drbd-reactor-instead-of-minidrbdc.patch -Patch1111: 0111-fix-LinstorSR-ensure-vhdutil-calls-are-correctly-exe.patch -Patch1112: 0112-fix-LinstorSR-replace-bad-param-in-detach_thin-impl.patch -Patch1113: 0113-fix-linstorvolumemanager-remove-usage-of-realpath.patch -Patch1114: 0114-fix-linstorvhdutil-avoid-parent-path-resolution.patch -Patch1115: 0115-fix-LinstorSR-create-parent-path-during-attach.patch -Patch1116: 0116-fix-LinstorSR-retry-if-we-can-t-build-volume-cache.patch -Patch1117: 0117-fix-linstorvolumemanager-reduce-peer-slots-param-to-.patch -Patch1118: 0118-fix-LinstorSR-attach-a-valid-XAPI-session-is_open-is.patch -Patch1119: 0119-fix-LinstorSR-ensure-we-always-have-a-DRBD-path-to-s.patch -Patch1120: 0120-fix-LinstorSR-remove-hosts-ips-param.patch -Patch1121: 0121-fix-LinstorSR-compute-correctly-SR-size-using-pool-c.patch -Patch1122: 0122-fix-blktap2-ensure-we-can-import-this-module-when-LI.patch -Patch1123: 0123-fix-LinstorSR-ensure-volume-cache-can-be-recreated.patch -Patch1124: 0124-fix-linstor-manager-remove-dead-useless-code-in-add-.patch -Patch1125: 0125-fix-LinstorSR-Ensure-we-always-have-a-device-path-du.patch -Patch1126: 0126-fix-LinstorSR-always-use-lock.acquire-during-attach-.patch -Patch1127: 0127-fix-LinstorSR-mare-sure-hostnames-are-unique-at-SR-c.patch -Patch1128: 0128-fix-LinstorSR-ensure-we-can-attach-non-special-stati.patch -Patch1129: 0129-fix-LinstorSR-ensure-we-can-detach-when-deflate-call.patch -Patch1130: 0130-fix-LinstorSR-assume-VDI-is-always-a-VHD-when-the-in.patch -Patch1131: 0131-fix-LinstorSR-remove-SR-lock-during-thin-attach-deta.patch -Patch1132: 0132-fix-LinstorSR-ensure-database-is-mounted-during-scan.patch -Patch1133: 0133-fix-LinstorSR-restart-drbd-reactor-in-case-of-failur.patch -Patch1134: 0134-fix-linstorvolumemanager-retry-in-case-of-failure-du.patch -Patch1135: 0135-fix-linstorvolumemanager-avoid-diskless-creation-whe.patch -Patch1136: 0136-fix-LinstorSR-remove-diskless-after-VDI.detach-calls.patch -Patch1137: 0137-fix-LinstorSR-robustify-_load_vdi_info-in-cleanup.py.patch -Patch1138: 0138-fix-LinstorSR-ensure-detach-never-fails-on-plugin-fa.patch -Patch1139: 0139-fix-LinstorSR-ensure-we-coalesce-only-volumes-with-a.patch -Patch1140: 0140-fix-LinstorSR-don-t-try-to-repair-persistent-volumes.patch -Patch1141: 0141-fix-linstorvhdutil-format-correctly-message-if-vhd-u.patch -Patch1142: 0142-fix-LinstorSR-wait-during-attach-to-open-DRBD-path.patch -Patch1143: 0143-fix-LinstorSR-support-different-volume-sizes-in-clea.patch -Patch1144: 0144-fix-LinstorSR-remove-useless-IPS_XHA_CACHE-var.patch -Patch1145: 0145-fix-LinstorSR-ensure-we-can-deflate-on-any-host-afte.patch -Patch1146: 0146-fix-LinstorSR-ensure-we-always-use-real-DRBD-VHD-siz.patch -Patch1147: 0147-feat-linstor-kv-tool-If-no-controller-uri-option-is-.patch -Patch1148: 0148-fix-linstorvolumemanager-robustify-SR-destroy-46.patch -Patch1149: 0149-feat-linstor-manager-extend-API-with-createNodeInter.patch -Patch1150: 0150-fix-LinstorSR-support-VDI.resize-on-thick-volumes.patch -Patch1151: 0151-fix-linstorvolumemanager-format-correctly-exception-.patch -Patch1152: 0152-fix-LinstorSR-ensure-we-can-skip-coalesces-if-device.patch -Patch1153: 0153-feat-linstor-manager-add-methods-to-modify-destroy-l.patch -Patch1154: 0154-fix-LinstorSR-force-a-defined-volume-prefix-if-we-ca.patch -Patch1155: 0155-fix-LinstorSR-explicit-error-message-when-a-group-is.patch -Patch1156: 0156-fix-LinstorSR-make-sure-VDI.delete-doesn-t-throw-und.patch -Patch1157: 0157-fix-LinstorSR-add-drbd-in-the-blacklist-of-multipath.patch -Patch1158: 0158-fix-linstorvolumemanager-create-cloned-volumes-on-ho.patch -Patch1159: 0159-fix-linstorvolumemanager-don-t-align-volumes-on-LVM-.patch -Patch1160: 0160-fix-linstorvolumemanager-assert-with-message-after-l.patch -Patch1161: 0161-fix-linstorvolumemanager-retry-resize-if-volume-is-n.patch -Patch1162: 0162-fix-LinstorSR-create-DRBD-diskless-if-necessary-for-.patch -Patch1163: 0163-fix-LinstorSR-fix-bad-call-to-vhdutil.inflate-bad-ex.patch -Patch1164: 0164-fix-LinstorSR-activate-VG-if-attach-from-config-is-a.patch -Patch1165: 0165-feat-LinstorSR-use-a-specific-resource-group-for-DB-.patch -Patch1166: 0166-feat-linstor-manager-add-getNodePreferredInterface-h.patch -Patch1167: 0167-fix-linstorvolumemanager-blocks-deletion-of-default-.patch -Patch1168: 0168-feat-linstorvolumemanager-change-logic-of-get_resour.patch -Patch1169: 0169-feat-linstor-manager-add-error-codes-to-healthCheck-.patch -Patch1170: 0170-fix-LinstorSR-fix-bad-exception-reference-during-sna.patch -Patch1171: 0171-fix-tapdisk-pause-ensure-LINSTOR-VHD-chain-is-availa.patch -Patch1172: 0172-fix-LVHDoISCSISR-disable-restart-of-ISCSI-daemon.patch +Patch1024: 0024-Revert-CA-379329-check-for-missing-iSCSI-sessions-an.patch +Patch1025: 0025-Fix-timeout_call-alarm-must-be-reset-in-case-of-succ.patch +Patch1026: 0026-timeout_call-returns-the-result-of-user-function-now.patch +Patch1027: 0027-Always-remove-the-pause-tag-from-VDIs-in-case-of-fai.patch +Patch1028: 0028-fix-LinstorSR-repair-volumes-only-if-an-exclusive-co.patch +Patch1029: 0029-feat-LinstorSR-Improve-LINSTOR-performance.patch +Patch1030: 0030-feat-LinstorSR-robustify-scan-to-avoid-losing-VDIs-i.patch +Patch1031: 0031-feat-LinstorSR-display-a-correctly-readable-size-for.patch +Patch1032: 0032-feat-linstor-monitord-scan-all-LINSTOR-SRs-every-12-.patch +Patch1033: 0033-fix-LinstorSR-call-correctly-method-in-_locked_load-.patch +Patch1034: 0034-feat-LinstorSR-integrate-minidrbdcluster-daemon.patch +Patch1035: 0035-feat-LinstorSR-ensure-heartbeat-and-redo_log-VDIs-ar.patch +Patch1036: 0036-feat-LinstorSR-protect-sr-commands-to-avoid-forgetti.patch +Patch1037: 0037-fix-LinstorJournaler-ensure-uri-is-not-None-during-l.patch +Patch1038: 0038-feat-LinstorSR-add-an-option-to-disable-auto-quorum-.patch +Patch1039: 0039-fix-LinstorVolumeManager-add-a-workaround-to-create-.patch +Patch1040: 0040-feat-LinstorSR-add-optional-ips-parameter.patch +Patch1041: 0041-feat-LinstorSR-add-a-helper-log_drbd_erofs-to-trace-.patch +Patch1042: 0042-fix-LinstorSR-try-to-restart-the-services-again-if-t.patch +Patch1043: 0043-fix-LinstorSR-robustify-linstor-manager-to-never-inc.patch +Patch1044: 0044-fix-LinstorSR-prevent-starting-controller-during-fai.patch +Patch1045: 0045-feat-LinstorVolumeManager-increase-peer-slots-limit-.patch +Patch1046: 0046-feat-LinstorVolumeManager-add-a-fallback-to-find-con.patch +Patch1047: 0047-fix-var-lib-linstor.mount-ensure-we-always-mount-dat.patch +Patch1048: 0048-feat-LinstorVolumeManager-add-a-fallback-to-find-nod.patch +Patch1049: 0049-feat-LinstorSR-explain-on-which-host-plugins-command.patch +Patch1050: 0050-fix-LinstorSR-create-diskless-path-if-necessary-duri.patch +Patch1051: 0051-feat-LinstorSR-use-HTTP-NBD-instead-of-DRBD-directly.patch +Patch1052: 0052-fix-LinstorSR-find-controller-when-XAPI-unreachable-.patch +Patch1053: 0053-fix-LinstorSR-use-IPs-instead-of-hostnames-in-NBD-se.patch +Patch1054: 0054-fix-LinstorVolumeManager-ensure-we-always-use-IPs-in.patch +Patch1055: 0055-feat-linstor-manager-add-methods-to-add-remove-host-.patch +Patch1056: 0056-feat-LinstorVolumeManager-support-SR-creation-with-d.patch +Patch1057: 0057-feat-LinstorSR-add-a-config-var-to-disable-HTTP-NBD-.patch +Patch1058: 0058-feat-LinstorSr-ensure-LVM-group-is-activated-during-.patch +Patch1059: 0059-feat-linstor-manager-add-method-to-create-LinstorSR-.patch +Patch1060: 0060-fix-LinstorSR-always-set-vdi_path-in-generate_config.patch +Patch1061: 0061-fix-minidrbdcluster-supports-new-properties-like-for.patch +Patch1062: 0062-fix-LinstorSR-enabled-disable-minidrbcluster-with-fi.patch +Patch1063: 0063-fix-linstor-manager-change-linstor-satellite-start-b.patch +Patch1064: 0064-Fix-is_open-call-for-LinstorSR.patch +Patch1065: 0065-fix-linstorvhdutil-fix-boolean-params-of-check-call.patch +Patch1066: 0066-feat-linstor-manager-robustify-exec_create_sr.patch +Patch1067: 0067-fix-cleanup-print-LINSTOR-VDI-UUID-if-error-during-i.patch +Patch1068: 0068-feat-cleanup-raise-and-dump-DRBD-openers-in-case-of-.patch +Patch1069: 0069-feat-linstorvhdutil-trace-DRBD-openers-in-case-of-ER.patch +Patch1070: 0070-fix-linstorvolumemanager-compute-correctly-size-in-a.patch +Patch1071: 0071-feat-LinstorSR-use-DRBD-openers-instead-of-lsof-to-l.patch +Patch1072: 0072-feat-LinstorSR-support-cProfile-to-trace-calls-when-.patch +Patch1073: 0073-fix-LinstorJournaler-reset-namespace-when-get-is-cal.patch +Patch1074: 0074-fix-linstorvhdutil-fix-coalesce-with-VM-running-unde.patch +Patch1075: 0075-fix-linstorvolumemanager-_get_volumes_info-doesn-t-r.patch +Patch1076: 0076-fix-linstorvolumemanager-remove-double-prefix-on-kv-.patch +Patch1077: 0077-feat-LinstorSR-add-linstor-kv-dump-helper-to-print-k.patch +Patch1078: 0078-fix-LinstorSR-disable-VHD-key-hash-usage-to-limit-ex.patch +Patch1079: 0079-fix-minidrbdcluster-ensure-SIGINT-is-handled-correct.patch +Patch1080: 0080-feat-minidrbdcluster-stop-resource-services-at-start.patch +Patch1081: 0081-feat-linstor-manager-add-new-healthCheck-function-to.patch +Patch1082: 0082-fix-LinstorSR-fix-xha-conf-parsing-return-host-ip-no.patch +Patch1083: 0083-fix-LinstorSR-start-correctly-HA-servers-HTTP-NBD-af.patch +Patch1084: 0084-fix-linstorvolumemanager-use-an-array-to-store-diskf.patch +Patch1085: 0085-feat-linstorvolumemanager-support-snaps-when-a-host-.patch +Patch1086: 0086-fix-linstorvolumemanager-support-offline-hosts-when-.patch +Patch1087: 0087-fix-linstorvolumemanager-define-_base_group_name-mem.patch +Patch1088: 0088-feat-linstorvhdutil-modify-logic-of-local-vhdutil-ca.patch +Patch1089: 0089-fix-linstorvolumemanager-robustify-failed-snapshots.patch +Patch1090: 0090-fix-linstorvolumemanager-use-a-namespace-for-volumes.patch +Patch1091: 0091-feat-linstor-kv-dump-rename-to-linstor-kv-tool-add-r.patch +Patch1092: 0092-fix-LinstorSR-handle-correctly-localhost-during-star.patch +Patch1093: 0093-fix-cleanup.py-call-repair-on-another-host-when-EROF.patch +Patch1094: 0094-fix-LinstorSR-avoid-introduction-of-DELETED-volumes.patch +Patch1095: 0095-feat-linstor-kv-tool-remove-all-volumes-supports-jou.patch +Patch1096: 0096-fix-linstorvhdutil-due-to-bad-refactoring-check-call.patch +Patch1097: 0097-feat-linstorvhdutil-ensure-we-use-VHD-parent-to-find.patch +Patch1098: 0098-feat-linstorvolumemanager-force-DRBD-demote-after-fa.patch +Patch1099: 0099-fix-linstorvhdutil-ensure-we-retry-creation-in-all-s.patch +Patch1100: 0100-fix-linstorvhdutil-don-t-retry-local-vhdutil-call-wh.patch +Patch1101: 0101-feat-fork-log-daemon-ignore-SIGTERM.patch +Patch1102: 0102-feat-LinstorSR-wait-for-http-disk-server-startup.patch +Patch1103: 0103-fix-LinstorSR-handle-inflate-resize-actions-correctl.patch +Patch1104: 0104-fix-linstor-manager-add-a-static-iptables-rule-for-D.patch +Patch1105: 0105-feat-LinstorSR-sync-with-last-http-nbd-transfer-vers.patch +Patch1106: 0106-fix-LinstorSR-don-t-check-VDI-metadata-while-listing.patch +Patch1107: 0107-fix-LinstorSR-don-t-check-metadata-when-destroying-s.patch +Patch1108: 0108-fix-linstorvhdutil-handle-correctly-generic-exceptio.patch +Patch1109: 0109-fix-minidrbdcluster-robustify-to-unmount-correctly-L.patch +Patch1110: 0110-fix-minidrbdcluster-handle-correctly-KeyboardInterru.patch +Patch1111: 0111-feat-LinstorSR-use-drbd-reactor-instead-of-minidrbdc.patch +Patch1112: 0112-fix-LinstorSR-ensure-vhdutil-calls-are-correctly-exe.patch +Patch1113: 0113-fix-LinstorSR-replace-bad-param-in-detach_thin-impl.patch +Patch1114: 0114-fix-linstorvolumemanager-remove-usage-of-realpath.patch +Patch1115: 0115-fix-linstorvhdutil-avoid-parent-path-resolution.patch +Patch1116: 0116-fix-LinstorSR-create-parent-path-during-attach.patch +Patch1117: 0117-fix-LinstorSR-retry-if-we-can-t-build-volume-cache.patch +Patch1118: 0118-fix-linstorvolumemanager-reduce-peer-slots-param-to-.patch +Patch1119: 0119-fix-LinstorSR-attach-a-valid-XAPI-session-is_open-is.patch +Patch1120: 0120-fix-LinstorSR-ensure-we-always-have-a-DRBD-path-to-s.patch +Patch1121: 0121-fix-LinstorSR-remove-hosts-ips-param.patch +Patch1122: 0122-fix-LinstorSR-compute-correctly-SR-size-using-pool-c.patch +Patch1123: 0123-fix-blktap2-ensure-we-can-import-this-module-when-LI.patch +Patch1124: 0124-fix-LinstorSR-ensure-volume-cache-can-be-recreated.patch +Patch1125: 0125-fix-linstor-manager-remove-dead-useless-code-in-add-.patch +Patch1126: 0126-fix-LinstorSR-Ensure-we-always-have-a-device-path-du.patch +Patch1127: 0127-fix-LinstorSR-always-use-lock.acquire-during-attach-.patch +Patch1128: 0128-fix-LinstorSR-mare-sure-hostnames-are-unique-at-SR-c.patch +Patch1129: 0129-fix-LinstorSR-ensure-we-can-attach-non-special-stati.patch +Patch1130: 0130-fix-LinstorSR-ensure-we-can-detach-when-deflate-call.patch +Patch1131: 0131-fix-LinstorSR-assume-VDI-is-always-a-VHD-when-the-in.patch +Patch1132: 0132-fix-LinstorSR-remove-SR-lock-during-thin-attach-deta.patch +Patch1133: 0133-fix-LinstorSR-ensure-database-is-mounted-during-scan.patch +Patch1134: 0134-fix-LinstorSR-restart-drbd-reactor-in-case-of-failur.patch +Patch1135: 0135-fix-linstorvolumemanager-retry-in-case-of-failure-du.patch +Patch1136: 0136-fix-linstorvolumemanager-avoid-diskless-creation-whe.patch +Patch1137: 0137-fix-LinstorSR-remove-diskless-after-VDI.detach-calls.patch +Patch1138: 0138-fix-LinstorSR-robustify-_load_vdi_info-in-cleanup.py.patch +Patch1139: 0139-fix-LinstorSR-ensure-detach-never-fails-on-plugin-fa.patch +Patch1140: 0140-fix-LinstorSR-ensure-we-coalesce-only-volumes-with-a.patch +Patch1141: 0141-fix-LinstorSR-don-t-try-to-repair-persistent-volumes.patch +Patch1142: 0142-fix-linstorvhdutil-format-correctly-message-if-vhd-u.patch +Patch1143: 0143-fix-LinstorSR-wait-during-attach-to-open-DRBD-path.patch +Patch1144: 0144-fix-LinstorSR-support-different-volume-sizes-in-clea.patch +Patch1145: 0145-fix-LinstorSR-remove-useless-IPS_XHA_CACHE-var.patch +Patch1146: 0146-fix-LinstorSR-ensure-we-can-deflate-on-any-host-afte.patch +Patch1147: 0147-fix-LinstorSR-ensure-we-always-use-real-DRBD-VHD-siz.patch +Patch1148: 0148-feat-linstor-kv-tool-If-no-controller-uri-option-is-.patch +Patch1149: 0149-fix-linstorvolumemanager-robustify-SR-destroy-46.patch +Patch1150: 0150-feat-linstor-manager-extend-API-with-createNodeInter.patch +Patch1151: 0151-fix-LinstorSR-support-VDI.resize-on-thick-volumes.patch +Patch1152: 0152-fix-linstorvolumemanager-format-correctly-exception-.patch +Patch1153: 0153-fix-LinstorSR-ensure-we-can-skip-coalesces-if-device.patch +Patch1154: 0154-feat-linstor-manager-add-methods-to-modify-destroy-l.patch +Patch1155: 0155-fix-LinstorSR-force-a-defined-volume-prefix-if-we-ca.patch +Patch1156: 0156-fix-LinstorSR-explicit-error-message-when-a-group-is.patch +Patch1157: 0157-fix-LinstorSR-make-sure-VDI.delete-doesn-t-throw-und.patch +Patch1158: 0158-fix-LinstorSR-add-drbd-in-the-blacklist-of-multipath.patch +Patch1159: 0159-fix-linstorvolumemanager-create-cloned-volumes-on-ho.patch +Patch1160: 0160-fix-linstorvolumemanager-don-t-align-volumes-on-LVM-.patch +Patch1161: 0161-fix-linstorvolumemanager-assert-with-message-after-l.patch +Patch1162: 0162-fix-linstorvolumemanager-retry-resize-if-volume-is-n.patch +Patch1163: 0163-fix-LinstorSR-create-DRBD-diskless-if-necessary-for-.patch +Patch1164: 0164-fix-LinstorSR-fix-bad-call-to-vhdutil.inflate-bad-ex.patch +Patch1165: 0165-fix-LinstorSR-activate-VG-if-attach-from-config-is-a.patch +Patch1166: 0166-feat-LinstorSR-use-a-specific-resource-group-for-DB-.patch +Patch1167: 0167-feat-linstor-manager-add-getNodePreferredInterface-h.patch +Patch1168: 0168-fix-linstorvolumemanager-blocks-deletion-of-default-.patch +Patch1169: 0169-feat-linstorvolumemanager-change-logic-of-get_resour.patch +Patch1170: 0170-feat-linstor-manager-add-error-codes-to-healthCheck-.patch +Patch1171: 0171-fix-LinstorSR-fix-bad-exception-reference-during-sna.patch +Patch1172: 0172-fix-tapdisk-pause-ensure-LINSTOR-VHD-chain-is-availa.patch Patch1173: 0173-fix-linstorvhdutil-retry-check-on-another-machine-in.patch Patch1174: 0174-fix-LinstorSR-explicit-errors-when-database-path-is-.patch Patch1175: 0175-fix-LinstorSR-Misc-fixes-on-destroy.patch @@ -302,8 +302,6 @@ rm -rf $RPM_BUILD_ROOT %systemd_post storage-init.service %systemd_post usb-scan.socket %systemd_post mpathcount.socket -%systemd_post sr_health_check.timer -%systemd_post sr_health_check.service # On upgrade, migrate from the old statefile to the new statefile so that # storage is not reinitialized. @@ -321,9 +319,6 @@ if [ -e /etc/multipath.conf -a ! -h /etc/multipath.conf ]; then fi update-alternatives --install /etc/multipath.conf multipath.conf /etc/multipath.xenserver/multipath.conf 90 -systemctl enable sr_health_check.timer -systemctl start sr_health_check.timer - # XCP-ng: enable linstor-monitor by default. # However it won't start without linstor-controller.service systemctl enable linstor-monitor.service @@ -344,8 +339,6 @@ fi %systemd_preun storage-init.service %systemd_preun usb-scan.socket %systemd_preun mpathcount.socket -%systemd_preun sr_health_check.timer -%systemd_preun sr_health_check.service # Remove sm-multipath on upgrade or uninstall, to ensure it goes [ ! -x /sbin/chkconfig ] || chkconfig --del sm-multipath || : # only remove in case of erase (but not at upgrade) @@ -363,8 +356,6 @@ exit 0 %systemd_postun sm-mpath-root.service %systemd_postun xs-sm.service %systemd_postun storage-init.service -%systemd_postun sr_health_check.timer -%systemd_postun sr_health_check.service if [ $1 -eq 0 ]; then [ ! -d /etc/lvm/master ] || rm -Rf /etc/lvm/master || exit $? cp -f /etc/lvm/lvm.conf.orig /etc/lvm/lvm.conf || exit $? @@ -610,9 +601,6 @@ cp -r htmlcov %{buildroot}/htmlcov /opt/xensource/sm/cbtutil.pyc /opt/xensource/sm/cbtutil.pyo /opt/xensource/sm/multipath-root-setup -/opt/xensource/sm/sr_health_check.py -/opt/xensource/sm/sr_health_check.pyc -/opt/xensource/sm/sr_health_check.pyo %dir /opt/xensource/sm/plugins /opt/xensource/sm/plugins/__init__.py* /sbin/mpathutil @@ -625,8 +613,6 @@ cp -r htmlcov %{buildroot}/htmlcov %{_unitdir}/mpathcount.service %{_unitdir}/mpathcount.socket %{_unitdir}/storage-init.service -%{_unitdir}/sr_health_check.timer -%{_unitdir}/sr_health_check.service %config /etc/udev/rules.d/65-multipath.rules %config /etc/udev/rules.d/55-xs-mpath-scsidev.rules %config /etc/udev/rules.d/58-xapi.rules @@ -690,6 +676,12 @@ cp -r htmlcov %{buildroot}/htmlcov %{_unitdir}/linstor-monitor.service %changelog +* Tue Aug 06 2024 Damien Thenot - 2.30.8-12.2.0.linstor.1 +- Sync patches with latest 2.30.8-8.2 +- *** 8.2 release changelog *** +- * Thu Jun 27 2024 Benjamin Reis - 2.30.8-12.2 +- - Add 0024-Revert-CA-379329-check-for-missing-iSCSI-sessions-an.patch + * Fri Jul 26 2024 Ronan Abhamon 2.30.8-12.1.0.linstor.4 - Add 0177-fix-LinstorSR-ensure-_is_master-is-always-set.patch - Add 0178-fix-linstor-check-if-resource-is-tiebreaker-62.patch From 09fa934bac93359826cdb3baa4f83559280376b9 Mon Sep 17 00:00:00 2001 From: Damien Thenot Date: Wed, 31 Jul 2024 11:22:59 +0200 Subject: [PATCH 6/8] Add 0179-feat-Linstor-rewrite-linstorhostcall-logic.patch Signed-off-by: Damien Thenot --- ...21cc248d79b749a63d4ad099e6d5f4b8b588.patch | 2 +- ...-sm.service-s-description-for-XCP-ng.patch | 2 +- .../0003-Add-TrueNAS-multipath-config.patch | 2 +- ...add-CephFS-GlusterFS-and-XFS-drivers.patch | 2 +- ...-ZFS-driver-to-avoid-losing-VDI-meta.patch | 2 +- ...driver-for-users-who-need-to-transit.patch | 2 +- ...07-feat-drivers-add-LinstorSR-driver.patch | 2 +- ...nit-tests-concerning-ZFS-close-xcp-n.patch | 2 +- ...no-NFS-ACLs-provided-assume-everyone.patch | 2 +- .../0010-Added-SM-Driver-for-MooseFS.patch | 2 +- ...mount-in-ISOSR-when-legacy_mode-is-u.patch | 2 +- ...SR-uses-now-UUID-subdirs-for-each-SR.patch | 2 +- ...Fix-is_open-call-for-many-drivers-25.patch | 2 +- ...HING-capability-for-many-SR-types-24.patch | 2 +- ...ve-SR_PROBE-from-ZFS-capabilities-37.patch | 2 +- ...ix-vdi-ref-when-static-vdis-are-used.patch | 2 +- ...-not-to-edit-multipath.conf-directly.patch | 2 +- ...om.conf-multipath-configuration-file.patch | 2 +- ...all-etc-multipath-conf.d-custom.conf.patch | 2 +- SOURCES/0020-Backport-NFS4-only-support.patch | 2 +- ...or-NFS4-when-rpcinfo-does-not-includ.patch | 2 +- ...Block-backport-of-largeblocksr-51-55.patch | 2 +- ...dd-a-way-to-modify-config-of-LVMs-56.patch | 2 +- ...-check-for-missing-iSCSI-sessions-an.patch | 2 +- ...-alarm-must-be-reset-in-case-of-succ.patch | 2 +- ...urns-the-result-of-user-function-now.patch | 2 +- ...e-pause-tag-from-VDIs-in-case-of-fai.patch | 2 +- ...pair-volumes-only-if-an-exclusive-co.patch | 2 +- ...instorSR-Improve-LINSTOR-performance.patch | 2 +- ...obustify-scan-to-avoid-losing-VDIs-i.patch | 2 +- ...isplay-a-correctly-readable-size-for.patch | 2 +- ...itord-scan-all-LINSTOR-SRs-every-12-.patch | 2 +- ...ll-correctly-method-in-_locked_load-.patch | 2 +- ...rSR-integrate-minidrbdcluster-daemon.patch | 2 +- ...nsure-heartbeat-and-redo_log-VDIs-ar.patch | 2 +- ...rotect-sr-commands-to-avoid-forgetti.patch | 2 +- ...aler-ensure-uri-is-not-None-during-l.patch | 2 +- ...dd-an-option-to-disable-auto-quorum-.patch | 2 +- ...eManager-add-a-workaround-to-create-.patch | 2 +- ...LinstorSR-add-optional-ips-parameter.patch | 2 +- ...dd-a-helper-log_drbd_erofs-to-trace-.patch | 2 +- ...y-to-restart-the-services-again-if-t.patch | 2 +- ...bustify-linstor-manager-to-never-inc.patch | 2 +- ...event-starting-controller-during-fai.patch | 2 +- ...meManager-increase-peer-slots-limit-.patch | 2 +- ...meManager-add-a-fallback-to-find-con.patch | 2 +- ...tor.mount-ensure-we-always-mount-dat.patch | 2 +- ...meManager-add-a-fallback-to-find-nod.patch | 2 +- ...xplain-on-which-host-plugins-command.patch | 2 +- ...eate-diskless-path-if-necessary-duri.patch | 2 +- ...se-HTTP-NBD-instead-of-DRBD-directly.patch | 2 +- ...nd-controller-when-XAPI-unreachable-.patch | 2 +- ...e-IPs-instead-of-hostnames-in-NBD-se.patch | 2 +- ...eManager-ensure-we-always-use-IPs-in.patch | 2 +- ...ager-add-methods-to-add-remove-host-.patch | 2 +- ...meManager-support-SR-creation-with-d.patch | 2 +- ...dd-a-config-var-to-disable-HTTP-NBD-.patch | 2 +- ...nsure-LVM-group-is-activated-during-.patch | 2 +- ...ager-add-method-to-create-LinstorSR-.patch | 2 +- ...ways-set-vdi_path-in-generate_config.patch | 2 +- ...ter-supports-new-properties-like-for.patch | 2 +- ...abled-disable-minidrbcluster-with-fi.patch | 2 +- ...ger-change-linstor-satellite-start-b.patch | 2 +- .../0064-Fix-is_open-call-for-LinstorSR.patch | 2 +- ...til-fix-boolean-params-of-check-call.patch | 2 +- ...tor-manager-robustify-exec_create_sr.patch | 2 +- ...t-LINSTOR-VDI-UUID-if-error-during-i.patch | 2 +- ...se-and-dump-DRBD-openers-in-case-of-.patch | 2 +- ...til-trace-DRBD-openers-in-case-of-ER.patch | 2 +- ...emanager-compute-correctly-size-in-a.patch | 2 +- ...se-DRBD-openers-instead-of-lsof-to-l.patch | 2 +- ...upport-cProfile-to-trace-calls-when-.patch | 2 +- ...aler-reset-namespace-when-get-is-cal.patch | 2 +- ...il-fix-coalesce-with-VM-running-unde.patch | 2 +- ...emanager-_get_volumes_info-doesn-t-r.patch | 2 +- ...emanager-remove-double-prefix-on-kv-.patch | 2 +- ...dd-linstor-kv-dump-helper-to-print-k.patch | 2 +- ...sable-VHD-key-hash-usage-to-limit-ex.patch | 2 +- ...ter-ensure-SIGINT-is-handled-correct.patch | 2 +- ...ster-stop-resource-services-at-start.patch | 2 +- ...ager-add-new-healthCheck-function-to.patch | 2 +- ...x-xha-conf-parsing-return-host-ip-no.patch | 2 +- ...art-correctly-HA-servers-HTTP-NBD-af.patch | 2 +- ...emanager-use-an-array-to-store-diskf.patch | 2 +- ...memanager-support-snaps-when-a-host-.patch | 2 +- ...emanager-support-offline-hosts-when-.patch | 2 +- ...emanager-define-_base_group_name-mem.patch | 2 +- ...til-modify-logic-of-local-vhdutil-ca.patch | 2 +- ...memanager-robustify-failed-snapshots.patch | 2 +- ...emanager-use-a-namespace-for-volumes.patch | 2 +- ...dump-rename-to-linstor-kv-tool-add-r.patch | 2 +- ...ndle-correctly-localhost-during-star.patch | 2 +- ...all-repair-on-another-host-when-EROF.patch | 2 +- ...void-introduction-of-DELETED-volumes.patch | 2 +- ...tool-remove-all-volumes-supports-jou.patch | 2 +- ...il-due-to-bad-refactoring-check-call.patch | 2 +- ...til-ensure-we-use-VHD-parent-to-find.patch | 2 +- ...memanager-force-DRBD-demote-after-fa.patch | 2 +- ...il-ensure-we-retry-creation-in-all-s.patch | 2 +- ...il-don-t-retry-local-vhdutil-call-wh.patch | 2 +- ...-feat-fork-log-daemon-ignore-SIGTERM.patch | 2 +- ...SR-wait-for-http-disk-server-startup.patch | 2 +- ...ndle-inflate-resize-actions-correctl.patch | 2 +- ...ger-add-a-static-iptables-rule-for-D.patch | 2 +- ...ync-with-last-http-nbd-transfer-vers.patch | 2 +- ...n-t-check-VDI-metadata-while-listing.patch | 2 +- ...n-t-check-metadata-when-destroying-s.patch | 2 +- ...il-handle-correctly-generic-exceptio.patch | 2 +- ...ter-robustify-to-unmount-correctly-L.patch | 2 +- ...ter-handle-correctly-KeyboardInterru.patch | 2 +- ...se-drbd-reactor-instead-of-minidrbdc.patch | 2 +- ...sure-vhdutil-calls-are-correctly-exe.patch | 2 +- ...eplace-bad-param-in-detach_thin-impl.patch | 2 +- ...lumemanager-remove-usage-of-realpath.patch | 2 +- ...vhdutil-avoid-parent-path-resolution.patch | 2 +- ...rSR-create-parent-path-during-attach.patch | 2 +- ...retry-if-we-can-t-build-volume-cache.patch | 2 +- ...emanager-reduce-peer-slots-param-to-.patch | 2 +- ...tach-a-valid-XAPI-session-is_open-is.patch | 2 +- ...sure-we-always-have-a-DRBD-path-to-s.patch | 2 +- ...fix-LinstorSR-remove-hosts-ips-param.patch | 2 +- ...mpute-correctly-SR-size-using-pool-c.patch | 2 +- ...re-we-can-import-this-module-when-LI.patch | 2 +- ...ensure-volume-cache-can-be-recreated.patch | 2 +- ...ger-remove-dead-useless-code-in-add-.patch | 2 +- ...sure-we-always-have-a-device-path-du.patch | 2 +- ...ways-use-lock.acquire-during-attach-.patch | 2 +- ...re-sure-hostnames-are-unique-at-SR-c.patch | 2 +- ...sure-we-can-attach-non-special-stati.patch | 2 +- ...sure-we-can-detach-when-deflate-call.patch | 2 +- ...sume-VDI-is-always-a-VHD-when-the-in.patch | 2 +- ...move-SR-lock-during-thin-attach-deta.patch | 2 +- ...sure-database-is-mounted-during-scan.patch | 2 +- ...start-drbd-reactor-in-case-of-failur.patch | 2 +- ...emanager-retry-in-case-of-failure-du.patch | 2 +- ...emanager-avoid-diskless-creation-whe.patch | 2 +- ...move-diskless-after-VDI.detach-calls.patch | 2 +- ...bustify-_load_vdi_info-in-cleanup.py.patch | 2 +- ...sure-detach-never-fails-on-plugin-fa.patch | 2 +- ...sure-we-coalesce-only-volumes-with-a.patch | 2 +- ...n-t-try-to-repair-persistent-volumes.patch | 2 +- ...il-format-correctly-message-if-vhd-u.patch | 2 +- ...wait-during-attach-to-open-DRBD-path.patch | 2 +- ...pport-different-volume-sizes-in-clea.patch | 2 +- ...rSR-remove-useless-IPS_XHA_CACHE-var.patch | 2 +- ...sure-we-can-deflate-on-any-host-afte.patch | 2 +- ...sure-we-always-use-real-DRBD-VHD-siz.patch | 2 +- ...tool-If-no-controller-uri-option-is-.patch | 2 +- ...olumemanager-robustify-SR-destroy-46.patch | 2 +- ...ager-extend-API-with-createNodeInter.patch | 2 +- ...-support-VDI.resize-on-thick-volumes.patch | 2 +- ...emanager-format-correctly-exception-.patch | 2 +- ...sure-we-can-skip-coalesces-if-device.patch | 2 +- ...ager-add-methods-to-modify-destroy-l.patch | 2 +- ...rce-a-defined-volume-prefix-if-we-ca.patch | 2 +- ...plicit-error-message-when-a-group-is.patch | 2 +- ...ke-sure-VDI.delete-doesn-t-throw-und.patch | 2 +- ...d-drbd-in-the-blacklist-of-multipath.patch | 2 +- ...emanager-create-cloned-volumes-on-ho.patch | 2 +- ...emanager-don-t-align-volumes-on-LVM-.patch | 2 +- ...emanager-assert-with-message-after-l.patch | 2 +- ...emanager-retry-resize-if-volume-is-n.patch | 2 +- ...eate-DRBD-diskless-if-necessary-for-.patch | 2 +- ...x-bad-call-to-vhdutil.inflate-bad-ex.patch | 2 +- ...tivate-VG-if-attach-from-config-is-a.patch | 2 +- ...se-a-specific-resource-group-for-DB-.patch | 2 +- ...ager-add-getNodePreferredInterface-h.patch | 2 +- ...emanager-blocks-deletion-of-default-.patch | 2 +- ...memanager-change-logic-of-get_resour.patch | 2 +- ...ager-add-error-codes-to-healthCheck-.patch | 2 +- ...x-bad-exception-reference-during-sna.patch | 2 +- ...e-ensure-LINSTOR-VHD-chain-is-availa.patch | 2 +- ...il-retry-check-on-another-machine-in.patch | 2 +- ...plicit-errors-when-database-path-is-.patch | 2 +- ...-fix-LinstorSR-Misc-fixes-on-destroy.patch | 2 +- ...en-non-leaf-volumes-in-RO-mode-creat.patch | 2 +- ...orSR-ensure-_is_master-is-always-set.patch | 2 +- ...r-check-if-resource-is-tiebreaker-62.patch | 2 +- ...instor-rewrite-linstorhostcall-logic.patch | 168 ++++++++++++++++++ SPECS/sm.spec | 4 + 180 files changed, 350 insertions(+), 178 deletions(-) create mode 100644 SOURCES/0179-feat-Linstor-rewrite-linstorhostcall-logic.patch diff --git a/SOURCES/0001-backport-of-ccd121cc248d79b749a63d4ad099e6d5f4b8b588.patch b/SOURCES/0001-backport-of-ccd121cc248d79b749a63d4ad099e6d5f4b8b588.patch index 224c9f4d..f6f44249 100644 --- a/SOURCES/0001-backport-of-ccd121cc248d79b749a63d4ad099e6d5f4b8b588.patch +++ b/SOURCES/0001-backport-of-ccd121cc248d79b749a63d4ad099e6d5f4b8b588.patch @@ -1,7 +1,7 @@ From a365619c2835e593259dad3c26761575f64066d6 Mon Sep 17 00:00:00 2001 From: Mark Syms Date: Thu, 20 May 2021 17:40:06 +0100 -Subject: [PATCH 001/178] backport of ccd121cc248d79b749a63d4ad099e6d5f4b8b588: +Subject: [PATCH 001/179] backport of ccd121cc248d79b749a63d4ad099e6d5f4b8b588: CA-354692: check for device parameter in create/probe calls Signed-off-by: Mark Syms diff --git a/SOURCES/0002-Update-xs-sm.service-s-description-for-XCP-ng.patch b/SOURCES/0002-Update-xs-sm.service-s-description-for-XCP-ng.patch index 49a6d8ab..b2200098 100644 --- a/SOURCES/0002-Update-xs-sm.service-s-description-for-XCP-ng.patch +++ b/SOURCES/0002-Update-xs-sm.service-s-description-for-XCP-ng.patch @@ -1,7 +1,7 @@ From 283242d159438c4b301e153a95adde5dfaea3b58 Mon Sep 17 00:00:00 2001 From: Samuel Verschelde Date: Thu, 13 Aug 2020 15:22:17 +0200 -Subject: [PATCH 002/178] Update xs-sm.service's description for XCP-ng +Subject: [PATCH 002/179] 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. diff --git a/SOURCES/0003-Add-TrueNAS-multipath-config.patch b/SOURCES/0003-Add-TrueNAS-multipath-config.patch index 8490f577..52b19b03 100644 --- a/SOURCES/0003-Add-TrueNAS-multipath-config.patch +++ b/SOURCES/0003-Add-TrueNAS-multipath-config.patch @@ -1,7 +1,7 @@ From d6528d899b762ec5d7ceec1fb9c8b13c2c7e6f73 Mon Sep 17 00:00:00 2001 From: Samuel Verschelde Date: Thu, 13 Aug 2020 15:26:43 +0200 -Subject: [PATCH 003/178] Add TrueNAS multipath config +Subject: [PATCH 003/179] 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. diff --git a/SOURCES/0004-feat-drivers-add-CephFS-GlusterFS-and-XFS-drivers.patch b/SOURCES/0004-feat-drivers-add-CephFS-GlusterFS-and-XFS-drivers.patch index f69f8c9b..fac555d9 100644 --- a/SOURCES/0004-feat-drivers-add-CephFS-GlusterFS-and-XFS-drivers.patch +++ b/SOURCES/0004-feat-drivers-add-CephFS-GlusterFS-and-XFS-drivers.patch @@ -1,7 +1,7 @@ From 13542e244eea28a4c60708de99a50fa8c3d4ec5a Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 20 Jul 2020 16:26:42 +0200 -Subject: [PATCH 004/178] feat(drivers): add CephFS, GlusterFS and XFS drivers +Subject: [PATCH 004/179] feat(drivers): add CephFS, GlusterFS and XFS drivers --- Makefile | 3 + diff --git a/SOURCES/0005-feat-drivers-add-ZFS-driver-to-avoid-losing-VDI-meta.patch b/SOURCES/0005-feat-drivers-add-ZFS-driver-to-avoid-losing-VDI-meta.patch index da98c5ed..1bcd22b2 100644 --- a/SOURCES/0005-feat-drivers-add-ZFS-driver-to-avoid-losing-VDI-meta.patch +++ b/SOURCES/0005-feat-drivers-add-ZFS-driver-to-avoid-losing-VDI-meta.patch @@ -1,7 +1,7 @@ From 4525a55b84eb46f4c67797da6eaf61a329dac9d7 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 12 Aug 2020 11:14:33 +0200 -Subject: [PATCH 005/178] feat(drivers): add ZFS driver to avoid losing VDI +Subject: [PATCH 005/179] feat(drivers): add ZFS driver to avoid losing VDI metadata (xcp-ng/xcp#401) --- diff --git a/SOURCES/0006-Re-add-the-ext4-driver-for-users-who-need-to-transit.patch b/SOURCES/0006-Re-add-the-ext4-driver-for-users-who-need-to-transit.patch index bc193fb8..0f350506 100644 --- a/SOURCES/0006-Re-add-the-ext4-driver-for-users-who-need-to-transit.patch +++ b/SOURCES/0006-Re-add-the-ext4-driver-for-users-who-need-to-transit.patch @@ -1,7 +1,7 @@ From 5987a43e40444a524768b1434de1a67c6e53000a Mon Sep 17 00:00:00 2001 From: Samuel Verschelde Date: Thu, 13 Aug 2020 17:10:12 +0200 -Subject: [PATCH 006/178] Re-add the ext4 driver for users who need to +Subject: [PATCH 006/179] Re-add the ext4 driver for users who need to transition The driver is needed to transition to the ext driver. diff --git a/SOURCES/0007-feat-drivers-add-LinstorSR-driver.patch b/SOURCES/0007-feat-drivers-add-LinstorSR-driver.patch index b827c19b..69bc737e 100644 --- a/SOURCES/0007-feat-drivers-add-LinstorSR-driver.patch +++ b/SOURCES/0007-feat-drivers-add-LinstorSR-driver.patch @@ -1,7 +1,7 @@ From 2c71c3ce33cd02573824a57bd4b3917b45c890b0 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 16 Mar 2020 15:39:44 +0100 -Subject: [PATCH 007/178] feat(drivers): add LinstorSR driver +Subject: [PATCH 007/179] feat(drivers): add LinstorSR driver Some important points: diff --git a/SOURCES/0008-feat-tests-add-unit-tests-concerning-ZFS-close-xcp-n.patch b/SOURCES/0008-feat-tests-add-unit-tests-concerning-ZFS-close-xcp-n.patch index 1338beb1..afd46158 100644 --- a/SOURCES/0008-feat-tests-add-unit-tests-concerning-ZFS-close-xcp-n.patch +++ b/SOURCES/0008-feat-tests-add-unit-tests-concerning-ZFS-close-xcp-n.patch @@ -1,7 +1,7 @@ From 89cee57b097a681edc800be05d1dfc7d97aec995 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 27 Oct 2020 15:04:36 +0100 -Subject: [PATCH 008/178] feat(tests): add unit tests concerning ZFS (close +Subject: [PATCH 008/179] feat(tests): add unit tests concerning ZFS (close xcp-ng/xcp#425) - Check if "create" doesn't succeed without zfs packages diff --git a/SOURCES/0009-If-no-NFS-ACLs-provided-assume-everyone.patch b/SOURCES/0009-If-no-NFS-ACLs-provided-assume-everyone.patch index 51e5bf9c..8bc6e700 100644 --- a/SOURCES/0009-If-no-NFS-ACLs-provided-assume-everyone.patch +++ b/SOURCES/0009-If-no-NFS-ACLs-provided-assume-everyone.patch @@ -1,7 +1,7 @@ From c338e356dcad6ad17b2f2248ff45fcf983173e0e Mon Sep 17 00:00:00 2001 From: BenjiReis Date: Thu, 25 Feb 2021 09:54:52 +0100 -Subject: [PATCH 009/178] If no NFS ACLs provided, assume everyone: +Subject: [PATCH 009/179] 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: "*". diff --git a/SOURCES/0010-Added-SM-Driver-for-MooseFS.patch b/SOURCES/0010-Added-SM-Driver-for-MooseFS.patch index 3a5f9ff3..1fe103a5 100644 --- a/SOURCES/0010-Added-SM-Driver-for-MooseFS.patch +++ b/SOURCES/0010-Added-SM-Driver-for-MooseFS.patch @@ -1,7 +1,7 @@ From 359dd15436b153bedf32af7768973febc2b84c2f Mon Sep 17 00:00:00 2001 From: Aleksander Wieliczko Date: Fri, 29 Jan 2021 15:21:23 +0100 -Subject: [PATCH 010/178] Added SM Driver for MooseFS +Subject: [PATCH 010/179] Added SM Driver for MooseFS Co-authored-by: Piotr Robert Konopelko Signed-off-by: Aleksander Wieliczko diff --git a/SOURCES/0011-Avoid-usage-of-umount-in-ISOSR-when-legacy_mode-is-u.patch b/SOURCES/0011-Avoid-usage-of-umount-in-ISOSR-when-legacy_mode-is-u.patch index 8e8b06d2..c6ef7b69 100644 --- a/SOURCES/0011-Avoid-usage-of-umount-in-ISOSR-when-legacy_mode-is-u.patch +++ b/SOURCES/0011-Avoid-usage-of-umount-in-ISOSR-when-legacy_mode-is-u.patch @@ -1,7 +1,7 @@ From c984a5c3510b12c44a9fd2d0297cdb21111d20f7 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 2 Dec 2021 09:28:37 +0100 -Subject: [PATCH 011/178] Avoid usage of `umount` in `ISOSR` when `legacy_mode` +Subject: [PATCH 011/179] 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 diff --git a/SOURCES/0012-MooseFS-SR-uses-now-UUID-subdirs-for-each-SR.patch b/SOURCES/0012-MooseFS-SR-uses-now-UUID-subdirs-for-each-SR.patch index f5db7613..04972a46 100644 --- a/SOURCES/0012-MooseFS-SR-uses-now-UUID-subdirs-for-each-SR.patch +++ b/SOURCES/0012-MooseFS-SR-uses-now-UUID-subdirs-for-each-SR.patch @@ -1,7 +1,7 @@ From c701f410bdac559ac8384da2f8b40833e5e89866 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 18 May 2022 17:28:09 +0200 -Subject: [PATCH 012/178] MooseFS SR uses now UUID subdirs for each SR +Subject: [PATCH 012/179] 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 diff --git a/SOURCES/0013-Fix-is_open-call-for-many-drivers-25.patch b/SOURCES/0013-Fix-is_open-call-for-many-drivers-25.patch index 455ea091..429077a5 100644 --- a/SOURCES/0013-Fix-is_open-call-for-many-drivers-25.patch +++ b/SOURCES/0013-Fix-is_open-call-for-many-drivers-25.patch @@ -1,7 +1,7 @@ From cba6bde2b5243bac634b5e5e910db685355ba83e Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 23 Jun 2022 10:36:36 +0200 -Subject: [PATCH 013/178] Fix is_open call for many drivers (#25) +Subject: [PATCH 013/179] 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. diff --git a/SOURCES/0014-Remove-SR_CACHING-capability-for-many-SR-types-24.patch b/SOURCES/0014-Remove-SR_CACHING-capability-for-many-SR-types-24.patch index c56c5f16..453a8150 100644 --- a/SOURCES/0014-Remove-SR_CACHING-capability-for-many-SR-types-24.patch +++ b/SOURCES/0014-Remove-SR_CACHING-capability-for-many-SR-types-24.patch @@ -1,7 +1,7 @@ From bf7577ff65e882686af8e7ca1748cfb0b7934a14 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 23 Jun 2022 10:37:07 +0200 -Subject: [PATCH 014/178] Remove SR_CACHING capability for many SR types (#24) +Subject: [PATCH 014/179] 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. diff --git a/SOURCES/0015-Remove-SR_PROBE-from-ZFS-capabilities-37.patch b/SOURCES/0015-Remove-SR_PROBE-from-ZFS-capabilities-37.patch index 3fffabb0..3e83babe 100644 --- a/SOURCES/0015-Remove-SR_PROBE-from-ZFS-capabilities-37.patch +++ b/SOURCES/0015-Remove-SR_PROBE-from-ZFS-capabilities-37.patch @@ -1,7 +1,7 @@ From 1a7496b75ae96edf79f2da481b54b80e8d2925f8 Mon Sep 17 00:00:00 2001 From: BenjiReis Date: Fri, 4 Aug 2023 12:10:08 +0200 -Subject: [PATCH 015/178] Remove `SR_PROBE` from ZFS capabilities (#37) +Subject: [PATCH 015/179] Remove `SR_PROBE` from ZFS capabilities (#37) The probe method is not implemented so we shouldn't advertise it. diff --git a/SOURCES/0016-Fix-vdi-ref-when-static-vdis-are-used.patch b/SOURCES/0016-Fix-vdi-ref-when-static-vdis-are-used.patch index 0b6816b9..3f6320ea 100644 --- a/SOURCES/0016-Fix-vdi-ref-when-static-vdis-are-used.patch +++ b/SOURCES/0016-Fix-vdi-ref-when-static-vdis-are-used.patch @@ -1,7 +1,7 @@ From 37c79431e2c6654c5afdb6cde6e23c4c321c4cda Mon Sep 17 00:00:00 2001 From: Guillaume Date: Wed, 16 Aug 2023 13:42:21 +0200 -Subject: [PATCH 016/178] Fix vdi-ref when static vdis are used +Subject: [PATCH 016/179] 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. diff --git a/SOURCES/0017-Tell-users-not-to-edit-multipath.conf-directly.patch b/SOURCES/0017-Tell-users-not-to-edit-multipath.conf-directly.patch index 533f27eb..7a5d423b 100644 --- a/SOURCES/0017-Tell-users-not-to-edit-multipath.conf-directly.patch +++ b/SOURCES/0017-Tell-users-not-to-edit-multipath.conf-directly.patch @@ -1,7 +1,7 @@ From 9bfcb0be3ff34354c9299bf6e0a90e691f14e813 Mon Sep 17 00:00:00 2001 From: Samuel Verschelde Date: Fri, 27 Jan 2023 12:03:15 +0100 -Subject: [PATCH 017/178] Tell users not to edit multipath.conf directly +Subject: [PATCH 017/179] 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 diff --git a/SOURCES/0018-Add-custom.conf-multipath-configuration-file.patch b/SOURCES/0018-Add-custom.conf-multipath-configuration-file.patch index f4eef0e6..b6f14a1d 100644 --- a/SOURCES/0018-Add-custom.conf-multipath-configuration-file.patch +++ b/SOURCES/0018-Add-custom.conf-multipath-configuration-file.patch @@ -1,7 +1,7 @@ From 383f9128fb1a788074a5a6aca09a249bfeaa44f5 Mon Sep 17 00:00:00 2001 From: Samuel Verschelde Date: Fri, 27 Jan 2023 12:23:13 +0100 -Subject: [PATCH 018/178] Add custom.conf multipath configuration file +Subject: [PATCH 018/179] 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 diff --git a/SOURCES/0019-Install-etc-multipath-conf.d-custom.conf.patch b/SOURCES/0019-Install-etc-multipath-conf.d-custom.conf.patch index 445ace79..74778050 100644 --- a/SOURCES/0019-Install-etc-multipath-conf.d-custom.conf.patch +++ b/SOURCES/0019-Install-etc-multipath-conf.d-custom.conf.patch @@ -1,7 +1,7 @@ From 507c2f067878ee88765c5750d3e618c8c63208c7 Mon Sep 17 00:00:00 2001 From: Samuel Verschelde Date: Fri, 25 Aug 2023 17:47:34 +0200 -Subject: [PATCH 019/178] Install /etc/multipath/conf.d/custom.conf +Subject: [PATCH 019/179] Install /etc/multipath/conf.d/custom.conf Update Makefile so that the file is installed along with sm. diff --git a/SOURCES/0020-Backport-NFS4-only-support.patch b/SOURCES/0020-Backport-NFS4-only-support.patch index c16552f2..a23fec11 100644 --- a/SOURCES/0020-Backport-NFS4-only-support.patch +++ b/SOURCES/0020-Backport-NFS4-only-support.patch @@ -1,7 +1,7 @@ From 2d197ca1c046dce44579f77f4e2ac23397edb9c1 Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Mon, 18 Dec 2023 10:22:26 +0100 -Subject: [PATCH 020/178] Backport NFS4 only support +Subject: [PATCH 020/179] Backport NFS4 only support See: https://github.com/xapi-project/sm/pull/617 diff --git a/SOURCES/0021-Backport-probe-for-NFS4-when-rpcinfo-does-not-includ.patch b/SOURCES/0021-Backport-probe-for-NFS4-when-rpcinfo-does-not-includ.patch index c3543117..c80423a4 100644 --- a/SOURCES/0021-Backport-probe-for-NFS4-when-rpcinfo-does-not-includ.patch +++ b/SOURCES/0021-Backport-probe-for-NFS4-when-rpcinfo-does-not-includ.patch @@ -1,7 +1,7 @@ From bcebd6854894ddd9cc6af7d41a54daab7a45f7be Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Mon, 18 Dec 2023 10:35:46 +0100 -Subject: [PATCH 021/178] Backport probe for NFS4 when rpcinfo does not include +Subject: [PATCH 021/179] Backport probe for NFS4 when rpcinfo does not include it See: https://github.com/xapi-project/sm/pull/655 diff --git a/SOURCES/0022-feat-LargeBlock-backport-of-largeblocksr-51-55.patch b/SOURCES/0022-feat-LargeBlock-backport-of-largeblocksr-51-55.patch index 00f38f07..72572530 100644 --- a/SOURCES/0022-feat-LargeBlock-backport-of-largeblocksr-51-55.patch +++ b/SOURCES/0022-feat-LargeBlock-backport-of-largeblocksr-51-55.patch @@ -1,7 +1,7 @@ From 52d495879ebf8c1caee78f3e10f7febd65d8ccd3 Mon Sep 17 00:00:00 2001 From: Damien Thenot Date: Tue, 7 May 2024 15:20:22 +0200 -Subject: [PATCH 022/178] feat(LargeBlock): backport of largeblocksr (#51) +Subject: [PATCH 022/179] feat(LargeBlock): backport of largeblocksr (#51) (#55) A SR inheriting from a EXTSR allowing to use a 4KiB blocksize device as diff --git a/SOURCES/0023-feat-LVHDSR-add-a-way-to-modify-config-of-LVMs-56.patch b/SOURCES/0023-feat-LVHDSR-add-a-way-to-modify-config-of-LVMs-56.patch index 924eb4ec..8e2f5d34 100644 --- a/SOURCES/0023-feat-LVHDSR-add-a-way-to-modify-config-of-LVMs-56.patch +++ b/SOURCES/0023-feat-LVHDSR-add-a-way-to-modify-config-of-LVMs-56.patch @@ -1,7 +1,7 @@ From ec5c7c6cd4732e7f70122ccdb8ccdaf6711e5f31 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 28 May 2024 15:17:21 +0200 -Subject: [PATCH 023/178] feat(LVHDSR): add a way to modify config of LVMs +Subject: [PATCH 023/179] feat(LVHDSR): add a way to modify config of LVMs (#56) With this change the driver supports a "lvm-conf" param on "other-config". diff --git a/SOURCES/0024-Revert-CA-379329-check-for-missing-iSCSI-sessions-an.patch b/SOURCES/0024-Revert-CA-379329-check-for-missing-iSCSI-sessions-an.patch index 4b18934d..96c66dfa 100644 --- a/SOURCES/0024-Revert-CA-379329-check-for-missing-iSCSI-sessions-an.patch +++ b/SOURCES/0024-Revert-CA-379329-check-for-missing-iSCSI-sessions-an.patch @@ -1,7 +1,7 @@ From 4ffea27c739e2a02c78438bfb2d281259afad615 Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Thu, 27 Jun 2024 17:55:10 +0200 -Subject: [PATCH 024/178] Revert "CA-379329: check for missing iSCSI sessions +Subject: [PATCH 024/179] Revert "CA-379329: check for missing iSCSI sessions and reconnect" This reverts commit d28dcc1341166ed4839dbea8ef6d1a24e981f461. diff --git a/SOURCES/0025-Fix-timeout_call-alarm-must-be-reset-in-case-of-succ.patch b/SOURCES/0025-Fix-timeout_call-alarm-must-be-reset-in-case-of-succ.patch index 62b7fa1c..64d9225b 100644 --- a/SOURCES/0025-Fix-timeout_call-alarm-must-be-reset-in-case-of-succ.patch +++ b/SOURCES/0025-Fix-timeout_call-alarm-must-be-reset-in-case-of-succ.patch @@ -1,7 +1,7 @@ From 81233191b418528ff660f2dcc4f179db598eded5 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 16 Feb 2022 18:24:56 +0100 -Subject: [PATCH 025/178] Fix timeout_call: alarm must be reset in case of +Subject: [PATCH 025/179] Fix timeout_call: alarm must be reset in case of success Otherwise the SIGALRM signal can be emitted after the execution diff --git a/SOURCES/0026-timeout_call-returns-the-result-of-user-function-now.patch b/SOURCES/0026-timeout_call-returns-the-result-of-user-function-now.patch index 821dcb9f..9d97881a 100644 --- a/SOURCES/0026-timeout_call-returns-the-result-of-user-function-now.patch +++ b/SOURCES/0026-timeout_call-returns-the-result-of-user-function-now.patch @@ -1,7 +1,7 @@ From 608866667c3f834f5a8128f0e646b494dbfda73f Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 16 Feb 2022 18:28:06 +0100 -Subject: [PATCH 026/178] timeout_call returns the result of user function now +Subject: [PATCH 026/179] timeout_call returns the result of user function now Signed-off-by: Ronan Abhamon --- diff --git a/SOURCES/0027-Always-remove-the-pause-tag-from-VDIs-in-case-of-fai.patch b/SOURCES/0027-Always-remove-the-pause-tag-from-VDIs-in-case-of-fai.patch index 37c567a6..28d57ebe 100644 --- a/SOURCES/0027-Always-remove-the-pause-tag-from-VDIs-in-case-of-fai.patch +++ b/SOURCES/0027-Always-remove-the-pause-tag-from-VDIs-in-case-of-fai.patch @@ -1,7 +1,7 @@ From e2533c00ebd0e76502dd3b8e4b57bae3e271e19e Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 5 Feb 2024 23:16:16 +0100 -Subject: [PATCH 027/178] Always remove the pause tag from VDIs in case of +Subject: [PATCH 027/179] Always remove the pause tag from VDIs in case of failure During VDI activation in the blktap module and in case of failure diff --git a/SOURCES/0028-fix-LinstorSR-repair-volumes-only-if-an-exclusive-co.patch b/SOURCES/0028-fix-LinstorSR-repair-volumes-only-if-an-exclusive-co.patch index 0f61727f..5b1f3f53 100644 --- a/SOURCES/0028-fix-LinstorSR-repair-volumes-only-if-an-exclusive-co.patch +++ b/SOURCES/0028-fix-LinstorSR-repair-volumes-only-if-an-exclusive-co.patch @@ -1,7 +1,7 @@ From 2f5bef7771d539e57b314ccb34a51fa91c62582c Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 20 Nov 2020 16:42:52 +0100 -Subject: [PATCH 028/178] fix(LinstorSR): repair volumes only if an exclusive +Subject: [PATCH 028/179] fix(LinstorSR): repair volumes only if an exclusive command is executed Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0029-feat-LinstorSR-Improve-LINSTOR-performance.patch b/SOURCES/0029-feat-LinstorSR-Improve-LINSTOR-performance.patch index a18f9fa4..562fd0e9 100644 --- a/SOURCES/0029-feat-LinstorSR-Improve-LINSTOR-performance.patch +++ b/SOURCES/0029-feat-LinstorSR-Improve-LINSTOR-performance.patch @@ -1,7 +1,7 @@ From fa6b3dcb7cc88a68152282bd9943cbc71a8c8b97 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 10 Dec 2020 17:56:15 +0100 -Subject: [PATCH 029/178] feat(LinstorSR): Improve LINSTOR performance +Subject: [PATCH 029/179] feat(LinstorSR): Improve LINSTOR performance Details: - vdi_attach and vdi_detach are now exclusive diff --git a/SOURCES/0030-feat-LinstorSR-robustify-scan-to-avoid-losing-VDIs-i.patch b/SOURCES/0030-feat-LinstorSR-robustify-scan-to-avoid-losing-VDIs-i.patch index 7087f603..d93067b5 100644 --- a/SOURCES/0030-feat-LinstorSR-robustify-scan-to-avoid-losing-VDIs-i.patch +++ b/SOURCES/0030-feat-LinstorSR-robustify-scan-to-avoid-losing-VDIs-i.patch @@ -1,7 +1,7 @@ From 7492a4f950f109830dc7b48adee93f0fce76027d Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 7 Jan 2021 11:17:08 +0100 -Subject: [PATCH 030/178] feat(LinstorSR): robustify scan to avoid losing VDIs +Subject: [PATCH 030/179] feat(LinstorSR): robustify scan to avoid losing VDIs if function is called outside module Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0031-feat-LinstorSR-display-a-correctly-readable-size-for.patch b/SOURCES/0031-feat-LinstorSR-display-a-correctly-readable-size-for.patch index 02ff3705..664761cc 100644 --- a/SOURCES/0031-feat-LinstorSR-display-a-correctly-readable-size-for.patch +++ b/SOURCES/0031-feat-LinstorSR-display-a-correctly-readable-size-for.patch @@ -1,7 +1,7 @@ From 0569b8b07776f203532c856d8cf92e7fe4957300 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 8 Jan 2021 16:12:15 +0100 -Subject: [PATCH 031/178] feat(LinstorSR): display a correctly readable size +Subject: [PATCH 031/179] feat(LinstorSR): display a correctly readable size for the user Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0032-feat-linstor-monitord-scan-all-LINSTOR-SRs-every-12-.patch b/SOURCES/0032-feat-linstor-monitord-scan-all-LINSTOR-SRs-every-12-.patch index cb6c8e64..15ab7cd6 100644 --- a/SOURCES/0032-feat-linstor-monitord-scan-all-LINSTOR-SRs-every-12-.patch +++ b/SOURCES/0032-feat-linstor-monitord-scan-all-LINSTOR-SRs-every-12-.patch @@ -1,7 +1,7 @@ From e5d09d4036b314c4f2b3fbfa148d367ef319841e Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 12 Jan 2021 14:06:34 +0100 -Subject: [PATCH 032/178] feat(linstor-monitord): scan all LINSTOR SRs every 12 +Subject: [PATCH 032/179] feat(linstor-monitord): scan all LINSTOR SRs every 12 minutes to update allocated size stats Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0033-fix-LinstorSR-call-correctly-method-in-_locked_load-.patch b/SOURCES/0033-fix-LinstorSR-call-correctly-method-in-_locked_load-.patch index 29ff1f32..a5cae438 100644 --- a/SOURCES/0033-fix-LinstorSR-call-correctly-method-in-_locked_load-.patch +++ b/SOURCES/0033-fix-LinstorSR-call-correctly-method-in-_locked_load-.patch @@ -1,7 +1,7 @@ From 3fd04d9be881f7ea2c978ba93e4dae3695d3cb74 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 15 Jan 2021 17:01:05 +0100 -Subject: [PATCH 033/178] fix(LinstorSR): call correctly method in _locked_load +Subject: [PATCH 033/179] fix(LinstorSR): call correctly method in _locked_load when vdi_attach_from_config is executed Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0034-feat-LinstorSR-integrate-minidrbdcluster-daemon.patch b/SOURCES/0034-feat-LinstorSR-integrate-minidrbdcluster-daemon.patch index b17acc50..6bb7cca6 100644 --- a/SOURCES/0034-feat-LinstorSR-integrate-minidrbdcluster-daemon.patch +++ b/SOURCES/0034-feat-LinstorSR-integrate-minidrbdcluster-daemon.patch @@ -1,7 +1,7 @@ From f815b2bde1959d8342c5e009e7d739b10b1845ed Mon Sep 17 00:00:00 2001 From: Wescoeur Date: Wed, 20 Jan 2021 18:04:26 +0100 -Subject: [PATCH 034/178] feat(LinstorSR): integrate minidrbdcluster daemon +Subject: [PATCH 034/179] feat(LinstorSR): integrate minidrbdcluster daemon Now, we can: - Start a controller on any node diff --git a/SOURCES/0035-feat-LinstorSR-ensure-heartbeat-and-redo_log-VDIs-ar.patch b/SOURCES/0035-feat-LinstorSR-ensure-heartbeat-and-redo_log-VDIs-ar.patch index 3be31a6f..394b85d6 100644 --- a/SOURCES/0035-feat-LinstorSR-ensure-heartbeat-and-redo_log-VDIs-ar.patch +++ b/SOURCES/0035-feat-LinstorSR-ensure-heartbeat-and-redo_log-VDIs-ar.patch @@ -1,7 +1,7 @@ From 7eaa8b7d67bd1704b2c8d6537703ed30f5e4303d Mon Sep 17 00:00:00 2001 From: Wescoeur Date: Wed, 24 Feb 2021 11:17:23 +0100 -Subject: [PATCH 035/178] feat(LinstorSR): ensure heartbeat and redo_log VDIs +Subject: [PATCH 035/179] feat(LinstorSR): ensure heartbeat and redo_log VDIs are not diskless Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0036-feat-LinstorSR-protect-sr-commands-to-avoid-forgetti.patch b/SOURCES/0036-feat-LinstorSR-protect-sr-commands-to-avoid-forgetti.patch index 9672e481..aa2acf3f 100644 --- a/SOURCES/0036-feat-LinstorSR-protect-sr-commands-to-avoid-forgetti.patch +++ b/SOURCES/0036-feat-LinstorSR-protect-sr-commands-to-avoid-forgetti.patch @@ -1,7 +1,7 @@ From 957fb9efcf9e31071ce90563fae78ce17a5c6aa6 Mon Sep 17 00:00:00 2001 From: Wescoeur Date: Thu, 25 Feb 2021 17:52:57 +0100 -Subject: [PATCH 036/178] feat(LinstorSR): protect sr commands to avoid +Subject: [PATCH 036/179] feat(LinstorSR): protect sr commands to avoid forgetting LINSTOR volumes when master satellite is down Steps to reproduce: diff --git a/SOURCES/0037-fix-LinstorJournaler-ensure-uri-is-not-None-during-l.patch b/SOURCES/0037-fix-LinstorJournaler-ensure-uri-is-not-None-during-l.patch index 42bc422f..8b90a585 100644 --- a/SOURCES/0037-fix-LinstorJournaler-ensure-uri-is-not-None-during-l.patch +++ b/SOURCES/0037-fix-LinstorJournaler-ensure-uri-is-not-None-during-l.patch @@ -1,7 +1,7 @@ From 5e96c8a43e8a672bc1622ed10ba7bc8138caed91 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 8 Mar 2021 13:25:28 +0100 -Subject: [PATCH 037/178] fix(LinstorJournaler): ensure uri is not None during +Subject: [PATCH 037/179] fix(LinstorJournaler): ensure uri is not None during linstor.KV creation Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0038-feat-LinstorSR-add-an-option-to-disable-auto-quorum-.patch b/SOURCES/0038-feat-LinstorSR-add-an-option-to-disable-auto-quorum-.patch index 0515369c..91fa2ad8 100644 --- a/SOURCES/0038-feat-LinstorSR-add-an-option-to-disable-auto-quorum-.patch +++ b/SOURCES/0038-feat-LinstorSR-add-an-option-to-disable-auto-quorum-.patch @@ -1,7 +1,7 @@ From 4a5e7d4ee020c3e1fa1b07a2306dd6480003da43 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 22 Mar 2021 17:32:26 +0100 -Subject: [PATCH 038/178] feat(LinstorSR): add an option to disable auto-quorum +Subject: [PATCH 038/179] feat(LinstorSR): add an option to disable auto-quorum on volume DB + fix doc Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0039-fix-LinstorVolumeManager-add-a-workaround-to-create-.patch b/SOURCES/0039-fix-LinstorVolumeManager-add-a-workaround-to-create-.patch index 676a546d..8a7a9559 100644 --- a/SOURCES/0039-fix-LinstorVolumeManager-add-a-workaround-to-create-.patch +++ b/SOURCES/0039-fix-LinstorVolumeManager-add-a-workaround-to-create-.patch @@ -1,7 +1,7 @@ From 5a2642058762b8fa64c44b53e89618f5c7b77f3b Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 23 Mar 2021 14:49:39 +0100 -Subject: [PATCH 039/178] fix(LinstorVolumeManager): add a workaround to create +Subject: [PATCH 039/179] fix(LinstorVolumeManager): add a workaround to create properly SR with thin LVM Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0040-feat-LinstorSR-add-optional-ips-parameter.patch b/SOURCES/0040-feat-LinstorSR-add-optional-ips-parameter.patch index b95e853c..c1517470 100644 --- a/SOURCES/0040-feat-LinstorSR-add-optional-ips-parameter.patch +++ b/SOURCES/0040-feat-LinstorSR-add-optional-ips-parameter.patch @@ -1,7 +1,7 @@ From 0940fe2bfcfc74d6252a07cf95d1f261bf77cfc8 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 24 Mar 2021 10:06:58 +0100 -Subject: [PATCH 040/178] feat(LinstorSR): add optional ips parameter +Subject: [PATCH 040/179] feat(LinstorSR): add optional ips parameter Signed-off-by: Ronan Abhamon --- diff --git a/SOURCES/0041-feat-LinstorSR-add-a-helper-log_drbd_erofs-to-trace-.patch b/SOURCES/0041-feat-LinstorSR-add-a-helper-log_drbd_erofs-to-trace-.patch index f27f2ddf..e61265a4 100644 --- a/SOURCES/0041-feat-LinstorSR-add-a-helper-log_drbd_erofs-to-trace-.patch +++ b/SOURCES/0041-feat-LinstorSR-add-a-helper-log_drbd_erofs-to-trace-.patch @@ -1,7 +1,7 @@ From f54ac1cef57268f0f7494af54fd4008a9aa67481 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 26 Mar 2021 16:13:20 +0100 -Subject: [PATCH 041/178] feat(LinstorSR): add a helper `log_drbd_erofs` to +Subject: [PATCH 041/179] feat(LinstorSR): add a helper `log_drbd_erofs` to trace EROFS errno code with DRBD resources + check EROFS error Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0042-fix-LinstorSR-try-to-restart-the-services-again-if-t.patch b/SOURCES/0042-fix-LinstorSR-try-to-restart-the-services-again-if-t.patch index 2fccdc94..2cf00946 100644 --- a/SOURCES/0042-fix-LinstorSR-try-to-restart-the-services-again-if-t.patch +++ b/SOURCES/0042-fix-LinstorSR-try-to-restart-the-services-again-if-t.patch @@ -1,7 +1,7 @@ From 70e19894b836132d11001dd506dc1f6b97c38a57 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 28 Apr 2021 15:15:58 +0200 -Subject: [PATCH 042/178] fix(LinstorSR): try to restart the services again if +Subject: [PATCH 042/179] fix(LinstorSR): try to restart the services again if there is a failure in linstor-manager Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0043-fix-LinstorSR-robustify-linstor-manager-to-never-inc.patch b/SOURCES/0043-fix-LinstorSR-robustify-linstor-manager-to-never-inc.patch index 933e3dfc..e3954403 100644 --- a/SOURCES/0043-fix-LinstorSR-robustify-linstor-manager-to-never-inc.patch +++ b/SOURCES/0043-fix-LinstorSR-robustify-linstor-manager-to-never-inc.patch @@ -1,7 +1,7 @@ From 00000e9bd493c60ff0fd29bd1ee0612188f14cba Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 26 Aug 2021 15:26:11 +0200 -Subject: [PATCH 043/178] fix(LinstorSR): robustify linstor-manager to never +Subject: [PATCH 043/179] fix(LinstorSR): robustify linstor-manager to never include from plugins path Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0044-fix-LinstorSR-prevent-starting-controller-during-fai.patch b/SOURCES/0044-fix-LinstorSR-prevent-starting-controller-during-fai.patch index 41606748..b5f3fd5f 100644 --- a/SOURCES/0044-fix-LinstorSR-prevent-starting-controller-during-fai.patch +++ b/SOURCES/0044-fix-LinstorSR-prevent-starting-controller-during-fai.patch @@ -1,7 +1,7 @@ From 388927905668b5f4b577b2099ea95fcae1f62c57 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 26 Aug 2021 16:52:01 +0200 -Subject: [PATCH 044/178] fix(LinstorSR): prevent starting controller during +Subject: [PATCH 044/179] fix(LinstorSR): prevent starting controller during fail in linstor manager destroy method Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0045-feat-LinstorVolumeManager-increase-peer-slots-limit-.patch b/SOURCES/0045-feat-LinstorVolumeManager-increase-peer-slots-limit-.patch index fb67162c..60d2c6d0 100644 --- a/SOURCES/0045-feat-LinstorVolumeManager-increase-peer-slots-limit-.patch +++ b/SOURCES/0045-feat-LinstorVolumeManager-increase-peer-slots-limit-.patch @@ -1,7 +1,7 @@ From 7bbb8e4cb68122d9e2a784dae2359edbe8a16445 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 19 Oct 2021 14:48:17 +0200 -Subject: [PATCH 045/178] feat(LinstorVolumeManager): increase peer slots limit +Subject: [PATCH 045/179] feat(LinstorVolumeManager): increase peer slots limit (support 31 connections to a DRBD) - Also, create diskless devices when db is created diff --git a/SOURCES/0046-feat-LinstorVolumeManager-add-a-fallback-to-find-con.patch b/SOURCES/0046-feat-LinstorVolumeManager-add-a-fallback-to-find-con.patch index 15f6bba4..e4240bcf 100644 --- a/SOURCES/0046-feat-LinstorVolumeManager-add-a-fallback-to-find-con.patch +++ b/SOURCES/0046-feat-LinstorVolumeManager-add-a-fallback-to-find-con.patch @@ -1,7 +1,7 @@ From c96f969e228b789d1ac28ae17eb35255cfee0aa0 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 20 Oct 2021 14:33:04 +0200 -Subject: [PATCH 046/178] feat(LinstorVolumeManager): add a fallback to find +Subject: [PATCH 046/179] feat(LinstorVolumeManager): add a fallback to find controller uri (when len(hosts) >= 4) Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0047-fix-var-lib-linstor.mount-ensure-we-always-mount-dat.patch b/SOURCES/0047-fix-var-lib-linstor.mount-ensure-we-always-mount-dat.patch index 27db1348..6d674eb7 100644 --- a/SOURCES/0047-fix-var-lib-linstor.mount-ensure-we-always-mount-dat.patch +++ b/SOURCES/0047-fix-var-lib-linstor.mount-ensure-we-always-mount-dat.patch @@ -1,7 +1,7 @@ From 1911a8c147f036f0e57062cb3134c6798a468e30 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 21 Oct 2021 11:13:07 +0200 -Subject: [PATCH 047/178] fix(var-lib-linstor.mount): ensure we always mount +Subject: [PATCH 047/179] fix(var-lib-linstor.mount): ensure we always mount database with RW flags Sometimes systemd fallback to read only FS if the volume can't be mounted, we must diff --git a/SOURCES/0048-feat-LinstorVolumeManager-add-a-fallback-to-find-nod.patch b/SOURCES/0048-feat-LinstorVolumeManager-add-a-fallback-to-find-nod.patch index b757fa1b..6f4c0328 100644 --- a/SOURCES/0048-feat-LinstorVolumeManager-add-a-fallback-to-find-nod.patch +++ b/SOURCES/0048-feat-LinstorVolumeManager-add-a-fallback-to-find-nod.patch @@ -1,7 +1,7 @@ From 53850ec1f126a68485c20d01a81da2529ba19d90 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 21 Oct 2021 11:51:32 +0200 -Subject: [PATCH 048/178] feat(LinstorVolumeManager): add a fallback to find +Subject: [PATCH 048/179] feat(LinstorVolumeManager): add a fallback to find node name (when len(hosts) >= 4) Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0049-feat-LinstorSR-explain-on-which-host-plugins-command.patch b/SOURCES/0049-feat-LinstorSR-explain-on-which-host-plugins-command.patch index 8acc15de..ae20da4c 100644 --- a/SOURCES/0049-feat-LinstorSR-explain-on-which-host-plugins-command.patch +++ b/SOURCES/0049-feat-LinstorSR-explain-on-which-host-plugins-command.patch @@ -1,7 +1,7 @@ From a719956530bd08539fa58f1cfd0043779cc7c0d9 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 26 Oct 2021 10:44:00 +0200 -Subject: [PATCH 049/178] feat(LinstorSR): explain on which host, plugins +Subject: [PATCH 049/179] feat(LinstorSR): explain on which host, plugins commands are executed Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0050-fix-LinstorSR-create-diskless-path-if-necessary-duri.patch b/SOURCES/0050-fix-LinstorSR-create-diskless-path-if-necessary-duri.patch index 53db14c1..33fa019d 100644 --- a/SOURCES/0050-fix-LinstorSR-create-diskless-path-if-necessary-duri.patch +++ b/SOURCES/0050-fix-LinstorSR-create-diskless-path-if-necessary-duri.patch @@ -1,7 +1,7 @@ From ea6fa3de772d60b15718834e0510e47bedb334fc Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 3 Nov 2021 14:59:31 +0100 -Subject: [PATCH 050/178] fix(LinstorSR): create diskless path if necessary +Subject: [PATCH 050/179] fix(LinstorSR): create diskless path if necessary during VDI loading Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0051-feat-LinstorSR-use-HTTP-NBD-instead-of-DRBD-directly.patch b/SOURCES/0051-feat-LinstorSR-use-HTTP-NBD-instead-of-DRBD-directly.patch index 0b51b002..8afbb273 100644 --- a/SOURCES/0051-feat-LinstorSR-use-HTTP-NBD-instead-of-DRBD-directly.patch +++ b/SOURCES/0051-feat-LinstorSR-use-HTTP-NBD-instead-of-DRBD-directly.patch @@ -1,7 +1,7 @@ From 38960f4621164640ed1c4423959e0fd195569403 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 12 May 2022 17:52:35 +0200 -Subject: [PATCH 051/178] feat(LinstorSR): use HTTP/NBD instead of DRBD +Subject: [PATCH 051/179] feat(LinstorSR): use HTTP/NBD instead of DRBD directly with heartbeat VDI Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0052-fix-LinstorSR-find-controller-when-XAPI-unreachable-.patch b/SOURCES/0052-fix-LinstorSR-find-controller-when-XAPI-unreachable-.patch index a75c5010..d2e59337 100644 --- a/SOURCES/0052-fix-LinstorSR-find-controller-when-XAPI-unreachable-.patch +++ b/SOURCES/0052-fix-LinstorSR-find-controller-when-XAPI-unreachable-.patch @@ -1,7 +1,7 @@ From 43cdaa51754d3e397f17e2092a64919daf6e4a05 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 3 Mar 2022 15:02:17 +0100 -Subject: [PATCH 052/178] fix(LinstorSR): find controller when XAPI unreachable +Subject: [PATCH 052/179] fix(LinstorSR): find controller when XAPI unreachable (XHA) Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0053-fix-LinstorSR-use-IPs-instead-of-hostnames-in-NBD-se.patch b/SOURCES/0053-fix-LinstorSR-use-IPs-instead-of-hostnames-in-NBD-se.patch index fcdf5de2..a9c9a8f0 100644 --- a/SOURCES/0053-fix-LinstorSR-use-IPs-instead-of-hostnames-in-NBD-se.patch +++ b/SOURCES/0053-fix-LinstorSR-use-IPs-instead-of-hostnames-in-NBD-se.patch @@ -1,7 +1,7 @@ From a6d4a6ef809faeb91f4cd7c7f4e4bba8dc2d0b7f Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 24 Mar 2022 18:13:46 +0100 -Subject: [PATCH 053/178] fix(LinstorSR): use IPs instead of hostnames in NBD +Subject: [PATCH 053/179] fix(LinstorSR): use IPs instead of hostnames in NBD server Without this patch we can't use XCP-ng hosts configured with static IPS. diff --git a/SOURCES/0054-fix-LinstorVolumeManager-ensure-we-always-use-IPs-in.patch b/SOURCES/0054-fix-LinstorVolumeManager-ensure-we-always-use-IPs-in.patch index 9611e49e..1a875083 100644 --- a/SOURCES/0054-fix-LinstorVolumeManager-ensure-we-always-use-IPs-in.patch +++ b/SOURCES/0054-fix-LinstorVolumeManager-ensure-we-always-use-IPs-in.patch @@ -1,7 +1,7 @@ From 5e39604cc13941a2d3fe20a2096e3553c1838dba Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 31 Mar 2022 11:21:19 +0200 -Subject: [PATCH 054/178] fix(LinstorVolumeManager): ensure we always use IPs +Subject: [PATCH 054/179] fix(LinstorVolumeManager): ensure we always use IPs in _get_controller_uri Otherwise if a hostname is returned, we can't use it if the XCP-ng pool diff --git a/SOURCES/0055-feat-linstor-manager-add-methods-to-add-remove-host-.patch b/SOURCES/0055-feat-linstor-manager-add-methods-to-add-remove-host-.patch index 176ac7b9..9bd61f5e 100644 --- a/SOURCES/0055-feat-linstor-manager-add-methods-to-add-remove-host-.patch +++ b/SOURCES/0055-feat-linstor-manager-add-methods-to-add-remove-host-.patch @@ -1,7 +1,7 @@ From 28aba096541cca6fb8afcf8d0cb4789b8ef8575f Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 6 Apr 2022 17:53:02 +0200 -Subject: [PATCH 055/178] feat(linstor-manager): add methods to add remove/host +Subject: [PATCH 055/179] feat(linstor-manager): add methods to add remove/host from LINSTOR SR Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0056-feat-LinstorVolumeManager-support-SR-creation-with-d.patch b/SOURCES/0056-feat-LinstorVolumeManager-support-SR-creation-with-d.patch index 096b0ba0..cdbb191e 100644 --- a/SOURCES/0056-feat-LinstorVolumeManager-support-SR-creation-with-d.patch +++ b/SOURCES/0056-feat-LinstorVolumeManager-support-SR-creation-with-d.patch @@ -1,7 +1,7 @@ From 20097cdf57ee556867918c67505fe017d56e20a8 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 13 Apr 2022 15:56:42 +0200 -Subject: [PATCH 056/178] feat(LinstorVolumeManager): support SR creation with +Subject: [PATCH 056/179] feat(LinstorVolumeManager): support SR creation with diskless nodes Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0057-feat-LinstorSR-add-a-config-var-to-disable-HTTP-NBD-.patch b/SOURCES/0057-feat-LinstorSR-add-a-config-var-to-disable-HTTP-NBD-.patch index 98c61652..fad833d3 100644 --- a/SOURCES/0057-feat-LinstorSR-add-a-config-var-to-disable-HTTP-NBD-.patch +++ b/SOURCES/0057-feat-LinstorSR-add-a-config-var-to-disable-HTTP-NBD-.patch @@ -1,7 +1,7 @@ From 95fd9bba2bffc7313f5d155779e14d3922974584 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 14 Apr 2022 10:30:23 +0200 -Subject: [PATCH 057/178] feat(LinstorSR): add a config var to disable HTTP/NBD +Subject: [PATCH 057/179] feat(LinstorSR): add a config var to disable HTTP/NBD servers Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0058-feat-LinstorSr-ensure-LVM-group-is-activated-during-.patch b/SOURCES/0058-feat-LinstorSr-ensure-LVM-group-is-activated-during-.patch index f86173ad..d8353b6b 100644 --- a/SOURCES/0058-feat-LinstorSr-ensure-LVM-group-is-activated-during-.patch +++ b/SOURCES/0058-feat-LinstorSr-ensure-LVM-group-is-activated-during-.patch @@ -1,7 +1,7 @@ From dc48c3878151d9c23db4ca8c5a6247da70797d8c Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 14 Apr 2022 15:45:20 +0200 -Subject: [PATCH 058/178] feat(LinstorSr): ensure LVM group is activated during +Subject: [PATCH 058/179] feat(LinstorSr): ensure LVM group is activated during SR.attach/create Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0059-feat-linstor-manager-add-method-to-create-LinstorSR-.patch b/SOURCES/0059-feat-linstor-manager-add-method-to-create-LinstorSR-.patch index 44250d42..c8cbe6fe 100644 --- a/SOURCES/0059-feat-linstor-manager-add-method-to-create-LinstorSR-.patch +++ b/SOURCES/0059-feat-linstor-manager-add-method-to-create-LinstorSR-.patch @@ -1,7 +1,7 @@ From 705841677140a8163c1ff3df384002e1e03c2678 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 25 Apr 2022 14:47:51 +0200 -Subject: [PATCH 059/178] feat(linstor-manager): add method to create LinstorSR +Subject: [PATCH 059/179] feat(linstor-manager): add method to create LinstorSR + to list/destroy DRBD volumes Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0060-fix-LinstorSR-always-set-vdi_path-in-generate_config.patch b/SOURCES/0060-fix-LinstorSR-always-set-vdi_path-in-generate_config.patch index 96932fd4..75ec5844 100644 --- a/SOURCES/0060-fix-LinstorSR-always-set-vdi_path-in-generate_config.patch +++ b/SOURCES/0060-fix-LinstorSR-always-set-vdi_path-in-generate_config.patch @@ -1,7 +1,7 @@ From 136b46200c12aa90dd246559107e0f742ccb66a7 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 26 Apr 2022 11:20:08 +0200 -Subject: [PATCH 060/178] fix(LinstorSR): always set vdi_path in +Subject: [PATCH 060/179] fix(LinstorSR): always set vdi_path in generate_config If the volume of a generated config is not related to HTTP/NBD diff --git a/SOURCES/0061-fix-minidrbdcluster-supports-new-properties-like-for.patch b/SOURCES/0061-fix-minidrbdcluster-supports-new-properties-like-for.patch index de60de7c..c1178c06 100644 --- a/SOURCES/0061-fix-minidrbdcluster-supports-new-properties-like-for.patch +++ b/SOURCES/0061-fix-minidrbdcluster-supports-new-properties-like-for.patch @@ -1,7 +1,7 @@ From 49fad6ce14acee828ef7d5c90abbc1a4310b788c Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 13 May 2022 14:35:57 +0200 -Subject: [PATCH 061/178] fix(minidrbdcluster): supports new properties like +Subject: [PATCH 061/179] fix(minidrbdcluster): supports new properties like `force-io-failures` Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0062-fix-LinstorSR-enabled-disable-minidrbcluster-with-fi.patch b/SOURCES/0062-fix-LinstorSR-enabled-disable-minidrbcluster-with-fi.patch index 5b285872..a0a4050b 100644 --- a/SOURCES/0062-fix-LinstorSR-enabled-disable-minidrbcluster-with-fi.patch +++ b/SOURCES/0062-fix-LinstorSR-enabled-disable-minidrbcluster-with-fi.patch @@ -1,7 +1,7 @@ From c72704cc8eeb8c7ee16b9ff919c012613e58e9b9 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 18 May 2022 17:28:33 +0200 -Subject: [PATCH 062/178] fix(LinstorSR): enabled/disable minidrbcluster with +Subject: [PATCH 062/179] fix(LinstorSR): enabled/disable minidrbcluster with fixed order Ensure we disable minidrbdcluster during SR destruction on all hosts diff --git a/SOURCES/0063-fix-linstor-manager-change-linstor-satellite-start-b.patch b/SOURCES/0063-fix-linstor-manager-change-linstor-satellite-start-b.patch index cbbc3661..b5105428 100644 --- a/SOURCES/0063-fix-linstor-manager-change-linstor-satellite-start-b.patch +++ b/SOURCES/0063-fix-linstor-manager-change-linstor-satellite-start-b.patch @@ -1,7 +1,7 @@ From 753d654a5f81243b6c7a28880b5936ff0a4077c5 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 31 May 2022 14:01:45 +0200 -Subject: [PATCH 063/178] fix(linstor-manager): change linstor satellite start +Subject: [PATCH 063/179] fix(linstor-manager): change linstor satellite start behavior Ensure we don't have an invalid cache used by a satellite: diff --git a/SOURCES/0064-Fix-is_open-call-for-LinstorSR.patch b/SOURCES/0064-Fix-is_open-call-for-LinstorSR.patch index 280d7a3d..c7da97ca 100644 --- a/SOURCES/0064-Fix-is_open-call-for-LinstorSR.patch +++ b/SOURCES/0064-Fix-is_open-call-for-LinstorSR.patch @@ -1,7 +1,7 @@ From 1a7b9177a0975ef6663607077797d3fe00b73bc6 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 2 Jun 2022 09:04:28 +0200 -Subject: [PATCH 064/178] Fix is_open call for LinstorSR +Subject: [PATCH 064/179] Fix is_open call for LinstorSR 1. Ensure LinstorSR driver is imported in `_is_open` definition to register it in the driver list. Otherwise this function always fails with a SRUnknownType exception. diff --git a/SOURCES/0065-fix-linstorvhdutil-fix-boolean-params-of-check-call.patch b/SOURCES/0065-fix-linstorvhdutil-fix-boolean-params-of-check-call.patch index 8b21e2fe..cbd20739 100644 --- a/SOURCES/0065-fix-linstorvhdutil-fix-boolean-params-of-check-call.patch +++ b/SOURCES/0065-fix-linstorvhdutil-fix-boolean-params-of-check-call.patch @@ -1,7 +1,7 @@ From d03d8fb5ef8790e9de1229200c8cd5e873990026 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 2 Jun 2022 09:28:32 +0200 -Subject: [PATCH 065/178] fix(linstorvhdutil): fix boolean params of `check` +Subject: [PATCH 065/179] fix(linstorvhdutil): fix boolean params of `check` call `ignoreMissingFooter` and `fast` must be string types to be used with XAPI plugin API. diff --git a/SOURCES/0066-feat-linstor-manager-robustify-exec_create_sr.patch b/SOURCES/0066-feat-linstor-manager-robustify-exec_create_sr.patch index 3eee1817..a3e57469 100644 --- a/SOURCES/0066-feat-linstor-manager-robustify-exec_create_sr.patch +++ b/SOURCES/0066-feat-linstor-manager-robustify-exec_create_sr.patch @@ -1,7 +1,7 @@ From 78820c47841ddce844286d12a590bd04c8b7f065 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 30 Jun 2022 17:09:51 +0200 -Subject: [PATCH 066/178] feat(linstor-manager): robustify exec_create_sr +Subject: [PATCH 066/179] feat(linstor-manager): robustify exec_create_sr - Use lvm.py XCP-ng xapi plugins instead of lvm (old name) - Check arguments to create the SR diff --git a/SOURCES/0067-fix-cleanup-print-LINSTOR-VDI-UUID-if-error-during-i.patch b/SOURCES/0067-fix-cleanup-print-LINSTOR-VDI-UUID-if-error-during-i.patch index 81296324..22f63f16 100644 --- a/SOURCES/0067-fix-cleanup-print-LINSTOR-VDI-UUID-if-error-during-i.patch +++ b/SOURCES/0067-fix-cleanup-print-LINSTOR-VDI-UUID-if-error-during-i.patch @@ -1,7 +1,7 @@ From a4922a1709c39af0a7c1a9808bbf7bc03300fcd4 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 8 Jul 2022 14:52:25 +0200 -Subject: [PATCH 067/178] fix(cleanup): print LINSTOR VDI UUID if error during +Subject: [PATCH 067/179] fix(cleanup): print LINSTOR VDI UUID if error during info loading (not SR UUID) Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0068-feat-cleanup-raise-and-dump-DRBD-openers-in-case-of-.patch b/SOURCES/0068-feat-cleanup-raise-and-dump-DRBD-openers-in-case-of-.patch index 16321499..62e2ef43 100644 --- a/SOURCES/0068-feat-cleanup-raise-and-dump-DRBD-openers-in-case-of-.patch +++ b/SOURCES/0068-feat-cleanup-raise-and-dump-DRBD-openers-in-case-of-.patch @@ -1,7 +1,7 @@ From 08c339d4c31048e5d979712dad5adb4cf82c95c7 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 21 Jul 2022 11:39:20 +0200 -Subject: [PATCH 068/178] feat(cleanup): raise and dump DRBD openers in case of +Subject: [PATCH 068/179] feat(cleanup): raise and dump DRBD openers in case of bad coalesce Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0069-feat-linstorvhdutil-trace-DRBD-openers-in-case-of-ER.patch b/SOURCES/0069-feat-linstorvhdutil-trace-DRBD-openers-in-case-of-ER.patch index 64ec0f74..cd6c337a 100644 --- a/SOURCES/0069-feat-linstorvhdutil-trace-DRBD-openers-in-case-of-ER.patch +++ b/SOURCES/0069-feat-linstorvhdutil-trace-DRBD-openers-in-case-of-ER.patch @@ -1,7 +1,7 @@ From 0e6bde3144a0b8cf47aa5e569e6e42b39603bb00 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 22 Jul 2022 10:26:20 +0200 -Subject: [PATCH 069/178] feat(linstorvhdutil): trace DRBD openers in case of +Subject: [PATCH 069/179] feat(linstorvhdutil): trace DRBD openers in case of EROFS errors Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0070-fix-linstorvolumemanager-compute-correctly-size-in-a.patch b/SOURCES/0070-fix-linstorvolumemanager-compute-correctly-size-in-a.patch index be2bce35..a82e56ad 100644 --- a/SOURCES/0070-fix-linstorvolumemanager-compute-correctly-size-in-a.patch +++ b/SOURCES/0070-fix-linstorvolumemanager-compute-correctly-size-in-a.patch @@ -1,7 +1,7 @@ From 4ac2809b987876231912df71bdc6aed6fb02822a Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 29 Jul 2022 17:25:48 +0200 -Subject: [PATCH 070/178] fix(linstorvolumemanager): compute correctly size in +Subject: [PATCH 070/179] fix(linstorvolumemanager): compute correctly size in allocated_volume_size Remove replication count in computation. diff --git a/SOURCES/0071-feat-LinstorSR-use-DRBD-openers-instead-of-lsof-to-l.patch b/SOURCES/0071-feat-LinstorSR-use-DRBD-openers-instead-of-lsof-to-l.patch index 14044189..41e41ea5 100644 --- a/SOURCES/0071-feat-LinstorSR-use-DRBD-openers-instead-of-lsof-to-l.patch +++ b/SOURCES/0071-feat-LinstorSR-use-DRBD-openers-instead-of-lsof-to-l.patch @@ -1,7 +1,7 @@ From 40e0621614ab4334c1edc21e88ae24d5e72df7d6 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 9 Aug 2022 11:07:57 +0200 -Subject: [PATCH 071/178] feat(LinstorSR): use DRBD openers instead of lsof to +Subject: [PATCH 071/179] feat(LinstorSR): use DRBD openers instead of lsof to log in blktap2 Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0072-feat-LinstorSR-support-cProfile-to-trace-calls-when-.patch b/SOURCES/0072-feat-LinstorSR-support-cProfile-to-trace-calls-when-.patch index 2ffc5bc7..2d7e37ca 100644 --- a/SOURCES/0072-feat-LinstorSR-support-cProfile-to-trace-calls-when-.patch +++ b/SOURCES/0072-feat-LinstorSR-support-cProfile-to-trace-calls-when-.patch @@ -1,7 +1,7 @@ From 2bf415703e247e502c8e036ce9a3216888ceab37 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 25 Aug 2022 12:11:18 +0200 -Subject: [PATCH 072/178] feat(LinstorSR): support cProfile to trace calls when +Subject: [PATCH 072/179] feat(LinstorSR): support cProfile to trace calls when a command is executed Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0073-fix-LinstorJournaler-reset-namespace-when-get-is-cal.patch b/SOURCES/0073-fix-LinstorJournaler-reset-namespace-when-get-is-cal.patch index 823a1dc6..660deb07 100644 --- a/SOURCES/0073-fix-LinstorJournaler-reset-namespace-when-get-is-cal.patch +++ b/SOURCES/0073-fix-LinstorJournaler-reset-namespace-when-get-is-cal.patch @@ -1,7 +1,7 @@ From e2900bfd2689841a1230bfbbe9e5c34b735503ea Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 24 Aug 2022 17:09:11 +0200 -Subject: [PATCH 073/178] fix(LinstorJournaler): reset namespace when `get` is +Subject: [PATCH 073/179] fix(LinstorJournaler): reset namespace when `get` is called Otherwise, we can be in the wrong namespace and the key to find will be inaccessible. diff --git a/SOURCES/0074-fix-linstorvhdutil-fix-coalesce-with-VM-running-unde.patch b/SOURCES/0074-fix-linstorvhdutil-fix-coalesce-with-VM-running-unde.patch index 0a2040a9..6d28c8b4 100644 --- a/SOURCES/0074-fix-linstorvhdutil-fix-coalesce-with-VM-running-unde.patch +++ b/SOURCES/0074-fix-linstorvhdutil-fix-coalesce-with-VM-running-unde.patch @@ -1,7 +1,7 @@ From 640c28db2bd83893634fa8740abbbd1023cee0ab Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 25 Aug 2022 10:54:56 +0200 -Subject: [PATCH 074/178] fix(linstorvhdutil): fix coalesce with VM running +Subject: [PATCH 074/179] fix(linstorvhdutil): fix coalesce with VM running under specific scenario: When a VM is running, we can't coalesce without this patch with a long chain diff --git a/SOURCES/0075-fix-linstorvolumemanager-_get_volumes_info-doesn-t-r.patch b/SOURCES/0075-fix-linstorvolumemanager-_get_volumes_info-doesn-t-r.patch index ed44f497..eed702da 100644 --- a/SOURCES/0075-fix-linstorvolumemanager-_get_volumes_info-doesn-t-r.patch +++ b/SOURCES/0075-fix-linstorvolumemanager-_get_volumes_info-doesn-t-r.patch @@ -1,7 +1,7 @@ From af2068715b685b59877d80e2328c10c6dc14318b Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 5 Sep 2022 15:09:17 +0200 -Subject: [PATCH 075/178] fix(linstorvolumemanager): `_get_volumes_info` +Subject: [PATCH 075/179] fix(linstorvolumemanager): `_get_volumes_info` doesn't raise with offline host Ensure this method doesn't raise an exception when a host is offline. diff --git a/SOURCES/0076-fix-linstorvolumemanager-remove-double-prefix-on-kv-.patch b/SOURCES/0076-fix-linstorvolumemanager-remove-double-prefix-on-kv-.patch index e2bc6a51..3e544c26 100644 --- a/SOURCES/0076-fix-linstorvolumemanager-remove-double-prefix-on-kv-.patch +++ b/SOURCES/0076-fix-linstorvolumemanager-remove-double-prefix-on-kv-.patch @@ -1,7 +1,7 @@ From 43ecef813014a86cd92c70e0411f725c24714fe9 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 12 Sep 2022 15:56:09 +0200 -Subject: [PATCH 076/178] fix(linstorvolumemanager): remove double prefix on kv +Subject: [PATCH 076/179] fix(linstorvolumemanager): remove double prefix on kv group name - Before this patch, when the kv store was created/accessed, a double "xcp-sr-" prefix was used. diff --git a/SOURCES/0077-feat-LinstorSR-add-linstor-kv-dump-helper-to-print-k.patch b/SOURCES/0077-feat-LinstorSR-add-linstor-kv-dump-helper-to-print-k.patch index 80f0d640..fb3ce85a 100644 --- a/SOURCES/0077-feat-LinstorSR-add-linstor-kv-dump-helper-to-print-k.patch +++ b/SOURCES/0077-feat-LinstorSR-add-linstor-kv-dump-helper-to-print-k.patch @@ -1,7 +1,7 @@ From 494ecc96c37cb01698c825c00f9ddb3e5c6f53c3 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 12 Sep 2022 17:54:57 +0200 -Subject: [PATCH 077/178] feat(LinstorSR): add linstor-kv-dump helper to print +Subject: [PATCH 077/179] feat(LinstorSR): add linstor-kv-dump helper to print kv store Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0078-fix-LinstorSR-disable-VHD-key-hash-usage-to-limit-ex.patch b/SOURCES/0078-fix-LinstorSR-disable-VHD-key-hash-usage-to-limit-ex.patch index f67bf36d..c6427af5 100644 --- a/SOURCES/0078-fix-LinstorSR-disable-VHD-key-hash-usage-to-limit-ex.patch +++ b/SOURCES/0078-fix-LinstorSR-disable-VHD-key-hash-usage-to-limit-ex.patch @@ -1,7 +1,7 @@ From 59c9be98c2eeeb37e15c76874ca62071dab4c164 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 14 Sep 2022 10:17:18 +0200 -Subject: [PATCH 078/178] fix(LinstorSR): disable VHD key hash usage to limit +Subject: [PATCH 078/179] fix(LinstorSR): disable VHD key hash usage to limit exec time Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0079-fix-minidrbdcluster-ensure-SIGINT-is-handled-correct.patch b/SOURCES/0079-fix-minidrbdcluster-ensure-SIGINT-is-handled-correct.patch index a894d010..719eb68d 100644 --- a/SOURCES/0079-fix-minidrbdcluster-ensure-SIGINT-is-handled-correct.patch +++ b/SOURCES/0079-fix-minidrbdcluster-ensure-SIGINT-is-handled-correct.patch @@ -1,7 +1,7 @@ From 730853aa446f399f3acecb0afa7783ea36ed5240 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 15 Sep 2022 11:34:25 +0200 -Subject: [PATCH 079/178] fix(minidrbdcluster): ensure SIGINT is handled +Subject: [PATCH 079/179] fix(minidrbdcluster): ensure SIGINT is handled correctly This patch is here to make sure no LINSTOR controller survives when diff --git a/SOURCES/0080-feat-minidrbdcluster-stop-resource-services-at-start.patch b/SOURCES/0080-feat-minidrbdcluster-stop-resource-services-at-start.patch index 5ea7569e..5cbdde48 100644 --- a/SOURCES/0080-feat-minidrbdcluster-stop-resource-services-at-start.patch +++ b/SOURCES/0080-feat-minidrbdcluster-stop-resource-services-at-start.patch @@ -1,7 +1,7 @@ From d8a3fcab1752746435c599664efd7f4789e2c58f Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 15 Sep 2022 11:49:34 +0200 -Subject: [PATCH 080/178] feat(minidrbdcluster): stop resource services at +Subject: [PATCH 080/179] feat(minidrbdcluster): stop resource services at startup - Ensure all services are stopped when minidrbcluster is started. diff --git a/SOURCES/0081-feat-linstor-manager-add-new-healthCheck-function-to.patch b/SOURCES/0081-feat-linstor-manager-add-new-healthCheck-function-to.patch index b84181d9..19381e6f 100644 --- a/SOURCES/0081-feat-linstor-manager-add-new-healthCheck-function-to.patch +++ b/SOURCES/0081-feat-linstor-manager-add-new-healthCheck-function-to.patch @@ -1,7 +1,7 @@ From ef9a22262f1cfb444bf01274bfbbf0b53607f341 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 23 Sep 2022 17:45:08 +0200 -Subject: [PATCH 081/178] feat(linstor-manager): add new `healthCheck` function +Subject: [PATCH 081/179] feat(linstor-manager): add new `healthCheck` function to monitor pool (#26) Print a JSON output to monitor state of LINSTOR SRs: diff --git a/SOURCES/0082-fix-LinstorSR-fix-xha-conf-parsing-return-host-ip-no.patch b/SOURCES/0082-fix-LinstorSR-fix-xha-conf-parsing-return-host-ip-no.patch index c98112c6..26a01ddb 100644 --- a/SOURCES/0082-fix-LinstorSR-fix-xha-conf-parsing-return-host-ip-no.patch +++ b/SOURCES/0082-fix-LinstorSR-fix-xha-conf-parsing-return-host-ip-no.patch @@ -1,7 +1,7 @@ From 42c75bb0a6f16360c87f0688ee38d93b3a66e2e2 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 4 Oct 2022 11:01:33 +0200 -Subject: [PATCH 082/178] fix(LinstorSR): fix xha conf parsing => return host +Subject: [PATCH 082/179] fix(LinstorSR): fix xha conf parsing => return host ip, not the UUID Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0083-fix-LinstorSR-start-correctly-HA-servers-HTTP-NBD-af.patch b/SOURCES/0083-fix-LinstorSR-start-correctly-HA-servers-HTTP-NBD-af.patch index bb034c10..8204d077 100644 --- a/SOURCES/0083-fix-LinstorSR-start-correctly-HA-servers-HTTP-NBD-af.patch +++ b/SOURCES/0083-fix-LinstorSR-start-correctly-HA-servers-HTTP-NBD-af.patch @@ -1,7 +1,7 @@ From 3847194acc3cf8769a71e85636d66f0eaacb0593 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 4 Oct 2022 18:48:09 +0200 -Subject: [PATCH 083/178] fix(LinstorSR): start correctly HA servers (HTTP/NBD) +Subject: [PATCH 083/179] fix(LinstorSR): start correctly HA servers (HTTP/NBD) after reboot Use a timeout call after a reboot to get a XAPI session because diff --git a/SOURCES/0084-fix-linstorvolumemanager-use-an-array-to-store-diskf.patch b/SOURCES/0084-fix-linstorvolumemanager-use-an-array-to-store-diskf.patch index 44554e42..50cceb8d 100644 --- a/SOURCES/0084-fix-linstorvolumemanager-use-an-array-to-store-diskf.patch +++ b/SOURCES/0084-fix-linstorvolumemanager-use-an-array-to-store-diskf.patch @@ -1,7 +1,7 @@ From 1af86e89ed07f4b0bce6e032f37f500fb58d0cee Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 5 Oct 2022 10:45:50 +0200 -Subject: [PATCH 084/178] fix(linstorvolumemanager): use an array to store +Subject: [PATCH 084/179] fix(linstorvolumemanager): use an array to store diskful volumes info Otherwise the `is_diskful` attr only reflects the info of one host diff --git a/SOURCES/0085-feat-linstorvolumemanager-support-snaps-when-a-host-.patch b/SOURCES/0085-feat-linstorvolumemanager-support-snaps-when-a-host-.patch index 6263f207..357ad740 100644 --- a/SOURCES/0085-feat-linstorvolumemanager-support-snaps-when-a-host-.patch +++ b/SOURCES/0085-feat-linstorvolumemanager-support-snaps-when-a-host-.patch @@ -1,7 +1,7 @@ From 414bc1efcd2fd9f1b8b41c690bcee46c8d550552 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 6 Oct 2022 17:54:10 +0200 -Subject: [PATCH 085/178] feat(linstorvolumemanager): support snaps when a host +Subject: [PATCH 085/179] feat(linstorvolumemanager): support snaps when a host is offline - Don't create diskless volumes during clone, delay it. diff --git a/SOURCES/0086-fix-linstorvolumemanager-support-offline-hosts-when-.patch b/SOURCES/0086-fix-linstorvolumemanager-support-offline-hosts-when-.patch index ffe54782..aee932fc 100644 --- a/SOURCES/0086-fix-linstorvolumemanager-support-offline-hosts-when-.patch +++ b/SOURCES/0086-fix-linstorvolumemanager-support-offline-hosts-when-.patch @@ -1,7 +1,7 @@ From 32b338239370f6c3d0148723a3c2e6a61903daeb Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 7 Oct 2022 17:18:37 +0200 -Subject: [PATCH 086/178] fix(linstorvolumemanager): support offline hosts when +Subject: [PATCH 086/179] fix(linstorvolumemanager): support offline hosts when plugins are called - Robustify plugin calls diff --git a/SOURCES/0087-fix-linstorvolumemanager-define-_base_group_name-mem.patch b/SOURCES/0087-fix-linstorvolumemanager-define-_base_group_name-mem.patch index 79b7b925..4ce95fc4 100644 --- a/SOURCES/0087-fix-linstorvolumemanager-define-_base_group_name-mem.patch +++ b/SOURCES/0087-fix-linstorvolumemanager-define-_base_group_name-mem.patch @@ -1,7 +1,7 @@ From 846da4170432a4be553ac1e98db146df069ce2ae Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 7 Oct 2022 17:45:26 +0200 -Subject: [PATCH 087/178] fix(linstorvolumemanager): define _base_group_name +Subject: [PATCH 087/179] fix(linstorvolumemanager): define _base_group_name member at SR creation Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0088-feat-linstorvhdutil-modify-logic-of-local-vhdutil-ca.patch b/SOURCES/0088-feat-linstorvhdutil-modify-logic-of-local-vhdutil-ca.patch index 4ec59442..ee72e356 100644 --- a/SOURCES/0088-feat-linstorvhdutil-modify-logic-of-local-vhdutil-ca.patch +++ b/SOURCES/0088-feat-linstorvhdutil-modify-logic-of-local-vhdutil-ca.patch @@ -1,7 +1,7 @@ From 76b0beee9ffa96cc6eb687408a94fde1034ecab7 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 10 Oct 2022 14:33:24 +0200 -Subject: [PATCH 088/178] feat(linstorvhdutil): modify logic of local vhdutil +Subject: [PATCH 088/179] feat(linstorvhdutil): modify logic of local vhdutil calls - Always log openers when we can't call vhdutil locally diff --git a/SOURCES/0089-fix-linstorvolumemanager-robustify-failed-snapshots.patch b/SOURCES/0089-fix-linstorvolumemanager-robustify-failed-snapshots.patch index c7705e87..7e7998ed 100644 --- a/SOURCES/0089-fix-linstorvolumemanager-robustify-failed-snapshots.patch +++ b/SOURCES/0089-fix-linstorvolumemanager-robustify-failed-snapshots.patch @@ -1,7 +1,7 @@ From 5d2f1d8bbc0c46b8ea1096188b73bcddd8e519ff Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 17 Oct 2022 18:14:16 +0200 -Subject: [PATCH 089/178] fix(linstorvolumemanager): robustify failed snapshots +Subject: [PATCH 089/179] fix(linstorvolumemanager): robustify failed snapshots - Ensure we can always rename a failed snap, so we must check if we have metadata in the KV-store. Otherwise an error is triggered diff --git a/SOURCES/0090-fix-linstorvolumemanager-use-a-namespace-for-volumes.patch b/SOURCES/0090-fix-linstorvolumemanager-use-a-namespace-for-volumes.patch index 3167e1d8..adcb82cd 100644 --- a/SOURCES/0090-fix-linstorvolumemanager-use-a-namespace-for-volumes.patch +++ b/SOURCES/0090-fix-linstorvolumemanager-use-a-namespace-for-volumes.patch @@ -1,7 +1,7 @@ From 612f6ccde1042223048bf4f7dec8810bb86d8575 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 8 Nov 2022 17:31:45 +0100 -Subject: [PATCH 090/178] fix(linstorvolumemanager): use a namespace for +Subject: [PATCH 090/179] fix(linstorvolumemanager): use a namespace for volumes - This change is not compatible with existing LINSTOR SR instances! diff --git a/SOURCES/0091-feat-linstor-kv-dump-rename-to-linstor-kv-tool-add-r.patch b/SOURCES/0091-feat-linstor-kv-dump-rename-to-linstor-kv-tool-add-r.patch index 6ba7d151..87386d8f 100644 --- a/SOURCES/0091-feat-linstor-kv-dump-rename-to-linstor-kv-tool-add-r.patch +++ b/SOURCES/0091-feat-linstor-kv-dump-rename-to-linstor-kv-tool-add-r.patch @@ -1,7 +1,7 @@ From 32b38dfdf74d01673c1e9ac177346145aa8a3518 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 14 Nov 2022 17:18:48 +0100 -Subject: [PATCH 091/178] feat(linstor-kv-dump): rename to linstor-kv-tool + +Subject: [PATCH 091/179] feat(linstor-kv-dump): rename to linstor-kv-tool + add remove volume helpers --- diff --git a/SOURCES/0092-fix-LinstorSR-handle-correctly-localhost-during-star.patch b/SOURCES/0092-fix-LinstorSR-handle-correctly-localhost-during-star.patch index 2e323d93..1b2e75c4 100644 --- a/SOURCES/0092-fix-LinstorSR-handle-correctly-localhost-during-star.patch +++ b/SOURCES/0092-fix-LinstorSR-handle-correctly-localhost-during-star.patch @@ -1,7 +1,7 @@ From bcc899d36e498e15ec9e5860f1439fcc4be4622b Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 16 Nov 2022 12:12:12 +0100 -Subject: [PATCH 092/178] fix(LinstorSR): handle correctly localhost during +Subject: [PATCH 092/179] fix(LinstorSR): handle correctly localhost during start/stop of minidrbdcluster Otherwise another controller can be started during `xe sr-destroy` call. diff --git a/SOURCES/0093-fix-cleanup.py-call-repair-on-another-host-when-EROF.patch b/SOURCES/0093-fix-cleanup.py-call-repair-on-another-host-when-EROF.patch index 68a57710..3576ff80 100644 --- a/SOURCES/0093-fix-cleanup.py-call-repair-on-another-host-when-EROF.patch +++ b/SOURCES/0093-fix-cleanup.py-call-repair-on-another-host-when-EROF.patch @@ -1,7 +1,7 @@ From 228634f7d8cc5fa78203272269e114a209821356 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 17 Nov 2022 15:43:25 +0100 -Subject: [PATCH 093/178] fix(cleanup.py): call repair on another host when +Subject: [PATCH 093/179] fix(cleanup.py): call repair on another host when EROFS is returned (DRBD) Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0094-fix-LinstorSR-avoid-introduction-of-DELETED-volumes.patch b/SOURCES/0094-fix-LinstorSR-avoid-introduction-of-DELETED-volumes.patch index dcf713e5..84ea2444 100644 --- a/SOURCES/0094-fix-LinstorSR-avoid-introduction-of-DELETED-volumes.patch +++ b/SOURCES/0094-fix-LinstorSR-avoid-introduction-of-DELETED-volumes.patch @@ -1,7 +1,7 @@ From a17925aa496b1814038ff6f998461b533f90d077 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 17 Nov 2022 15:46:02 +0100 -Subject: [PATCH 094/178] fix(LinstorSR): avoid introduction of DELETED volumes +Subject: [PATCH 094/179] fix(LinstorSR): avoid introduction of DELETED volumes Signed-off-by: Ronan Abhamon --- diff --git a/SOURCES/0095-feat-linstor-kv-tool-remove-all-volumes-supports-jou.patch b/SOURCES/0095-feat-linstor-kv-tool-remove-all-volumes-supports-jou.patch index c6e5ab02..707c05bb 100644 --- a/SOURCES/0095-feat-linstor-kv-tool-remove-all-volumes-supports-jou.patch +++ b/SOURCES/0095-feat-linstor-kv-tool-remove-all-volumes-supports-jou.patch @@ -1,7 +1,7 @@ From e6ef1f66479ae68d5b0809f7a2158106aa1b3eec Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 18 Nov 2022 10:40:58 +0100 -Subject: [PATCH 095/178] feat(linstor-kv-tool): remove-all-volumes supports +Subject: [PATCH 095/179] feat(linstor-kv-tool): remove-all-volumes supports journals now Not yet supported for remove-volume, not sure about the consequences diff --git a/SOURCES/0096-fix-linstorvhdutil-due-to-bad-refactoring-check-call.patch b/SOURCES/0096-fix-linstorvhdutil-due-to-bad-refactoring-check-call.patch index 7dd66ef5..a845ec37 100644 --- a/SOURCES/0096-fix-linstorvhdutil-due-to-bad-refactoring-check-call.patch +++ b/SOURCES/0096-fix-linstorvhdutil-due-to-bad-refactoring-check-call.patch @@ -1,7 +1,7 @@ From 5a94eadf986c919cee83780a9e6cdce167a6701c Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 23 Nov 2022 15:26:51 +0100 -Subject: [PATCH 096/178] fix(linstorvhdutil): due to bad refactoring, check +Subject: [PATCH 096/179] fix(linstorvhdutil): due to bad refactoring, check call was broken Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0097-feat-linstorvhdutil-ensure-we-use-VHD-parent-to-find.patch b/SOURCES/0097-feat-linstorvhdutil-ensure-we-use-VHD-parent-to-find.patch index 2f334aef..bb2b4ee3 100644 --- a/SOURCES/0097-feat-linstorvhdutil-ensure-we-use-VHD-parent-to-find.patch +++ b/SOURCES/0097-feat-linstorvhdutil-ensure-we-use-VHD-parent-to-find.patch @@ -1,7 +1,7 @@ From 8390021e0aedb7ef2979ff9ac9c21fe3367a4f23 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 23 Nov 2022 15:28:23 +0100 -Subject: [PATCH 097/178] feat(linstorvhdutil): ensure we use VHD parent to +Subject: [PATCH 097/179] feat(linstorvhdutil): ensure we use VHD parent to find host where to coalesce Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0098-feat-linstorvolumemanager-force-DRBD-demote-after-fa.patch b/SOURCES/0098-feat-linstorvolumemanager-force-DRBD-demote-after-fa.patch index bab657c9..8a935362 100644 --- a/SOURCES/0098-feat-linstorvolumemanager-force-DRBD-demote-after-fa.patch +++ b/SOURCES/0098-feat-linstorvolumemanager-force-DRBD-demote-after-fa.patch @@ -1,7 +1,7 @@ From b1355b13bc58003fa01f29fb31516f6b1fcc67e8 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 5 Dec 2022 18:40:11 +0100 -Subject: [PATCH 098/178] feat(linstorvolumemanager): force DRBD demote after +Subject: [PATCH 098/179] feat(linstorvolumemanager): force DRBD demote after failed volume creation/clone Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0099-fix-linstorvhdutil-ensure-we-retry-creation-in-all-s.patch b/SOURCES/0099-fix-linstorvhdutil-ensure-we-retry-creation-in-all-s.patch index 54f0b592..bf7c22ec 100644 --- a/SOURCES/0099-fix-linstorvhdutil-ensure-we-retry-creation-in-all-s.patch +++ b/SOURCES/0099-fix-linstorvhdutil-ensure-we-retry-creation-in-all-s.patch @@ -1,7 +1,7 @@ From 33c9cbedb5e26d291dda3f020513db5154dac454 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 6 Dec 2022 11:22:15 +0100 -Subject: [PATCH 099/178] fix(linstorvhdutil): ensure we retry creation in all +Subject: [PATCH 099/179] fix(linstorvhdutil): ensure we retry creation in all situations Without this patch, a basic resource creation is never restarted diff --git a/SOURCES/0100-fix-linstorvhdutil-don-t-retry-local-vhdutil-call-wh.patch b/SOURCES/0100-fix-linstorvhdutil-don-t-retry-local-vhdutil-call-wh.patch index 13e0cad7..46926a82 100644 --- a/SOURCES/0100-fix-linstorvhdutil-don-t-retry-local-vhdutil-call-wh.patch +++ b/SOURCES/0100-fix-linstorvhdutil-don-t-retry-local-vhdutil-call-wh.patch @@ -1,7 +1,7 @@ From e5dafb76bd0436d5d19d33e9d9ecdc9c958863b2 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 7 Dec 2022 17:56:39 +0100 -Subject: [PATCH 100/178] fix(linstorvhdutil): don't retry local vhdutil call +Subject: [PATCH 100/179] fix(linstorvhdutil): don't retry local vhdutil call when EROFS is detected Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0101-feat-fork-log-daemon-ignore-SIGTERM.patch b/SOURCES/0101-feat-fork-log-daemon-ignore-SIGTERM.patch index 53eb8dc9..1db48fc7 100644 --- a/SOURCES/0101-feat-fork-log-daemon-ignore-SIGTERM.patch +++ b/SOURCES/0101-feat-fork-log-daemon-ignore-SIGTERM.patch @@ -1,7 +1,7 @@ From 71e0f39881c539f3677089e103d1f7800fe4a99b Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 15 Dec 2022 14:36:04 +0100 -Subject: [PATCH 101/178] feat(fork-log-daemon): ignore SIGTERM +Subject: [PATCH 101/179] feat(fork-log-daemon): ignore SIGTERM Without this patch, the output logs of the fork-log-daemon child are never displayed when SIGTERM is sent to the PGID. diff --git a/SOURCES/0102-feat-LinstorSR-wait-for-http-disk-server-startup.patch b/SOURCES/0102-feat-LinstorSR-wait-for-http-disk-server-startup.patch index 638dc9fb..22607054 100644 --- a/SOURCES/0102-feat-LinstorSR-wait-for-http-disk-server-startup.patch +++ b/SOURCES/0102-feat-LinstorSR-wait-for-http-disk-server-startup.patch @@ -1,7 +1,7 @@ From 6eec8a19ce65fdcb3336367251901750df329027 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 16 Dec 2022 16:52:50 +0100 -Subject: [PATCH 102/178] feat(LinstorSR): wait for http-disk-server startup +Subject: [PATCH 102/179] feat(LinstorSR): wait for http-disk-server startup Avoid a race condition with NBD server. We must be sure the HTTP server is reachable before the NBD server execution, diff --git a/SOURCES/0103-fix-LinstorSR-handle-inflate-resize-actions-correctl.patch b/SOURCES/0103-fix-LinstorSR-handle-inflate-resize-actions-correctl.patch index 5fb2da5b..e00315c7 100644 --- a/SOURCES/0103-fix-LinstorSR-handle-inflate-resize-actions-correctl.patch +++ b/SOURCES/0103-fix-LinstorSR-handle-inflate-resize-actions-correctl.patch @@ -1,7 +1,7 @@ From ec1278ddf7ba15e35410b6991354ff46deb71ca5 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 16 Jan 2023 17:58:51 +0100 -Subject: [PATCH 103/178] fix(LinstorSR): handle inflate + resize actions +Subject: [PATCH 103/179] fix(LinstorSR): handle inflate + resize actions correctly - Ensure LINSTOR set the expected new volume size when inflate is executed, diff --git a/SOURCES/0104-fix-linstor-manager-add-a-static-iptables-rule-for-D.patch b/SOURCES/0104-fix-linstor-manager-add-a-static-iptables-rule-for-D.patch index 216eba6f..815a029b 100644 --- a/SOURCES/0104-fix-linstor-manager-add-a-static-iptables-rule-for-D.patch +++ b/SOURCES/0104-fix-linstor-manager-add-a-static-iptables-rule-for-D.patch @@ -1,7 +1,7 @@ From 6524029ca094f5063a62a3d4ce42b0794f61fad1 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 17 Jan 2023 11:55:00 +0100 -Subject: [PATCH 104/178] fix(linstor-manager): add a static iptables rule for +Subject: [PATCH 104/179] fix(linstor-manager): add a static iptables rule for DRBD volumes Using the XAPI iptables firewall may drop DRBD packets when the connection diff --git a/SOURCES/0105-feat-LinstorSR-sync-with-last-http-nbd-transfer-vers.patch b/SOURCES/0105-feat-LinstorSR-sync-with-last-http-nbd-transfer-vers.patch index 657a0de5..2a9ab40c 100644 --- a/SOURCES/0105-feat-LinstorSR-sync-with-last-http-nbd-transfer-vers.patch +++ b/SOURCES/0105-feat-LinstorSR-sync-with-last-http-nbd-transfer-vers.patch @@ -1,7 +1,7 @@ From cc57e8036ee5cd993658fcf2bd2ac65ba36156b5 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 3 Feb 2023 16:38:49 +0100 -Subject: [PATCH 105/178] feat(LinstorSR): sync with last http-nbd-transfer +Subject: [PATCH 105/179] feat(LinstorSR): sync with last http-nbd-transfer version - Increase auto promote timeout of heartbeat VDI to reduce CPU usage diff --git a/SOURCES/0106-fix-LinstorSR-don-t-check-VDI-metadata-while-listing.patch b/SOURCES/0106-fix-LinstorSR-don-t-check-VDI-metadata-while-listing.patch index c512ec5c..ab5d5cb4 100644 --- a/SOURCES/0106-fix-LinstorSR-don-t-check-VDI-metadata-while-listing.patch +++ b/SOURCES/0106-fix-LinstorSR-don-t-check-VDI-metadata-while-listing.patch @@ -1,7 +1,7 @@ From 839eb7f719a3e3206b3d5d419b88a63c4d7a7a5d Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 13 Feb 2023 17:24:16 +0100 -Subject: [PATCH 106/178] fix(LinstorSR): don't check VDI metadata while +Subject: [PATCH 106/179] fix(LinstorSR): don't check VDI metadata while listing VDIs if it's deleted Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0107-fix-LinstorSR-don-t-check-metadata-when-destroying-s.patch b/SOURCES/0107-fix-LinstorSR-don-t-check-metadata-when-destroying-s.patch index 238cc1d9..34f00cfe 100644 --- a/SOURCES/0107-fix-LinstorSR-don-t-check-metadata-when-destroying-s.patch +++ b/SOURCES/0107-fix-LinstorSR-don-t-check-metadata-when-destroying-s.patch @@ -1,7 +1,7 @@ From 5de99a76105212088f70b4a7a7daab4b1d5e3f49 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 13 Feb 2023 17:27:43 +0100 -Subject: [PATCH 107/178] fix(LinstorSR): don't check metadata when destroying +Subject: [PATCH 107/179] fix(LinstorSR): don't check metadata when destroying snap in undo_clone Remove useless check in the snap rollback helper when there is an error diff --git a/SOURCES/0108-fix-linstorvhdutil-handle-correctly-generic-exceptio.patch b/SOURCES/0108-fix-linstorvhdutil-handle-correctly-generic-exceptio.patch index 2ffb9c04..76092544 100644 --- a/SOURCES/0108-fix-linstorvhdutil-handle-correctly-generic-exceptio.patch +++ b/SOURCES/0108-fix-linstorvhdutil-handle-correctly-generic-exceptio.patch @@ -1,7 +1,7 @@ From 3aed3787570dae79cef8952cb87596aec8ff98df Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 15 Feb 2023 11:34:54 +0100 -Subject: [PATCH 108/178] fix(linstorvhdutil): handle correctly generic +Subject: [PATCH 108/179] fix(linstorvhdutil): handle correctly generic exceptions in _raise_openers_exception Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0109-fix-minidrbdcluster-robustify-to-unmount-correctly-L.patch b/SOURCES/0109-fix-minidrbdcluster-robustify-to-unmount-correctly-L.patch index 33898a09..df71ae03 100644 --- a/SOURCES/0109-fix-minidrbdcluster-robustify-to-unmount-correctly-L.patch +++ b/SOURCES/0109-fix-minidrbdcluster-robustify-to-unmount-correctly-L.patch @@ -1,7 +1,7 @@ From 1f41b0a39ce73787bf51a226d8bc515fc664f122 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 16 Feb 2023 14:24:07 +0100 -Subject: [PATCH 109/178] fix(minidrbdcluster): robustify to unmount correctly +Subject: [PATCH 109/179] fix(minidrbdcluster): robustify to unmount correctly LINSTOR DB There is a small delay during which the database may not be unmounted diff --git a/SOURCES/0110-fix-minidrbdcluster-handle-correctly-KeyboardInterru.patch b/SOURCES/0110-fix-minidrbdcluster-handle-correctly-KeyboardInterru.patch index 838c5228..99e8f646 100644 --- a/SOURCES/0110-fix-minidrbdcluster-handle-correctly-KeyboardInterru.patch +++ b/SOURCES/0110-fix-minidrbdcluster-handle-correctly-KeyboardInterru.patch @@ -1,7 +1,7 @@ From cccde07e13727a1f03e47ed33f2487dfce1bdaed Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 20 Feb 2023 19:30:18 +0100 -Subject: [PATCH 110/178] fix(minidrbdcluster): handle correctly +Subject: [PATCH 110/179] fix(minidrbdcluster): handle correctly KeyboardInterrupt with systemd units It's necessary to always add systemd services in the running list before diff --git a/SOURCES/0111-feat-LinstorSR-use-drbd-reactor-instead-of-minidrbdc.patch b/SOURCES/0111-feat-LinstorSR-use-drbd-reactor-instead-of-minidrbdc.patch index d794d5ec..96827846 100644 --- a/SOURCES/0111-feat-LinstorSR-use-drbd-reactor-instead-of-minidrbdc.patch +++ b/SOURCES/0111-feat-LinstorSR-use-drbd-reactor-instead-of-minidrbdc.patch @@ -1,7 +1,7 @@ From 6da63ee78f16326dc8699706d58d58fe3a5c4ec3 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 24 Feb 2023 14:28:29 +0100 -Subject: [PATCH 111/178] feat(LinstorSR): use drbd-reactor instead of +Subject: [PATCH 111/179] feat(LinstorSR): use drbd-reactor instead of minidrbdcluster Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0112-fix-LinstorSR-ensure-vhdutil-calls-are-correctly-exe.patch b/SOURCES/0112-fix-LinstorSR-ensure-vhdutil-calls-are-correctly-exe.patch index ec370399..4bbc0171 100644 --- a/SOURCES/0112-fix-LinstorSR-ensure-vhdutil-calls-are-correctly-exe.patch +++ b/SOURCES/0112-fix-LinstorSR-ensure-vhdutil-calls-are-correctly-exe.patch @@ -1,7 +1,7 @@ From c27027a689f926d2a0235e1dc85d4891f0346815 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 1 Mar 2023 10:56:43 +0100 -Subject: [PATCH 112/178] fix(LinstorSR): ensure vhdutil calls are correctly +Subject: [PATCH 112/179] fix(LinstorSR): ensure vhdutil calls are correctly executed on pools with > 3 hosts Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0113-fix-LinstorSR-replace-bad-param-in-detach_thin-impl.patch b/SOURCES/0113-fix-LinstorSR-replace-bad-param-in-detach_thin-impl.patch index 85544d0b..c32a3077 100644 --- a/SOURCES/0113-fix-LinstorSR-replace-bad-param-in-detach_thin-impl.patch +++ b/SOURCES/0113-fix-LinstorSR-replace-bad-param-in-detach_thin-impl.patch @@ -1,7 +1,7 @@ From 6da70e1e569db84a6220d5c568b0e18547011dd3 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 9 Mar 2023 17:06:59 +0100 -Subject: [PATCH 113/178] fix(LinstorSR): replace bad param in detach_thin impl +Subject: [PATCH 113/179] fix(LinstorSR): replace bad param in detach_thin impl To get the physical size, the volume UUID must be used, not the path. diff --git a/SOURCES/0114-fix-linstorvolumemanager-remove-usage-of-realpath.patch b/SOURCES/0114-fix-linstorvolumemanager-remove-usage-of-realpath.patch index 96e68c9e..bc2e2a31 100644 --- a/SOURCES/0114-fix-linstorvolumemanager-remove-usage-of-realpath.patch +++ b/SOURCES/0114-fix-linstorvolumemanager-remove-usage-of-realpath.patch @@ -1,7 +1,7 @@ From 84f028a160d8cf7273dbe2c73f35e798b4ad0b9d Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 10 Mar 2023 18:11:10 +0100 -Subject: [PATCH 114/178] fix(linstorvolumemanager): remove usage of realpath +Subject: [PATCH 114/179] fix(linstorvolumemanager): remove usage of realpath Because a diskless DRBD path not always exist, get_volume_name_from_device_path can fail. It's easy to reproduce using > 4 hosts and with a call to linstorvhdutil.get_vhd_info: diff --git a/SOURCES/0115-fix-linstorvhdutil-avoid-parent-path-resolution.patch b/SOURCES/0115-fix-linstorvhdutil-avoid-parent-path-resolution.patch index 40c0e1d4..ce365cf2 100644 --- a/SOURCES/0115-fix-linstorvhdutil-avoid-parent-path-resolution.patch +++ b/SOURCES/0115-fix-linstorvhdutil-avoid-parent-path-resolution.patch @@ -1,7 +1,7 @@ From cc3f34ef376bcf1f5e036f830ffc3f68c64154c8 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 16 Mar 2023 18:54:46 +0100 -Subject: [PATCH 115/178] fix(linstorvhdutil): avoid parent path resolution +Subject: [PATCH 115/179] fix(linstorvhdutil): avoid parent path resolution When many hosts are used (>= 4), we can fail to get VHD info (with parent option) because the local parent VDI diff --git a/SOURCES/0116-fix-LinstorSR-create-parent-path-during-attach.patch b/SOURCES/0116-fix-LinstorSR-create-parent-path-during-attach.patch index e0e7f35f..77730a90 100644 --- a/SOURCES/0116-fix-LinstorSR-create-parent-path-during-attach.patch +++ b/SOURCES/0116-fix-LinstorSR-create-parent-path-during-attach.patch @@ -1,7 +1,7 @@ From 2201c29474b54183acb4b529a773c94a3571ca61 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 17 Mar 2023 12:06:08 +0100 -Subject: [PATCH 116/178] fix(LinstorSR): create parent path during attach +Subject: [PATCH 116/179] fix(LinstorSR): create parent path during attach It's necessary to force DRBD diskless path creation when a VDI is attached. Otherwise the attach can fail on pool with diff --git a/SOURCES/0117-fix-LinstorSR-retry-if-we-can-t-build-volume-cache.patch b/SOURCES/0117-fix-LinstorSR-retry-if-we-can-t-build-volume-cache.patch index 660d720a..4d7e1e99 100644 --- a/SOURCES/0117-fix-LinstorSR-retry-if-we-can-t-build-volume-cache.patch +++ b/SOURCES/0117-fix-LinstorSR-retry-if-we-can-t-build-volume-cache.patch @@ -1,7 +1,7 @@ From 71bbec844018985c25dc2c84ad9c1624065a8ca7 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 3 Apr 2023 10:03:57 +0200 -Subject: [PATCH 117/178] fix(LinstorSR): retry if we can't build volume cache +Subject: [PATCH 117/179] fix(LinstorSR): retry if we can't build volume cache Otherwise after SR creation, the master PBD can be unplugged. See: https://xcp-ng.org/forum/post/60726 diff --git a/SOURCES/0118-fix-linstorvolumemanager-reduce-peer-slots-param-to-.patch b/SOURCES/0118-fix-linstorvolumemanager-reduce-peer-slots-param-to-.patch index c8c92e80..e42852be 100644 --- a/SOURCES/0118-fix-linstorvolumemanager-reduce-peer-slots-param-to-.patch +++ b/SOURCES/0118-fix-linstorvolumemanager-reduce-peer-slots-param-to-.patch @@ -1,7 +1,7 @@ From d67af12145aaf807bee1e16ea4647bbbafef3666 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 25 Apr 2023 10:46:00 +0200 -Subject: [PATCH 118/178] fix(linstorvolumemanager): reduce peer-slots param to +Subject: [PATCH 118/179] fix(linstorvolumemanager): reduce peer-slots param to 3 Because we use 3 backing disks at most, it's useless to increase the default linstor limit (8). diff --git a/SOURCES/0119-fix-LinstorSR-attach-a-valid-XAPI-session-is_open-is.patch b/SOURCES/0119-fix-LinstorSR-attach-a-valid-XAPI-session-is_open-is.patch index 1988dba6..3d70ea18 100644 --- a/SOURCES/0119-fix-LinstorSR-attach-a-valid-XAPI-session-is_open-is.patch +++ b/SOURCES/0119-fix-LinstorSR-attach-a-valid-XAPI-session-is_open-is.patch @@ -1,7 +1,7 @@ From ec5a6609241a382f5734577f35194911ec8a1876 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 25 Apr 2023 11:20:55 +0200 -Subject: [PATCH 119/178] fix(LinstorSR): attach a valid XAPI session is_open +Subject: [PATCH 119/179] fix(LinstorSR): attach a valid XAPI session is_open is called Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0120-fix-LinstorSR-ensure-we-always-have-a-DRBD-path-to-s.patch b/SOURCES/0120-fix-LinstorSR-ensure-we-always-have-a-DRBD-path-to-s.patch index 2ca015b7..26b66a04 100644 --- a/SOURCES/0120-fix-LinstorSR-ensure-we-always-have-a-DRBD-path-to-s.patch +++ b/SOURCES/0120-fix-LinstorSR-ensure-we-always-have-a-DRBD-path-to-s.patch @@ -1,7 +1,7 @@ From ec92e0b26035555a9492809c1cae1fed1425e01f Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 28 Apr 2023 10:43:27 +0200 -Subject: [PATCH 120/178] fix(LinstorSR): ensure we always have a DRBD path to +Subject: [PATCH 120/179] fix(LinstorSR): ensure we always have a DRBD path to snap Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0121-fix-LinstorSR-remove-hosts-ips-param.patch b/SOURCES/0121-fix-LinstorSR-remove-hosts-ips-param.patch index 9fbaf189..e393872b 100644 --- a/SOURCES/0121-fix-LinstorSR-remove-hosts-ips-param.patch +++ b/SOURCES/0121-fix-LinstorSR-remove-hosts-ips-param.patch @@ -1,7 +1,7 @@ From 6afb9f195a5b3ce97d6f727337708ce536e19456 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 30 May 2023 11:19:13 +0200 -Subject: [PATCH 121/178] fix(LinstorSR): remove hosts/ips param +Subject: [PATCH 121/179] fix(LinstorSR): remove hosts/ips param --- drivers/LinstorSR.py | 47 +++++---------------------------- diff --git a/SOURCES/0122-fix-LinstorSR-compute-correctly-SR-size-using-pool-c.patch b/SOURCES/0122-fix-LinstorSR-compute-correctly-SR-size-using-pool-c.patch index 6fad327d..cb9d130f 100644 --- a/SOURCES/0122-fix-LinstorSR-compute-correctly-SR-size-using-pool-c.patch +++ b/SOURCES/0122-fix-LinstorSR-compute-correctly-SR-size-using-pool-c.patch @@ -1,7 +1,7 @@ From 46d03cba7a491c03335a4ea5549df187c5c72806 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 1 Jun 2023 17:40:37 +0200 -Subject: [PATCH 122/178] fix(LinstorSR): compute correctly SR size using pool +Subject: [PATCH 122/179] fix(LinstorSR): compute correctly SR size using pool count Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0123-fix-blktap2-ensure-we-can-import-this-module-when-LI.patch b/SOURCES/0123-fix-blktap2-ensure-we-can-import-this-module-when-LI.patch index 6ae5e9a5..ff5e9414 100644 --- a/SOURCES/0123-fix-blktap2-ensure-we-can-import-this-module-when-LI.patch +++ b/SOURCES/0123-fix-blktap2-ensure-we-can-import-this-module-when-LI.patch @@ -1,7 +1,7 @@ From d3c6b68c18e910c1defbdfa815718e16e9323bca Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 6 Jun 2023 11:50:54 +0200 -Subject: [PATCH 123/178] fix(blktap2): ensure we can import this module when +Subject: [PATCH 123/179] fix(blktap2): ensure we can import this module when LINSTOR is not installed Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0124-fix-LinstorSR-ensure-volume-cache-can-be-recreated.patch b/SOURCES/0124-fix-LinstorSR-ensure-volume-cache-can-be-recreated.patch index a5267eea..98f6deb9 100644 --- a/SOURCES/0124-fix-LinstorSR-ensure-volume-cache-can-be-recreated.patch +++ b/SOURCES/0124-fix-LinstorSR-ensure-volume-cache-can-be-recreated.patch @@ -1,7 +1,7 @@ From 99788730369ee3eb883d76b53b61a195f95c885d Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 21 Jun 2023 14:10:18 +0200 -Subject: [PATCH 124/178] fix(LinstorSR): ensure volume cache can be recreated +Subject: [PATCH 124/179] fix(LinstorSR): ensure volume cache can be recreated After SR creation we may fail to load volumes with this exception: "Failed to get usable size of..." and so we can't plug the master PBD. diff --git a/SOURCES/0125-fix-linstor-manager-remove-dead-useless-code-in-add-.patch b/SOURCES/0125-fix-linstor-manager-remove-dead-useless-code-in-add-.patch index 5ef43886..acc5de0f 100644 --- a/SOURCES/0125-fix-linstor-manager-remove-dead-useless-code-in-add-.patch +++ b/SOURCES/0125-fix-linstor-manager-remove-dead-useless-code-in-add-.patch @@ -1,7 +1,7 @@ From c341a4047f34b35b128fd5555eeffe62b6a8977a Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 20 Jul 2023 10:46:33 +0200 -Subject: [PATCH 125/178] fix(linstor-manager): remove dead/useless code in +Subject: [PATCH 125/179] fix(linstor-manager): remove dead/useless code in add/remove_host helpers Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0126-fix-LinstorSR-Ensure-we-always-have-a-device-path-du.patch b/SOURCES/0126-fix-LinstorSR-Ensure-we-always-have-a-device-path-du.patch index 9bba4c29..b9885b81 100644 --- a/SOURCES/0126-fix-LinstorSR-Ensure-we-always-have-a-device-path-du.patch +++ b/SOURCES/0126-fix-LinstorSR-Ensure-we-always-have-a-device-path-du.patch @@ -1,7 +1,7 @@ From b63d80afb41d5cc1d053a3eb9cb12fe9d7c5cfee Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 1 Aug 2023 15:16:17 +0200 -Subject: [PATCH 126/178] fix(LinstorSR): Ensure we always have a device path +Subject: [PATCH 126/179] fix(LinstorSR): Ensure we always have a device path during leaf-coalesce calls So we must not verify that we have a valid DRBD path in the load step, diff --git a/SOURCES/0127-fix-LinstorSR-always-use-lock.acquire-during-attach-.patch b/SOURCES/0127-fix-LinstorSR-always-use-lock.acquire-during-attach-.patch index 06b634b8..8db443bc 100644 --- a/SOURCES/0127-fix-LinstorSR-always-use-lock.acquire-during-attach-.patch +++ b/SOURCES/0127-fix-LinstorSR-always-use-lock.acquire-during-attach-.patch @@ -1,7 +1,7 @@ From 859ddf7beed5f4c8967879a1815ba408b5990db1 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 16 Aug 2023 12:04:01 +0200 -Subject: [PATCH 127/178] fix(LinstorSR): always use lock.acquire() during +Subject: [PATCH 127/179] fix(LinstorSR): always use lock.acquire() during attach/detach We can't use a retry range on the lock because we can trigger a bad situation diff --git a/SOURCES/0128-fix-LinstorSR-mare-sure-hostnames-are-unique-at-SR-c.patch b/SOURCES/0128-fix-LinstorSR-mare-sure-hostnames-are-unique-at-SR-c.patch index cb75bacf..15f20271 100644 --- a/SOURCES/0128-fix-LinstorSR-mare-sure-hostnames-are-unique-at-SR-c.patch +++ b/SOURCES/0128-fix-LinstorSR-mare-sure-hostnames-are-unique-at-SR-c.patch @@ -1,7 +1,7 @@ From 02b497c783fab888e8127ab5d1dd8b58632d2995 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 17 Aug 2023 14:52:13 +0200 -Subject: [PATCH 128/178] fix(LinstorSR): mare sure hostnames are unique at SR +Subject: [PATCH 128/179] fix(LinstorSR): mare sure hostnames are unique at SR creation Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0129-fix-LinstorSR-ensure-we-can-attach-non-special-stati.patch b/SOURCES/0129-fix-LinstorSR-ensure-we-can-attach-non-special-stati.patch index 1512e878..810940ce 100644 --- a/SOURCES/0129-fix-LinstorSR-ensure-we-can-attach-non-special-stati.patch +++ b/SOURCES/0129-fix-LinstorSR-ensure-we-can-attach-non-special-stati.patch @@ -1,7 +1,7 @@ From 6dff0030453b2031f625518f4e4fc6ae8a168eb9 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 18 Aug 2023 11:06:56 +0200 -Subject: [PATCH 129/178] fix(LinstorSR): ensure we can attach non-special +Subject: [PATCH 129/179] fix(LinstorSR): ensure we can attach non-special static VDIs Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0130-fix-LinstorSR-ensure-we-can-detach-when-deflate-call.patch b/SOURCES/0130-fix-LinstorSR-ensure-we-can-detach-when-deflate-call.patch index c18ee481..6e6eb626 100644 --- a/SOURCES/0130-fix-LinstorSR-ensure-we-can-detach-when-deflate-call.patch +++ b/SOURCES/0130-fix-LinstorSR-ensure-we-can-detach-when-deflate-call.patch @@ -1,7 +1,7 @@ From 0d58254293a08ee5f0b1c4b8529dc04a8ea161f2 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 31 Aug 2023 18:00:27 +0200 -Subject: [PATCH 130/178] fix(LinstorSR): ensure we can detach when deflate +Subject: [PATCH 130/179] fix(LinstorSR): ensure we can detach when deflate call is not possible Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0131-fix-LinstorSR-assume-VDI-is-always-a-VHD-when-the-in.patch b/SOURCES/0131-fix-LinstorSR-assume-VDI-is-always-a-VHD-when-the-in.patch index 4e77a648..515b028f 100644 --- a/SOURCES/0131-fix-LinstorSR-assume-VDI-is-always-a-VHD-when-the-in.patch +++ b/SOURCES/0131-fix-LinstorSR-assume-VDI-is-always-a-VHD-when-the-in.patch @@ -1,7 +1,7 @@ From 32ecbab86a91729a8b2d2f11830a8354d0a78a62 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 28 Sep 2023 16:00:02 +0200 -Subject: [PATCH 131/178] fix(LinstorSR): assume VDI is always a VHD when the +Subject: [PATCH 131/179] fix(LinstorSR): assume VDI is always a VHD when the info is missing during cleanup Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0132-fix-LinstorSR-remove-SR-lock-during-thin-attach-deta.patch b/SOURCES/0132-fix-LinstorSR-remove-SR-lock-during-thin-attach-deta.patch index 6d03653a..d8840c53 100644 --- a/SOURCES/0132-fix-LinstorSR-remove-SR-lock-during-thin-attach-deta.patch +++ b/SOURCES/0132-fix-LinstorSR-remove-SR-lock-during-thin-attach-deta.patch @@ -1,7 +1,7 @@ From 70ce954b27d64a8e6b7584270f9191409eef4161 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 2 Oct 2023 16:48:49 +0200 -Subject: [PATCH 132/178] fix(LinstorSR): remove SR lock during thin +Subject: [PATCH 132/179] fix(LinstorSR): remove SR lock during thin attach/detach This lock is normally useless and can create a dead lock when thin mode is activated: diff --git a/SOURCES/0133-fix-LinstorSR-ensure-database-is-mounted-during-scan.patch b/SOURCES/0133-fix-LinstorSR-ensure-database-is-mounted-during-scan.patch index 7443ba1b..5e06f9d7 100644 --- a/SOURCES/0133-fix-LinstorSR-ensure-database-is-mounted-during-scan.patch +++ b/SOURCES/0133-fix-LinstorSR-ensure-database-is-mounted-during-scan.patch @@ -1,7 +1,7 @@ From c6079f164c87e87c519cd1eb1d9c79603bc19906 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 3 Oct 2023 18:42:42 +0200 -Subject: [PATCH 133/178] fix(LinstorSR): ensure database is mounted during +Subject: [PATCH 133/179] fix(LinstorSR): ensure database is mounted during scan Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0134-fix-LinstorSR-restart-drbd-reactor-in-case-of-failur.patch b/SOURCES/0134-fix-LinstorSR-restart-drbd-reactor-in-case-of-failur.patch index b64f2a51..4b831a15 100644 --- a/SOURCES/0134-fix-LinstorSR-restart-drbd-reactor-in-case-of-failur.patch +++ b/SOURCES/0134-fix-LinstorSR-restart-drbd-reactor-in-case-of-failur.patch @@ -1,7 +1,7 @@ From 9f7664dbeb77485792a15db05e794e6f0c5edceb Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 4 Oct 2023 14:30:36 +0200 -Subject: [PATCH 134/178] fix(LinstorSR): restart drbd-reactor in case of +Subject: [PATCH 134/179] fix(LinstorSR): restart drbd-reactor in case of failure Otherwise we can have all hosts unusable after a massive reboot: diff --git a/SOURCES/0135-fix-linstorvolumemanager-retry-in-case-of-failure-du.patch b/SOURCES/0135-fix-linstorvolumemanager-retry-in-case-of-failure-du.patch index b4971a07..f6e760b0 100644 --- a/SOURCES/0135-fix-linstorvolumemanager-retry-in-case-of-failure-du.patch +++ b/SOURCES/0135-fix-linstorvolumemanager-retry-in-case-of-failure-du.patch @@ -1,7 +1,7 @@ From bdd5c9af875ffc62d413a29ce70d2408b78a1304 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 9 Oct 2023 10:37:32 +0200 -Subject: [PATCH 135/178] fix(linstorvolumemanager): retry in case of failure +Subject: [PATCH 135/179] fix(linstorvolumemanager): retry in case of failure during mkfs call on database The device is not always ready after creation. diff --git a/SOURCES/0136-fix-linstorvolumemanager-avoid-diskless-creation-whe.patch b/SOURCES/0136-fix-linstorvolumemanager-avoid-diskless-creation-whe.patch index dbe7ef2c..06cf4032 100644 --- a/SOURCES/0136-fix-linstorvolumemanager-avoid-diskless-creation-whe.patch +++ b/SOURCES/0136-fix-linstorvolumemanager-avoid-diskless-creation-whe.patch @@ -1,7 +1,7 @@ From a6352f0f967b9f688240e3bd2928330fab772893 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 26 Sep 2023 11:48:38 +0200 -Subject: [PATCH 136/178] fix(linstorvolumemanager): avoid diskless creation +Subject: [PATCH 136/179] fix(linstorvolumemanager): avoid diskless creation when a new resource is added Like said in this discussion https://github.com/xcp-ng/sm/pull/34 : diff --git a/SOURCES/0137-fix-LinstorSR-remove-diskless-after-VDI.detach-calls.patch b/SOURCES/0137-fix-LinstorSR-remove-diskless-after-VDI.detach-calls.patch index d6788193..be07c2e8 100644 --- a/SOURCES/0137-fix-LinstorSR-remove-diskless-after-VDI.detach-calls.patch +++ b/SOURCES/0137-fix-LinstorSR-remove-diskless-after-VDI.detach-calls.patch @@ -1,7 +1,7 @@ From e543a48ebf3139d6423b5273777592bfe172a58c Mon Sep 17 00:00:00 2001 From: Rene Peinthor Date: Tue, 25 Jul 2023 11:19:39 +0200 -Subject: [PATCH 137/178] fix(LinstorSR): remove diskless after VDI.detach +Subject: [PATCH 137/179] fix(LinstorSR): remove diskless after VDI.detach calls Signed-off-by: Rene Peinthor diff --git a/SOURCES/0138-fix-LinstorSR-robustify-_load_vdi_info-in-cleanup.py.patch b/SOURCES/0138-fix-LinstorSR-robustify-_load_vdi_info-in-cleanup.py.patch index 607bb851..3a6f38a5 100644 --- a/SOURCES/0138-fix-LinstorSR-robustify-_load_vdi_info-in-cleanup.py.patch +++ b/SOURCES/0138-fix-LinstorSR-robustify-_load_vdi_info-in-cleanup.py.patch @@ -1,7 +1,7 @@ From c3f1a7b62b9696cc6abb305a5164a75b49240de6 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 11 Oct 2023 12:39:56 +0200 -Subject: [PATCH 138/178] fix(LinstorSR): robustify _load_vdi_info in +Subject: [PATCH 138/179] fix(LinstorSR): robustify _load_vdi_info in cleanup.py After a failed snapshot like that: diff --git a/SOURCES/0139-fix-LinstorSR-ensure-detach-never-fails-on-plugin-fa.patch b/SOURCES/0139-fix-LinstorSR-ensure-detach-never-fails-on-plugin-fa.patch index e11b6690..5235f5d6 100644 --- a/SOURCES/0139-fix-LinstorSR-ensure-detach-never-fails-on-plugin-fa.patch +++ b/SOURCES/0139-fix-LinstorSR-ensure-detach-never-fails-on-plugin-fa.patch @@ -1,7 +1,7 @@ From f885dbd5d82b1af3ca70b38a0640580207d9bf5a Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 23 Oct 2023 14:31:27 +0200 -Subject: [PATCH 139/178] fix(LinstorSR): ensure detach never fails on plugin +Subject: [PATCH 139/179] fix(LinstorSR): ensure detach never fails on plugin failure Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0140-fix-LinstorSR-ensure-we-coalesce-only-volumes-with-a.patch b/SOURCES/0140-fix-LinstorSR-ensure-we-coalesce-only-volumes-with-a.patch index fd4e6097..1b320174 100644 --- a/SOURCES/0140-fix-LinstorSR-ensure-we-coalesce-only-volumes-with-a.patch +++ b/SOURCES/0140-fix-LinstorSR-ensure-we-coalesce-only-volumes-with-a.patch @@ -1,7 +1,7 @@ From 3633eecad17dc34a65fbb127f11ec90c5934d2d4 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 23 Oct 2023 15:52:23 +0200 -Subject: [PATCH 140/178] fix(LinstorSR): ensure we coalesce only volumes with +Subject: [PATCH 140/179] fix(LinstorSR): ensure we coalesce only volumes with a valid size --- diff --git a/SOURCES/0141-fix-LinstorSR-don-t-try-to-repair-persistent-volumes.patch b/SOURCES/0141-fix-LinstorSR-don-t-try-to-repair-persistent-volumes.patch index 35f9c9df..c0ff4ce5 100644 --- a/SOURCES/0141-fix-LinstorSR-don-t-try-to-repair-persistent-volumes.patch +++ b/SOURCES/0141-fix-LinstorSR-don-t-try-to-repair-persistent-volumes.patch @@ -1,7 +1,7 @@ From 3be63d299ba706e86f1fbcac59d5173967860a2e Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 24 Oct 2023 11:57:40 +0200 -Subject: [PATCH 141/178] fix(LinstorSR): don't try to repair persistent +Subject: [PATCH 141/179] fix(LinstorSR): don't try to repair persistent volumes in GC Use constants to simplify maintenance. diff --git a/SOURCES/0142-fix-linstorvhdutil-format-correctly-message-if-vhd-u.patch b/SOURCES/0142-fix-linstorvhdutil-format-correctly-message-if-vhd-u.patch index 4b328cab..60096cbe 100644 --- a/SOURCES/0142-fix-linstorvhdutil-format-correctly-message-if-vhd-u.patch +++ b/SOURCES/0142-fix-linstorvhdutil-format-correctly-message-if-vhd-u.patch @@ -1,7 +1,7 @@ From 1230aa74fee21eabb70be27959d16a01b20dd747 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 14 Nov 2023 18:21:53 +0100 -Subject: [PATCH 142/178] fix(linstorvhdutil): format correctly message if +Subject: [PATCH 142/179] fix(linstorvhdutil): format correctly message if vhd-util cannot be run Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0143-fix-LinstorSR-wait-during-attach-to-open-DRBD-path.patch b/SOURCES/0143-fix-LinstorSR-wait-during-attach-to-open-DRBD-path.patch index 897cc47e..06e7b2a3 100644 --- a/SOURCES/0143-fix-LinstorSR-wait-during-attach-to-open-DRBD-path.patch +++ b/SOURCES/0143-fix-LinstorSR-wait-during-attach-to-open-DRBD-path.patch @@ -1,7 +1,7 @@ From 7bfaf3d9be6f56fec13b0f8536e8748fc053620a Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 24 Oct 2023 23:07:23 +0200 -Subject: [PATCH 143/178] fix(LinstorSR): wait during attach to open DRBD path +Subject: [PATCH 143/179] fix(LinstorSR): wait during attach to open DRBD path ENODATA and other errors like EROFS can be raised when a new DRBD path is created on the fly. So ensure to block before tapdisk starts. diff --git a/SOURCES/0144-fix-LinstorSR-support-different-volume-sizes-in-clea.patch b/SOURCES/0144-fix-LinstorSR-support-different-volume-sizes-in-clea.patch index 9d280f4b..ac6734bb 100644 --- a/SOURCES/0144-fix-LinstorSR-support-different-volume-sizes-in-clea.patch +++ b/SOURCES/0144-fix-LinstorSR-support-different-volume-sizes-in-clea.patch @@ -1,7 +1,7 @@ From cbbfa5a864ea184ecfed516cf0948a5b5075dfda Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 14 Nov 2023 18:08:26 +0100 -Subject: [PATCH 144/178] fix(LinstorSR): support different volume sizes in +Subject: [PATCH 144/179] fix(LinstorSR): support different volume sizes in cleanup.py Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0145-fix-LinstorSR-remove-useless-IPS_XHA_CACHE-var.patch b/SOURCES/0145-fix-LinstorSR-remove-useless-IPS_XHA_CACHE-var.patch index 7deb5b59..60d7117d 100644 --- a/SOURCES/0145-fix-LinstorSR-remove-useless-IPS_XHA_CACHE-var.patch +++ b/SOURCES/0145-fix-LinstorSR-remove-useless-IPS_XHA_CACHE-var.patch @@ -1,7 +1,7 @@ From 1b324ce8a21ca4bf18125e43885683084a5a8c08 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 20 Nov 2023 10:52:27 +0100 -Subject: [PATCH 145/178] fix(LinstorSR): remove useless IPS_XHA_CACHE var +Subject: [PATCH 145/179] fix(LinstorSR): remove useless IPS_XHA_CACHE var Signed-off-by: Ronan Abhamon --- diff --git a/SOURCES/0146-fix-LinstorSR-ensure-we-can-deflate-on-any-host-afte.patch b/SOURCES/0146-fix-LinstorSR-ensure-we-can-deflate-on-any-host-afte.patch index 16ced1c8..0346fbbf 100644 --- a/SOURCES/0146-fix-LinstorSR-ensure-we-can-deflate-on-any-host-afte.patch +++ b/SOURCES/0146-fix-LinstorSR-ensure-we-can-deflate-on-any-host-afte.patch @@ -1,7 +1,7 @@ From 4a7d088083167e073cf0149f3ad54aa0c31869c3 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 21 Nov 2023 13:50:24 +0100 -Subject: [PATCH 146/178] fix(LinstorSR): ensure we can deflate on any host +Subject: [PATCH 146/179] fix(LinstorSR): ensure we can deflate on any host after a journal rollback Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0147-fix-LinstorSR-ensure-we-always-use-real-DRBD-VHD-siz.patch b/SOURCES/0147-fix-LinstorSR-ensure-we-always-use-real-DRBD-VHD-siz.patch index 0e5ceb7d..78c91a17 100644 --- a/SOURCES/0147-fix-LinstorSR-ensure-we-always-use-real-DRBD-VHD-siz.patch +++ b/SOURCES/0147-fix-LinstorSR-ensure-we-always-use-real-DRBD-VHD-siz.patch @@ -1,7 +1,7 @@ From 6fdfda1d9cc245c0227c7db49115f1ae689ae242 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 27 Nov 2023 12:15:43 +0100 -Subject: [PATCH 147/178] fix(LinstorSR): ensure we always use real DRBD/VHD +Subject: [PATCH 147/179] fix(LinstorSR): ensure we always use real DRBD/VHD sizes in inflate/deflate GC calls --- diff --git a/SOURCES/0148-feat-linstor-kv-tool-If-no-controller-uri-option-is-.patch b/SOURCES/0148-feat-linstor-kv-tool-If-no-controller-uri-option-is-.patch index e8b2693a..19936e6e 100644 --- a/SOURCES/0148-feat-linstor-kv-tool-If-no-controller-uri-option-is-.patch +++ b/SOURCES/0148-feat-linstor-kv-tool-If-no-controller-uri-option-is-.patch @@ -1,7 +1,7 @@ From 620ca1abd996743be6096300df42230c23c35d9d Mon Sep 17 00:00:00 2001 From: BenjiReis Date: Mon, 27 Nov 2023 14:23:57 +0100 -Subject: [PATCH 148/178] feat(linstor-kv-tool): If no controller uri option is +Subject: [PATCH 148/179] feat(linstor-kv-tool): If no controller uri option is provided fetch it (#48) Signed-off-by: BenjiReis diff --git a/SOURCES/0149-fix-linstorvolumemanager-robustify-SR-destroy-46.patch b/SOURCES/0149-fix-linstorvolumemanager-robustify-SR-destroy-46.patch index 5881c5d0..a4a9a71d 100644 --- a/SOURCES/0149-fix-linstorvolumemanager-robustify-SR-destroy-46.patch +++ b/SOURCES/0149-fix-linstorvolumemanager-robustify-SR-destroy-46.patch @@ -1,7 +1,7 @@ From 0ae964a043bf01824b38c23aef7c2360519fe38f Mon Sep 17 00:00:00 2001 From: BenjiReis Date: Wed, 29 Nov 2023 15:45:32 +0100 -Subject: [PATCH 149/178] fix(linstorvolumemanager): robustify SR destroy (#46) +Subject: [PATCH 149/179] fix(linstorvolumemanager): robustify SR destroy (#46) Signed-off-by: Ronan Abhamon Co-authored-by: BenjiReis diff --git a/SOURCES/0150-feat-linstor-manager-extend-API-with-createNodeInter.patch b/SOURCES/0150-feat-linstor-manager-extend-API-with-createNodeInter.patch index e60aaed3..39b1dfa3 100644 --- a/SOURCES/0150-feat-linstor-manager-extend-API-with-createNodeInter.patch +++ b/SOURCES/0150-feat-linstor-manager-extend-API-with-createNodeInter.patch @@ -1,7 +1,7 @@ From da9afe424c2ad652e7278af658c7b4b4c7d5d0e7 Mon Sep 17 00:00:00 2001 From: BenjiReis Date: Wed, 29 Nov 2023 16:54:30 +0100 -Subject: [PATCH 150/178] feat(linstor-manager): extend API with +Subject: [PATCH 150/179] feat(linstor-manager): extend API with createNodeInterface and setNodePreferredInterface (#47) Signed-off-by: BenjiReis diff --git a/SOURCES/0151-fix-LinstorSR-support-VDI.resize-on-thick-volumes.patch b/SOURCES/0151-fix-LinstorSR-support-VDI.resize-on-thick-volumes.patch index 44ab7fcf..b8d792ec 100644 --- a/SOURCES/0151-fix-LinstorSR-support-VDI.resize-on-thick-volumes.patch +++ b/SOURCES/0151-fix-LinstorSR-support-VDI.resize-on-thick-volumes.patch @@ -1,7 +1,7 @@ From 13f341c188dae35cc64dbcaf6197c47e23dd4bd2 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 1 Dec 2023 11:55:12 +0100 -Subject: [PATCH 151/178] fix(LinstorSR): support VDI.resize on thick volumes +Subject: [PATCH 151/179] fix(LinstorSR): support VDI.resize on thick volumes --- drivers/LinstorSR.py | 3 +++ diff --git a/SOURCES/0152-fix-linstorvolumemanager-format-correctly-exception-.patch b/SOURCES/0152-fix-linstorvolumemanager-format-correctly-exception-.patch index 082c66bb..33f5e108 100644 --- a/SOURCES/0152-fix-linstorvolumemanager-format-correctly-exception-.patch +++ b/SOURCES/0152-fix-linstorvolumemanager-format-correctly-exception-.patch @@ -1,7 +1,7 @@ From fc7ee546007b745d8bf5fd96bb039b782e57908b Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 4 Dec 2023 16:36:55 +0100 -Subject: [PATCH 152/178] fix(linstorvolumemanager): format correctly exception +Subject: [PATCH 152/179] fix(linstorvolumemanager): format correctly exception during db mount Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0153-fix-LinstorSR-ensure-we-can-skip-coalesces-if-device.patch b/SOURCES/0153-fix-LinstorSR-ensure-we-can-skip-coalesces-if-device.patch index afd13740..230b7bf9 100644 --- a/SOURCES/0153-fix-LinstorSR-ensure-we-can-skip-coalesces-if-device.patch +++ b/SOURCES/0153-fix-LinstorSR-ensure-we-can-skip-coalesces-if-device.patch @@ -1,7 +1,7 @@ From 3199098e8780e80ed57ee610c0f82f07d10be6c5 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 4 Dec 2023 18:57:08 +0100 -Subject: [PATCH 153/178] fix(LinstorSR): ensure we can skip coalesces if +Subject: [PATCH 153/179] fix(LinstorSR): ensure we can skip coalesces if device path can't be fetched Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0154-feat-linstor-manager-add-methods-to-modify-destroy-l.patch b/SOURCES/0154-feat-linstor-manager-add-methods-to-modify-destroy-l.patch index d5288f56..8ac9a68b 100644 --- a/SOURCES/0154-feat-linstor-manager-add-methods-to-modify-destroy-l.patch +++ b/SOURCES/0154-feat-linstor-manager-add-methods-to-modify-destroy-l.patch @@ -1,7 +1,7 @@ From fd6a07a09507abbfd51564bea77415cef56472e8 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 19 Dec 2023 14:49:33 +0100 -Subject: [PATCH 154/178] feat(linstor-manager): add methods to +Subject: [PATCH 154/179] feat(linstor-manager): add methods to modify/destroy/list net interfaces Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0155-fix-LinstorSR-force-a-defined-volume-prefix-if-we-ca.patch b/SOURCES/0155-fix-LinstorSR-force-a-defined-volume-prefix-if-we-ca.patch index 2b7589da..333284cf 100644 --- a/SOURCES/0155-fix-LinstorSR-force-a-defined-volume-prefix-if-we-ca.patch +++ b/SOURCES/0155-fix-LinstorSR-force-a-defined-volume-prefix-if-we-ca.patch @@ -1,7 +1,7 @@ From ab68cd45f930d47f051911a7bdb7ca8aad7d09fb Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 12 Jan 2024 10:28:20 +0100 -Subject: [PATCH 155/178] fix(LinstorSR): force a defined volume prefix if we +Subject: [PATCH 155/179] fix(LinstorSR): force a defined volume prefix if we can't import libs Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0156-fix-LinstorSR-explicit-error-message-when-a-group-is.patch b/SOURCES/0156-fix-LinstorSR-explicit-error-message-when-a-group-is.patch index eeb64e04..804b8b07 100644 --- a/SOURCES/0156-fix-LinstorSR-explicit-error-message-when-a-group-is.patch +++ b/SOURCES/0156-fix-LinstorSR-explicit-error-message-when-a-group-is.patch @@ -1,7 +1,7 @@ From b83d372cdf4f424289f542ecfe71744c2d186859 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 18 Jan 2024 10:24:01 +0100 -Subject: [PATCH 156/178] fix(LinstorSR): explicit error message when a group +Subject: [PATCH 156/179] fix(LinstorSR): explicit error message when a group is not unique during SR creation Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0157-fix-LinstorSR-make-sure-VDI.delete-doesn-t-throw-und.patch b/SOURCES/0157-fix-LinstorSR-make-sure-VDI.delete-doesn-t-throw-und.patch index 93c9fa9d..f73ebaa9 100644 --- a/SOURCES/0157-fix-LinstorSR-make-sure-VDI.delete-doesn-t-throw-und.patch +++ b/SOURCES/0157-fix-LinstorSR-make-sure-VDI.delete-doesn-t-throw-und.patch @@ -1,7 +1,7 @@ From ce96408a3dda9b8d321e2f12723d28043a251237 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 18 Jan 2024 11:18:11 +0100 -Subject: [PATCH 157/178] fix(LinstorSR): make sure VDI.delete doesn't throw +Subject: [PATCH 157/179] fix(LinstorSR): make sure VDI.delete doesn't throw under specific conditions If we can update the volume state in the KV-store, there is no reason to raise diff --git a/SOURCES/0158-fix-LinstorSR-add-drbd-in-the-blacklist-of-multipath.patch b/SOURCES/0158-fix-LinstorSR-add-drbd-in-the-blacklist-of-multipath.patch index e6f978d8..65f4d487 100644 --- a/SOURCES/0158-fix-LinstorSR-add-drbd-in-the-blacklist-of-multipath.patch +++ b/SOURCES/0158-fix-LinstorSR-add-drbd-in-the-blacklist-of-multipath.patch @@ -1,7 +1,7 @@ From 30a3692573e79f371c2cf2b79c19b7cc02bc693f Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 19 Jan 2024 14:39:17 +0100 -Subject: [PATCH 158/178] fix(LinstorSR): add drbd in the blacklist of +Subject: [PATCH 158/179] fix(LinstorSR): add drbd in the blacklist of multipath.conf If DRBD is installed for the first time, and if the multipathd diff --git a/SOURCES/0159-fix-linstorvolumemanager-create-cloned-volumes-on-ho.patch b/SOURCES/0159-fix-linstorvolumemanager-create-cloned-volumes-on-ho.patch index 16175a9c..770e5aca 100644 --- a/SOURCES/0159-fix-linstorvolumemanager-create-cloned-volumes-on-ho.patch +++ b/SOURCES/0159-fix-linstorvolumemanager-create-cloned-volumes-on-ho.patch @@ -1,7 +1,7 @@ From 4edb24b82089ace930eb68beb69a6ab57714b04e Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 22 Jan 2024 11:25:25 +0100 -Subject: [PATCH 159/178] fix(linstorvolumemanager): create cloned volumes on +Subject: [PATCH 159/179] fix(linstorvolumemanager): create cloned volumes on host selected by LINSTOR Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0160-fix-linstorvolumemanager-don-t-align-volumes-on-LVM-.patch b/SOURCES/0160-fix-linstorvolumemanager-don-t-align-volumes-on-LVM-.patch index 8167586f..bd51d745 100644 --- a/SOURCES/0160-fix-linstorvolumemanager-don-t-align-volumes-on-LVM-.patch +++ b/SOURCES/0160-fix-linstorvolumemanager-don-t-align-volumes-on-LVM-.patch @@ -1,7 +1,7 @@ From 09a32aefb00ff510ee3197dba69f1dfe1c40c81b Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 26 Jan 2024 15:29:21 +0100 -Subject: [PATCH 160/178] fix(linstorvolumemanager): don't align volumes on LVM +Subject: [PATCH 160/179] fix(linstorvolumemanager): don't align volumes on LVM sector size It's the goal of the LINSTOR stack to align properly on the LVM layer. diff --git a/SOURCES/0161-fix-linstorvolumemanager-assert-with-message-after-l.patch b/SOURCES/0161-fix-linstorvolumemanager-assert-with-message-after-l.patch index 21b5065e..23bd4094 100644 --- a/SOURCES/0161-fix-linstorvolumemanager-assert-with-message-after-l.patch +++ b/SOURCES/0161-fix-linstorvolumemanager-assert-with-message-after-l.patch @@ -1,7 +1,7 @@ From bd36d8cc1077b88bf5257a91f270f84cf5261e64 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 5 Feb 2024 18:01:22 +0100 -Subject: [PATCH 161/178] fix(linstorvolumemanager): assert with message after +Subject: [PATCH 161/179] fix(linstorvolumemanager): assert with message after log in update_volume_uuid Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0162-fix-linstorvolumemanager-retry-resize-if-volume-is-n.patch b/SOURCES/0162-fix-linstorvolumemanager-retry-resize-if-volume-is-n.patch index bd602cd2..70c9df32 100644 --- a/SOURCES/0162-fix-linstorvolumemanager-retry-resize-if-volume-is-n.patch +++ b/SOURCES/0162-fix-linstorvolumemanager-retry-resize-if-volume-is-n.patch @@ -1,7 +1,7 @@ From af5c06ba9a7d679ce82ed7a2dc0df96301a4994b Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 5 Feb 2024 23:13:06 +0100 -Subject: [PATCH 162/178] fix(linstorvolumemanager): retry resize if volume is +Subject: [PATCH 162/179] fix(linstorvolumemanager): retry resize if volume is not up to date Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0163-fix-LinstorSR-create-DRBD-diskless-if-necessary-for-.patch b/SOURCES/0163-fix-LinstorSR-create-DRBD-diskless-if-necessary-for-.patch index 527fd5c3..dfe9e685 100644 --- a/SOURCES/0163-fix-LinstorSR-create-DRBD-diskless-if-necessary-for-.patch +++ b/SOURCES/0163-fix-LinstorSR-create-DRBD-diskless-if-necessary-for-.patch @@ -1,7 +1,7 @@ From a3859a63b34c6e888c07ea4e5ec070ad94fd0aa8 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 6 Feb 2024 00:10:32 +0100 -Subject: [PATCH 163/178] fix(LinstorSR): create DRBD diskless if necessary for +Subject: [PATCH 163/179] fix(LinstorSR): create DRBD diskless if necessary for each VHD parent It's necessary to have all parents during snapshot to create a new VHD child. diff --git a/SOURCES/0164-fix-LinstorSR-fix-bad-call-to-vhdutil.inflate-bad-ex.patch b/SOURCES/0164-fix-LinstorSR-fix-bad-call-to-vhdutil.inflate-bad-ex.patch index 8b345540..d14b2ec8 100644 --- a/SOURCES/0164-fix-LinstorSR-fix-bad-call-to-vhdutil.inflate-bad-ex.patch +++ b/SOURCES/0164-fix-LinstorSR-fix-bad-call-to-vhdutil.inflate-bad-ex.patch @@ -1,7 +1,7 @@ From e21d3bc7b517bb790517e494f9e2eed18e9f3290 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 6 Feb 2024 00:14:11 +0100 -Subject: [PATCH 164/178] fix(LinstorSR): fix bad call to vhdutil.inflate + bad +Subject: [PATCH 164/179] fix(LinstorSR): fix bad call to vhdutil.inflate + bad exception Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0165-fix-LinstorSR-activate-VG-if-attach-from-config-is-a.patch b/SOURCES/0165-fix-LinstorSR-activate-VG-if-attach-from-config-is-a.patch index 4f561983..9d7178d5 100644 --- a/SOURCES/0165-fix-LinstorSR-activate-VG-if-attach-from-config-is-a.patch +++ b/SOURCES/0165-fix-LinstorSR-activate-VG-if-attach-from-config-is-a.patch @@ -1,7 +1,7 @@ From adea9c192b43f438da3732188ed0ad05751179e6 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 12 Feb 2024 20:54:06 +0100 -Subject: [PATCH 165/178] fix(LinstorSR): activate VG if attach from config is +Subject: [PATCH 165/179] fix(LinstorSR): activate VG if attach from config is asked Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0166-feat-LinstorSR-use-a-specific-resource-group-for-DB-.patch b/SOURCES/0166-feat-LinstorSR-use-a-specific-resource-group-for-DB-.patch index 54748071..af0fc322 100644 --- a/SOURCES/0166-feat-LinstorSR-use-a-specific-resource-group-for-DB-.patch +++ b/SOURCES/0166-feat-LinstorSR-use-a-specific-resource-group-for-DB-.patch @@ -1,7 +1,7 @@ From 3227a0c30b0a58e4431cb80ab1b188b89a004a41 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 19 Mar 2024 23:09:54 +0100 -Subject: [PATCH 166/178] feat(LinstorSR): use a specific resource group for DB +Subject: [PATCH 166/179] feat(LinstorSR): use a specific resource group for DB and HA Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0167-feat-linstor-manager-add-getNodePreferredInterface-h.patch b/SOURCES/0167-feat-linstor-manager-add-getNodePreferredInterface-h.patch index 26020c58..540046ac 100644 --- a/SOURCES/0167-feat-linstor-manager-add-getNodePreferredInterface-h.patch +++ b/SOURCES/0167-feat-linstor-manager-add-getNodePreferredInterface-h.patch @@ -1,7 +1,7 @@ From 99997af6173a0bd6ed59a0242657f162245aef91 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 15 Apr 2024 11:22:18 +0200 -Subject: [PATCH 167/178] feat(linstor-manager): add +Subject: [PATCH 167/179] feat(linstor-manager): add `getNodePreferredInterface` helper Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0168-fix-linstorvolumemanager-blocks-deletion-of-default-.patch b/SOURCES/0168-fix-linstorvolumemanager-blocks-deletion-of-default-.patch index 9c0e4051..147d7295 100644 --- a/SOURCES/0168-fix-linstorvolumemanager-blocks-deletion-of-default-.patch +++ b/SOURCES/0168-fix-linstorvolumemanager-blocks-deletion-of-default-.patch @@ -1,7 +1,7 @@ From 5491fbc0f245095e62f83b78e3afcd76745cbe5e Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 15 Apr 2024 11:26:00 +0200 -Subject: [PATCH 168/178] fix(linstorvolumemanager): blocks deletion of default +Subject: [PATCH 168/179] fix(linstorvolumemanager): blocks deletion of default network interface Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0169-feat-linstorvolumemanager-change-logic-of-get_resour.patch b/SOURCES/0169-feat-linstorvolumemanager-change-logic-of-get_resour.patch index c9f83f6e..b043b23a 100644 --- a/SOURCES/0169-feat-linstorvolumemanager-change-logic-of-get_resour.patch +++ b/SOURCES/0169-feat-linstorvolumemanager-change-logic-of-get_resour.patch @@ -1,7 +1,7 @@ From 21788b7143fd9add8681f1a909c4eca1b18d2919 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 15 Apr 2024 17:56:47 +0200 -Subject: [PATCH 169/178] feat(linstorvolumemanager): change logic of +Subject: [PATCH 169/179] feat(linstorvolumemanager): change logic of `get_resources_info`: - Add a nested level "nodes" for each resource - Add a "uuid" attr on resources - Rename LINSTOR "uuid" to "linstor-uuid" - Optimize code diff --git a/SOURCES/0170-feat-linstor-manager-add-error-codes-to-healthCheck-.patch b/SOURCES/0170-feat-linstor-manager-add-error-codes-to-healthCheck-.patch index 06601a9e..af8811f4 100644 --- a/SOURCES/0170-feat-linstor-manager-add-error-codes-to-healthCheck-.patch +++ b/SOURCES/0170-feat-linstor-manager-add-error-codes-to-healthCheck-.patch @@ -1,7 +1,7 @@ From d325b4d57656cb4e57225898dbe09c19d3a05737 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 18 Apr 2024 13:57:37 +0200 -Subject: [PATCH 170/178] feat(linstor-manager): add error codes to healthCheck +Subject: [PATCH 170/179] feat(linstor-manager): add error codes to healthCheck helper Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0171-fix-LinstorSR-fix-bad-exception-reference-during-sna.patch b/SOURCES/0171-fix-LinstorSR-fix-bad-exception-reference-during-sna.patch index 46d89e73..71c0b90f 100644 --- a/SOURCES/0171-fix-LinstorSR-fix-bad-exception-reference-during-sna.patch +++ b/SOURCES/0171-fix-LinstorSR-fix-bad-exception-reference-during-sna.patch @@ -1,7 +1,7 @@ From d690c2a413af2e41bb81f55d32b646a7c48476ec Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 24 Apr 2024 15:10:49 +0200 -Subject: [PATCH 171/178] fix(LinstorSR): fix bad exception reference during +Subject: [PATCH 171/179] fix(LinstorSR): fix bad exception reference during snapshot Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0172-fix-tapdisk-pause-ensure-LINSTOR-VHD-chain-is-availa.patch b/SOURCES/0172-fix-tapdisk-pause-ensure-LINSTOR-VHD-chain-is-availa.patch index bbb9cd47..1091b185 100644 --- a/SOURCES/0172-fix-tapdisk-pause-ensure-LINSTOR-VHD-chain-is-availa.patch +++ b/SOURCES/0172-fix-tapdisk-pause-ensure-LINSTOR-VHD-chain-is-availa.patch @@ -1,7 +1,7 @@ From e1343b31312142eced90f45ea0ade39a07e5a447 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 24 Apr 2024 17:29:26 +0200 -Subject: [PATCH 172/178] fix(tapdisk-pause): ensure LINSTOR VHD chain is +Subject: [PATCH 172/179] fix(tapdisk-pause): ensure LINSTOR VHD chain is available Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0173-fix-linstorvhdutil-retry-check-on-another-machine-in.patch b/SOURCES/0173-fix-linstorvhdutil-retry-check-on-another-machine-in.patch index 4f39ecc1..17246b05 100644 --- a/SOURCES/0173-fix-linstorvhdutil-retry-check-on-another-machine-in.patch +++ b/SOURCES/0173-fix-linstorvhdutil-retry-check-on-another-machine-in.patch @@ -1,7 +1,7 @@ From bee9bb828530924b8596135b70bb38092ef5cf8f Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 6 May 2024 18:15:00 +0200 -Subject: [PATCH 173/178] fix(linstorvhdutil): retry check on another machine +Subject: [PATCH 173/179] fix(linstorvhdutil): retry check on another machine in case of failure (#54) Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0174-fix-LinstorSR-explicit-errors-when-database-path-is-.patch b/SOURCES/0174-fix-LinstorSR-explicit-errors-when-database-path-is-.patch index 9b5e01dc..5972d430 100644 --- a/SOURCES/0174-fix-LinstorSR-explicit-errors-when-database-path-is-.patch +++ b/SOURCES/0174-fix-LinstorSR-explicit-errors-when-database-path-is-.patch @@ -1,7 +1,7 @@ From 3aba57e6ea4f6826b5164b97971099d8196c8d3e Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 6 May 2024 21:35:36 +0200 -Subject: [PATCH 174/178] fix(LinstorSR): explicit errors when database path is +Subject: [PATCH 174/179] fix(LinstorSR): explicit errors when database path is fetched --- diff --git a/SOURCES/0175-fix-LinstorSR-Misc-fixes-on-destroy.patch b/SOURCES/0175-fix-LinstorSR-Misc-fixes-on-destroy.patch index 9bbe3984..6ff0d12c 100644 --- a/SOURCES/0175-fix-LinstorSR-Misc-fixes-on-destroy.patch +++ b/SOURCES/0175-fix-LinstorSR-Misc-fixes-on-destroy.patch @@ -1,7 +1,7 @@ From e65ad0c6669174d90ab356f171d5aa121da8eca1 Mon Sep 17 00:00:00 2001 From: Damien Thenot Date: Tue, 30 Apr 2024 15:38:34 +0200 -Subject: [PATCH 175/178] fix(LinstorSR): Misc fixes on destroy +Subject: [PATCH 175/179] fix(LinstorSR): Misc fixes on destroy linstor-manager: - fix on get_drbd_volumes diff --git a/SOURCES/0176-fix-LinstorSR-open-non-leaf-volumes-in-RO-mode-creat.patch b/SOURCES/0176-fix-LinstorSR-open-non-leaf-volumes-in-RO-mode-creat.patch index 61a99441..78861ba3 100644 --- a/SOURCES/0176-fix-LinstorSR-open-non-leaf-volumes-in-RO-mode-creat.patch +++ b/SOURCES/0176-fix-LinstorSR-open-non-leaf-volumes-in-RO-mode-creat.patch @@ -1,7 +1,7 @@ From 8901bc318ee16f7eba20dc6ad2ea735610f73c41 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 20 Jun 2024 22:37:40 +0200 -Subject: [PATCH 176/178] fix(LinstorSR): open non-leaf volumes in RO mode +Subject: [PATCH 176/179] fix(LinstorSR): open non-leaf volumes in RO mode (create_chain_paths) We must never open non-leaf volumes with the write option. diff --git a/SOURCES/0177-fix-LinstorSR-ensure-_is_master-is-always-set.patch b/SOURCES/0177-fix-LinstorSR-ensure-_is_master-is-always-set.patch index 65e5df1f..65e0dc17 100644 --- a/SOURCES/0177-fix-LinstorSR-ensure-_is_master-is-always-set.patch +++ b/SOURCES/0177-fix-LinstorSR-ensure-_is_master-is-always-set.patch @@ -1,7 +1,7 @@ From 8434a428d51849320db4b42e528501d283d495ac Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 26 Jul 2024 11:32:20 +0200 -Subject: [PATCH 177/178] fix(LinstorSR): ensure `_is_master` is always set +Subject: [PATCH 177/179] fix(LinstorSR): ensure `_is_master` is always set `_is_master` is not always initialized, and more precisely in the case of detach where LinstorSR.load method is not called. diff --git a/SOURCES/0178-fix-linstor-check-if-resource-is-tiebreaker-62.patch b/SOURCES/0178-fix-linstor-check-if-resource-is-tiebreaker-62.patch index b5f83e7a..69e7041e 100644 --- a/SOURCES/0178-fix-linstor-check-if-resource-is-tiebreaker-62.patch +++ b/SOURCES/0178-fix-linstor-check-if-resource-is-tiebreaker-62.patch @@ -1,7 +1,7 @@ From 9207abe1f2e1ff1795cdba1a0aeb76574412a583 Mon Sep 17 00:00:00 2001 From: Damien Thenot Date: Fri, 26 Jul 2024 14:13:05 +0200 -Subject: [PATCH 178/178] fix(linstor): check if resource is tiebreaker (#62) +Subject: [PATCH 178/179] fix(linstor): check if resource is tiebreaker (#62) We check if a resource is already a tiebreaker before trying to delete the resource. diff --git a/SOURCES/0179-feat-Linstor-rewrite-linstorhostcall-logic.patch b/SOURCES/0179-feat-Linstor-rewrite-linstorhostcall-logic.patch new file mode 100644 index 00000000..cc0ae905 --- /dev/null +++ b/SOURCES/0179-feat-Linstor-rewrite-linstorhostcall-logic.patch @@ -0,0 +1,168 @@ +From 31d150bf84decf56a42866d0db09210493388090 Mon Sep 17 00:00:00 2001 +From: Damien Thenot +Date: Fri, 19 Apr 2024 14:55:49 +0200 +Subject: [PATCH 179/179] feat(Linstor): rewrite linstorhostcall logic + +Try to use host_OpaqueRef to access primary then try on the master host +if it doesn't work, then find the primary with linstor API or if no +primary, any other host. + +Signed-off-by: Damien Thenot +Co-authored-by: Ronan Abhamon +--- + drivers/linstorvhdutil.py | 86 ++++++++++++++++++--------------- + drivers/linstorvolumemanager.py | 18 +++++++ + 2 files changed, 66 insertions(+), 38 deletions(-) + +diff --git a/drivers/linstorvhdutil.py b/drivers/linstorvhdutil.py +index 7f8efa1..4b7115b 100644 +--- a/drivers/linstorvhdutil.py ++++ b/drivers/linstorvhdutil.py +@@ -33,18 +33,21 @@ EMEDIUMTYPE = 124 + + + def call_remote_method(session, host_ref, method, device_path, args): ++ host_rec = session.xenapi.host.get_record(host_ref) ++ host_uuid = host_rec['uuid'] ++ + try: + response = session.xenapi.host.call_plugin( + host_ref, MANAGER_PLUGIN, method, args + ) + except Exception as e: +- util.SMlog('call-plugin ({} with {}) exception: {}'.format( +- method, args, e ++ util.SMlog('call-plugin on {} ({} with {}) exception: {}'.format( ++ host_uuid, method, args, e + )) + raise util.SMException(str(e)) + +- util.SMlog('call-plugin ({} with {}) returned: {}'.format( +- method, args, response ++ util.SMlog('call-plugin on {} ({} with {}) returned: {}'.format( ++ host_uuid, method, args, response + )) + + return response +@@ -86,33 +89,6 @@ def linstorhostcall(local_method, remote_method): + self._linstor.get_volume_name(vdi_uuid) + ) + +- # A. Try a call using directly the DRBD device to avoid +- # remote request. +- +- # Try to read locally if the device is not in use or if the device +- # is up to date and not diskless. +- (node_names, in_use_by) = \ +- self._linstor.find_up_to_date_diskful_nodes(vdi_uuid) +- +- local_e = None +- try: +- if not in_use_by or socket.gethostname() in node_names: +- return self._call_local_method(local_method, device_path, *args[2:], **kwargs) +- except ErofsLinstorCallException as e: +- local_e = e.cmd_err +- except Exception as e: +- local_e = e +- +- util.SMlog( +- 'unable to execute `{}` locally, retry using a readable host... (cause: {})'.format( +- remote_method, local_e if local_e else 'local diskless + in use or not up to date' +- ) +- ) +- +- if in_use_by: +- node_names = {in_use_by} +- +- # B. Execute the plugin on master or slave. + remote_args = { + 'devicePath': device_path, + 'groupName': self._linstor.group_name +@@ -121,14 +97,48 @@ def linstorhostcall(local_method, remote_method): + remote_args = {str(key): str(value) for key, value in remote_args.iteritems()} + + try: +- def remote_call(): +- host_ref = self._get_readonly_host(vdi_uuid, device_path, node_names) +- return call_remote_method(self._session, host_ref, remote_method, device_path, remote_args) +- response = util.retry(remote_call, 5, 2) +- except Exception as remote_e: +- self._raise_openers_exception(device_path, local_e or remote_e) ++ host_ref_attached = util.get_hosts_attached_on(self._session, [vdi_uuid])[0] ++ if host_ref_attached: ++ response = call_remote_method( ++ self._session, host_ref_attached, remote_method, device_path, remote_args ++ ) ++ return response_parser(self, vdi_uuid, response) ++ except Exception as e: ++ util.SMlog( ++ 'Failed to call method on attached host. Trying local access... (cause: {})'.format(e), ++ priority=util.LOG_DEBUG ++ ) ++ ++ try: ++ master_ref = self._session.xenapi.pool.get_all_records().values()[0]['master'] ++ response = call_remote_method(self._session, master_ref, remote_method, device_path, remote_args) ++ return response_parser(self, vdi_uuid, response) ++ except Exception as e: ++ util.SMlog( ++ 'Failed to call method on master host. Finding primary node... (cause: {})'.format(e), ++ priority=util.LOG_DEBUG ++ ) ++ ++ nodes, primary_hostname = self._linstor.find_up_to_date_diskful_nodes(vdi_uuid) ++ if primary_hostname: ++ try: ++ host_ref = self._get_readonly_host(vdi_uuid, device_path, {primary_hostname}) ++ response = call_remote_method(self._session, host_ref, remote_method, device_path, remote_args) ++ return response_parser(self, vdi_uuid, response) ++ except Exception as remote_e: ++ self._raise_openers_exception(device_path, remote_e) ++ else: ++ util.SMlog( ++ 'Couldn\'t get primary for {}. Trying with another node...'.format(vdi_uuid), ++ priority=util.LOG_DEBUG ++ ) ++ try: ++ host = self._get_readonly_host(vdi_uuid, device_path, nodes) ++ response = call_remote_method(self._session, host, remote_method, device_path, remote_args) ++ return response_parser(self, vdi_uuid, response) ++ except Exception as remote_e: ++ self._raise_openers_exception(device_path, remote_e) + +- return response_parser(self, vdi_uuid, response) + return wrapper + return decorated + +diff --git a/drivers/linstorvolumemanager.py b/drivers/linstorvolumemanager.py +index 8bfd1c1..fb47b09 100755 +--- a/drivers/linstorvolumemanager.py ++++ b/drivers/linstorvolumemanager.py +@@ -1438,6 +1438,24 @@ class LinstorVolumeManager(object): + + return (node_names, in_use_by) + ++ def get_primary(self, volume_uuid): ++ """ ++ Find the node that opened a volume, i.e. the primary. ++ :rtype: str ++ """ ++ volume_name = self.get_volume_name(volume_uuid) ++ ++ resource_states = filter( ++ lambda resource_state: resource_state.name == volume_name, ++ self._get_resource_cache().resource_states ++ ) ++ ++ for resource_state in resource_states: ++ if resource_state.in_use: ++ return resource_state.node_name ++ ++ return None ++ + def invalidate_resource_cache(self): + """ + If resources are impacted by external commands like vhdutil, +-- +2.46.0 + diff --git a/SPECS/sm.spec b/SPECS/sm.spec index debd1f04..b1c60f49 100644 --- a/SPECS/sm.spec +++ b/SPECS/sm.spec @@ -274,6 +274,7 @@ Patch1175: 0175-fix-LinstorSR-Misc-fixes-on-destroy.patch Patch1176: 0176-fix-LinstorSR-open-non-leaf-volumes-in-RO-mode-creat.patch Patch1177: 0177-fix-LinstorSR-ensure-_is_master-is-always-set.patch Patch1178: 0178-fix-linstor-check-if-resource-is-tiebreaker-62.patch +Patch1179: 0179-feat-Linstor-rewrite-linstorhostcall-logic.patch %description This package contains storage backends used in XCP @@ -676,6 +677,9 @@ cp -r htmlcov %{buildroot}/htmlcov %{_unitdir}/linstor-monitor.service %changelog +* Wed Aug 07 2024 Damien Thenot 2.30.8-12.2.0.linstor.2 +- Add 0179-feat-Linstor-rewrite-linstorhostcall-logic.patch + * Tue Aug 06 2024 Damien Thenot - 2.30.8-12.2.0.linstor.1 - Sync patches with latest 2.30.8-8.2 - *** 8.2 release changelog *** From b80e0a15e6d49e8b97922548565b36b994a137e4 Mon Sep 17 00:00:00 2001 From: Damien Thenot Date: Mon, 5 Aug 2024 14:59:53 +0200 Subject: [PATCH 7/8] Temporary tag for build Signed-off-by: Damien Thenot --- SPECS/sm.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SPECS/sm.spec b/SPECS/sm.spec index b1c60f49..4d3587a6 100644 --- a/SPECS/sm.spec +++ b/SPECS/sm.spec @@ -11,7 +11,7 @@ Summary: sm - XCP storage managers Name: sm Version: 2.30.8 -Release: %{?xsrel}.2.0.linstor.1%{?dist} +Release: %{?xsrel}.2.0.linstor.1.1.linstorhostcall.1%{?dist} Group: System/Hypervisor License: LGPL URL: https://github.com/xapi-project/sm @@ -677,7 +677,7 @@ cp -r htmlcov %{buildroot}/htmlcov %{_unitdir}/linstor-monitor.service %changelog -* Wed Aug 07 2024 Damien Thenot 2.30.8-12.2.0.linstor.2 +* Wed Aug 07 2024 Damien Thenot 2.30.8-12.2.0.linstor.1.1.linstorhostcall.1 - Add 0179-feat-Linstor-rewrite-linstorhostcall-logic.patch * Tue Aug 06 2024 Damien Thenot - 2.30.8-12.2.0.linstor.1 From d1030a3d48c476b62691ee9d5b1d857571996850 Mon Sep 17 00:00:00 2001 From: Damien Thenot Date: Fri, 9 Aug 2024 11:24:44 +0200 Subject: [PATCH 8/8] Add 0180-feat-linstor-Add-new-debug-log-in-linstorhostcall-67.patch Signed-off-by: Damien Thenot --- ...21cc248d79b749a63d4ad099e6d5f4b8b588.patch | 2 +- ...-sm.service-s-description-for-XCP-ng.patch | 2 +- .../0003-Add-TrueNAS-multipath-config.patch | 2 +- ...add-CephFS-GlusterFS-and-XFS-drivers.patch | 2 +- ...-ZFS-driver-to-avoid-losing-VDI-meta.patch | 2 +- ...driver-for-users-who-need-to-transit.patch | 2 +- ...07-feat-drivers-add-LinstorSR-driver.patch | 2 +- ...nit-tests-concerning-ZFS-close-xcp-n.patch | 2 +- ...no-NFS-ACLs-provided-assume-everyone.patch | 2 +- .../0010-Added-SM-Driver-for-MooseFS.patch | 2 +- ...mount-in-ISOSR-when-legacy_mode-is-u.patch | 2 +- ...SR-uses-now-UUID-subdirs-for-each-SR.patch | 2 +- ...Fix-is_open-call-for-many-drivers-25.patch | 2 +- ...HING-capability-for-many-SR-types-24.patch | 2 +- ...ve-SR_PROBE-from-ZFS-capabilities-37.patch | 2 +- ...ix-vdi-ref-when-static-vdis-are-used.patch | 2 +- ...-not-to-edit-multipath.conf-directly.patch | 2 +- ...om.conf-multipath-configuration-file.patch | 2 +- ...all-etc-multipath-conf.d-custom.conf.patch | 2 +- SOURCES/0020-Backport-NFS4-only-support.patch | 2 +- ...or-NFS4-when-rpcinfo-does-not-includ.patch | 2 +- ...Block-backport-of-largeblocksr-51-55.patch | 2 +- ...dd-a-way-to-modify-config-of-LVMs-56.patch | 2 +- ...-check-for-missing-iSCSI-sessions-an.patch | 2 +- ...-alarm-must-be-reset-in-case-of-succ.patch | 2 +- ...urns-the-result-of-user-function-now.patch | 2 +- ...e-pause-tag-from-VDIs-in-case-of-fai.patch | 2 +- ...pair-volumes-only-if-an-exclusive-co.patch | 2 +- ...instorSR-Improve-LINSTOR-performance.patch | 2 +- ...obustify-scan-to-avoid-losing-VDIs-i.patch | 2 +- ...isplay-a-correctly-readable-size-for.patch | 2 +- ...itord-scan-all-LINSTOR-SRs-every-12-.patch | 2 +- ...ll-correctly-method-in-_locked_load-.patch | 2 +- ...rSR-integrate-minidrbdcluster-daemon.patch | 2 +- ...nsure-heartbeat-and-redo_log-VDIs-ar.patch | 2 +- ...rotect-sr-commands-to-avoid-forgetti.patch | 2 +- ...aler-ensure-uri-is-not-None-during-l.patch | 2 +- ...dd-an-option-to-disable-auto-quorum-.patch | 2 +- ...eManager-add-a-workaround-to-create-.patch | 2 +- ...LinstorSR-add-optional-ips-parameter.patch | 2 +- ...dd-a-helper-log_drbd_erofs-to-trace-.patch | 2 +- ...y-to-restart-the-services-again-if-t.patch | 2 +- ...bustify-linstor-manager-to-never-inc.patch | 2 +- ...event-starting-controller-during-fai.patch | 2 +- ...meManager-increase-peer-slots-limit-.patch | 2 +- ...meManager-add-a-fallback-to-find-con.patch | 2 +- ...tor.mount-ensure-we-always-mount-dat.patch | 2 +- ...meManager-add-a-fallback-to-find-nod.patch | 2 +- ...xplain-on-which-host-plugins-command.patch | 2 +- ...eate-diskless-path-if-necessary-duri.patch | 2 +- ...se-HTTP-NBD-instead-of-DRBD-directly.patch | 2 +- ...nd-controller-when-XAPI-unreachable-.patch | 2 +- ...e-IPs-instead-of-hostnames-in-NBD-se.patch | 2 +- ...eManager-ensure-we-always-use-IPs-in.patch | 2 +- ...ager-add-methods-to-add-remove-host-.patch | 2 +- ...meManager-support-SR-creation-with-d.patch | 2 +- ...dd-a-config-var-to-disable-HTTP-NBD-.patch | 2 +- ...nsure-LVM-group-is-activated-during-.patch | 2 +- ...ager-add-method-to-create-LinstorSR-.patch | 2 +- ...ways-set-vdi_path-in-generate_config.patch | 2 +- ...ter-supports-new-properties-like-for.patch | 2 +- ...abled-disable-minidrbcluster-with-fi.patch | 2 +- ...ger-change-linstor-satellite-start-b.patch | 2 +- .../0064-Fix-is_open-call-for-LinstorSR.patch | 2 +- ...til-fix-boolean-params-of-check-call.patch | 2 +- ...tor-manager-robustify-exec_create_sr.patch | 2 +- ...t-LINSTOR-VDI-UUID-if-error-during-i.patch | 2 +- ...se-and-dump-DRBD-openers-in-case-of-.patch | 2 +- ...til-trace-DRBD-openers-in-case-of-ER.patch | 2 +- ...emanager-compute-correctly-size-in-a.patch | 2 +- ...se-DRBD-openers-instead-of-lsof-to-l.patch | 2 +- ...upport-cProfile-to-trace-calls-when-.patch | 2 +- ...aler-reset-namespace-when-get-is-cal.patch | 2 +- ...il-fix-coalesce-with-VM-running-unde.patch | 2 +- ...emanager-_get_volumes_info-doesn-t-r.patch | 2 +- ...emanager-remove-double-prefix-on-kv-.patch | 2 +- ...dd-linstor-kv-dump-helper-to-print-k.patch | 2 +- ...sable-VHD-key-hash-usage-to-limit-ex.patch | 2 +- ...ter-ensure-SIGINT-is-handled-correct.patch | 2 +- ...ster-stop-resource-services-at-start.patch | 2 +- ...ager-add-new-healthCheck-function-to.patch | 2 +- ...x-xha-conf-parsing-return-host-ip-no.patch | 2 +- ...art-correctly-HA-servers-HTTP-NBD-af.patch | 2 +- ...emanager-use-an-array-to-store-diskf.patch | 2 +- ...memanager-support-snaps-when-a-host-.patch | 2 +- ...emanager-support-offline-hosts-when-.patch | 2 +- ...emanager-define-_base_group_name-mem.patch | 2 +- ...til-modify-logic-of-local-vhdutil-ca.patch | 2 +- ...memanager-robustify-failed-snapshots.patch | 2 +- ...emanager-use-a-namespace-for-volumes.patch | 2 +- ...dump-rename-to-linstor-kv-tool-add-r.patch | 2 +- ...ndle-correctly-localhost-during-star.patch | 2 +- ...all-repair-on-another-host-when-EROF.patch | 2 +- ...void-introduction-of-DELETED-volumes.patch | 2 +- ...tool-remove-all-volumes-supports-jou.patch | 2 +- ...il-due-to-bad-refactoring-check-call.patch | 2 +- ...til-ensure-we-use-VHD-parent-to-find.patch | 2 +- ...memanager-force-DRBD-demote-after-fa.patch | 2 +- ...il-ensure-we-retry-creation-in-all-s.patch | 2 +- ...il-don-t-retry-local-vhdutil-call-wh.patch | 2 +- ...-feat-fork-log-daemon-ignore-SIGTERM.patch | 2 +- ...SR-wait-for-http-disk-server-startup.patch | 2 +- ...ndle-inflate-resize-actions-correctl.patch | 2 +- ...ger-add-a-static-iptables-rule-for-D.patch | 2 +- ...ync-with-last-http-nbd-transfer-vers.patch | 2 +- ...n-t-check-VDI-metadata-while-listing.patch | 2 +- ...n-t-check-metadata-when-destroying-s.patch | 2 +- ...il-handle-correctly-generic-exceptio.patch | 2 +- ...ter-robustify-to-unmount-correctly-L.patch | 2 +- ...ter-handle-correctly-KeyboardInterru.patch | 2 +- ...se-drbd-reactor-instead-of-minidrbdc.patch | 2 +- ...sure-vhdutil-calls-are-correctly-exe.patch | 2 +- ...eplace-bad-param-in-detach_thin-impl.patch | 2 +- ...lumemanager-remove-usage-of-realpath.patch | 2 +- ...vhdutil-avoid-parent-path-resolution.patch | 2 +- ...rSR-create-parent-path-during-attach.patch | 2 +- ...retry-if-we-can-t-build-volume-cache.patch | 2 +- ...emanager-reduce-peer-slots-param-to-.patch | 2 +- ...tach-a-valid-XAPI-session-is_open-is.patch | 2 +- ...sure-we-always-have-a-DRBD-path-to-s.patch | 2 +- ...fix-LinstorSR-remove-hosts-ips-param.patch | 2 +- ...mpute-correctly-SR-size-using-pool-c.patch | 2 +- ...re-we-can-import-this-module-when-LI.patch | 2 +- ...ensure-volume-cache-can-be-recreated.patch | 2 +- ...ger-remove-dead-useless-code-in-add-.patch | 2 +- ...sure-we-always-have-a-device-path-du.patch | 2 +- ...ways-use-lock.acquire-during-attach-.patch | 2 +- ...re-sure-hostnames-are-unique-at-SR-c.patch | 2 +- ...sure-we-can-attach-non-special-stati.patch | 2 +- ...sure-we-can-detach-when-deflate-call.patch | 2 +- ...sume-VDI-is-always-a-VHD-when-the-in.patch | 2 +- ...move-SR-lock-during-thin-attach-deta.patch | 2 +- ...sure-database-is-mounted-during-scan.patch | 2 +- ...start-drbd-reactor-in-case-of-failur.patch | 2 +- ...emanager-retry-in-case-of-failure-du.patch | 2 +- ...emanager-avoid-diskless-creation-whe.patch | 2 +- ...move-diskless-after-VDI.detach-calls.patch | 2 +- ...bustify-_load_vdi_info-in-cleanup.py.patch | 2 +- ...sure-detach-never-fails-on-plugin-fa.patch | 2 +- ...sure-we-coalesce-only-volumes-with-a.patch | 2 +- ...n-t-try-to-repair-persistent-volumes.patch | 2 +- ...il-format-correctly-message-if-vhd-u.patch | 2 +- ...wait-during-attach-to-open-DRBD-path.patch | 2 +- ...pport-different-volume-sizes-in-clea.patch | 2 +- ...rSR-remove-useless-IPS_XHA_CACHE-var.patch | 2 +- ...sure-we-can-deflate-on-any-host-afte.patch | 2 +- ...sure-we-always-use-real-DRBD-VHD-siz.patch | 2 +- ...tool-If-no-controller-uri-option-is-.patch | 2 +- ...olumemanager-robustify-SR-destroy-46.patch | 2 +- ...ager-extend-API-with-createNodeInter.patch | 2 +- ...-support-VDI.resize-on-thick-volumes.patch | 2 +- ...emanager-format-correctly-exception-.patch | 2 +- ...sure-we-can-skip-coalesces-if-device.patch | 2 +- ...ager-add-methods-to-modify-destroy-l.patch | 2 +- ...rce-a-defined-volume-prefix-if-we-ca.patch | 2 +- ...plicit-error-message-when-a-group-is.patch | 2 +- ...ke-sure-VDI.delete-doesn-t-throw-und.patch | 2 +- ...d-drbd-in-the-blacklist-of-multipath.patch | 2 +- ...emanager-create-cloned-volumes-on-ho.patch | 2 +- ...emanager-don-t-align-volumes-on-LVM-.patch | 2 +- ...emanager-assert-with-message-after-l.patch | 2 +- ...emanager-retry-resize-if-volume-is-n.patch | 2 +- ...eate-DRBD-diskless-if-necessary-for-.patch | 2 +- ...x-bad-call-to-vhdutil.inflate-bad-ex.patch | 2 +- ...tivate-VG-if-attach-from-config-is-a.patch | 2 +- ...se-a-specific-resource-group-for-DB-.patch | 2 +- ...ager-add-getNodePreferredInterface-h.patch | 2 +- ...emanager-blocks-deletion-of-default-.patch | 2 +- ...memanager-change-logic-of-get_resour.patch | 2 +- ...ager-add-error-codes-to-healthCheck-.patch | 2 +- ...x-bad-exception-reference-during-sna.patch | 2 +- ...e-ensure-LINSTOR-VHD-chain-is-availa.patch | 2 +- ...il-retry-check-on-another-machine-in.patch | 2 +- ...plicit-errors-when-database-path-is-.patch | 2 +- ...-fix-LinstorSR-Misc-fixes-on-destroy.patch | 2 +- ...en-non-leaf-volumes-in-RO-mode-creat.patch | 2 +- ...orSR-ensure-_is_master-is-always-set.patch | 2 +- ...r-check-if-resource-is-tiebreaker-62.patch | 2 +- ...instor-rewrite-linstorhostcall-logic.patch | 2 +- ...-new-debug-log-in-linstorhostcall-67.patch | 85 +++++++++++++++++++ SPECS/sm.spec | 6 +- 181 files changed, 269 insertions(+), 180 deletions(-) create mode 100644 SOURCES/0180-feat-linstor-Add-new-debug-log-in-linstorhostcall-67.patch diff --git a/SOURCES/0001-backport-of-ccd121cc248d79b749a63d4ad099e6d5f4b8b588.patch b/SOURCES/0001-backport-of-ccd121cc248d79b749a63d4ad099e6d5f4b8b588.patch index f6f44249..b64115c9 100644 --- a/SOURCES/0001-backport-of-ccd121cc248d79b749a63d4ad099e6d5f4b8b588.patch +++ b/SOURCES/0001-backport-of-ccd121cc248d79b749a63d4ad099e6d5f4b8b588.patch @@ -1,7 +1,7 @@ From a365619c2835e593259dad3c26761575f64066d6 Mon Sep 17 00:00:00 2001 From: Mark Syms Date: Thu, 20 May 2021 17:40:06 +0100 -Subject: [PATCH 001/179] backport of ccd121cc248d79b749a63d4ad099e6d5f4b8b588: +Subject: [PATCH 001/180] backport of ccd121cc248d79b749a63d4ad099e6d5f4b8b588: CA-354692: check for device parameter in create/probe calls Signed-off-by: Mark Syms diff --git a/SOURCES/0002-Update-xs-sm.service-s-description-for-XCP-ng.patch b/SOURCES/0002-Update-xs-sm.service-s-description-for-XCP-ng.patch index b2200098..ec115c1b 100644 --- a/SOURCES/0002-Update-xs-sm.service-s-description-for-XCP-ng.patch +++ b/SOURCES/0002-Update-xs-sm.service-s-description-for-XCP-ng.patch @@ -1,7 +1,7 @@ From 283242d159438c4b301e153a95adde5dfaea3b58 Mon Sep 17 00:00:00 2001 From: Samuel Verschelde Date: Thu, 13 Aug 2020 15:22:17 +0200 -Subject: [PATCH 002/179] Update xs-sm.service's description for XCP-ng +Subject: [PATCH 002/180] 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. diff --git a/SOURCES/0003-Add-TrueNAS-multipath-config.patch b/SOURCES/0003-Add-TrueNAS-multipath-config.patch index 52b19b03..c5d094b6 100644 --- a/SOURCES/0003-Add-TrueNAS-multipath-config.patch +++ b/SOURCES/0003-Add-TrueNAS-multipath-config.patch @@ -1,7 +1,7 @@ From d6528d899b762ec5d7ceec1fb9c8b13c2c7e6f73 Mon Sep 17 00:00:00 2001 From: Samuel Verschelde Date: Thu, 13 Aug 2020 15:26:43 +0200 -Subject: [PATCH 003/179] Add TrueNAS multipath config +Subject: [PATCH 003/180] 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. diff --git a/SOURCES/0004-feat-drivers-add-CephFS-GlusterFS-and-XFS-drivers.patch b/SOURCES/0004-feat-drivers-add-CephFS-GlusterFS-and-XFS-drivers.patch index fac555d9..73dae834 100644 --- a/SOURCES/0004-feat-drivers-add-CephFS-GlusterFS-and-XFS-drivers.patch +++ b/SOURCES/0004-feat-drivers-add-CephFS-GlusterFS-and-XFS-drivers.patch @@ -1,7 +1,7 @@ From 13542e244eea28a4c60708de99a50fa8c3d4ec5a Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 20 Jul 2020 16:26:42 +0200 -Subject: [PATCH 004/179] feat(drivers): add CephFS, GlusterFS and XFS drivers +Subject: [PATCH 004/180] feat(drivers): add CephFS, GlusterFS and XFS drivers --- Makefile | 3 + diff --git a/SOURCES/0005-feat-drivers-add-ZFS-driver-to-avoid-losing-VDI-meta.patch b/SOURCES/0005-feat-drivers-add-ZFS-driver-to-avoid-losing-VDI-meta.patch index 1bcd22b2..f86c8ec7 100644 --- a/SOURCES/0005-feat-drivers-add-ZFS-driver-to-avoid-losing-VDI-meta.patch +++ b/SOURCES/0005-feat-drivers-add-ZFS-driver-to-avoid-losing-VDI-meta.patch @@ -1,7 +1,7 @@ From 4525a55b84eb46f4c67797da6eaf61a329dac9d7 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 12 Aug 2020 11:14:33 +0200 -Subject: [PATCH 005/179] feat(drivers): add ZFS driver to avoid losing VDI +Subject: [PATCH 005/180] feat(drivers): add ZFS driver to avoid losing VDI metadata (xcp-ng/xcp#401) --- diff --git a/SOURCES/0006-Re-add-the-ext4-driver-for-users-who-need-to-transit.patch b/SOURCES/0006-Re-add-the-ext4-driver-for-users-who-need-to-transit.patch index 0f350506..38a2d15f 100644 --- a/SOURCES/0006-Re-add-the-ext4-driver-for-users-who-need-to-transit.patch +++ b/SOURCES/0006-Re-add-the-ext4-driver-for-users-who-need-to-transit.patch @@ -1,7 +1,7 @@ From 5987a43e40444a524768b1434de1a67c6e53000a Mon Sep 17 00:00:00 2001 From: Samuel Verschelde Date: Thu, 13 Aug 2020 17:10:12 +0200 -Subject: [PATCH 006/179] Re-add the ext4 driver for users who need to +Subject: [PATCH 006/180] Re-add the ext4 driver for users who need to transition The driver is needed to transition to the ext driver. diff --git a/SOURCES/0007-feat-drivers-add-LinstorSR-driver.patch b/SOURCES/0007-feat-drivers-add-LinstorSR-driver.patch index 69bc737e..9e505c64 100644 --- a/SOURCES/0007-feat-drivers-add-LinstorSR-driver.patch +++ b/SOURCES/0007-feat-drivers-add-LinstorSR-driver.patch @@ -1,7 +1,7 @@ From 2c71c3ce33cd02573824a57bd4b3917b45c890b0 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 16 Mar 2020 15:39:44 +0100 -Subject: [PATCH 007/179] feat(drivers): add LinstorSR driver +Subject: [PATCH 007/180] feat(drivers): add LinstorSR driver Some important points: diff --git a/SOURCES/0008-feat-tests-add-unit-tests-concerning-ZFS-close-xcp-n.patch b/SOURCES/0008-feat-tests-add-unit-tests-concerning-ZFS-close-xcp-n.patch index afd46158..e4a92e27 100644 --- a/SOURCES/0008-feat-tests-add-unit-tests-concerning-ZFS-close-xcp-n.patch +++ b/SOURCES/0008-feat-tests-add-unit-tests-concerning-ZFS-close-xcp-n.patch @@ -1,7 +1,7 @@ From 89cee57b097a681edc800be05d1dfc7d97aec995 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 27 Oct 2020 15:04:36 +0100 -Subject: [PATCH 008/179] feat(tests): add unit tests concerning ZFS (close +Subject: [PATCH 008/180] feat(tests): add unit tests concerning ZFS (close xcp-ng/xcp#425) - Check if "create" doesn't succeed without zfs packages diff --git a/SOURCES/0009-If-no-NFS-ACLs-provided-assume-everyone.patch b/SOURCES/0009-If-no-NFS-ACLs-provided-assume-everyone.patch index 8bc6e700..622830bd 100644 --- a/SOURCES/0009-If-no-NFS-ACLs-provided-assume-everyone.patch +++ b/SOURCES/0009-If-no-NFS-ACLs-provided-assume-everyone.patch @@ -1,7 +1,7 @@ From c338e356dcad6ad17b2f2248ff45fcf983173e0e Mon Sep 17 00:00:00 2001 From: BenjiReis Date: Thu, 25 Feb 2021 09:54:52 +0100 -Subject: [PATCH 009/179] If no NFS ACLs provided, assume everyone: +Subject: [PATCH 009/180] 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: "*". diff --git a/SOURCES/0010-Added-SM-Driver-for-MooseFS.patch b/SOURCES/0010-Added-SM-Driver-for-MooseFS.patch index 1fe103a5..fb740920 100644 --- a/SOURCES/0010-Added-SM-Driver-for-MooseFS.patch +++ b/SOURCES/0010-Added-SM-Driver-for-MooseFS.patch @@ -1,7 +1,7 @@ From 359dd15436b153bedf32af7768973febc2b84c2f Mon Sep 17 00:00:00 2001 From: Aleksander Wieliczko Date: Fri, 29 Jan 2021 15:21:23 +0100 -Subject: [PATCH 010/179] Added SM Driver for MooseFS +Subject: [PATCH 010/180] Added SM Driver for MooseFS Co-authored-by: Piotr Robert Konopelko Signed-off-by: Aleksander Wieliczko diff --git a/SOURCES/0011-Avoid-usage-of-umount-in-ISOSR-when-legacy_mode-is-u.patch b/SOURCES/0011-Avoid-usage-of-umount-in-ISOSR-when-legacy_mode-is-u.patch index c6ef7b69..6012db23 100644 --- a/SOURCES/0011-Avoid-usage-of-umount-in-ISOSR-when-legacy_mode-is-u.patch +++ b/SOURCES/0011-Avoid-usage-of-umount-in-ISOSR-when-legacy_mode-is-u.patch @@ -1,7 +1,7 @@ From c984a5c3510b12c44a9fd2d0297cdb21111d20f7 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 2 Dec 2021 09:28:37 +0100 -Subject: [PATCH 011/179] Avoid usage of `umount` in `ISOSR` when `legacy_mode` +Subject: [PATCH 011/180] 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 diff --git a/SOURCES/0012-MooseFS-SR-uses-now-UUID-subdirs-for-each-SR.patch b/SOURCES/0012-MooseFS-SR-uses-now-UUID-subdirs-for-each-SR.patch index 04972a46..96945a0d 100644 --- a/SOURCES/0012-MooseFS-SR-uses-now-UUID-subdirs-for-each-SR.patch +++ b/SOURCES/0012-MooseFS-SR-uses-now-UUID-subdirs-for-each-SR.patch @@ -1,7 +1,7 @@ From c701f410bdac559ac8384da2f8b40833e5e89866 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 18 May 2022 17:28:09 +0200 -Subject: [PATCH 012/179] MooseFS SR uses now UUID subdirs for each SR +Subject: [PATCH 012/180] 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 diff --git a/SOURCES/0013-Fix-is_open-call-for-many-drivers-25.patch b/SOURCES/0013-Fix-is_open-call-for-many-drivers-25.patch index 429077a5..04da752e 100644 --- a/SOURCES/0013-Fix-is_open-call-for-many-drivers-25.patch +++ b/SOURCES/0013-Fix-is_open-call-for-many-drivers-25.patch @@ -1,7 +1,7 @@ From cba6bde2b5243bac634b5e5e910db685355ba83e Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 23 Jun 2022 10:36:36 +0200 -Subject: [PATCH 013/179] Fix is_open call for many drivers (#25) +Subject: [PATCH 013/180] 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. diff --git a/SOURCES/0014-Remove-SR_CACHING-capability-for-many-SR-types-24.patch b/SOURCES/0014-Remove-SR_CACHING-capability-for-many-SR-types-24.patch index 453a8150..ad3642c5 100644 --- a/SOURCES/0014-Remove-SR_CACHING-capability-for-many-SR-types-24.patch +++ b/SOURCES/0014-Remove-SR_CACHING-capability-for-many-SR-types-24.patch @@ -1,7 +1,7 @@ From bf7577ff65e882686af8e7ca1748cfb0b7934a14 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 23 Jun 2022 10:37:07 +0200 -Subject: [PATCH 014/179] Remove SR_CACHING capability for many SR types (#24) +Subject: [PATCH 014/180] 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. diff --git a/SOURCES/0015-Remove-SR_PROBE-from-ZFS-capabilities-37.patch b/SOURCES/0015-Remove-SR_PROBE-from-ZFS-capabilities-37.patch index 3e83babe..fca90ba8 100644 --- a/SOURCES/0015-Remove-SR_PROBE-from-ZFS-capabilities-37.patch +++ b/SOURCES/0015-Remove-SR_PROBE-from-ZFS-capabilities-37.patch @@ -1,7 +1,7 @@ From 1a7496b75ae96edf79f2da481b54b80e8d2925f8 Mon Sep 17 00:00:00 2001 From: BenjiReis Date: Fri, 4 Aug 2023 12:10:08 +0200 -Subject: [PATCH 015/179] Remove `SR_PROBE` from ZFS capabilities (#37) +Subject: [PATCH 015/180] Remove `SR_PROBE` from ZFS capabilities (#37) The probe method is not implemented so we shouldn't advertise it. diff --git a/SOURCES/0016-Fix-vdi-ref-when-static-vdis-are-used.patch b/SOURCES/0016-Fix-vdi-ref-when-static-vdis-are-used.patch index 3f6320ea..ebcf3eba 100644 --- a/SOURCES/0016-Fix-vdi-ref-when-static-vdis-are-used.patch +++ b/SOURCES/0016-Fix-vdi-ref-when-static-vdis-are-used.patch @@ -1,7 +1,7 @@ From 37c79431e2c6654c5afdb6cde6e23c4c321c4cda Mon Sep 17 00:00:00 2001 From: Guillaume Date: Wed, 16 Aug 2023 13:42:21 +0200 -Subject: [PATCH 016/179] Fix vdi-ref when static vdis are used +Subject: [PATCH 016/180] 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. diff --git a/SOURCES/0017-Tell-users-not-to-edit-multipath.conf-directly.patch b/SOURCES/0017-Tell-users-not-to-edit-multipath.conf-directly.patch index 7a5d423b..a654e2cf 100644 --- a/SOURCES/0017-Tell-users-not-to-edit-multipath.conf-directly.patch +++ b/SOURCES/0017-Tell-users-not-to-edit-multipath.conf-directly.patch @@ -1,7 +1,7 @@ From 9bfcb0be3ff34354c9299bf6e0a90e691f14e813 Mon Sep 17 00:00:00 2001 From: Samuel Verschelde Date: Fri, 27 Jan 2023 12:03:15 +0100 -Subject: [PATCH 017/179] Tell users not to edit multipath.conf directly +Subject: [PATCH 017/180] 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 diff --git a/SOURCES/0018-Add-custom.conf-multipath-configuration-file.patch b/SOURCES/0018-Add-custom.conf-multipath-configuration-file.patch index b6f14a1d..b72dc181 100644 --- a/SOURCES/0018-Add-custom.conf-multipath-configuration-file.patch +++ b/SOURCES/0018-Add-custom.conf-multipath-configuration-file.patch @@ -1,7 +1,7 @@ From 383f9128fb1a788074a5a6aca09a249bfeaa44f5 Mon Sep 17 00:00:00 2001 From: Samuel Verschelde Date: Fri, 27 Jan 2023 12:23:13 +0100 -Subject: [PATCH 018/179] Add custom.conf multipath configuration file +Subject: [PATCH 018/180] 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 diff --git a/SOURCES/0019-Install-etc-multipath-conf.d-custom.conf.patch b/SOURCES/0019-Install-etc-multipath-conf.d-custom.conf.patch index 74778050..d1ace212 100644 --- a/SOURCES/0019-Install-etc-multipath-conf.d-custom.conf.patch +++ b/SOURCES/0019-Install-etc-multipath-conf.d-custom.conf.patch @@ -1,7 +1,7 @@ From 507c2f067878ee88765c5750d3e618c8c63208c7 Mon Sep 17 00:00:00 2001 From: Samuel Verschelde Date: Fri, 25 Aug 2023 17:47:34 +0200 -Subject: [PATCH 019/179] Install /etc/multipath/conf.d/custom.conf +Subject: [PATCH 019/180] Install /etc/multipath/conf.d/custom.conf Update Makefile so that the file is installed along with sm. diff --git a/SOURCES/0020-Backport-NFS4-only-support.patch b/SOURCES/0020-Backport-NFS4-only-support.patch index a23fec11..67c3d8e0 100644 --- a/SOURCES/0020-Backport-NFS4-only-support.patch +++ b/SOURCES/0020-Backport-NFS4-only-support.patch @@ -1,7 +1,7 @@ From 2d197ca1c046dce44579f77f4e2ac23397edb9c1 Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Mon, 18 Dec 2023 10:22:26 +0100 -Subject: [PATCH 020/179] Backport NFS4 only support +Subject: [PATCH 020/180] Backport NFS4 only support See: https://github.com/xapi-project/sm/pull/617 diff --git a/SOURCES/0021-Backport-probe-for-NFS4-when-rpcinfo-does-not-includ.patch b/SOURCES/0021-Backport-probe-for-NFS4-when-rpcinfo-does-not-includ.patch index c80423a4..286c4477 100644 --- a/SOURCES/0021-Backport-probe-for-NFS4-when-rpcinfo-does-not-includ.patch +++ b/SOURCES/0021-Backport-probe-for-NFS4-when-rpcinfo-does-not-includ.patch @@ -1,7 +1,7 @@ From bcebd6854894ddd9cc6af7d41a54daab7a45f7be Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Mon, 18 Dec 2023 10:35:46 +0100 -Subject: [PATCH 021/179] Backport probe for NFS4 when rpcinfo does not include +Subject: [PATCH 021/180] Backport probe for NFS4 when rpcinfo does not include it See: https://github.com/xapi-project/sm/pull/655 diff --git a/SOURCES/0022-feat-LargeBlock-backport-of-largeblocksr-51-55.patch b/SOURCES/0022-feat-LargeBlock-backport-of-largeblocksr-51-55.patch index 72572530..852c82e0 100644 --- a/SOURCES/0022-feat-LargeBlock-backport-of-largeblocksr-51-55.patch +++ b/SOURCES/0022-feat-LargeBlock-backport-of-largeblocksr-51-55.patch @@ -1,7 +1,7 @@ From 52d495879ebf8c1caee78f3e10f7febd65d8ccd3 Mon Sep 17 00:00:00 2001 From: Damien Thenot Date: Tue, 7 May 2024 15:20:22 +0200 -Subject: [PATCH 022/179] feat(LargeBlock): backport of largeblocksr (#51) +Subject: [PATCH 022/180] feat(LargeBlock): backport of largeblocksr (#51) (#55) A SR inheriting from a EXTSR allowing to use a 4KiB blocksize device as diff --git a/SOURCES/0023-feat-LVHDSR-add-a-way-to-modify-config-of-LVMs-56.patch b/SOURCES/0023-feat-LVHDSR-add-a-way-to-modify-config-of-LVMs-56.patch index 8e2f5d34..c45eab00 100644 --- a/SOURCES/0023-feat-LVHDSR-add-a-way-to-modify-config-of-LVMs-56.patch +++ b/SOURCES/0023-feat-LVHDSR-add-a-way-to-modify-config-of-LVMs-56.patch @@ -1,7 +1,7 @@ From ec5c7c6cd4732e7f70122ccdb8ccdaf6711e5f31 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 28 May 2024 15:17:21 +0200 -Subject: [PATCH 023/179] feat(LVHDSR): add a way to modify config of LVMs +Subject: [PATCH 023/180] feat(LVHDSR): add a way to modify config of LVMs (#56) With this change the driver supports a "lvm-conf" param on "other-config". diff --git a/SOURCES/0024-Revert-CA-379329-check-for-missing-iSCSI-sessions-an.patch b/SOURCES/0024-Revert-CA-379329-check-for-missing-iSCSI-sessions-an.patch index 96c66dfa..ce3b42e1 100644 --- a/SOURCES/0024-Revert-CA-379329-check-for-missing-iSCSI-sessions-an.patch +++ b/SOURCES/0024-Revert-CA-379329-check-for-missing-iSCSI-sessions-an.patch @@ -1,7 +1,7 @@ From 4ffea27c739e2a02c78438bfb2d281259afad615 Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Thu, 27 Jun 2024 17:55:10 +0200 -Subject: [PATCH 024/179] Revert "CA-379329: check for missing iSCSI sessions +Subject: [PATCH 024/180] Revert "CA-379329: check for missing iSCSI sessions and reconnect" This reverts commit d28dcc1341166ed4839dbea8ef6d1a24e981f461. diff --git a/SOURCES/0025-Fix-timeout_call-alarm-must-be-reset-in-case-of-succ.patch b/SOURCES/0025-Fix-timeout_call-alarm-must-be-reset-in-case-of-succ.patch index 64d9225b..c6527e49 100644 --- a/SOURCES/0025-Fix-timeout_call-alarm-must-be-reset-in-case-of-succ.patch +++ b/SOURCES/0025-Fix-timeout_call-alarm-must-be-reset-in-case-of-succ.patch @@ -1,7 +1,7 @@ From 81233191b418528ff660f2dcc4f179db598eded5 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 16 Feb 2022 18:24:56 +0100 -Subject: [PATCH 025/179] Fix timeout_call: alarm must be reset in case of +Subject: [PATCH 025/180] Fix timeout_call: alarm must be reset in case of success Otherwise the SIGALRM signal can be emitted after the execution diff --git a/SOURCES/0026-timeout_call-returns-the-result-of-user-function-now.patch b/SOURCES/0026-timeout_call-returns-the-result-of-user-function-now.patch index 9d97881a..f68b0ad0 100644 --- a/SOURCES/0026-timeout_call-returns-the-result-of-user-function-now.patch +++ b/SOURCES/0026-timeout_call-returns-the-result-of-user-function-now.patch @@ -1,7 +1,7 @@ From 608866667c3f834f5a8128f0e646b494dbfda73f Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 16 Feb 2022 18:28:06 +0100 -Subject: [PATCH 026/179] timeout_call returns the result of user function now +Subject: [PATCH 026/180] timeout_call returns the result of user function now Signed-off-by: Ronan Abhamon --- diff --git a/SOURCES/0027-Always-remove-the-pause-tag-from-VDIs-in-case-of-fai.patch b/SOURCES/0027-Always-remove-the-pause-tag-from-VDIs-in-case-of-fai.patch index 28d57ebe..ddfc9e33 100644 --- a/SOURCES/0027-Always-remove-the-pause-tag-from-VDIs-in-case-of-fai.patch +++ b/SOURCES/0027-Always-remove-the-pause-tag-from-VDIs-in-case-of-fai.patch @@ -1,7 +1,7 @@ From e2533c00ebd0e76502dd3b8e4b57bae3e271e19e Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 5 Feb 2024 23:16:16 +0100 -Subject: [PATCH 027/179] Always remove the pause tag from VDIs in case of +Subject: [PATCH 027/180] Always remove the pause tag from VDIs in case of failure During VDI activation in the blktap module and in case of failure diff --git a/SOURCES/0028-fix-LinstorSR-repair-volumes-only-if-an-exclusive-co.patch b/SOURCES/0028-fix-LinstorSR-repair-volumes-only-if-an-exclusive-co.patch index 5b1f3f53..d6780a3e 100644 --- a/SOURCES/0028-fix-LinstorSR-repair-volumes-only-if-an-exclusive-co.patch +++ b/SOURCES/0028-fix-LinstorSR-repair-volumes-only-if-an-exclusive-co.patch @@ -1,7 +1,7 @@ From 2f5bef7771d539e57b314ccb34a51fa91c62582c Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 20 Nov 2020 16:42:52 +0100 -Subject: [PATCH 028/179] fix(LinstorSR): repair volumes only if an exclusive +Subject: [PATCH 028/180] fix(LinstorSR): repair volumes only if an exclusive command is executed Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0029-feat-LinstorSR-Improve-LINSTOR-performance.patch b/SOURCES/0029-feat-LinstorSR-Improve-LINSTOR-performance.patch index 562fd0e9..c66c30d2 100644 --- a/SOURCES/0029-feat-LinstorSR-Improve-LINSTOR-performance.patch +++ b/SOURCES/0029-feat-LinstorSR-Improve-LINSTOR-performance.patch @@ -1,7 +1,7 @@ From fa6b3dcb7cc88a68152282bd9943cbc71a8c8b97 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 10 Dec 2020 17:56:15 +0100 -Subject: [PATCH 029/179] feat(LinstorSR): Improve LINSTOR performance +Subject: [PATCH 029/180] feat(LinstorSR): Improve LINSTOR performance Details: - vdi_attach and vdi_detach are now exclusive diff --git a/SOURCES/0030-feat-LinstorSR-robustify-scan-to-avoid-losing-VDIs-i.patch b/SOURCES/0030-feat-LinstorSR-robustify-scan-to-avoid-losing-VDIs-i.patch index d93067b5..10cc352c 100644 --- a/SOURCES/0030-feat-LinstorSR-robustify-scan-to-avoid-losing-VDIs-i.patch +++ b/SOURCES/0030-feat-LinstorSR-robustify-scan-to-avoid-losing-VDIs-i.patch @@ -1,7 +1,7 @@ From 7492a4f950f109830dc7b48adee93f0fce76027d Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 7 Jan 2021 11:17:08 +0100 -Subject: [PATCH 030/179] feat(LinstorSR): robustify scan to avoid losing VDIs +Subject: [PATCH 030/180] feat(LinstorSR): robustify scan to avoid losing VDIs if function is called outside module Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0031-feat-LinstorSR-display-a-correctly-readable-size-for.patch b/SOURCES/0031-feat-LinstorSR-display-a-correctly-readable-size-for.patch index 664761cc..612f9c24 100644 --- a/SOURCES/0031-feat-LinstorSR-display-a-correctly-readable-size-for.patch +++ b/SOURCES/0031-feat-LinstorSR-display-a-correctly-readable-size-for.patch @@ -1,7 +1,7 @@ From 0569b8b07776f203532c856d8cf92e7fe4957300 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 8 Jan 2021 16:12:15 +0100 -Subject: [PATCH 031/179] feat(LinstorSR): display a correctly readable size +Subject: [PATCH 031/180] feat(LinstorSR): display a correctly readable size for the user Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0032-feat-linstor-monitord-scan-all-LINSTOR-SRs-every-12-.patch b/SOURCES/0032-feat-linstor-monitord-scan-all-LINSTOR-SRs-every-12-.patch index 15ab7cd6..be36eb7a 100644 --- a/SOURCES/0032-feat-linstor-monitord-scan-all-LINSTOR-SRs-every-12-.patch +++ b/SOURCES/0032-feat-linstor-monitord-scan-all-LINSTOR-SRs-every-12-.patch @@ -1,7 +1,7 @@ From e5d09d4036b314c4f2b3fbfa148d367ef319841e Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 12 Jan 2021 14:06:34 +0100 -Subject: [PATCH 032/179] feat(linstor-monitord): scan all LINSTOR SRs every 12 +Subject: [PATCH 032/180] feat(linstor-monitord): scan all LINSTOR SRs every 12 minutes to update allocated size stats Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0033-fix-LinstorSR-call-correctly-method-in-_locked_load-.patch b/SOURCES/0033-fix-LinstorSR-call-correctly-method-in-_locked_load-.patch index a5cae438..bd3a6c27 100644 --- a/SOURCES/0033-fix-LinstorSR-call-correctly-method-in-_locked_load-.patch +++ b/SOURCES/0033-fix-LinstorSR-call-correctly-method-in-_locked_load-.patch @@ -1,7 +1,7 @@ From 3fd04d9be881f7ea2c978ba93e4dae3695d3cb74 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 15 Jan 2021 17:01:05 +0100 -Subject: [PATCH 033/179] fix(LinstorSR): call correctly method in _locked_load +Subject: [PATCH 033/180] fix(LinstorSR): call correctly method in _locked_load when vdi_attach_from_config is executed Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0034-feat-LinstorSR-integrate-minidrbdcluster-daemon.patch b/SOURCES/0034-feat-LinstorSR-integrate-minidrbdcluster-daemon.patch index 6bb7cca6..aed62cd7 100644 --- a/SOURCES/0034-feat-LinstorSR-integrate-minidrbdcluster-daemon.patch +++ b/SOURCES/0034-feat-LinstorSR-integrate-minidrbdcluster-daemon.patch @@ -1,7 +1,7 @@ From f815b2bde1959d8342c5e009e7d739b10b1845ed Mon Sep 17 00:00:00 2001 From: Wescoeur Date: Wed, 20 Jan 2021 18:04:26 +0100 -Subject: [PATCH 034/179] feat(LinstorSR): integrate minidrbdcluster daemon +Subject: [PATCH 034/180] feat(LinstorSR): integrate minidrbdcluster daemon Now, we can: - Start a controller on any node diff --git a/SOURCES/0035-feat-LinstorSR-ensure-heartbeat-and-redo_log-VDIs-ar.patch b/SOURCES/0035-feat-LinstorSR-ensure-heartbeat-and-redo_log-VDIs-ar.patch index 394b85d6..57d88099 100644 --- a/SOURCES/0035-feat-LinstorSR-ensure-heartbeat-and-redo_log-VDIs-ar.patch +++ b/SOURCES/0035-feat-LinstorSR-ensure-heartbeat-and-redo_log-VDIs-ar.patch @@ -1,7 +1,7 @@ From 7eaa8b7d67bd1704b2c8d6537703ed30f5e4303d Mon Sep 17 00:00:00 2001 From: Wescoeur Date: Wed, 24 Feb 2021 11:17:23 +0100 -Subject: [PATCH 035/179] feat(LinstorSR): ensure heartbeat and redo_log VDIs +Subject: [PATCH 035/180] feat(LinstorSR): ensure heartbeat and redo_log VDIs are not diskless Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0036-feat-LinstorSR-protect-sr-commands-to-avoid-forgetti.patch b/SOURCES/0036-feat-LinstorSR-protect-sr-commands-to-avoid-forgetti.patch index aa2acf3f..06b8a14c 100644 --- a/SOURCES/0036-feat-LinstorSR-protect-sr-commands-to-avoid-forgetti.patch +++ b/SOURCES/0036-feat-LinstorSR-protect-sr-commands-to-avoid-forgetti.patch @@ -1,7 +1,7 @@ From 957fb9efcf9e31071ce90563fae78ce17a5c6aa6 Mon Sep 17 00:00:00 2001 From: Wescoeur Date: Thu, 25 Feb 2021 17:52:57 +0100 -Subject: [PATCH 036/179] feat(LinstorSR): protect sr commands to avoid +Subject: [PATCH 036/180] feat(LinstorSR): protect sr commands to avoid forgetting LINSTOR volumes when master satellite is down Steps to reproduce: diff --git a/SOURCES/0037-fix-LinstorJournaler-ensure-uri-is-not-None-during-l.patch b/SOURCES/0037-fix-LinstorJournaler-ensure-uri-is-not-None-during-l.patch index 8b90a585..269794de 100644 --- a/SOURCES/0037-fix-LinstorJournaler-ensure-uri-is-not-None-during-l.patch +++ b/SOURCES/0037-fix-LinstorJournaler-ensure-uri-is-not-None-during-l.patch @@ -1,7 +1,7 @@ From 5e96c8a43e8a672bc1622ed10ba7bc8138caed91 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 8 Mar 2021 13:25:28 +0100 -Subject: [PATCH 037/179] fix(LinstorJournaler): ensure uri is not None during +Subject: [PATCH 037/180] fix(LinstorJournaler): ensure uri is not None during linstor.KV creation Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0038-feat-LinstorSR-add-an-option-to-disable-auto-quorum-.patch b/SOURCES/0038-feat-LinstorSR-add-an-option-to-disable-auto-quorum-.patch index 91fa2ad8..62ee28fb 100644 --- a/SOURCES/0038-feat-LinstorSR-add-an-option-to-disable-auto-quorum-.patch +++ b/SOURCES/0038-feat-LinstorSR-add-an-option-to-disable-auto-quorum-.patch @@ -1,7 +1,7 @@ From 4a5e7d4ee020c3e1fa1b07a2306dd6480003da43 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 22 Mar 2021 17:32:26 +0100 -Subject: [PATCH 038/179] feat(LinstorSR): add an option to disable auto-quorum +Subject: [PATCH 038/180] feat(LinstorSR): add an option to disable auto-quorum on volume DB + fix doc Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0039-fix-LinstorVolumeManager-add-a-workaround-to-create-.patch b/SOURCES/0039-fix-LinstorVolumeManager-add-a-workaround-to-create-.patch index 8a7a9559..b8036356 100644 --- a/SOURCES/0039-fix-LinstorVolumeManager-add-a-workaround-to-create-.patch +++ b/SOURCES/0039-fix-LinstorVolumeManager-add-a-workaround-to-create-.patch @@ -1,7 +1,7 @@ From 5a2642058762b8fa64c44b53e89618f5c7b77f3b Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 23 Mar 2021 14:49:39 +0100 -Subject: [PATCH 039/179] fix(LinstorVolumeManager): add a workaround to create +Subject: [PATCH 039/180] fix(LinstorVolumeManager): add a workaround to create properly SR with thin LVM Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0040-feat-LinstorSR-add-optional-ips-parameter.patch b/SOURCES/0040-feat-LinstorSR-add-optional-ips-parameter.patch index c1517470..032a1ba0 100644 --- a/SOURCES/0040-feat-LinstorSR-add-optional-ips-parameter.patch +++ b/SOURCES/0040-feat-LinstorSR-add-optional-ips-parameter.patch @@ -1,7 +1,7 @@ From 0940fe2bfcfc74d6252a07cf95d1f261bf77cfc8 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 24 Mar 2021 10:06:58 +0100 -Subject: [PATCH 040/179] feat(LinstorSR): add optional ips parameter +Subject: [PATCH 040/180] feat(LinstorSR): add optional ips parameter Signed-off-by: Ronan Abhamon --- diff --git a/SOURCES/0041-feat-LinstorSR-add-a-helper-log_drbd_erofs-to-trace-.patch b/SOURCES/0041-feat-LinstorSR-add-a-helper-log_drbd_erofs-to-trace-.patch index e61265a4..d4c74207 100644 --- a/SOURCES/0041-feat-LinstorSR-add-a-helper-log_drbd_erofs-to-trace-.patch +++ b/SOURCES/0041-feat-LinstorSR-add-a-helper-log_drbd_erofs-to-trace-.patch @@ -1,7 +1,7 @@ From f54ac1cef57268f0f7494af54fd4008a9aa67481 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 26 Mar 2021 16:13:20 +0100 -Subject: [PATCH 041/179] feat(LinstorSR): add a helper `log_drbd_erofs` to +Subject: [PATCH 041/180] feat(LinstorSR): add a helper `log_drbd_erofs` to trace EROFS errno code with DRBD resources + check EROFS error Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0042-fix-LinstorSR-try-to-restart-the-services-again-if-t.patch b/SOURCES/0042-fix-LinstorSR-try-to-restart-the-services-again-if-t.patch index 2cf00946..50f503d8 100644 --- a/SOURCES/0042-fix-LinstorSR-try-to-restart-the-services-again-if-t.patch +++ b/SOURCES/0042-fix-LinstorSR-try-to-restart-the-services-again-if-t.patch @@ -1,7 +1,7 @@ From 70e19894b836132d11001dd506dc1f6b97c38a57 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 28 Apr 2021 15:15:58 +0200 -Subject: [PATCH 042/179] fix(LinstorSR): try to restart the services again if +Subject: [PATCH 042/180] fix(LinstorSR): try to restart the services again if there is a failure in linstor-manager Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0043-fix-LinstorSR-robustify-linstor-manager-to-never-inc.patch b/SOURCES/0043-fix-LinstorSR-robustify-linstor-manager-to-never-inc.patch index e3954403..b6723283 100644 --- a/SOURCES/0043-fix-LinstorSR-robustify-linstor-manager-to-never-inc.patch +++ b/SOURCES/0043-fix-LinstorSR-robustify-linstor-manager-to-never-inc.patch @@ -1,7 +1,7 @@ From 00000e9bd493c60ff0fd29bd1ee0612188f14cba Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 26 Aug 2021 15:26:11 +0200 -Subject: [PATCH 043/179] fix(LinstorSR): robustify linstor-manager to never +Subject: [PATCH 043/180] fix(LinstorSR): robustify linstor-manager to never include from plugins path Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0044-fix-LinstorSR-prevent-starting-controller-during-fai.patch b/SOURCES/0044-fix-LinstorSR-prevent-starting-controller-during-fai.patch index b5f3fd5f..28bfe3dd 100644 --- a/SOURCES/0044-fix-LinstorSR-prevent-starting-controller-during-fai.patch +++ b/SOURCES/0044-fix-LinstorSR-prevent-starting-controller-during-fai.patch @@ -1,7 +1,7 @@ From 388927905668b5f4b577b2099ea95fcae1f62c57 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 26 Aug 2021 16:52:01 +0200 -Subject: [PATCH 044/179] fix(LinstorSR): prevent starting controller during +Subject: [PATCH 044/180] fix(LinstorSR): prevent starting controller during fail in linstor manager destroy method Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0045-feat-LinstorVolumeManager-increase-peer-slots-limit-.patch b/SOURCES/0045-feat-LinstorVolumeManager-increase-peer-slots-limit-.patch index 60d2c6d0..9b92081c 100644 --- a/SOURCES/0045-feat-LinstorVolumeManager-increase-peer-slots-limit-.patch +++ b/SOURCES/0045-feat-LinstorVolumeManager-increase-peer-slots-limit-.patch @@ -1,7 +1,7 @@ From 7bbb8e4cb68122d9e2a784dae2359edbe8a16445 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 19 Oct 2021 14:48:17 +0200 -Subject: [PATCH 045/179] feat(LinstorVolumeManager): increase peer slots limit +Subject: [PATCH 045/180] feat(LinstorVolumeManager): increase peer slots limit (support 31 connections to a DRBD) - Also, create diskless devices when db is created diff --git a/SOURCES/0046-feat-LinstorVolumeManager-add-a-fallback-to-find-con.patch b/SOURCES/0046-feat-LinstorVolumeManager-add-a-fallback-to-find-con.patch index e4240bcf..cbb05166 100644 --- a/SOURCES/0046-feat-LinstorVolumeManager-add-a-fallback-to-find-con.patch +++ b/SOURCES/0046-feat-LinstorVolumeManager-add-a-fallback-to-find-con.patch @@ -1,7 +1,7 @@ From c96f969e228b789d1ac28ae17eb35255cfee0aa0 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 20 Oct 2021 14:33:04 +0200 -Subject: [PATCH 046/179] feat(LinstorVolumeManager): add a fallback to find +Subject: [PATCH 046/180] feat(LinstorVolumeManager): add a fallback to find controller uri (when len(hosts) >= 4) Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0047-fix-var-lib-linstor.mount-ensure-we-always-mount-dat.patch b/SOURCES/0047-fix-var-lib-linstor.mount-ensure-we-always-mount-dat.patch index 6d674eb7..ab87de16 100644 --- a/SOURCES/0047-fix-var-lib-linstor.mount-ensure-we-always-mount-dat.patch +++ b/SOURCES/0047-fix-var-lib-linstor.mount-ensure-we-always-mount-dat.patch @@ -1,7 +1,7 @@ From 1911a8c147f036f0e57062cb3134c6798a468e30 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 21 Oct 2021 11:13:07 +0200 -Subject: [PATCH 047/179] fix(var-lib-linstor.mount): ensure we always mount +Subject: [PATCH 047/180] fix(var-lib-linstor.mount): ensure we always mount database with RW flags Sometimes systemd fallback to read only FS if the volume can't be mounted, we must diff --git a/SOURCES/0048-feat-LinstorVolumeManager-add-a-fallback-to-find-nod.patch b/SOURCES/0048-feat-LinstorVolumeManager-add-a-fallback-to-find-nod.patch index 6f4c0328..2e4ed6f7 100644 --- a/SOURCES/0048-feat-LinstorVolumeManager-add-a-fallback-to-find-nod.patch +++ b/SOURCES/0048-feat-LinstorVolumeManager-add-a-fallback-to-find-nod.patch @@ -1,7 +1,7 @@ From 53850ec1f126a68485c20d01a81da2529ba19d90 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 21 Oct 2021 11:51:32 +0200 -Subject: [PATCH 048/179] feat(LinstorVolumeManager): add a fallback to find +Subject: [PATCH 048/180] feat(LinstorVolumeManager): add a fallback to find node name (when len(hosts) >= 4) Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0049-feat-LinstorSR-explain-on-which-host-plugins-command.patch b/SOURCES/0049-feat-LinstorSR-explain-on-which-host-plugins-command.patch index ae20da4c..0cefbd11 100644 --- a/SOURCES/0049-feat-LinstorSR-explain-on-which-host-plugins-command.patch +++ b/SOURCES/0049-feat-LinstorSR-explain-on-which-host-plugins-command.patch @@ -1,7 +1,7 @@ From a719956530bd08539fa58f1cfd0043779cc7c0d9 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 26 Oct 2021 10:44:00 +0200 -Subject: [PATCH 049/179] feat(LinstorSR): explain on which host, plugins +Subject: [PATCH 049/180] feat(LinstorSR): explain on which host, plugins commands are executed Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0050-fix-LinstorSR-create-diskless-path-if-necessary-duri.patch b/SOURCES/0050-fix-LinstorSR-create-diskless-path-if-necessary-duri.patch index 33fa019d..04fed73b 100644 --- a/SOURCES/0050-fix-LinstorSR-create-diskless-path-if-necessary-duri.patch +++ b/SOURCES/0050-fix-LinstorSR-create-diskless-path-if-necessary-duri.patch @@ -1,7 +1,7 @@ From ea6fa3de772d60b15718834e0510e47bedb334fc Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 3 Nov 2021 14:59:31 +0100 -Subject: [PATCH 050/179] fix(LinstorSR): create diskless path if necessary +Subject: [PATCH 050/180] fix(LinstorSR): create diskless path if necessary during VDI loading Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0051-feat-LinstorSR-use-HTTP-NBD-instead-of-DRBD-directly.patch b/SOURCES/0051-feat-LinstorSR-use-HTTP-NBD-instead-of-DRBD-directly.patch index 8afbb273..462d4799 100644 --- a/SOURCES/0051-feat-LinstorSR-use-HTTP-NBD-instead-of-DRBD-directly.patch +++ b/SOURCES/0051-feat-LinstorSR-use-HTTP-NBD-instead-of-DRBD-directly.patch @@ -1,7 +1,7 @@ From 38960f4621164640ed1c4423959e0fd195569403 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 12 May 2022 17:52:35 +0200 -Subject: [PATCH 051/179] feat(LinstorSR): use HTTP/NBD instead of DRBD +Subject: [PATCH 051/180] feat(LinstorSR): use HTTP/NBD instead of DRBD directly with heartbeat VDI Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0052-fix-LinstorSR-find-controller-when-XAPI-unreachable-.patch b/SOURCES/0052-fix-LinstorSR-find-controller-when-XAPI-unreachable-.patch index d2e59337..a189a00c 100644 --- a/SOURCES/0052-fix-LinstorSR-find-controller-when-XAPI-unreachable-.patch +++ b/SOURCES/0052-fix-LinstorSR-find-controller-when-XAPI-unreachable-.patch @@ -1,7 +1,7 @@ From 43cdaa51754d3e397f17e2092a64919daf6e4a05 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 3 Mar 2022 15:02:17 +0100 -Subject: [PATCH 052/179] fix(LinstorSR): find controller when XAPI unreachable +Subject: [PATCH 052/180] fix(LinstorSR): find controller when XAPI unreachable (XHA) Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0053-fix-LinstorSR-use-IPs-instead-of-hostnames-in-NBD-se.patch b/SOURCES/0053-fix-LinstorSR-use-IPs-instead-of-hostnames-in-NBD-se.patch index a9c9a8f0..386a06b1 100644 --- a/SOURCES/0053-fix-LinstorSR-use-IPs-instead-of-hostnames-in-NBD-se.patch +++ b/SOURCES/0053-fix-LinstorSR-use-IPs-instead-of-hostnames-in-NBD-se.patch @@ -1,7 +1,7 @@ From a6d4a6ef809faeb91f4cd7c7f4e4bba8dc2d0b7f Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 24 Mar 2022 18:13:46 +0100 -Subject: [PATCH 053/179] fix(LinstorSR): use IPs instead of hostnames in NBD +Subject: [PATCH 053/180] fix(LinstorSR): use IPs instead of hostnames in NBD server Without this patch we can't use XCP-ng hosts configured with static IPS. diff --git a/SOURCES/0054-fix-LinstorVolumeManager-ensure-we-always-use-IPs-in.patch b/SOURCES/0054-fix-LinstorVolumeManager-ensure-we-always-use-IPs-in.patch index 1a875083..81f28d5c 100644 --- a/SOURCES/0054-fix-LinstorVolumeManager-ensure-we-always-use-IPs-in.patch +++ b/SOURCES/0054-fix-LinstorVolumeManager-ensure-we-always-use-IPs-in.patch @@ -1,7 +1,7 @@ From 5e39604cc13941a2d3fe20a2096e3553c1838dba Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 31 Mar 2022 11:21:19 +0200 -Subject: [PATCH 054/179] fix(LinstorVolumeManager): ensure we always use IPs +Subject: [PATCH 054/180] fix(LinstorVolumeManager): ensure we always use IPs in _get_controller_uri Otherwise if a hostname is returned, we can't use it if the XCP-ng pool diff --git a/SOURCES/0055-feat-linstor-manager-add-methods-to-add-remove-host-.patch b/SOURCES/0055-feat-linstor-manager-add-methods-to-add-remove-host-.patch index 9bd61f5e..280e6d6e 100644 --- a/SOURCES/0055-feat-linstor-manager-add-methods-to-add-remove-host-.patch +++ b/SOURCES/0055-feat-linstor-manager-add-methods-to-add-remove-host-.patch @@ -1,7 +1,7 @@ From 28aba096541cca6fb8afcf8d0cb4789b8ef8575f Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 6 Apr 2022 17:53:02 +0200 -Subject: [PATCH 055/179] feat(linstor-manager): add methods to add remove/host +Subject: [PATCH 055/180] feat(linstor-manager): add methods to add remove/host from LINSTOR SR Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0056-feat-LinstorVolumeManager-support-SR-creation-with-d.patch b/SOURCES/0056-feat-LinstorVolumeManager-support-SR-creation-with-d.patch index cdbb191e..988ec1e0 100644 --- a/SOURCES/0056-feat-LinstorVolumeManager-support-SR-creation-with-d.patch +++ b/SOURCES/0056-feat-LinstorVolumeManager-support-SR-creation-with-d.patch @@ -1,7 +1,7 @@ From 20097cdf57ee556867918c67505fe017d56e20a8 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 13 Apr 2022 15:56:42 +0200 -Subject: [PATCH 056/179] feat(LinstorVolumeManager): support SR creation with +Subject: [PATCH 056/180] feat(LinstorVolumeManager): support SR creation with diskless nodes Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0057-feat-LinstorSR-add-a-config-var-to-disable-HTTP-NBD-.patch b/SOURCES/0057-feat-LinstorSR-add-a-config-var-to-disable-HTTP-NBD-.patch index fad833d3..c25972ce 100644 --- a/SOURCES/0057-feat-LinstorSR-add-a-config-var-to-disable-HTTP-NBD-.patch +++ b/SOURCES/0057-feat-LinstorSR-add-a-config-var-to-disable-HTTP-NBD-.patch @@ -1,7 +1,7 @@ From 95fd9bba2bffc7313f5d155779e14d3922974584 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 14 Apr 2022 10:30:23 +0200 -Subject: [PATCH 057/179] feat(LinstorSR): add a config var to disable HTTP/NBD +Subject: [PATCH 057/180] feat(LinstorSR): add a config var to disable HTTP/NBD servers Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0058-feat-LinstorSr-ensure-LVM-group-is-activated-during-.patch b/SOURCES/0058-feat-LinstorSr-ensure-LVM-group-is-activated-during-.patch index d8353b6b..366751f4 100644 --- a/SOURCES/0058-feat-LinstorSr-ensure-LVM-group-is-activated-during-.patch +++ b/SOURCES/0058-feat-LinstorSr-ensure-LVM-group-is-activated-during-.patch @@ -1,7 +1,7 @@ From dc48c3878151d9c23db4ca8c5a6247da70797d8c Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 14 Apr 2022 15:45:20 +0200 -Subject: [PATCH 058/179] feat(LinstorSr): ensure LVM group is activated during +Subject: [PATCH 058/180] feat(LinstorSr): ensure LVM group is activated during SR.attach/create Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0059-feat-linstor-manager-add-method-to-create-LinstorSR-.patch b/SOURCES/0059-feat-linstor-manager-add-method-to-create-LinstorSR-.patch index c8cbe6fe..03f11ac1 100644 --- a/SOURCES/0059-feat-linstor-manager-add-method-to-create-LinstorSR-.patch +++ b/SOURCES/0059-feat-linstor-manager-add-method-to-create-LinstorSR-.patch @@ -1,7 +1,7 @@ From 705841677140a8163c1ff3df384002e1e03c2678 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 25 Apr 2022 14:47:51 +0200 -Subject: [PATCH 059/179] feat(linstor-manager): add method to create LinstorSR +Subject: [PATCH 059/180] feat(linstor-manager): add method to create LinstorSR + to list/destroy DRBD volumes Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0060-fix-LinstorSR-always-set-vdi_path-in-generate_config.patch b/SOURCES/0060-fix-LinstorSR-always-set-vdi_path-in-generate_config.patch index 75ec5844..941b03cf 100644 --- a/SOURCES/0060-fix-LinstorSR-always-set-vdi_path-in-generate_config.patch +++ b/SOURCES/0060-fix-LinstorSR-always-set-vdi_path-in-generate_config.patch @@ -1,7 +1,7 @@ From 136b46200c12aa90dd246559107e0f742ccb66a7 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 26 Apr 2022 11:20:08 +0200 -Subject: [PATCH 060/179] fix(LinstorSR): always set vdi_path in +Subject: [PATCH 060/180] fix(LinstorSR): always set vdi_path in generate_config If the volume of a generated config is not related to HTTP/NBD diff --git a/SOURCES/0061-fix-minidrbdcluster-supports-new-properties-like-for.patch b/SOURCES/0061-fix-minidrbdcluster-supports-new-properties-like-for.patch index c1178c06..0cadb836 100644 --- a/SOURCES/0061-fix-minidrbdcluster-supports-new-properties-like-for.patch +++ b/SOURCES/0061-fix-minidrbdcluster-supports-new-properties-like-for.patch @@ -1,7 +1,7 @@ From 49fad6ce14acee828ef7d5c90abbc1a4310b788c Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 13 May 2022 14:35:57 +0200 -Subject: [PATCH 061/179] fix(minidrbdcluster): supports new properties like +Subject: [PATCH 061/180] fix(minidrbdcluster): supports new properties like `force-io-failures` Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0062-fix-LinstorSR-enabled-disable-minidrbcluster-with-fi.patch b/SOURCES/0062-fix-LinstorSR-enabled-disable-minidrbcluster-with-fi.patch index a0a4050b..0ed7cdf6 100644 --- a/SOURCES/0062-fix-LinstorSR-enabled-disable-minidrbcluster-with-fi.patch +++ b/SOURCES/0062-fix-LinstorSR-enabled-disable-minidrbcluster-with-fi.patch @@ -1,7 +1,7 @@ From c72704cc8eeb8c7ee16b9ff919c012613e58e9b9 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 18 May 2022 17:28:33 +0200 -Subject: [PATCH 062/179] fix(LinstorSR): enabled/disable minidrbcluster with +Subject: [PATCH 062/180] fix(LinstorSR): enabled/disable minidrbcluster with fixed order Ensure we disable minidrbdcluster during SR destruction on all hosts diff --git a/SOURCES/0063-fix-linstor-manager-change-linstor-satellite-start-b.patch b/SOURCES/0063-fix-linstor-manager-change-linstor-satellite-start-b.patch index b5105428..7479c9b3 100644 --- a/SOURCES/0063-fix-linstor-manager-change-linstor-satellite-start-b.patch +++ b/SOURCES/0063-fix-linstor-manager-change-linstor-satellite-start-b.patch @@ -1,7 +1,7 @@ From 753d654a5f81243b6c7a28880b5936ff0a4077c5 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 31 May 2022 14:01:45 +0200 -Subject: [PATCH 063/179] fix(linstor-manager): change linstor satellite start +Subject: [PATCH 063/180] fix(linstor-manager): change linstor satellite start behavior Ensure we don't have an invalid cache used by a satellite: diff --git a/SOURCES/0064-Fix-is_open-call-for-LinstorSR.patch b/SOURCES/0064-Fix-is_open-call-for-LinstorSR.patch index c7da97ca..cdd0cbd7 100644 --- a/SOURCES/0064-Fix-is_open-call-for-LinstorSR.patch +++ b/SOURCES/0064-Fix-is_open-call-for-LinstorSR.patch @@ -1,7 +1,7 @@ From 1a7b9177a0975ef6663607077797d3fe00b73bc6 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 2 Jun 2022 09:04:28 +0200 -Subject: [PATCH 064/179] Fix is_open call for LinstorSR +Subject: [PATCH 064/180] Fix is_open call for LinstorSR 1. Ensure LinstorSR driver is imported in `_is_open` definition to register it in the driver list. Otherwise this function always fails with a SRUnknownType exception. diff --git a/SOURCES/0065-fix-linstorvhdutil-fix-boolean-params-of-check-call.patch b/SOURCES/0065-fix-linstorvhdutil-fix-boolean-params-of-check-call.patch index cbd20739..6b1ce988 100644 --- a/SOURCES/0065-fix-linstorvhdutil-fix-boolean-params-of-check-call.patch +++ b/SOURCES/0065-fix-linstorvhdutil-fix-boolean-params-of-check-call.patch @@ -1,7 +1,7 @@ From d03d8fb5ef8790e9de1229200c8cd5e873990026 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 2 Jun 2022 09:28:32 +0200 -Subject: [PATCH 065/179] fix(linstorvhdutil): fix boolean params of `check` +Subject: [PATCH 065/180] fix(linstorvhdutil): fix boolean params of `check` call `ignoreMissingFooter` and `fast` must be string types to be used with XAPI plugin API. diff --git a/SOURCES/0066-feat-linstor-manager-robustify-exec_create_sr.patch b/SOURCES/0066-feat-linstor-manager-robustify-exec_create_sr.patch index a3e57469..eea92343 100644 --- a/SOURCES/0066-feat-linstor-manager-robustify-exec_create_sr.patch +++ b/SOURCES/0066-feat-linstor-manager-robustify-exec_create_sr.patch @@ -1,7 +1,7 @@ From 78820c47841ddce844286d12a590bd04c8b7f065 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 30 Jun 2022 17:09:51 +0200 -Subject: [PATCH 066/179] feat(linstor-manager): robustify exec_create_sr +Subject: [PATCH 066/180] feat(linstor-manager): robustify exec_create_sr - Use lvm.py XCP-ng xapi plugins instead of lvm (old name) - Check arguments to create the SR diff --git a/SOURCES/0067-fix-cleanup-print-LINSTOR-VDI-UUID-if-error-during-i.patch b/SOURCES/0067-fix-cleanup-print-LINSTOR-VDI-UUID-if-error-during-i.patch index 22f63f16..aca1a1e1 100644 --- a/SOURCES/0067-fix-cleanup-print-LINSTOR-VDI-UUID-if-error-during-i.patch +++ b/SOURCES/0067-fix-cleanup-print-LINSTOR-VDI-UUID-if-error-during-i.patch @@ -1,7 +1,7 @@ From a4922a1709c39af0a7c1a9808bbf7bc03300fcd4 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 8 Jul 2022 14:52:25 +0200 -Subject: [PATCH 067/179] fix(cleanup): print LINSTOR VDI UUID if error during +Subject: [PATCH 067/180] fix(cleanup): print LINSTOR VDI UUID if error during info loading (not SR UUID) Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0068-feat-cleanup-raise-and-dump-DRBD-openers-in-case-of-.patch b/SOURCES/0068-feat-cleanup-raise-and-dump-DRBD-openers-in-case-of-.patch index 62e2ef43..337c71b3 100644 --- a/SOURCES/0068-feat-cleanup-raise-and-dump-DRBD-openers-in-case-of-.patch +++ b/SOURCES/0068-feat-cleanup-raise-and-dump-DRBD-openers-in-case-of-.patch @@ -1,7 +1,7 @@ From 08c339d4c31048e5d979712dad5adb4cf82c95c7 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 21 Jul 2022 11:39:20 +0200 -Subject: [PATCH 068/179] feat(cleanup): raise and dump DRBD openers in case of +Subject: [PATCH 068/180] feat(cleanup): raise and dump DRBD openers in case of bad coalesce Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0069-feat-linstorvhdutil-trace-DRBD-openers-in-case-of-ER.patch b/SOURCES/0069-feat-linstorvhdutil-trace-DRBD-openers-in-case-of-ER.patch index cd6c337a..aff1d8b5 100644 --- a/SOURCES/0069-feat-linstorvhdutil-trace-DRBD-openers-in-case-of-ER.patch +++ b/SOURCES/0069-feat-linstorvhdutil-trace-DRBD-openers-in-case-of-ER.patch @@ -1,7 +1,7 @@ From 0e6bde3144a0b8cf47aa5e569e6e42b39603bb00 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 22 Jul 2022 10:26:20 +0200 -Subject: [PATCH 069/179] feat(linstorvhdutil): trace DRBD openers in case of +Subject: [PATCH 069/180] feat(linstorvhdutil): trace DRBD openers in case of EROFS errors Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0070-fix-linstorvolumemanager-compute-correctly-size-in-a.patch b/SOURCES/0070-fix-linstorvolumemanager-compute-correctly-size-in-a.patch index a82e56ad..ce8bd295 100644 --- a/SOURCES/0070-fix-linstorvolumemanager-compute-correctly-size-in-a.patch +++ b/SOURCES/0070-fix-linstorvolumemanager-compute-correctly-size-in-a.patch @@ -1,7 +1,7 @@ From 4ac2809b987876231912df71bdc6aed6fb02822a Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 29 Jul 2022 17:25:48 +0200 -Subject: [PATCH 070/179] fix(linstorvolumemanager): compute correctly size in +Subject: [PATCH 070/180] fix(linstorvolumemanager): compute correctly size in allocated_volume_size Remove replication count in computation. diff --git a/SOURCES/0071-feat-LinstorSR-use-DRBD-openers-instead-of-lsof-to-l.patch b/SOURCES/0071-feat-LinstorSR-use-DRBD-openers-instead-of-lsof-to-l.patch index 41e41ea5..8548f4cd 100644 --- a/SOURCES/0071-feat-LinstorSR-use-DRBD-openers-instead-of-lsof-to-l.patch +++ b/SOURCES/0071-feat-LinstorSR-use-DRBD-openers-instead-of-lsof-to-l.patch @@ -1,7 +1,7 @@ From 40e0621614ab4334c1edc21e88ae24d5e72df7d6 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 9 Aug 2022 11:07:57 +0200 -Subject: [PATCH 071/179] feat(LinstorSR): use DRBD openers instead of lsof to +Subject: [PATCH 071/180] feat(LinstorSR): use DRBD openers instead of lsof to log in blktap2 Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0072-feat-LinstorSR-support-cProfile-to-trace-calls-when-.patch b/SOURCES/0072-feat-LinstorSR-support-cProfile-to-trace-calls-when-.patch index 2d7e37ca..66613492 100644 --- a/SOURCES/0072-feat-LinstorSR-support-cProfile-to-trace-calls-when-.patch +++ b/SOURCES/0072-feat-LinstorSR-support-cProfile-to-trace-calls-when-.patch @@ -1,7 +1,7 @@ From 2bf415703e247e502c8e036ce9a3216888ceab37 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 25 Aug 2022 12:11:18 +0200 -Subject: [PATCH 072/179] feat(LinstorSR): support cProfile to trace calls when +Subject: [PATCH 072/180] feat(LinstorSR): support cProfile to trace calls when a command is executed Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0073-fix-LinstorJournaler-reset-namespace-when-get-is-cal.patch b/SOURCES/0073-fix-LinstorJournaler-reset-namespace-when-get-is-cal.patch index 660deb07..90c6c767 100644 --- a/SOURCES/0073-fix-LinstorJournaler-reset-namespace-when-get-is-cal.patch +++ b/SOURCES/0073-fix-LinstorJournaler-reset-namespace-when-get-is-cal.patch @@ -1,7 +1,7 @@ From e2900bfd2689841a1230bfbbe9e5c34b735503ea Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 24 Aug 2022 17:09:11 +0200 -Subject: [PATCH 073/179] fix(LinstorJournaler): reset namespace when `get` is +Subject: [PATCH 073/180] fix(LinstorJournaler): reset namespace when `get` is called Otherwise, we can be in the wrong namespace and the key to find will be inaccessible. diff --git a/SOURCES/0074-fix-linstorvhdutil-fix-coalesce-with-VM-running-unde.patch b/SOURCES/0074-fix-linstorvhdutil-fix-coalesce-with-VM-running-unde.patch index 6d28c8b4..8a2b623c 100644 --- a/SOURCES/0074-fix-linstorvhdutil-fix-coalesce-with-VM-running-unde.patch +++ b/SOURCES/0074-fix-linstorvhdutil-fix-coalesce-with-VM-running-unde.patch @@ -1,7 +1,7 @@ From 640c28db2bd83893634fa8740abbbd1023cee0ab Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 25 Aug 2022 10:54:56 +0200 -Subject: [PATCH 074/179] fix(linstorvhdutil): fix coalesce with VM running +Subject: [PATCH 074/180] fix(linstorvhdutil): fix coalesce with VM running under specific scenario: When a VM is running, we can't coalesce without this patch with a long chain diff --git a/SOURCES/0075-fix-linstorvolumemanager-_get_volumes_info-doesn-t-r.patch b/SOURCES/0075-fix-linstorvolumemanager-_get_volumes_info-doesn-t-r.patch index eed702da..4721daa8 100644 --- a/SOURCES/0075-fix-linstorvolumemanager-_get_volumes_info-doesn-t-r.patch +++ b/SOURCES/0075-fix-linstorvolumemanager-_get_volumes_info-doesn-t-r.patch @@ -1,7 +1,7 @@ From af2068715b685b59877d80e2328c10c6dc14318b Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 5 Sep 2022 15:09:17 +0200 -Subject: [PATCH 075/179] fix(linstorvolumemanager): `_get_volumes_info` +Subject: [PATCH 075/180] fix(linstorvolumemanager): `_get_volumes_info` doesn't raise with offline host Ensure this method doesn't raise an exception when a host is offline. diff --git a/SOURCES/0076-fix-linstorvolumemanager-remove-double-prefix-on-kv-.patch b/SOURCES/0076-fix-linstorvolumemanager-remove-double-prefix-on-kv-.patch index 3e544c26..9de29681 100644 --- a/SOURCES/0076-fix-linstorvolumemanager-remove-double-prefix-on-kv-.patch +++ b/SOURCES/0076-fix-linstorvolumemanager-remove-double-prefix-on-kv-.patch @@ -1,7 +1,7 @@ From 43ecef813014a86cd92c70e0411f725c24714fe9 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 12 Sep 2022 15:56:09 +0200 -Subject: [PATCH 076/179] fix(linstorvolumemanager): remove double prefix on kv +Subject: [PATCH 076/180] fix(linstorvolumemanager): remove double prefix on kv group name - Before this patch, when the kv store was created/accessed, a double "xcp-sr-" prefix was used. diff --git a/SOURCES/0077-feat-LinstorSR-add-linstor-kv-dump-helper-to-print-k.patch b/SOURCES/0077-feat-LinstorSR-add-linstor-kv-dump-helper-to-print-k.patch index fb3ce85a..c6eca224 100644 --- a/SOURCES/0077-feat-LinstorSR-add-linstor-kv-dump-helper-to-print-k.patch +++ b/SOURCES/0077-feat-LinstorSR-add-linstor-kv-dump-helper-to-print-k.patch @@ -1,7 +1,7 @@ From 494ecc96c37cb01698c825c00f9ddb3e5c6f53c3 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 12 Sep 2022 17:54:57 +0200 -Subject: [PATCH 077/179] feat(LinstorSR): add linstor-kv-dump helper to print +Subject: [PATCH 077/180] feat(LinstorSR): add linstor-kv-dump helper to print kv store Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0078-fix-LinstorSR-disable-VHD-key-hash-usage-to-limit-ex.patch b/SOURCES/0078-fix-LinstorSR-disable-VHD-key-hash-usage-to-limit-ex.patch index c6427af5..920c71e2 100644 --- a/SOURCES/0078-fix-LinstorSR-disable-VHD-key-hash-usage-to-limit-ex.patch +++ b/SOURCES/0078-fix-LinstorSR-disable-VHD-key-hash-usage-to-limit-ex.patch @@ -1,7 +1,7 @@ From 59c9be98c2eeeb37e15c76874ca62071dab4c164 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 14 Sep 2022 10:17:18 +0200 -Subject: [PATCH 078/179] fix(LinstorSR): disable VHD key hash usage to limit +Subject: [PATCH 078/180] fix(LinstorSR): disable VHD key hash usage to limit exec time Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0079-fix-minidrbdcluster-ensure-SIGINT-is-handled-correct.patch b/SOURCES/0079-fix-minidrbdcluster-ensure-SIGINT-is-handled-correct.patch index 719eb68d..1c0ad651 100644 --- a/SOURCES/0079-fix-minidrbdcluster-ensure-SIGINT-is-handled-correct.patch +++ b/SOURCES/0079-fix-minidrbdcluster-ensure-SIGINT-is-handled-correct.patch @@ -1,7 +1,7 @@ From 730853aa446f399f3acecb0afa7783ea36ed5240 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 15 Sep 2022 11:34:25 +0200 -Subject: [PATCH 079/179] fix(minidrbdcluster): ensure SIGINT is handled +Subject: [PATCH 079/180] fix(minidrbdcluster): ensure SIGINT is handled correctly This patch is here to make sure no LINSTOR controller survives when diff --git a/SOURCES/0080-feat-minidrbdcluster-stop-resource-services-at-start.patch b/SOURCES/0080-feat-minidrbdcluster-stop-resource-services-at-start.patch index 5cbdde48..4a6a2ff5 100644 --- a/SOURCES/0080-feat-minidrbdcluster-stop-resource-services-at-start.patch +++ b/SOURCES/0080-feat-minidrbdcluster-stop-resource-services-at-start.patch @@ -1,7 +1,7 @@ From d8a3fcab1752746435c599664efd7f4789e2c58f Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 15 Sep 2022 11:49:34 +0200 -Subject: [PATCH 080/179] feat(minidrbdcluster): stop resource services at +Subject: [PATCH 080/180] feat(minidrbdcluster): stop resource services at startup - Ensure all services are stopped when minidrbcluster is started. diff --git a/SOURCES/0081-feat-linstor-manager-add-new-healthCheck-function-to.patch b/SOURCES/0081-feat-linstor-manager-add-new-healthCheck-function-to.patch index 19381e6f..668be78b 100644 --- a/SOURCES/0081-feat-linstor-manager-add-new-healthCheck-function-to.patch +++ b/SOURCES/0081-feat-linstor-manager-add-new-healthCheck-function-to.patch @@ -1,7 +1,7 @@ From ef9a22262f1cfb444bf01274bfbbf0b53607f341 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 23 Sep 2022 17:45:08 +0200 -Subject: [PATCH 081/179] feat(linstor-manager): add new `healthCheck` function +Subject: [PATCH 081/180] feat(linstor-manager): add new `healthCheck` function to monitor pool (#26) Print a JSON output to monitor state of LINSTOR SRs: diff --git a/SOURCES/0082-fix-LinstorSR-fix-xha-conf-parsing-return-host-ip-no.patch b/SOURCES/0082-fix-LinstorSR-fix-xha-conf-parsing-return-host-ip-no.patch index 26a01ddb..2c025b7c 100644 --- a/SOURCES/0082-fix-LinstorSR-fix-xha-conf-parsing-return-host-ip-no.patch +++ b/SOURCES/0082-fix-LinstorSR-fix-xha-conf-parsing-return-host-ip-no.patch @@ -1,7 +1,7 @@ From 42c75bb0a6f16360c87f0688ee38d93b3a66e2e2 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 4 Oct 2022 11:01:33 +0200 -Subject: [PATCH 082/179] fix(LinstorSR): fix xha conf parsing => return host +Subject: [PATCH 082/180] fix(LinstorSR): fix xha conf parsing => return host ip, not the UUID Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0083-fix-LinstorSR-start-correctly-HA-servers-HTTP-NBD-af.patch b/SOURCES/0083-fix-LinstorSR-start-correctly-HA-servers-HTTP-NBD-af.patch index 8204d077..c8a2f02e 100644 --- a/SOURCES/0083-fix-LinstorSR-start-correctly-HA-servers-HTTP-NBD-af.patch +++ b/SOURCES/0083-fix-LinstorSR-start-correctly-HA-servers-HTTP-NBD-af.patch @@ -1,7 +1,7 @@ From 3847194acc3cf8769a71e85636d66f0eaacb0593 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 4 Oct 2022 18:48:09 +0200 -Subject: [PATCH 083/179] fix(LinstorSR): start correctly HA servers (HTTP/NBD) +Subject: [PATCH 083/180] fix(LinstorSR): start correctly HA servers (HTTP/NBD) after reboot Use a timeout call after a reboot to get a XAPI session because diff --git a/SOURCES/0084-fix-linstorvolumemanager-use-an-array-to-store-diskf.patch b/SOURCES/0084-fix-linstorvolumemanager-use-an-array-to-store-diskf.patch index 50cceb8d..921245ae 100644 --- a/SOURCES/0084-fix-linstorvolumemanager-use-an-array-to-store-diskf.patch +++ b/SOURCES/0084-fix-linstorvolumemanager-use-an-array-to-store-diskf.patch @@ -1,7 +1,7 @@ From 1af86e89ed07f4b0bce6e032f37f500fb58d0cee Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 5 Oct 2022 10:45:50 +0200 -Subject: [PATCH 084/179] fix(linstorvolumemanager): use an array to store +Subject: [PATCH 084/180] fix(linstorvolumemanager): use an array to store diskful volumes info Otherwise the `is_diskful` attr only reflects the info of one host diff --git a/SOURCES/0085-feat-linstorvolumemanager-support-snaps-when-a-host-.patch b/SOURCES/0085-feat-linstorvolumemanager-support-snaps-when-a-host-.patch index 357ad740..d4a2c9f0 100644 --- a/SOURCES/0085-feat-linstorvolumemanager-support-snaps-when-a-host-.patch +++ b/SOURCES/0085-feat-linstorvolumemanager-support-snaps-when-a-host-.patch @@ -1,7 +1,7 @@ From 414bc1efcd2fd9f1b8b41c690bcee46c8d550552 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 6 Oct 2022 17:54:10 +0200 -Subject: [PATCH 085/179] feat(linstorvolumemanager): support snaps when a host +Subject: [PATCH 085/180] feat(linstorvolumemanager): support snaps when a host is offline - Don't create diskless volumes during clone, delay it. diff --git a/SOURCES/0086-fix-linstorvolumemanager-support-offline-hosts-when-.patch b/SOURCES/0086-fix-linstorvolumemanager-support-offline-hosts-when-.patch index aee932fc..0cc74059 100644 --- a/SOURCES/0086-fix-linstorvolumemanager-support-offline-hosts-when-.patch +++ b/SOURCES/0086-fix-linstorvolumemanager-support-offline-hosts-when-.patch @@ -1,7 +1,7 @@ From 32b338239370f6c3d0148723a3c2e6a61903daeb Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 7 Oct 2022 17:18:37 +0200 -Subject: [PATCH 086/179] fix(linstorvolumemanager): support offline hosts when +Subject: [PATCH 086/180] fix(linstorvolumemanager): support offline hosts when plugins are called - Robustify plugin calls diff --git a/SOURCES/0087-fix-linstorvolumemanager-define-_base_group_name-mem.patch b/SOURCES/0087-fix-linstorvolumemanager-define-_base_group_name-mem.patch index 4ce95fc4..0242e710 100644 --- a/SOURCES/0087-fix-linstorvolumemanager-define-_base_group_name-mem.patch +++ b/SOURCES/0087-fix-linstorvolumemanager-define-_base_group_name-mem.patch @@ -1,7 +1,7 @@ From 846da4170432a4be553ac1e98db146df069ce2ae Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 7 Oct 2022 17:45:26 +0200 -Subject: [PATCH 087/179] fix(linstorvolumemanager): define _base_group_name +Subject: [PATCH 087/180] fix(linstorvolumemanager): define _base_group_name member at SR creation Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0088-feat-linstorvhdutil-modify-logic-of-local-vhdutil-ca.patch b/SOURCES/0088-feat-linstorvhdutil-modify-logic-of-local-vhdutil-ca.patch index ee72e356..8df47104 100644 --- a/SOURCES/0088-feat-linstorvhdutil-modify-logic-of-local-vhdutil-ca.patch +++ b/SOURCES/0088-feat-linstorvhdutil-modify-logic-of-local-vhdutil-ca.patch @@ -1,7 +1,7 @@ From 76b0beee9ffa96cc6eb687408a94fde1034ecab7 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 10 Oct 2022 14:33:24 +0200 -Subject: [PATCH 088/179] feat(linstorvhdutil): modify logic of local vhdutil +Subject: [PATCH 088/180] feat(linstorvhdutil): modify logic of local vhdutil calls - Always log openers when we can't call vhdutil locally diff --git a/SOURCES/0089-fix-linstorvolumemanager-robustify-failed-snapshots.patch b/SOURCES/0089-fix-linstorvolumemanager-robustify-failed-snapshots.patch index 7e7998ed..4c458b8a 100644 --- a/SOURCES/0089-fix-linstorvolumemanager-robustify-failed-snapshots.patch +++ b/SOURCES/0089-fix-linstorvolumemanager-robustify-failed-snapshots.patch @@ -1,7 +1,7 @@ From 5d2f1d8bbc0c46b8ea1096188b73bcddd8e519ff Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 17 Oct 2022 18:14:16 +0200 -Subject: [PATCH 089/179] fix(linstorvolumemanager): robustify failed snapshots +Subject: [PATCH 089/180] fix(linstorvolumemanager): robustify failed snapshots - Ensure we can always rename a failed snap, so we must check if we have metadata in the KV-store. Otherwise an error is triggered diff --git a/SOURCES/0090-fix-linstorvolumemanager-use-a-namespace-for-volumes.patch b/SOURCES/0090-fix-linstorvolumemanager-use-a-namespace-for-volumes.patch index adcb82cd..0584cb9d 100644 --- a/SOURCES/0090-fix-linstorvolumemanager-use-a-namespace-for-volumes.patch +++ b/SOURCES/0090-fix-linstorvolumemanager-use-a-namespace-for-volumes.patch @@ -1,7 +1,7 @@ From 612f6ccde1042223048bf4f7dec8810bb86d8575 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 8 Nov 2022 17:31:45 +0100 -Subject: [PATCH 090/179] fix(linstorvolumemanager): use a namespace for +Subject: [PATCH 090/180] fix(linstorvolumemanager): use a namespace for volumes - This change is not compatible with existing LINSTOR SR instances! diff --git a/SOURCES/0091-feat-linstor-kv-dump-rename-to-linstor-kv-tool-add-r.patch b/SOURCES/0091-feat-linstor-kv-dump-rename-to-linstor-kv-tool-add-r.patch index 87386d8f..54337d2e 100644 --- a/SOURCES/0091-feat-linstor-kv-dump-rename-to-linstor-kv-tool-add-r.patch +++ b/SOURCES/0091-feat-linstor-kv-dump-rename-to-linstor-kv-tool-add-r.patch @@ -1,7 +1,7 @@ From 32b38dfdf74d01673c1e9ac177346145aa8a3518 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 14 Nov 2022 17:18:48 +0100 -Subject: [PATCH 091/179] feat(linstor-kv-dump): rename to linstor-kv-tool + +Subject: [PATCH 091/180] feat(linstor-kv-dump): rename to linstor-kv-tool + add remove volume helpers --- diff --git a/SOURCES/0092-fix-LinstorSR-handle-correctly-localhost-during-star.patch b/SOURCES/0092-fix-LinstorSR-handle-correctly-localhost-during-star.patch index 1b2e75c4..c20b7c50 100644 --- a/SOURCES/0092-fix-LinstorSR-handle-correctly-localhost-during-star.patch +++ b/SOURCES/0092-fix-LinstorSR-handle-correctly-localhost-during-star.patch @@ -1,7 +1,7 @@ From bcc899d36e498e15ec9e5860f1439fcc4be4622b Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 16 Nov 2022 12:12:12 +0100 -Subject: [PATCH 092/179] fix(LinstorSR): handle correctly localhost during +Subject: [PATCH 092/180] fix(LinstorSR): handle correctly localhost during start/stop of minidrbdcluster Otherwise another controller can be started during `xe sr-destroy` call. diff --git a/SOURCES/0093-fix-cleanup.py-call-repair-on-another-host-when-EROF.patch b/SOURCES/0093-fix-cleanup.py-call-repair-on-another-host-when-EROF.patch index 3576ff80..ed9a2668 100644 --- a/SOURCES/0093-fix-cleanup.py-call-repair-on-another-host-when-EROF.patch +++ b/SOURCES/0093-fix-cleanup.py-call-repair-on-another-host-when-EROF.patch @@ -1,7 +1,7 @@ From 228634f7d8cc5fa78203272269e114a209821356 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 17 Nov 2022 15:43:25 +0100 -Subject: [PATCH 093/179] fix(cleanup.py): call repair on another host when +Subject: [PATCH 093/180] fix(cleanup.py): call repair on another host when EROFS is returned (DRBD) Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0094-fix-LinstorSR-avoid-introduction-of-DELETED-volumes.patch b/SOURCES/0094-fix-LinstorSR-avoid-introduction-of-DELETED-volumes.patch index 84ea2444..62884576 100644 --- a/SOURCES/0094-fix-LinstorSR-avoid-introduction-of-DELETED-volumes.patch +++ b/SOURCES/0094-fix-LinstorSR-avoid-introduction-of-DELETED-volumes.patch @@ -1,7 +1,7 @@ From a17925aa496b1814038ff6f998461b533f90d077 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 17 Nov 2022 15:46:02 +0100 -Subject: [PATCH 094/179] fix(LinstorSR): avoid introduction of DELETED volumes +Subject: [PATCH 094/180] fix(LinstorSR): avoid introduction of DELETED volumes Signed-off-by: Ronan Abhamon --- diff --git a/SOURCES/0095-feat-linstor-kv-tool-remove-all-volumes-supports-jou.patch b/SOURCES/0095-feat-linstor-kv-tool-remove-all-volumes-supports-jou.patch index 707c05bb..637c8906 100644 --- a/SOURCES/0095-feat-linstor-kv-tool-remove-all-volumes-supports-jou.patch +++ b/SOURCES/0095-feat-linstor-kv-tool-remove-all-volumes-supports-jou.patch @@ -1,7 +1,7 @@ From e6ef1f66479ae68d5b0809f7a2158106aa1b3eec Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 18 Nov 2022 10:40:58 +0100 -Subject: [PATCH 095/179] feat(linstor-kv-tool): remove-all-volumes supports +Subject: [PATCH 095/180] feat(linstor-kv-tool): remove-all-volumes supports journals now Not yet supported for remove-volume, not sure about the consequences diff --git a/SOURCES/0096-fix-linstorvhdutil-due-to-bad-refactoring-check-call.patch b/SOURCES/0096-fix-linstorvhdutil-due-to-bad-refactoring-check-call.patch index a845ec37..c05c8558 100644 --- a/SOURCES/0096-fix-linstorvhdutil-due-to-bad-refactoring-check-call.patch +++ b/SOURCES/0096-fix-linstorvhdutil-due-to-bad-refactoring-check-call.patch @@ -1,7 +1,7 @@ From 5a94eadf986c919cee83780a9e6cdce167a6701c Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 23 Nov 2022 15:26:51 +0100 -Subject: [PATCH 096/179] fix(linstorvhdutil): due to bad refactoring, check +Subject: [PATCH 096/180] fix(linstorvhdutil): due to bad refactoring, check call was broken Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0097-feat-linstorvhdutil-ensure-we-use-VHD-parent-to-find.patch b/SOURCES/0097-feat-linstorvhdutil-ensure-we-use-VHD-parent-to-find.patch index bb2b4ee3..4ff6ba53 100644 --- a/SOURCES/0097-feat-linstorvhdutil-ensure-we-use-VHD-parent-to-find.patch +++ b/SOURCES/0097-feat-linstorvhdutil-ensure-we-use-VHD-parent-to-find.patch @@ -1,7 +1,7 @@ From 8390021e0aedb7ef2979ff9ac9c21fe3367a4f23 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 23 Nov 2022 15:28:23 +0100 -Subject: [PATCH 097/179] feat(linstorvhdutil): ensure we use VHD parent to +Subject: [PATCH 097/180] feat(linstorvhdutil): ensure we use VHD parent to find host where to coalesce Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0098-feat-linstorvolumemanager-force-DRBD-demote-after-fa.patch b/SOURCES/0098-feat-linstorvolumemanager-force-DRBD-demote-after-fa.patch index 8a935362..ae322347 100644 --- a/SOURCES/0098-feat-linstorvolumemanager-force-DRBD-demote-after-fa.patch +++ b/SOURCES/0098-feat-linstorvolumemanager-force-DRBD-demote-after-fa.patch @@ -1,7 +1,7 @@ From b1355b13bc58003fa01f29fb31516f6b1fcc67e8 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 5 Dec 2022 18:40:11 +0100 -Subject: [PATCH 098/179] feat(linstorvolumemanager): force DRBD demote after +Subject: [PATCH 098/180] feat(linstorvolumemanager): force DRBD demote after failed volume creation/clone Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0099-fix-linstorvhdutil-ensure-we-retry-creation-in-all-s.patch b/SOURCES/0099-fix-linstorvhdutil-ensure-we-retry-creation-in-all-s.patch index bf7c22ec..da46cf6c 100644 --- a/SOURCES/0099-fix-linstorvhdutil-ensure-we-retry-creation-in-all-s.patch +++ b/SOURCES/0099-fix-linstorvhdutil-ensure-we-retry-creation-in-all-s.patch @@ -1,7 +1,7 @@ From 33c9cbedb5e26d291dda3f020513db5154dac454 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 6 Dec 2022 11:22:15 +0100 -Subject: [PATCH 099/179] fix(linstorvhdutil): ensure we retry creation in all +Subject: [PATCH 099/180] fix(linstorvhdutil): ensure we retry creation in all situations Without this patch, a basic resource creation is never restarted diff --git a/SOURCES/0100-fix-linstorvhdutil-don-t-retry-local-vhdutil-call-wh.patch b/SOURCES/0100-fix-linstorvhdutil-don-t-retry-local-vhdutil-call-wh.patch index 46926a82..d91557db 100644 --- a/SOURCES/0100-fix-linstorvhdutil-don-t-retry-local-vhdutil-call-wh.patch +++ b/SOURCES/0100-fix-linstorvhdutil-don-t-retry-local-vhdutil-call-wh.patch @@ -1,7 +1,7 @@ From e5dafb76bd0436d5d19d33e9d9ecdc9c958863b2 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 7 Dec 2022 17:56:39 +0100 -Subject: [PATCH 100/179] fix(linstorvhdutil): don't retry local vhdutil call +Subject: [PATCH 100/180] fix(linstorvhdutil): don't retry local vhdutil call when EROFS is detected Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0101-feat-fork-log-daemon-ignore-SIGTERM.patch b/SOURCES/0101-feat-fork-log-daemon-ignore-SIGTERM.patch index 1db48fc7..611d395c 100644 --- a/SOURCES/0101-feat-fork-log-daemon-ignore-SIGTERM.patch +++ b/SOURCES/0101-feat-fork-log-daemon-ignore-SIGTERM.patch @@ -1,7 +1,7 @@ From 71e0f39881c539f3677089e103d1f7800fe4a99b Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 15 Dec 2022 14:36:04 +0100 -Subject: [PATCH 101/179] feat(fork-log-daemon): ignore SIGTERM +Subject: [PATCH 101/180] feat(fork-log-daemon): ignore SIGTERM Without this patch, the output logs of the fork-log-daemon child are never displayed when SIGTERM is sent to the PGID. diff --git a/SOURCES/0102-feat-LinstorSR-wait-for-http-disk-server-startup.patch b/SOURCES/0102-feat-LinstorSR-wait-for-http-disk-server-startup.patch index 22607054..c4c9bd0f 100644 --- a/SOURCES/0102-feat-LinstorSR-wait-for-http-disk-server-startup.patch +++ b/SOURCES/0102-feat-LinstorSR-wait-for-http-disk-server-startup.patch @@ -1,7 +1,7 @@ From 6eec8a19ce65fdcb3336367251901750df329027 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 16 Dec 2022 16:52:50 +0100 -Subject: [PATCH 102/179] feat(LinstorSR): wait for http-disk-server startup +Subject: [PATCH 102/180] feat(LinstorSR): wait for http-disk-server startup Avoid a race condition with NBD server. We must be sure the HTTP server is reachable before the NBD server execution, diff --git a/SOURCES/0103-fix-LinstorSR-handle-inflate-resize-actions-correctl.patch b/SOURCES/0103-fix-LinstorSR-handle-inflate-resize-actions-correctl.patch index e00315c7..c5a93a5f 100644 --- a/SOURCES/0103-fix-LinstorSR-handle-inflate-resize-actions-correctl.patch +++ b/SOURCES/0103-fix-LinstorSR-handle-inflate-resize-actions-correctl.patch @@ -1,7 +1,7 @@ From ec1278ddf7ba15e35410b6991354ff46deb71ca5 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 16 Jan 2023 17:58:51 +0100 -Subject: [PATCH 103/179] fix(LinstorSR): handle inflate + resize actions +Subject: [PATCH 103/180] fix(LinstorSR): handle inflate + resize actions correctly - Ensure LINSTOR set the expected new volume size when inflate is executed, diff --git a/SOURCES/0104-fix-linstor-manager-add-a-static-iptables-rule-for-D.patch b/SOURCES/0104-fix-linstor-manager-add-a-static-iptables-rule-for-D.patch index 815a029b..6fb6a926 100644 --- a/SOURCES/0104-fix-linstor-manager-add-a-static-iptables-rule-for-D.patch +++ b/SOURCES/0104-fix-linstor-manager-add-a-static-iptables-rule-for-D.patch @@ -1,7 +1,7 @@ From 6524029ca094f5063a62a3d4ce42b0794f61fad1 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 17 Jan 2023 11:55:00 +0100 -Subject: [PATCH 104/179] fix(linstor-manager): add a static iptables rule for +Subject: [PATCH 104/180] fix(linstor-manager): add a static iptables rule for DRBD volumes Using the XAPI iptables firewall may drop DRBD packets when the connection diff --git a/SOURCES/0105-feat-LinstorSR-sync-with-last-http-nbd-transfer-vers.patch b/SOURCES/0105-feat-LinstorSR-sync-with-last-http-nbd-transfer-vers.patch index 2a9ab40c..8489d168 100644 --- a/SOURCES/0105-feat-LinstorSR-sync-with-last-http-nbd-transfer-vers.patch +++ b/SOURCES/0105-feat-LinstorSR-sync-with-last-http-nbd-transfer-vers.patch @@ -1,7 +1,7 @@ From cc57e8036ee5cd993658fcf2bd2ac65ba36156b5 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 3 Feb 2023 16:38:49 +0100 -Subject: [PATCH 105/179] feat(LinstorSR): sync with last http-nbd-transfer +Subject: [PATCH 105/180] feat(LinstorSR): sync with last http-nbd-transfer version - Increase auto promote timeout of heartbeat VDI to reduce CPU usage diff --git a/SOURCES/0106-fix-LinstorSR-don-t-check-VDI-metadata-while-listing.patch b/SOURCES/0106-fix-LinstorSR-don-t-check-VDI-metadata-while-listing.patch index ab5d5cb4..45b0341a 100644 --- a/SOURCES/0106-fix-LinstorSR-don-t-check-VDI-metadata-while-listing.patch +++ b/SOURCES/0106-fix-LinstorSR-don-t-check-VDI-metadata-while-listing.patch @@ -1,7 +1,7 @@ From 839eb7f719a3e3206b3d5d419b88a63c4d7a7a5d Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 13 Feb 2023 17:24:16 +0100 -Subject: [PATCH 106/179] fix(LinstorSR): don't check VDI metadata while +Subject: [PATCH 106/180] fix(LinstorSR): don't check VDI metadata while listing VDIs if it's deleted Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0107-fix-LinstorSR-don-t-check-metadata-when-destroying-s.patch b/SOURCES/0107-fix-LinstorSR-don-t-check-metadata-when-destroying-s.patch index 34f00cfe..67c674e6 100644 --- a/SOURCES/0107-fix-LinstorSR-don-t-check-metadata-when-destroying-s.patch +++ b/SOURCES/0107-fix-LinstorSR-don-t-check-metadata-when-destroying-s.patch @@ -1,7 +1,7 @@ From 5de99a76105212088f70b4a7a7daab4b1d5e3f49 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 13 Feb 2023 17:27:43 +0100 -Subject: [PATCH 107/179] fix(LinstorSR): don't check metadata when destroying +Subject: [PATCH 107/180] fix(LinstorSR): don't check metadata when destroying snap in undo_clone Remove useless check in the snap rollback helper when there is an error diff --git a/SOURCES/0108-fix-linstorvhdutil-handle-correctly-generic-exceptio.patch b/SOURCES/0108-fix-linstorvhdutil-handle-correctly-generic-exceptio.patch index 76092544..be217dbc 100644 --- a/SOURCES/0108-fix-linstorvhdutil-handle-correctly-generic-exceptio.patch +++ b/SOURCES/0108-fix-linstorvhdutil-handle-correctly-generic-exceptio.patch @@ -1,7 +1,7 @@ From 3aed3787570dae79cef8952cb87596aec8ff98df Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 15 Feb 2023 11:34:54 +0100 -Subject: [PATCH 108/179] fix(linstorvhdutil): handle correctly generic +Subject: [PATCH 108/180] fix(linstorvhdutil): handle correctly generic exceptions in _raise_openers_exception Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0109-fix-minidrbdcluster-robustify-to-unmount-correctly-L.patch b/SOURCES/0109-fix-minidrbdcluster-robustify-to-unmount-correctly-L.patch index df71ae03..2f70b427 100644 --- a/SOURCES/0109-fix-minidrbdcluster-robustify-to-unmount-correctly-L.patch +++ b/SOURCES/0109-fix-minidrbdcluster-robustify-to-unmount-correctly-L.patch @@ -1,7 +1,7 @@ From 1f41b0a39ce73787bf51a226d8bc515fc664f122 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 16 Feb 2023 14:24:07 +0100 -Subject: [PATCH 109/179] fix(minidrbdcluster): robustify to unmount correctly +Subject: [PATCH 109/180] fix(minidrbdcluster): robustify to unmount correctly LINSTOR DB There is a small delay during which the database may not be unmounted diff --git a/SOURCES/0110-fix-minidrbdcluster-handle-correctly-KeyboardInterru.patch b/SOURCES/0110-fix-minidrbdcluster-handle-correctly-KeyboardInterru.patch index 99e8f646..eeacf357 100644 --- a/SOURCES/0110-fix-minidrbdcluster-handle-correctly-KeyboardInterru.patch +++ b/SOURCES/0110-fix-minidrbdcluster-handle-correctly-KeyboardInterru.patch @@ -1,7 +1,7 @@ From cccde07e13727a1f03e47ed33f2487dfce1bdaed Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 20 Feb 2023 19:30:18 +0100 -Subject: [PATCH 110/179] fix(minidrbdcluster): handle correctly +Subject: [PATCH 110/180] fix(minidrbdcluster): handle correctly KeyboardInterrupt with systemd units It's necessary to always add systemd services in the running list before diff --git a/SOURCES/0111-feat-LinstorSR-use-drbd-reactor-instead-of-minidrbdc.patch b/SOURCES/0111-feat-LinstorSR-use-drbd-reactor-instead-of-minidrbdc.patch index 96827846..d6601516 100644 --- a/SOURCES/0111-feat-LinstorSR-use-drbd-reactor-instead-of-minidrbdc.patch +++ b/SOURCES/0111-feat-LinstorSR-use-drbd-reactor-instead-of-minidrbdc.patch @@ -1,7 +1,7 @@ From 6da63ee78f16326dc8699706d58d58fe3a5c4ec3 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 24 Feb 2023 14:28:29 +0100 -Subject: [PATCH 111/179] feat(LinstorSR): use drbd-reactor instead of +Subject: [PATCH 111/180] feat(LinstorSR): use drbd-reactor instead of minidrbdcluster Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0112-fix-LinstorSR-ensure-vhdutil-calls-are-correctly-exe.patch b/SOURCES/0112-fix-LinstorSR-ensure-vhdutil-calls-are-correctly-exe.patch index 4bbc0171..dd343c4c 100644 --- a/SOURCES/0112-fix-LinstorSR-ensure-vhdutil-calls-are-correctly-exe.patch +++ b/SOURCES/0112-fix-LinstorSR-ensure-vhdutil-calls-are-correctly-exe.patch @@ -1,7 +1,7 @@ From c27027a689f926d2a0235e1dc85d4891f0346815 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 1 Mar 2023 10:56:43 +0100 -Subject: [PATCH 112/179] fix(LinstorSR): ensure vhdutil calls are correctly +Subject: [PATCH 112/180] fix(LinstorSR): ensure vhdutil calls are correctly executed on pools with > 3 hosts Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0113-fix-LinstorSR-replace-bad-param-in-detach_thin-impl.patch b/SOURCES/0113-fix-LinstorSR-replace-bad-param-in-detach_thin-impl.patch index c32a3077..e191bb0a 100644 --- a/SOURCES/0113-fix-LinstorSR-replace-bad-param-in-detach_thin-impl.patch +++ b/SOURCES/0113-fix-LinstorSR-replace-bad-param-in-detach_thin-impl.patch @@ -1,7 +1,7 @@ From 6da70e1e569db84a6220d5c568b0e18547011dd3 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 9 Mar 2023 17:06:59 +0100 -Subject: [PATCH 113/179] fix(LinstorSR): replace bad param in detach_thin impl +Subject: [PATCH 113/180] fix(LinstorSR): replace bad param in detach_thin impl To get the physical size, the volume UUID must be used, not the path. diff --git a/SOURCES/0114-fix-linstorvolumemanager-remove-usage-of-realpath.patch b/SOURCES/0114-fix-linstorvolumemanager-remove-usage-of-realpath.patch index bc2e2a31..2ae631e6 100644 --- a/SOURCES/0114-fix-linstorvolumemanager-remove-usage-of-realpath.patch +++ b/SOURCES/0114-fix-linstorvolumemanager-remove-usage-of-realpath.patch @@ -1,7 +1,7 @@ From 84f028a160d8cf7273dbe2c73f35e798b4ad0b9d Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 10 Mar 2023 18:11:10 +0100 -Subject: [PATCH 114/179] fix(linstorvolumemanager): remove usage of realpath +Subject: [PATCH 114/180] fix(linstorvolumemanager): remove usage of realpath Because a diskless DRBD path not always exist, get_volume_name_from_device_path can fail. It's easy to reproduce using > 4 hosts and with a call to linstorvhdutil.get_vhd_info: diff --git a/SOURCES/0115-fix-linstorvhdutil-avoid-parent-path-resolution.patch b/SOURCES/0115-fix-linstorvhdutil-avoid-parent-path-resolution.patch index ce365cf2..149b283c 100644 --- a/SOURCES/0115-fix-linstorvhdutil-avoid-parent-path-resolution.patch +++ b/SOURCES/0115-fix-linstorvhdutil-avoid-parent-path-resolution.patch @@ -1,7 +1,7 @@ From cc3f34ef376bcf1f5e036f830ffc3f68c64154c8 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 16 Mar 2023 18:54:46 +0100 -Subject: [PATCH 115/179] fix(linstorvhdutil): avoid parent path resolution +Subject: [PATCH 115/180] fix(linstorvhdutil): avoid parent path resolution When many hosts are used (>= 4), we can fail to get VHD info (with parent option) because the local parent VDI diff --git a/SOURCES/0116-fix-LinstorSR-create-parent-path-during-attach.patch b/SOURCES/0116-fix-LinstorSR-create-parent-path-during-attach.patch index 77730a90..799ddb41 100644 --- a/SOURCES/0116-fix-LinstorSR-create-parent-path-during-attach.patch +++ b/SOURCES/0116-fix-LinstorSR-create-parent-path-during-attach.patch @@ -1,7 +1,7 @@ From 2201c29474b54183acb4b529a773c94a3571ca61 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 17 Mar 2023 12:06:08 +0100 -Subject: [PATCH 116/179] fix(LinstorSR): create parent path during attach +Subject: [PATCH 116/180] fix(LinstorSR): create parent path during attach It's necessary to force DRBD diskless path creation when a VDI is attached. Otherwise the attach can fail on pool with diff --git a/SOURCES/0117-fix-LinstorSR-retry-if-we-can-t-build-volume-cache.patch b/SOURCES/0117-fix-LinstorSR-retry-if-we-can-t-build-volume-cache.patch index 4d7e1e99..74eb40c7 100644 --- a/SOURCES/0117-fix-LinstorSR-retry-if-we-can-t-build-volume-cache.patch +++ b/SOURCES/0117-fix-LinstorSR-retry-if-we-can-t-build-volume-cache.patch @@ -1,7 +1,7 @@ From 71bbec844018985c25dc2c84ad9c1624065a8ca7 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 3 Apr 2023 10:03:57 +0200 -Subject: [PATCH 117/179] fix(LinstorSR): retry if we can't build volume cache +Subject: [PATCH 117/180] fix(LinstorSR): retry if we can't build volume cache Otherwise after SR creation, the master PBD can be unplugged. See: https://xcp-ng.org/forum/post/60726 diff --git a/SOURCES/0118-fix-linstorvolumemanager-reduce-peer-slots-param-to-.patch b/SOURCES/0118-fix-linstorvolumemanager-reduce-peer-slots-param-to-.patch index e42852be..dc6d484a 100644 --- a/SOURCES/0118-fix-linstorvolumemanager-reduce-peer-slots-param-to-.patch +++ b/SOURCES/0118-fix-linstorvolumemanager-reduce-peer-slots-param-to-.patch @@ -1,7 +1,7 @@ From d67af12145aaf807bee1e16ea4647bbbafef3666 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 25 Apr 2023 10:46:00 +0200 -Subject: [PATCH 118/179] fix(linstorvolumemanager): reduce peer-slots param to +Subject: [PATCH 118/180] fix(linstorvolumemanager): reduce peer-slots param to 3 Because we use 3 backing disks at most, it's useless to increase the default linstor limit (8). diff --git a/SOURCES/0119-fix-LinstorSR-attach-a-valid-XAPI-session-is_open-is.patch b/SOURCES/0119-fix-LinstorSR-attach-a-valid-XAPI-session-is_open-is.patch index 3d70ea18..e119752e 100644 --- a/SOURCES/0119-fix-LinstorSR-attach-a-valid-XAPI-session-is_open-is.patch +++ b/SOURCES/0119-fix-LinstorSR-attach-a-valid-XAPI-session-is_open-is.patch @@ -1,7 +1,7 @@ From ec5a6609241a382f5734577f35194911ec8a1876 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 25 Apr 2023 11:20:55 +0200 -Subject: [PATCH 119/179] fix(LinstorSR): attach a valid XAPI session is_open +Subject: [PATCH 119/180] fix(LinstorSR): attach a valid XAPI session is_open is called Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0120-fix-LinstorSR-ensure-we-always-have-a-DRBD-path-to-s.patch b/SOURCES/0120-fix-LinstorSR-ensure-we-always-have-a-DRBD-path-to-s.patch index 26b66a04..3ea28e7e 100644 --- a/SOURCES/0120-fix-LinstorSR-ensure-we-always-have-a-DRBD-path-to-s.patch +++ b/SOURCES/0120-fix-LinstorSR-ensure-we-always-have-a-DRBD-path-to-s.patch @@ -1,7 +1,7 @@ From ec92e0b26035555a9492809c1cae1fed1425e01f Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 28 Apr 2023 10:43:27 +0200 -Subject: [PATCH 120/179] fix(LinstorSR): ensure we always have a DRBD path to +Subject: [PATCH 120/180] fix(LinstorSR): ensure we always have a DRBD path to snap Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0121-fix-LinstorSR-remove-hosts-ips-param.patch b/SOURCES/0121-fix-LinstorSR-remove-hosts-ips-param.patch index e393872b..e3f27e9a 100644 --- a/SOURCES/0121-fix-LinstorSR-remove-hosts-ips-param.patch +++ b/SOURCES/0121-fix-LinstorSR-remove-hosts-ips-param.patch @@ -1,7 +1,7 @@ From 6afb9f195a5b3ce97d6f727337708ce536e19456 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 30 May 2023 11:19:13 +0200 -Subject: [PATCH 121/179] fix(LinstorSR): remove hosts/ips param +Subject: [PATCH 121/180] fix(LinstorSR): remove hosts/ips param --- drivers/LinstorSR.py | 47 +++++---------------------------- diff --git a/SOURCES/0122-fix-LinstorSR-compute-correctly-SR-size-using-pool-c.patch b/SOURCES/0122-fix-LinstorSR-compute-correctly-SR-size-using-pool-c.patch index cb9d130f..d24c240a 100644 --- a/SOURCES/0122-fix-LinstorSR-compute-correctly-SR-size-using-pool-c.patch +++ b/SOURCES/0122-fix-LinstorSR-compute-correctly-SR-size-using-pool-c.patch @@ -1,7 +1,7 @@ From 46d03cba7a491c03335a4ea5549df187c5c72806 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 1 Jun 2023 17:40:37 +0200 -Subject: [PATCH 122/179] fix(LinstorSR): compute correctly SR size using pool +Subject: [PATCH 122/180] fix(LinstorSR): compute correctly SR size using pool count Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0123-fix-blktap2-ensure-we-can-import-this-module-when-LI.patch b/SOURCES/0123-fix-blktap2-ensure-we-can-import-this-module-when-LI.patch index ff5e9414..6f55d39b 100644 --- a/SOURCES/0123-fix-blktap2-ensure-we-can-import-this-module-when-LI.patch +++ b/SOURCES/0123-fix-blktap2-ensure-we-can-import-this-module-when-LI.patch @@ -1,7 +1,7 @@ From d3c6b68c18e910c1defbdfa815718e16e9323bca Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 6 Jun 2023 11:50:54 +0200 -Subject: [PATCH 123/179] fix(blktap2): ensure we can import this module when +Subject: [PATCH 123/180] fix(blktap2): ensure we can import this module when LINSTOR is not installed Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0124-fix-LinstorSR-ensure-volume-cache-can-be-recreated.patch b/SOURCES/0124-fix-LinstorSR-ensure-volume-cache-can-be-recreated.patch index 98f6deb9..fe616520 100644 --- a/SOURCES/0124-fix-LinstorSR-ensure-volume-cache-can-be-recreated.patch +++ b/SOURCES/0124-fix-LinstorSR-ensure-volume-cache-can-be-recreated.patch @@ -1,7 +1,7 @@ From 99788730369ee3eb883d76b53b61a195f95c885d Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 21 Jun 2023 14:10:18 +0200 -Subject: [PATCH 124/179] fix(LinstorSR): ensure volume cache can be recreated +Subject: [PATCH 124/180] fix(LinstorSR): ensure volume cache can be recreated After SR creation we may fail to load volumes with this exception: "Failed to get usable size of..." and so we can't plug the master PBD. diff --git a/SOURCES/0125-fix-linstor-manager-remove-dead-useless-code-in-add-.patch b/SOURCES/0125-fix-linstor-manager-remove-dead-useless-code-in-add-.patch index acc5de0f..5ff052f7 100644 --- a/SOURCES/0125-fix-linstor-manager-remove-dead-useless-code-in-add-.patch +++ b/SOURCES/0125-fix-linstor-manager-remove-dead-useless-code-in-add-.patch @@ -1,7 +1,7 @@ From c341a4047f34b35b128fd5555eeffe62b6a8977a Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 20 Jul 2023 10:46:33 +0200 -Subject: [PATCH 125/179] fix(linstor-manager): remove dead/useless code in +Subject: [PATCH 125/180] fix(linstor-manager): remove dead/useless code in add/remove_host helpers Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0126-fix-LinstorSR-Ensure-we-always-have-a-device-path-du.patch b/SOURCES/0126-fix-LinstorSR-Ensure-we-always-have-a-device-path-du.patch index b9885b81..38e64e30 100644 --- a/SOURCES/0126-fix-LinstorSR-Ensure-we-always-have-a-device-path-du.patch +++ b/SOURCES/0126-fix-LinstorSR-Ensure-we-always-have-a-device-path-du.patch @@ -1,7 +1,7 @@ From b63d80afb41d5cc1d053a3eb9cb12fe9d7c5cfee Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 1 Aug 2023 15:16:17 +0200 -Subject: [PATCH 126/179] fix(LinstorSR): Ensure we always have a device path +Subject: [PATCH 126/180] fix(LinstorSR): Ensure we always have a device path during leaf-coalesce calls So we must not verify that we have a valid DRBD path in the load step, diff --git a/SOURCES/0127-fix-LinstorSR-always-use-lock.acquire-during-attach-.patch b/SOURCES/0127-fix-LinstorSR-always-use-lock.acquire-during-attach-.patch index 8db443bc..a3776642 100644 --- a/SOURCES/0127-fix-LinstorSR-always-use-lock.acquire-during-attach-.patch +++ b/SOURCES/0127-fix-LinstorSR-always-use-lock.acquire-during-attach-.patch @@ -1,7 +1,7 @@ From 859ddf7beed5f4c8967879a1815ba408b5990db1 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 16 Aug 2023 12:04:01 +0200 -Subject: [PATCH 127/179] fix(LinstorSR): always use lock.acquire() during +Subject: [PATCH 127/180] fix(LinstorSR): always use lock.acquire() during attach/detach We can't use a retry range on the lock because we can trigger a bad situation diff --git a/SOURCES/0128-fix-LinstorSR-mare-sure-hostnames-are-unique-at-SR-c.patch b/SOURCES/0128-fix-LinstorSR-mare-sure-hostnames-are-unique-at-SR-c.patch index 15f20271..16055787 100644 --- a/SOURCES/0128-fix-LinstorSR-mare-sure-hostnames-are-unique-at-SR-c.patch +++ b/SOURCES/0128-fix-LinstorSR-mare-sure-hostnames-are-unique-at-SR-c.patch @@ -1,7 +1,7 @@ From 02b497c783fab888e8127ab5d1dd8b58632d2995 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 17 Aug 2023 14:52:13 +0200 -Subject: [PATCH 128/179] fix(LinstorSR): mare sure hostnames are unique at SR +Subject: [PATCH 128/180] fix(LinstorSR): mare sure hostnames are unique at SR creation Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0129-fix-LinstorSR-ensure-we-can-attach-non-special-stati.patch b/SOURCES/0129-fix-LinstorSR-ensure-we-can-attach-non-special-stati.patch index 810940ce..7c654d18 100644 --- a/SOURCES/0129-fix-LinstorSR-ensure-we-can-attach-non-special-stati.patch +++ b/SOURCES/0129-fix-LinstorSR-ensure-we-can-attach-non-special-stati.patch @@ -1,7 +1,7 @@ From 6dff0030453b2031f625518f4e4fc6ae8a168eb9 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 18 Aug 2023 11:06:56 +0200 -Subject: [PATCH 129/179] fix(LinstorSR): ensure we can attach non-special +Subject: [PATCH 129/180] fix(LinstorSR): ensure we can attach non-special static VDIs Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0130-fix-LinstorSR-ensure-we-can-detach-when-deflate-call.patch b/SOURCES/0130-fix-LinstorSR-ensure-we-can-detach-when-deflate-call.patch index 6e6eb626..19eade61 100644 --- a/SOURCES/0130-fix-LinstorSR-ensure-we-can-detach-when-deflate-call.patch +++ b/SOURCES/0130-fix-LinstorSR-ensure-we-can-detach-when-deflate-call.patch @@ -1,7 +1,7 @@ From 0d58254293a08ee5f0b1c4b8529dc04a8ea161f2 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 31 Aug 2023 18:00:27 +0200 -Subject: [PATCH 130/179] fix(LinstorSR): ensure we can detach when deflate +Subject: [PATCH 130/180] fix(LinstorSR): ensure we can detach when deflate call is not possible Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0131-fix-LinstorSR-assume-VDI-is-always-a-VHD-when-the-in.patch b/SOURCES/0131-fix-LinstorSR-assume-VDI-is-always-a-VHD-when-the-in.patch index 515b028f..cc650b59 100644 --- a/SOURCES/0131-fix-LinstorSR-assume-VDI-is-always-a-VHD-when-the-in.patch +++ b/SOURCES/0131-fix-LinstorSR-assume-VDI-is-always-a-VHD-when-the-in.patch @@ -1,7 +1,7 @@ From 32ecbab86a91729a8b2d2f11830a8354d0a78a62 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 28 Sep 2023 16:00:02 +0200 -Subject: [PATCH 131/179] fix(LinstorSR): assume VDI is always a VHD when the +Subject: [PATCH 131/180] fix(LinstorSR): assume VDI is always a VHD when the info is missing during cleanup Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0132-fix-LinstorSR-remove-SR-lock-during-thin-attach-deta.patch b/SOURCES/0132-fix-LinstorSR-remove-SR-lock-during-thin-attach-deta.patch index d8840c53..d648048c 100644 --- a/SOURCES/0132-fix-LinstorSR-remove-SR-lock-during-thin-attach-deta.patch +++ b/SOURCES/0132-fix-LinstorSR-remove-SR-lock-during-thin-attach-deta.patch @@ -1,7 +1,7 @@ From 70ce954b27d64a8e6b7584270f9191409eef4161 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 2 Oct 2023 16:48:49 +0200 -Subject: [PATCH 132/179] fix(LinstorSR): remove SR lock during thin +Subject: [PATCH 132/180] fix(LinstorSR): remove SR lock during thin attach/detach This lock is normally useless and can create a dead lock when thin mode is activated: diff --git a/SOURCES/0133-fix-LinstorSR-ensure-database-is-mounted-during-scan.patch b/SOURCES/0133-fix-LinstorSR-ensure-database-is-mounted-during-scan.patch index 5e06f9d7..7624dc1f 100644 --- a/SOURCES/0133-fix-LinstorSR-ensure-database-is-mounted-during-scan.patch +++ b/SOURCES/0133-fix-LinstorSR-ensure-database-is-mounted-during-scan.patch @@ -1,7 +1,7 @@ From c6079f164c87e87c519cd1eb1d9c79603bc19906 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 3 Oct 2023 18:42:42 +0200 -Subject: [PATCH 133/179] fix(LinstorSR): ensure database is mounted during +Subject: [PATCH 133/180] fix(LinstorSR): ensure database is mounted during scan Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0134-fix-LinstorSR-restart-drbd-reactor-in-case-of-failur.patch b/SOURCES/0134-fix-LinstorSR-restart-drbd-reactor-in-case-of-failur.patch index 4b831a15..2ee5c614 100644 --- a/SOURCES/0134-fix-LinstorSR-restart-drbd-reactor-in-case-of-failur.patch +++ b/SOURCES/0134-fix-LinstorSR-restart-drbd-reactor-in-case-of-failur.patch @@ -1,7 +1,7 @@ From 9f7664dbeb77485792a15db05e794e6f0c5edceb Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 4 Oct 2023 14:30:36 +0200 -Subject: [PATCH 134/179] fix(LinstorSR): restart drbd-reactor in case of +Subject: [PATCH 134/180] fix(LinstorSR): restart drbd-reactor in case of failure Otherwise we can have all hosts unusable after a massive reboot: diff --git a/SOURCES/0135-fix-linstorvolumemanager-retry-in-case-of-failure-du.patch b/SOURCES/0135-fix-linstorvolumemanager-retry-in-case-of-failure-du.patch index f6e760b0..830509f4 100644 --- a/SOURCES/0135-fix-linstorvolumemanager-retry-in-case-of-failure-du.patch +++ b/SOURCES/0135-fix-linstorvolumemanager-retry-in-case-of-failure-du.patch @@ -1,7 +1,7 @@ From bdd5c9af875ffc62d413a29ce70d2408b78a1304 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 9 Oct 2023 10:37:32 +0200 -Subject: [PATCH 135/179] fix(linstorvolumemanager): retry in case of failure +Subject: [PATCH 135/180] fix(linstorvolumemanager): retry in case of failure during mkfs call on database The device is not always ready after creation. diff --git a/SOURCES/0136-fix-linstorvolumemanager-avoid-diskless-creation-whe.patch b/SOURCES/0136-fix-linstorvolumemanager-avoid-diskless-creation-whe.patch index 06cf4032..06e95594 100644 --- a/SOURCES/0136-fix-linstorvolumemanager-avoid-diskless-creation-whe.patch +++ b/SOURCES/0136-fix-linstorvolumemanager-avoid-diskless-creation-whe.patch @@ -1,7 +1,7 @@ From a6352f0f967b9f688240e3bd2928330fab772893 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 26 Sep 2023 11:48:38 +0200 -Subject: [PATCH 136/179] fix(linstorvolumemanager): avoid diskless creation +Subject: [PATCH 136/180] fix(linstorvolumemanager): avoid diskless creation when a new resource is added Like said in this discussion https://github.com/xcp-ng/sm/pull/34 : diff --git a/SOURCES/0137-fix-LinstorSR-remove-diskless-after-VDI.detach-calls.patch b/SOURCES/0137-fix-LinstorSR-remove-diskless-after-VDI.detach-calls.patch index be07c2e8..5ea674de 100644 --- a/SOURCES/0137-fix-LinstorSR-remove-diskless-after-VDI.detach-calls.patch +++ b/SOURCES/0137-fix-LinstorSR-remove-diskless-after-VDI.detach-calls.patch @@ -1,7 +1,7 @@ From e543a48ebf3139d6423b5273777592bfe172a58c Mon Sep 17 00:00:00 2001 From: Rene Peinthor Date: Tue, 25 Jul 2023 11:19:39 +0200 -Subject: [PATCH 137/179] fix(LinstorSR): remove diskless after VDI.detach +Subject: [PATCH 137/180] fix(LinstorSR): remove diskless after VDI.detach calls Signed-off-by: Rene Peinthor diff --git a/SOURCES/0138-fix-LinstorSR-robustify-_load_vdi_info-in-cleanup.py.patch b/SOURCES/0138-fix-LinstorSR-robustify-_load_vdi_info-in-cleanup.py.patch index 3a6f38a5..f5855855 100644 --- a/SOURCES/0138-fix-LinstorSR-robustify-_load_vdi_info-in-cleanup.py.patch +++ b/SOURCES/0138-fix-LinstorSR-robustify-_load_vdi_info-in-cleanup.py.patch @@ -1,7 +1,7 @@ From c3f1a7b62b9696cc6abb305a5164a75b49240de6 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 11 Oct 2023 12:39:56 +0200 -Subject: [PATCH 138/179] fix(LinstorSR): robustify _load_vdi_info in +Subject: [PATCH 138/180] fix(LinstorSR): robustify _load_vdi_info in cleanup.py After a failed snapshot like that: diff --git a/SOURCES/0139-fix-LinstorSR-ensure-detach-never-fails-on-plugin-fa.patch b/SOURCES/0139-fix-LinstorSR-ensure-detach-never-fails-on-plugin-fa.patch index 5235f5d6..a68f4549 100644 --- a/SOURCES/0139-fix-LinstorSR-ensure-detach-never-fails-on-plugin-fa.patch +++ b/SOURCES/0139-fix-LinstorSR-ensure-detach-never-fails-on-plugin-fa.patch @@ -1,7 +1,7 @@ From f885dbd5d82b1af3ca70b38a0640580207d9bf5a Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 23 Oct 2023 14:31:27 +0200 -Subject: [PATCH 139/179] fix(LinstorSR): ensure detach never fails on plugin +Subject: [PATCH 139/180] fix(LinstorSR): ensure detach never fails on plugin failure Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0140-fix-LinstorSR-ensure-we-coalesce-only-volumes-with-a.patch b/SOURCES/0140-fix-LinstorSR-ensure-we-coalesce-only-volumes-with-a.patch index 1b320174..88fdf267 100644 --- a/SOURCES/0140-fix-LinstorSR-ensure-we-coalesce-only-volumes-with-a.patch +++ b/SOURCES/0140-fix-LinstorSR-ensure-we-coalesce-only-volumes-with-a.patch @@ -1,7 +1,7 @@ From 3633eecad17dc34a65fbb127f11ec90c5934d2d4 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 23 Oct 2023 15:52:23 +0200 -Subject: [PATCH 140/179] fix(LinstorSR): ensure we coalesce only volumes with +Subject: [PATCH 140/180] fix(LinstorSR): ensure we coalesce only volumes with a valid size --- diff --git a/SOURCES/0141-fix-LinstorSR-don-t-try-to-repair-persistent-volumes.patch b/SOURCES/0141-fix-LinstorSR-don-t-try-to-repair-persistent-volumes.patch index c0ff4ce5..a2cc6f49 100644 --- a/SOURCES/0141-fix-LinstorSR-don-t-try-to-repair-persistent-volumes.patch +++ b/SOURCES/0141-fix-LinstorSR-don-t-try-to-repair-persistent-volumes.patch @@ -1,7 +1,7 @@ From 3be63d299ba706e86f1fbcac59d5173967860a2e Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 24 Oct 2023 11:57:40 +0200 -Subject: [PATCH 141/179] fix(LinstorSR): don't try to repair persistent +Subject: [PATCH 141/180] fix(LinstorSR): don't try to repair persistent volumes in GC Use constants to simplify maintenance. diff --git a/SOURCES/0142-fix-linstorvhdutil-format-correctly-message-if-vhd-u.patch b/SOURCES/0142-fix-linstorvhdutil-format-correctly-message-if-vhd-u.patch index 60096cbe..969f4570 100644 --- a/SOURCES/0142-fix-linstorvhdutil-format-correctly-message-if-vhd-u.patch +++ b/SOURCES/0142-fix-linstorvhdutil-format-correctly-message-if-vhd-u.patch @@ -1,7 +1,7 @@ From 1230aa74fee21eabb70be27959d16a01b20dd747 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 14 Nov 2023 18:21:53 +0100 -Subject: [PATCH 142/179] fix(linstorvhdutil): format correctly message if +Subject: [PATCH 142/180] fix(linstorvhdutil): format correctly message if vhd-util cannot be run Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0143-fix-LinstorSR-wait-during-attach-to-open-DRBD-path.patch b/SOURCES/0143-fix-LinstorSR-wait-during-attach-to-open-DRBD-path.patch index 06e7b2a3..741b04b7 100644 --- a/SOURCES/0143-fix-LinstorSR-wait-during-attach-to-open-DRBD-path.patch +++ b/SOURCES/0143-fix-LinstorSR-wait-during-attach-to-open-DRBD-path.patch @@ -1,7 +1,7 @@ From 7bfaf3d9be6f56fec13b0f8536e8748fc053620a Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 24 Oct 2023 23:07:23 +0200 -Subject: [PATCH 143/179] fix(LinstorSR): wait during attach to open DRBD path +Subject: [PATCH 143/180] fix(LinstorSR): wait during attach to open DRBD path ENODATA and other errors like EROFS can be raised when a new DRBD path is created on the fly. So ensure to block before tapdisk starts. diff --git a/SOURCES/0144-fix-LinstorSR-support-different-volume-sizes-in-clea.patch b/SOURCES/0144-fix-LinstorSR-support-different-volume-sizes-in-clea.patch index ac6734bb..ec7d16be 100644 --- a/SOURCES/0144-fix-LinstorSR-support-different-volume-sizes-in-clea.patch +++ b/SOURCES/0144-fix-LinstorSR-support-different-volume-sizes-in-clea.patch @@ -1,7 +1,7 @@ From cbbfa5a864ea184ecfed516cf0948a5b5075dfda Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 14 Nov 2023 18:08:26 +0100 -Subject: [PATCH 144/179] fix(LinstorSR): support different volume sizes in +Subject: [PATCH 144/180] fix(LinstorSR): support different volume sizes in cleanup.py Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0145-fix-LinstorSR-remove-useless-IPS_XHA_CACHE-var.patch b/SOURCES/0145-fix-LinstorSR-remove-useless-IPS_XHA_CACHE-var.patch index 60d7117d..9a7542a4 100644 --- a/SOURCES/0145-fix-LinstorSR-remove-useless-IPS_XHA_CACHE-var.patch +++ b/SOURCES/0145-fix-LinstorSR-remove-useless-IPS_XHA_CACHE-var.patch @@ -1,7 +1,7 @@ From 1b324ce8a21ca4bf18125e43885683084a5a8c08 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 20 Nov 2023 10:52:27 +0100 -Subject: [PATCH 145/179] fix(LinstorSR): remove useless IPS_XHA_CACHE var +Subject: [PATCH 145/180] fix(LinstorSR): remove useless IPS_XHA_CACHE var Signed-off-by: Ronan Abhamon --- diff --git a/SOURCES/0146-fix-LinstorSR-ensure-we-can-deflate-on-any-host-afte.patch b/SOURCES/0146-fix-LinstorSR-ensure-we-can-deflate-on-any-host-afte.patch index 0346fbbf..f6113a94 100644 --- a/SOURCES/0146-fix-LinstorSR-ensure-we-can-deflate-on-any-host-afte.patch +++ b/SOURCES/0146-fix-LinstorSR-ensure-we-can-deflate-on-any-host-afte.patch @@ -1,7 +1,7 @@ From 4a7d088083167e073cf0149f3ad54aa0c31869c3 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 21 Nov 2023 13:50:24 +0100 -Subject: [PATCH 146/179] fix(LinstorSR): ensure we can deflate on any host +Subject: [PATCH 146/180] fix(LinstorSR): ensure we can deflate on any host after a journal rollback Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0147-fix-LinstorSR-ensure-we-always-use-real-DRBD-VHD-siz.patch b/SOURCES/0147-fix-LinstorSR-ensure-we-always-use-real-DRBD-VHD-siz.patch index 78c91a17..3b72f808 100644 --- a/SOURCES/0147-fix-LinstorSR-ensure-we-always-use-real-DRBD-VHD-siz.patch +++ b/SOURCES/0147-fix-LinstorSR-ensure-we-always-use-real-DRBD-VHD-siz.patch @@ -1,7 +1,7 @@ From 6fdfda1d9cc245c0227c7db49115f1ae689ae242 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 27 Nov 2023 12:15:43 +0100 -Subject: [PATCH 147/179] fix(LinstorSR): ensure we always use real DRBD/VHD +Subject: [PATCH 147/180] fix(LinstorSR): ensure we always use real DRBD/VHD sizes in inflate/deflate GC calls --- diff --git a/SOURCES/0148-feat-linstor-kv-tool-If-no-controller-uri-option-is-.patch b/SOURCES/0148-feat-linstor-kv-tool-If-no-controller-uri-option-is-.patch index 19936e6e..5e6433f5 100644 --- a/SOURCES/0148-feat-linstor-kv-tool-If-no-controller-uri-option-is-.patch +++ b/SOURCES/0148-feat-linstor-kv-tool-If-no-controller-uri-option-is-.patch @@ -1,7 +1,7 @@ From 620ca1abd996743be6096300df42230c23c35d9d Mon Sep 17 00:00:00 2001 From: BenjiReis Date: Mon, 27 Nov 2023 14:23:57 +0100 -Subject: [PATCH 148/179] feat(linstor-kv-tool): If no controller uri option is +Subject: [PATCH 148/180] feat(linstor-kv-tool): If no controller uri option is provided fetch it (#48) Signed-off-by: BenjiReis diff --git a/SOURCES/0149-fix-linstorvolumemanager-robustify-SR-destroy-46.patch b/SOURCES/0149-fix-linstorvolumemanager-robustify-SR-destroy-46.patch index a4a9a71d..310d6589 100644 --- a/SOURCES/0149-fix-linstorvolumemanager-robustify-SR-destroy-46.patch +++ b/SOURCES/0149-fix-linstorvolumemanager-robustify-SR-destroy-46.patch @@ -1,7 +1,7 @@ From 0ae964a043bf01824b38c23aef7c2360519fe38f Mon Sep 17 00:00:00 2001 From: BenjiReis Date: Wed, 29 Nov 2023 15:45:32 +0100 -Subject: [PATCH 149/179] fix(linstorvolumemanager): robustify SR destroy (#46) +Subject: [PATCH 149/180] fix(linstorvolumemanager): robustify SR destroy (#46) Signed-off-by: Ronan Abhamon Co-authored-by: BenjiReis diff --git a/SOURCES/0150-feat-linstor-manager-extend-API-with-createNodeInter.patch b/SOURCES/0150-feat-linstor-manager-extend-API-with-createNodeInter.patch index 39b1dfa3..ef263d93 100644 --- a/SOURCES/0150-feat-linstor-manager-extend-API-with-createNodeInter.patch +++ b/SOURCES/0150-feat-linstor-manager-extend-API-with-createNodeInter.patch @@ -1,7 +1,7 @@ From da9afe424c2ad652e7278af658c7b4b4c7d5d0e7 Mon Sep 17 00:00:00 2001 From: BenjiReis Date: Wed, 29 Nov 2023 16:54:30 +0100 -Subject: [PATCH 150/179] feat(linstor-manager): extend API with +Subject: [PATCH 150/180] feat(linstor-manager): extend API with createNodeInterface and setNodePreferredInterface (#47) Signed-off-by: BenjiReis diff --git a/SOURCES/0151-fix-LinstorSR-support-VDI.resize-on-thick-volumes.patch b/SOURCES/0151-fix-LinstorSR-support-VDI.resize-on-thick-volumes.patch index b8d792ec..f223b0bd 100644 --- a/SOURCES/0151-fix-LinstorSR-support-VDI.resize-on-thick-volumes.patch +++ b/SOURCES/0151-fix-LinstorSR-support-VDI.resize-on-thick-volumes.patch @@ -1,7 +1,7 @@ From 13f341c188dae35cc64dbcaf6197c47e23dd4bd2 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 1 Dec 2023 11:55:12 +0100 -Subject: [PATCH 151/179] fix(LinstorSR): support VDI.resize on thick volumes +Subject: [PATCH 151/180] fix(LinstorSR): support VDI.resize on thick volumes --- drivers/LinstorSR.py | 3 +++ diff --git a/SOURCES/0152-fix-linstorvolumemanager-format-correctly-exception-.patch b/SOURCES/0152-fix-linstorvolumemanager-format-correctly-exception-.patch index 33f5e108..2f9b8170 100644 --- a/SOURCES/0152-fix-linstorvolumemanager-format-correctly-exception-.patch +++ b/SOURCES/0152-fix-linstorvolumemanager-format-correctly-exception-.patch @@ -1,7 +1,7 @@ From fc7ee546007b745d8bf5fd96bb039b782e57908b Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 4 Dec 2023 16:36:55 +0100 -Subject: [PATCH 152/179] fix(linstorvolumemanager): format correctly exception +Subject: [PATCH 152/180] fix(linstorvolumemanager): format correctly exception during db mount Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0153-fix-LinstorSR-ensure-we-can-skip-coalesces-if-device.patch b/SOURCES/0153-fix-LinstorSR-ensure-we-can-skip-coalesces-if-device.patch index 230b7bf9..3b0f1a5e 100644 --- a/SOURCES/0153-fix-LinstorSR-ensure-we-can-skip-coalesces-if-device.patch +++ b/SOURCES/0153-fix-LinstorSR-ensure-we-can-skip-coalesces-if-device.patch @@ -1,7 +1,7 @@ From 3199098e8780e80ed57ee610c0f82f07d10be6c5 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 4 Dec 2023 18:57:08 +0100 -Subject: [PATCH 153/179] fix(LinstorSR): ensure we can skip coalesces if +Subject: [PATCH 153/180] fix(LinstorSR): ensure we can skip coalesces if device path can't be fetched Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0154-feat-linstor-manager-add-methods-to-modify-destroy-l.patch b/SOURCES/0154-feat-linstor-manager-add-methods-to-modify-destroy-l.patch index 8ac9a68b..e6aa1e9f 100644 --- a/SOURCES/0154-feat-linstor-manager-add-methods-to-modify-destroy-l.patch +++ b/SOURCES/0154-feat-linstor-manager-add-methods-to-modify-destroy-l.patch @@ -1,7 +1,7 @@ From fd6a07a09507abbfd51564bea77415cef56472e8 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 19 Dec 2023 14:49:33 +0100 -Subject: [PATCH 154/179] feat(linstor-manager): add methods to +Subject: [PATCH 154/180] feat(linstor-manager): add methods to modify/destroy/list net interfaces Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0155-fix-LinstorSR-force-a-defined-volume-prefix-if-we-ca.patch b/SOURCES/0155-fix-LinstorSR-force-a-defined-volume-prefix-if-we-ca.patch index 333284cf..828ec74b 100644 --- a/SOURCES/0155-fix-LinstorSR-force-a-defined-volume-prefix-if-we-ca.patch +++ b/SOURCES/0155-fix-LinstorSR-force-a-defined-volume-prefix-if-we-ca.patch @@ -1,7 +1,7 @@ From ab68cd45f930d47f051911a7bdb7ca8aad7d09fb Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 12 Jan 2024 10:28:20 +0100 -Subject: [PATCH 155/179] fix(LinstorSR): force a defined volume prefix if we +Subject: [PATCH 155/180] fix(LinstorSR): force a defined volume prefix if we can't import libs Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0156-fix-LinstorSR-explicit-error-message-when-a-group-is.patch b/SOURCES/0156-fix-LinstorSR-explicit-error-message-when-a-group-is.patch index 804b8b07..8072e320 100644 --- a/SOURCES/0156-fix-LinstorSR-explicit-error-message-when-a-group-is.patch +++ b/SOURCES/0156-fix-LinstorSR-explicit-error-message-when-a-group-is.patch @@ -1,7 +1,7 @@ From b83d372cdf4f424289f542ecfe71744c2d186859 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 18 Jan 2024 10:24:01 +0100 -Subject: [PATCH 156/179] fix(LinstorSR): explicit error message when a group +Subject: [PATCH 156/180] fix(LinstorSR): explicit error message when a group is not unique during SR creation Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0157-fix-LinstorSR-make-sure-VDI.delete-doesn-t-throw-und.patch b/SOURCES/0157-fix-LinstorSR-make-sure-VDI.delete-doesn-t-throw-und.patch index f73ebaa9..5e557c5d 100644 --- a/SOURCES/0157-fix-LinstorSR-make-sure-VDI.delete-doesn-t-throw-und.patch +++ b/SOURCES/0157-fix-LinstorSR-make-sure-VDI.delete-doesn-t-throw-und.patch @@ -1,7 +1,7 @@ From ce96408a3dda9b8d321e2f12723d28043a251237 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 18 Jan 2024 11:18:11 +0100 -Subject: [PATCH 157/179] fix(LinstorSR): make sure VDI.delete doesn't throw +Subject: [PATCH 157/180] fix(LinstorSR): make sure VDI.delete doesn't throw under specific conditions If we can update the volume state in the KV-store, there is no reason to raise diff --git a/SOURCES/0158-fix-LinstorSR-add-drbd-in-the-blacklist-of-multipath.patch b/SOURCES/0158-fix-LinstorSR-add-drbd-in-the-blacklist-of-multipath.patch index 65f4d487..7aee56e1 100644 --- a/SOURCES/0158-fix-LinstorSR-add-drbd-in-the-blacklist-of-multipath.patch +++ b/SOURCES/0158-fix-LinstorSR-add-drbd-in-the-blacklist-of-multipath.patch @@ -1,7 +1,7 @@ From 30a3692573e79f371c2cf2b79c19b7cc02bc693f Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 19 Jan 2024 14:39:17 +0100 -Subject: [PATCH 158/179] fix(LinstorSR): add drbd in the blacklist of +Subject: [PATCH 158/180] fix(LinstorSR): add drbd in the blacklist of multipath.conf If DRBD is installed for the first time, and if the multipathd diff --git a/SOURCES/0159-fix-linstorvolumemanager-create-cloned-volumes-on-ho.patch b/SOURCES/0159-fix-linstorvolumemanager-create-cloned-volumes-on-ho.patch index 770e5aca..cf9c851b 100644 --- a/SOURCES/0159-fix-linstorvolumemanager-create-cloned-volumes-on-ho.patch +++ b/SOURCES/0159-fix-linstorvolumemanager-create-cloned-volumes-on-ho.patch @@ -1,7 +1,7 @@ From 4edb24b82089ace930eb68beb69a6ab57714b04e Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 22 Jan 2024 11:25:25 +0100 -Subject: [PATCH 159/179] fix(linstorvolumemanager): create cloned volumes on +Subject: [PATCH 159/180] fix(linstorvolumemanager): create cloned volumes on host selected by LINSTOR Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0160-fix-linstorvolumemanager-don-t-align-volumes-on-LVM-.patch b/SOURCES/0160-fix-linstorvolumemanager-don-t-align-volumes-on-LVM-.patch index bd51d745..a62ba654 100644 --- a/SOURCES/0160-fix-linstorvolumemanager-don-t-align-volumes-on-LVM-.patch +++ b/SOURCES/0160-fix-linstorvolumemanager-don-t-align-volumes-on-LVM-.patch @@ -1,7 +1,7 @@ From 09a32aefb00ff510ee3197dba69f1dfe1c40c81b Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 26 Jan 2024 15:29:21 +0100 -Subject: [PATCH 160/179] fix(linstorvolumemanager): don't align volumes on LVM +Subject: [PATCH 160/180] fix(linstorvolumemanager): don't align volumes on LVM sector size It's the goal of the LINSTOR stack to align properly on the LVM layer. diff --git a/SOURCES/0161-fix-linstorvolumemanager-assert-with-message-after-l.patch b/SOURCES/0161-fix-linstorvolumemanager-assert-with-message-after-l.patch index 23bd4094..ae97e2e4 100644 --- a/SOURCES/0161-fix-linstorvolumemanager-assert-with-message-after-l.patch +++ b/SOURCES/0161-fix-linstorvolumemanager-assert-with-message-after-l.patch @@ -1,7 +1,7 @@ From bd36d8cc1077b88bf5257a91f270f84cf5261e64 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 5 Feb 2024 18:01:22 +0100 -Subject: [PATCH 161/179] fix(linstorvolumemanager): assert with message after +Subject: [PATCH 161/180] fix(linstorvolumemanager): assert with message after log in update_volume_uuid Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0162-fix-linstorvolumemanager-retry-resize-if-volume-is-n.patch b/SOURCES/0162-fix-linstorvolumemanager-retry-resize-if-volume-is-n.patch index 70c9df32..dbe24952 100644 --- a/SOURCES/0162-fix-linstorvolumemanager-retry-resize-if-volume-is-n.patch +++ b/SOURCES/0162-fix-linstorvolumemanager-retry-resize-if-volume-is-n.patch @@ -1,7 +1,7 @@ From af5c06ba9a7d679ce82ed7a2dc0df96301a4994b Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 5 Feb 2024 23:13:06 +0100 -Subject: [PATCH 162/179] fix(linstorvolumemanager): retry resize if volume is +Subject: [PATCH 162/180] fix(linstorvolumemanager): retry resize if volume is not up to date Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0163-fix-LinstorSR-create-DRBD-diskless-if-necessary-for-.patch b/SOURCES/0163-fix-LinstorSR-create-DRBD-diskless-if-necessary-for-.patch index dfe9e685..66c6c0f6 100644 --- a/SOURCES/0163-fix-LinstorSR-create-DRBD-diskless-if-necessary-for-.patch +++ b/SOURCES/0163-fix-LinstorSR-create-DRBD-diskless-if-necessary-for-.patch @@ -1,7 +1,7 @@ From a3859a63b34c6e888c07ea4e5ec070ad94fd0aa8 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 6 Feb 2024 00:10:32 +0100 -Subject: [PATCH 163/179] fix(LinstorSR): create DRBD diskless if necessary for +Subject: [PATCH 163/180] fix(LinstorSR): create DRBD diskless if necessary for each VHD parent It's necessary to have all parents during snapshot to create a new VHD child. diff --git a/SOURCES/0164-fix-LinstorSR-fix-bad-call-to-vhdutil.inflate-bad-ex.patch b/SOURCES/0164-fix-LinstorSR-fix-bad-call-to-vhdutil.inflate-bad-ex.patch index d14b2ec8..649c102b 100644 --- a/SOURCES/0164-fix-LinstorSR-fix-bad-call-to-vhdutil.inflate-bad-ex.patch +++ b/SOURCES/0164-fix-LinstorSR-fix-bad-call-to-vhdutil.inflate-bad-ex.patch @@ -1,7 +1,7 @@ From e21d3bc7b517bb790517e494f9e2eed18e9f3290 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 6 Feb 2024 00:14:11 +0100 -Subject: [PATCH 164/179] fix(LinstorSR): fix bad call to vhdutil.inflate + bad +Subject: [PATCH 164/180] fix(LinstorSR): fix bad call to vhdutil.inflate + bad exception Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0165-fix-LinstorSR-activate-VG-if-attach-from-config-is-a.patch b/SOURCES/0165-fix-LinstorSR-activate-VG-if-attach-from-config-is-a.patch index 9d7178d5..46381b2f 100644 --- a/SOURCES/0165-fix-LinstorSR-activate-VG-if-attach-from-config-is-a.patch +++ b/SOURCES/0165-fix-LinstorSR-activate-VG-if-attach-from-config-is-a.patch @@ -1,7 +1,7 @@ From adea9c192b43f438da3732188ed0ad05751179e6 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 12 Feb 2024 20:54:06 +0100 -Subject: [PATCH 165/179] fix(LinstorSR): activate VG if attach from config is +Subject: [PATCH 165/180] fix(LinstorSR): activate VG if attach from config is asked Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0166-feat-LinstorSR-use-a-specific-resource-group-for-DB-.patch b/SOURCES/0166-feat-LinstorSR-use-a-specific-resource-group-for-DB-.patch index af0fc322..1d87045f 100644 --- a/SOURCES/0166-feat-LinstorSR-use-a-specific-resource-group-for-DB-.patch +++ b/SOURCES/0166-feat-LinstorSR-use-a-specific-resource-group-for-DB-.patch @@ -1,7 +1,7 @@ From 3227a0c30b0a58e4431cb80ab1b188b89a004a41 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 19 Mar 2024 23:09:54 +0100 -Subject: [PATCH 166/179] feat(LinstorSR): use a specific resource group for DB +Subject: [PATCH 166/180] feat(LinstorSR): use a specific resource group for DB and HA Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0167-feat-linstor-manager-add-getNodePreferredInterface-h.patch b/SOURCES/0167-feat-linstor-manager-add-getNodePreferredInterface-h.patch index 540046ac..99c4404c 100644 --- a/SOURCES/0167-feat-linstor-manager-add-getNodePreferredInterface-h.patch +++ b/SOURCES/0167-feat-linstor-manager-add-getNodePreferredInterface-h.patch @@ -1,7 +1,7 @@ From 99997af6173a0bd6ed59a0242657f162245aef91 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 15 Apr 2024 11:22:18 +0200 -Subject: [PATCH 167/179] feat(linstor-manager): add +Subject: [PATCH 167/180] feat(linstor-manager): add `getNodePreferredInterface` helper Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0168-fix-linstorvolumemanager-blocks-deletion-of-default-.patch b/SOURCES/0168-fix-linstorvolumemanager-blocks-deletion-of-default-.patch index 147d7295..fb3a347a 100644 --- a/SOURCES/0168-fix-linstorvolumemanager-blocks-deletion-of-default-.patch +++ b/SOURCES/0168-fix-linstorvolumemanager-blocks-deletion-of-default-.patch @@ -1,7 +1,7 @@ From 5491fbc0f245095e62f83b78e3afcd76745cbe5e Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 15 Apr 2024 11:26:00 +0200 -Subject: [PATCH 168/179] fix(linstorvolumemanager): blocks deletion of default +Subject: [PATCH 168/180] fix(linstorvolumemanager): blocks deletion of default network interface Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0169-feat-linstorvolumemanager-change-logic-of-get_resour.patch b/SOURCES/0169-feat-linstorvolumemanager-change-logic-of-get_resour.patch index b043b23a..4e907958 100644 --- a/SOURCES/0169-feat-linstorvolumemanager-change-logic-of-get_resour.patch +++ b/SOURCES/0169-feat-linstorvolumemanager-change-logic-of-get_resour.patch @@ -1,7 +1,7 @@ From 21788b7143fd9add8681f1a909c4eca1b18d2919 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 15 Apr 2024 17:56:47 +0200 -Subject: [PATCH 169/179] feat(linstorvolumemanager): change logic of +Subject: [PATCH 169/180] feat(linstorvolumemanager): change logic of `get_resources_info`: - Add a nested level "nodes" for each resource - Add a "uuid" attr on resources - Rename LINSTOR "uuid" to "linstor-uuid" - Optimize code diff --git a/SOURCES/0170-feat-linstor-manager-add-error-codes-to-healthCheck-.patch b/SOURCES/0170-feat-linstor-manager-add-error-codes-to-healthCheck-.patch index af8811f4..0d0b19cd 100644 --- a/SOURCES/0170-feat-linstor-manager-add-error-codes-to-healthCheck-.patch +++ b/SOURCES/0170-feat-linstor-manager-add-error-codes-to-healthCheck-.patch @@ -1,7 +1,7 @@ From d325b4d57656cb4e57225898dbe09c19d3a05737 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 18 Apr 2024 13:57:37 +0200 -Subject: [PATCH 170/179] feat(linstor-manager): add error codes to healthCheck +Subject: [PATCH 170/180] feat(linstor-manager): add error codes to healthCheck helper Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0171-fix-LinstorSR-fix-bad-exception-reference-during-sna.patch b/SOURCES/0171-fix-LinstorSR-fix-bad-exception-reference-during-sna.patch index 71c0b90f..77240a27 100644 --- a/SOURCES/0171-fix-LinstorSR-fix-bad-exception-reference-during-sna.patch +++ b/SOURCES/0171-fix-LinstorSR-fix-bad-exception-reference-during-sna.patch @@ -1,7 +1,7 @@ From d690c2a413af2e41bb81f55d32b646a7c48476ec Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 24 Apr 2024 15:10:49 +0200 -Subject: [PATCH 171/179] fix(LinstorSR): fix bad exception reference during +Subject: [PATCH 171/180] fix(LinstorSR): fix bad exception reference during snapshot Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0172-fix-tapdisk-pause-ensure-LINSTOR-VHD-chain-is-availa.patch b/SOURCES/0172-fix-tapdisk-pause-ensure-LINSTOR-VHD-chain-is-availa.patch index 1091b185..b1b2dea8 100644 --- a/SOURCES/0172-fix-tapdisk-pause-ensure-LINSTOR-VHD-chain-is-availa.patch +++ b/SOURCES/0172-fix-tapdisk-pause-ensure-LINSTOR-VHD-chain-is-availa.patch @@ -1,7 +1,7 @@ From e1343b31312142eced90f45ea0ade39a07e5a447 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Wed, 24 Apr 2024 17:29:26 +0200 -Subject: [PATCH 172/179] fix(tapdisk-pause): ensure LINSTOR VHD chain is +Subject: [PATCH 172/180] fix(tapdisk-pause): ensure LINSTOR VHD chain is available Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0173-fix-linstorvhdutil-retry-check-on-another-machine-in.patch b/SOURCES/0173-fix-linstorvhdutil-retry-check-on-another-machine-in.patch index 17246b05..a59adbbf 100644 --- a/SOURCES/0173-fix-linstorvhdutil-retry-check-on-another-machine-in.patch +++ b/SOURCES/0173-fix-linstorvhdutil-retry-check-on-another-machine-in.patch @@ -1,7 +1,7 @@ From bee9bb828530924b8596135b70bb38092ef5cf8f Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 6 May 2024 18:15:00 +0200 -Subject: [PATCH 173/179] fix(linstorvhdutil): retry check on another machine +Subject: [PATCH 173/180] fix(linstorvhdutil): retry check on another machine in case of failure (#54) Signed-off-by: Ronan Abhamon diff --git a/SOURCES/0174-fix-LinstorSR-explicit-errors-when-database-path-is-.patch b/SOURCES/0174-fix-LinstorSR-explicit-errors-when-database-path-is-.patch index 5972d430..a73e7577 100644 --- a/SOURCES/0174-fix-LinstorSR-explicit-errors-when-database-path-is-.patch +++ b/SOURCES/0174-fix-LinstorSR-explicit-errors-when-database-path-is-.patch @@ -1,7 +1,7 @@ From 3aba57e6ea4f6826b5164b97971099d8196c8d3e Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 6 May 2024 21:35:36 +0200 -Subject: [PATCH 174/179] fix(LinstorSR): explicit errors when database path is +Subject: [PATCH 174/180] fix(LinstorSR): explicit errors when database path is fetched --- diff --git a/SOURCES/0175-fix-LinstorSR-Misc-fixes-on-destroy.patch b/SOURCES/0175-fix-LinstorSR-Misc-fixes-on-destroy.patch index 6ff0d12c..3fa99f57 100644 --- a/SOURCES/0175-fix-LinstorSR-Misc-fixes-on-destroy.patch +++ b/SOURCES/0175-fix-LinstorSR-Misc-fixes-on-destroy.patch @@ -1,7 +1,7 @@ From e65ad0c6669174d90ab356f171d5aa121da8eca1 Mon Sep 17 00:00:00 2001 From: Damien Thenot Date: Tue, 30 Apr 2024 15:38:34 +0200 -Subject: [PATCH 175/179] fix(LinstorSR): Misc fixes on destroy +Subject: [PATCH 175/180] fix(LinstorSR): Misc fixes on destroy linstor-manager: - fix on get_drbd_volumes diff --git a/SOURCES/0176-fix-LinstorSR-open-non-leaf-volumes-in-RO-mode-creat.patch b/SOURCES/0176-fix-LinstorSR-open-non-leaf-volumes-in-RO-mode-creat.patch index 78861ba3..7b16dd96 100644 --- a/SOURCES/0176-fix-LinstorSR-open-non-leaf-volumes-in-RO-mode-creat.patch +++ b/SOURCES/0176-fix-LinstorSR-open-non-leaf-volumes-in-RO-mode-creat.patch @@ -1,7 +1,7 @@ From 8901bc318ee16f7eba20dc6ad2ea735610f73c41 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 20 Jun 2024 22:37:40 +0200 -Subject: [PATCH 176/179] fix(LinstorSR): open non-leaf volumes in RO mode +Subject: [PATCH 176/180] fix(LinstorSR): open non-leaf volumes in RO mode (create_chain_paths) We must never open non-leaf volumes with the write option. diff --git a/SOURCES/0177-fix-LinstorSR-ensure-_is_master-is-always-set.patch b/SOURCES/0177-fix-LinstorSR-ensure-_is_master-is-always-set.patch index 65e0dc17..9888b1de 100644 --- a/SOURCES/0177-fix-LinstorSR-ensure-_is_master-is-always-set.patch +++ b/SOURCES/0177-fix-LinstorSR-ensure-_is_master-is-always-set.patch @@ -1,7 +1,7 @@ From 8434a428d51849320db4b42e528501d283d495ac Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 26 Jul 2024 11:32:20 +0200 -Subject: [PATCH 177/179] fix(LinstorSR): ensure `_is_master` is always set +Subject: [PATCH 177/180] fix(LinstorSR): ensure `_is_master` is always set `_is_master` is not always initialized, and more precisely in the case of detach where LinstorSR.load method is not called. diff --git a/SOURCES/0178-fix-linstor-check-if-resource-is-tiebreaker-62.patch b/SOURCES/0178-fix-linstor-check-if-resource-is-tiebreaker-62.patch index 69e7041e..25aa67a1 100644 --- a/SOURCES/0178-fix-linstor-check-if-resource-is-tiebreaker-62.patch +++ b/SOURCES/0178-fix-linstor-check-if-resource-is-tiebreaker-62.patch @@ -1,7 +1,7 @@ From 9207abe1f2e1ff1795cdba1a0aeb76574412a583 Mon Sep 17 00:00:00 2001 From: Damien Thenot Date: Fri, 26 Jul 2024 14:13:05 +0200 -Subject: [PATCH 178/179] fix(linstor): check if resource is tiebreaker (#62) +Subject: [PATCH 178/180] fix(linstor): check if resource is tiebreaker (#62) We check if a resource is already a tiebreaker before trying to delete the resource. diff --git a/SOURCES/0179-feat-Linstor-rewrite-linstorhostcall-logic.patch b/SOURCES/0179-feat-Linstor-rewrite-linstorhostcall-logic.patch index cc0ae905..48750853 100644 --- a/SOURCES/0179-feat-Linstor-rewrite-linstorhostcall-logic.patch +++ b/SOURCES/0179-feat-Linstor-rewrite-linstorhostcall-logic.patch @@ -1,7 +1,7 @@ From 31d150bf84decf56a42866d0db09210493388090 Mon Sep 17 00:00:00 2001 From: Damien Thenot Date: Fri, 19 Apr 2024 14:55:49 +0200 -Subject: [PATCH 179/179] feat(Linstor): rewrite linstorhostcall logic +Subject: [PATCH 179/180] feat(Linstor): rewrite linstorhostcall logic Try to use host_OpaqueRef to access primary then try on the master host if it doesn't work, then find the primary with linstor API or if no diff --git a/SOURCES/0180-feat-linstor-Add-new-debug-log-in-linstorhostcall-67.patch b/SOURCES/0180-feat-linstor-Add-new-debug-log-in-linstorhostcall-67.patch new file mode 100644 index 00000000..7a716154 --- /dev/null +++ b/SOURCES/0180-feat-linstor-Add-new-debug-log-in-linstorhostcall-67.patch @@ -0,0 +1,85 @@ +From 04c2c93b04f1840b7ee0062ae231d28305e214e7 Mon Sep 17 00:00:00 2001 +From: Damien Thenot +Date: Fri, 9 Aug 2024 09:31:26 +0200 +Subject: [PATCH 180/180] feat(linstor): Add new debug log in linstorhostcall + (#67) + +Signed-off-by: Damien Thenot +--- + drivers/linstorvhdutil.py | 32 ++++++++++++++++++++------------ + 1 file changed, 20 insertions(+), 12 deletions(-) + +diff --git a/drivers/linstorvhdutil.py b/drivers/linstorvhdutil.py +index 4b7115b..64148d6 100644 +--- a/drivers/linstorvhdutil.py ++++ b/drivers/linstorvhdutil.py +@@ -78,6 +78,17 @@ class ErofsLinstorCallException(LinstorCallException): + class NoPathLinstorCallException(LinstorCallException): + pass + ++def log_successful_call(target_host, device_path, vdi_uuid, remote_method, response): ++ util.SMlog( ++ 'Successful access on {} for device {} ({}): `{}` => {}'.format(target_host, device_path, vdi_uuid, remote_method, str(response)), ++ priority=util.LOG_DEBUG ++ ) ++ ++def log_failed_call(target_host, next_target, device_path, vdi_uuid, remote_method, e): ++ util.SMlog( ++ 'Failed to call method on {} for device {} ({}): {}. Trying accessing on {}... (cause: {})'.format(target_host, device_path, vdi_uuid, remote_method, next_target, e), ++ priority=util.LOG_DEBUG ++ ) + + def linstorhostcall(local_method, remote_method): + def decorated(response_parser): +@@ -102,39 +113,36 @@ def linstorhostcall(local_method, remote_method): + response = call_remote_method( + self._session, host_ref_attached, remote_method, device_path, remote_args + ) ++ log_successful_call('attached node', device_path, vdi_uuid, remote_method, response) + return response_parser(self, vdi_uuid, response) + except Exception as e: +- util.SMlog( +- 'Failed to call method on attached host. Trying local access... (cause: {})'.format(e), +- priority=util.LOG_DEBUG +- ) ++ log_failed_call('attached node', 'master', device_path, vdi_uuid, remote_method, e) + + try: + master_ref = self._session.xenapi.pool.get_all_records().values()[0]['master'] + response = call_remote_method(self._session, master_ref, remote_method, device_path, remote_args) ++ log_successful_call('master', device_path, vdi_uuid, remote_method, response) + return response_parser(self, vdi_uuid, response) + except Exception as e: +- util.SMlog( +- 'Failed to call method on master host. Finding primary node... (cause: {})'.format(e), +- priority=util.LOG_DEBUG +- ) ++ log_failed_call('master', 'primary', device_path, vdi_uuid, remote_method, e) ++ + + nodes, primary_hostname = self._linstor.find_up_to_date_diskful_nodes(vdi_uuid) + if primary_hostname: + try: + host_ref = self._get_readonly_host(vdi_uuid, device_path, {primary_hostname}) + response = call_remote_method(self._session, host_ref, remote_method, device_path, remote_args) ++ log_successful_call('primary', device_path, vdi_uuid, remote_method, response) + return response_parser(self, vdi_uuid, response) + except Exception as remote_e: + self._raise_openers_exception(device_path, remote_e) + else: +- util.SMlog( +- 'Couldn\'t get primary for {}. Trying with another node...'.format(vdi_uuid), +- priority=util.LOG_DEBUG +- ) ++ log_failed_call('primary', 'another node', device_path, vdi_uuid, remote_method, e) ++ + try: + host = self._get_readonly_host(vdi_uuid, device_path, nodes) + response = call_remote_method(self._session, host, remote_method, device_path, remote_args) ++ log_successful_call('another node', device_path, vdi_uuid, remote_method, response) + return response_parser(self, vdi_uuid, response) + except Exception as remote_e: + self._raise_openers_exception(device_path, remote_e) +-- +2.46.0 + diff --git a/SPECS/sm.spec b/SPECS/sm.spec index 4d3587a6..4e3cb54c 100644 --- a/SPECS/sm.spec +++ b/SPECS/sm.spec @@ -11,7 +11,7 @@ Summary: sm - XCP storage managers Name: sm Version: 2.30.8 -Release: %{?xsrel}.2.0.linstor.1.1.linstorhostcall.1%{?dist} +Release: %{?xsrel}.2.0.linstor.1.1.linstorhostcall.2%{?dist} Group: System/Hypervisor License: LGPL URL: https://github.com/xapi-project/sm @@ -275,6 +275,7 @@ Patch1176: 0176-fix-LinstorSR-open-non-leaf-volumes-in-RO-mode-creat.patch Patch1177: 0177-fix-LinstorSR-ensure-_is_master-is-always-set.patch Patch1178: 0178-fix-linstor-check-if-resource-is-tiebreaker-62.patch Patch1179: 0179-feat-Linstor-rewrite-linstorhostcall-logic.patch +Patch1180: 0180-feat-linstor-Add-new-debug-log-in-linstorhostcall-67.patch %description This package contains storage backends used in XCP @@ -677,6 +678,9 @@ cp -r htmlcov %{buildroot}/htmlcov %{_unitdir}/linstor-monitor.service %changelog +* Fri Aug 09 2024 Damien Thenot 2.30.8-12.2.0.linstor.1.1.linstorhostcall.2 +- Add 0180-feat-linstor-Add-new-debug-log-in-linstorhostcall-67.patch + * Wed Aug 07 2024 Damien Thenot 2.30.8-12.2.0.linstor.1.1.linstorhostcall.1 - Add 0179-feat-Linstor-rewrite-linstorhostcall-logic.patch