From 5a5fbda05b00b4b693eab33ce794d718f432ee77 Mon Sep 17 00:00:00 2001 From: Christian Wohlert Date: Thu, 12 Feb 2026 12:50:42 +0100 Subject: [PATCH] Autoplacer,block-size: Consider all property levels for initial min-IO size --- CHANGELOG.md | 1 + .../controller/CtrlRscCrtApiHelper.java | 38 ++++++++++++++++++- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 876ffa42e..9dcc45f3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Fixed auto block-size not considering resource group and controller properties for initial min-IO size - Fixed resource definition delete setting DELETE flag when resources are still in use - Fixed retry deletion of already deleting resource (no longer fails if it is the second to last diskful resource) - Satellite now properly merges remote nodes + their data (props, netIfs) diff --git a/controller/src/main/java/com/linbit/linstor/core/apicallhandler/controller/CtrlRscCrtApiHelper.java b/controller/src/main/java/com/linbit/linstor/core/apicallhandler/controller/CtrlRscCrtApiHelper.java index 796af1609..6170c5ff2 100644 --- a/controller/src/main/java/com/linbit/linstor/core/apicallhandler/controller/CtrlRscCrtApiHelper.java +++ b/controller/src/main/java/com/linbit/linstor/core/apicallhandler/controller/CtrlRscCrtApiHelper.java @@ -647,6 +647,42 @@ private void rscMinIoSizeCheck( } final boolean autoMinIoSizeForVlmDfn = minIoSizeHelper.isAutoMinIoSize(vlmDfn, apiCtx); + + // Consider configured block-size from resource group / volume group hierarchy + // so that volumes on storage pools with smaller min-IO size (e.g. 512) are created + // with the larger configured block-size (e.g. 4096), enabling later placement on + // storage pools with larger min-IO size + long effectiveBlockSize = poolBlockSize; + if (autoMinIoSizeForVlmDfn && vlmBlockSizeStr == null) + { + final PriorityProps blockSizePrioProps = new PriorityProps( + vlmDfn.getProps(apiCtx), + rscDfn.getProps(apiCtx), + rscDfn.getResourceGroup().getVolumeGroupProps(apiCtx, vlmDfn.getVolumeNumber()), + rscDfn.getResourceGroup().getProps(apiCtx), + ctrlPropsHelper.getStltPropsForView() + ); + final @Nullable String cfgBlockSizeStr = blockSizePrioProps.getProp( + InternalApiConsts.KEY_DRBD_BLOCK_SIZE, + ApiConsts.NAMESPC_DRBD_DISK_OPTIONS + ); + if (cfgBlockSizeStr != null) + { + try + { + final long cfgBlockSize = MathUtils.bounds( + BlockSizeConsts.MIN_IO_SIZE, + Long.parseLong(cfgBlockSizeStr), + BlockSizeConsts.MAX_IO_SIZE + ); + effectiveBlockSize = Math.max(poolBlockSize, cfgBlockSize); + } + catch (NumberFormatException ignored) + { + } + } + } + boolean minIoNeedsUpdate; if (vlmBlockSizeStr == null) { @@ -663,7 +699,7 @@ private void rscMinIoSizeCheck( if (canChangeMinIo) { // Set the changed minIoSize - vlmDfn.setMinIoSize(poolBlockSize, apiCtx); + vlmDfn.setMinIoSize(effectiveBlockSize, apiCtx); if (rscDfn.getResourceCount() > 1) { // Only enable the "restart DRBD" property if this is NOT the very first resource we are