iSCSILogicalUnit: add block size override and backstore type selection#2148
iSCSILogicalUnit: add block size override and backstore type selection#2148ryan-ronnander wants to merge 5 commits intoClusterLabs:mainfrom
Conversation
|
Can one of the project admins check and authorise this run please: https://haci.fast.eng.rdu2.dc.redhat.com/job/resource-agents/job/resource-agents-pipeline/job/PR-2148/1/input |
Add optional block_size parameter to override the logical block size (512, 1024, 2048, or 4096) presented to initiators. - lio-t: writes to configfs block_size attribute after backstore creation, before LUN mapping (must be set before LUN assignment) - scst: passes blocksize in the -open_dev attributes string at device creation time (read-only after creation) No-op when unset; kernel default (typically 512) is preserved.
2f6e86e to
e31468d
Compare
|
Can one of the project admins check and authorise this run please: https://haci.fast.eng.rdu2.dc.redhat.com/job/resource-agents/job/resource-agents-pipeline/job/PR-2148/2/input |
The SCST handler was hardcoded to vdisk_blockio, which uses direct I/O. Add scst_bstype parameter (default: vdisk_blockio) to allow selecting vdisk_fileio, which routes I/O through the kernel page cache. The fileio handler is needed when presenting smaller block sizes on 4K-native backing devices (for example, block_size=512 on a 4K NVMe drive).
…m lists Add scst_bstype to the unsupported parameter lists for iet, tgt, lio, and lio-t implementations so users get a warning when setting it on a non-scst target. Add liot_bstype to the scst list for the same reason.
|
Can one of the project admins check and authorise this run please: https://haci.fast.eng.rdu2.dc.redhat.com/job/resource-agents/job/resource-agents-pipeline/job/PR-2148/3/input |
|
While the original commit covers the typical use case of presenting 4K block sizes to initiators on 512-native storage (512 → 4K), doing the opposite (4K → 512) requires a The second commit adds Tested both directions on AlmaLinux 9 with targetcli and SCST. Happy with where this MR is. EDIT: A few more tweaks were needed to targetcli |
…tores The lio-t code path hardcoded iblock_* in configfs paths for scsi_sn, product_id, block_size, and emulate_* attribute writes. This only works for the default block backstore. When liot_bstype is set to fileio or pscsi, the configfs directory is fileio_* or pscsi_* respectively. Map liot_bstype to the correct configfs core directory name in both the start and monitor functions.
|
Can one of the project admins check and authorise this run please: https://haci.fast.eng.rdu2.dc.redhat.com/job/resource-agents/job/resource-agents-pipeline/job/PR-2148/4/input |
Expose the LIO configfs emulate_write_cache attribute as an RA parameter. Fileio backstores default to write-back caching which is unsafe for HA configurations. Setting emulate_write_cache=0 enables write-through mode. Follows the existing emulate_tpu, emulate_3pc, emulate_caw pattern.
|
Can one of the project admins check and authorise this run please: https://haci.fast.eng.rdu2.dc.redhat.com/job/resource-agents/job/resource-agents-pipeline/job/PR-2148/5/input |
|
Needed to expose yet another parameter in 8f9f820 to ensure we can set the correct write-back/write-through caching when used in a DRBD context.
|
|
Nice. I'll review it later this week or next week. |
Summary
This PR adds block size override and backstore type selection to the
iSCSILogicalUnitresource agent for thelio-t(targetcli) andscstimplementations.Commits
block_sizeparameter — Override the block size (512, 1024, 2048, or 4096) presented to iSCSI initiators. No-op when unset; the kernel default is preserved.block_sizeattribute after backstore creation, before LUN mappingblocksizein thescstadmin -open_devattributes string at device creation timescst_bstypeparameter — Select the SCST device handler (vdisk_blockioorvdisk_fileio). The handler was previously hardcoded tovdisk_blockio. Thevdisk_fileiohandler routes I/O through the kernel page cache, which is required when presenting smaller block sizes on 4K-native backing devices (for example,block_size=512on a 4K NVMe drive).Unsupported parameter warnings — Wire
scst_bstypeinto the unsupported parameter lists for non-scst implementations, andliot_bstypeinto the scst list, so users get a warning when setting parameters that do not apply to their implementation.Fix lio-t configfs paths — The lio-t code path hardcoded
iblock_*in configfs paths forscsi_sn,product_id,block_size, andemulate_*attribute writes. This only works for the defaultblockbackstore. Whenliot_bstypeisfileioorpscsi, the configfs directory isfileio_*orpscsi_*respectively. Both start and monitor functions now resolve the correct path based onliot_bstype.Allows these new parameters to be used in:
Testing
Tested on AlmaLinux 9, kernel 5.14.0-611.45.1.el9_7.x86_64, SCST master (5d74814).
blockbackstore withblock_size=4096: start, monitor, stop, Pacemaker failoverfileiobackstore withblock_size=4096: start, monitor, stop via LINSTOR Gatewayvdisk_blockiowithblock_size=4096: full target and LU lifecyclevdisk_fileiowithblock_size=512: full target and LU lifecycleblockdev --getssandblockdev --getpbszblockbackstore withblock_size=4096