diff --git a/ci/configs/truenas/scale/22.12/scale-iscsi.yaml b/ci/configs/truenas/scale/22.12/scale-iscsi.yaml index b6b6f43..a2f7d04 100644 --- a/ci/configs/truenas/scale/22.12/scale-iscsi.yaml +++ b/ci/configs/truenas/scale/22.12/scale-iscsi.yaml @@ -29,3 +29,10 @@ iscsi: targetGroupAuthGroup: # 0-100 (0 == ignore) extentAvailThreshold: 0 + +# https://github.com/SCST-project/scst/blob/master/scst/src/dev_handlers/scst_vdisk.c#L203 +_private: + csi: + volume: + idHash: + strategy: crc16 diff --git a/ci/configs/truenas/scale/23.10/scale-iscsi.yaml b/ci/configs/truenas/scale/23.10/scale-iscsi.yaml index b6b6f43..a2f7d04 100644 --- a/ci/configs/truenas/scale/23.10/scale-iscsi.yaml +++ b/ci/configs/truenas/scale/23.10/scale-iscsi.yaml @@ -29,3 +29,10 @@ iscsi: targetGroupAuthGroup: # 0-100 (0 == ignore) extentAvailThreshold: 0 + +# https://github.com/SCST-project/scst/blob/master/scst/src/dev_handlers/scst_vdisk.c#L203 +_private: + csi: + volume: + idHash: + strategy: crc16 diff --git a/src/driver/freenas/api.js b/src/driver/freenas/api.js index bdde629..3517503 100644 --- a/src/driver/freenas/api.js +++ b/src/driver/freenas/api.js @@ -685,6 +685,7 @@ class FreeNASApiDriver extends CsiBaseDriver { // According to RFC3270, 'Each iSCSI node, whether an initiator or target, MUST have an iSCSI name. Initiators and targets MUST support the receipt of iSCSI names of up to the maximum length of 223 bytes.' // https://kb.netapp.com/Advice_and_Troubleshooting/Miscellaneous/What_is_the_maximum_length_of_a_iSCSI_iqn_name // https://tools.ietf.org/html/rfc3720 + // https://github.com/SCST-project/scst/blob/master/scst/src/dev_handlers/scst_vdisk.c#L203 iscsiName = iscsiName.toLowerCase(); let extentDiskName = "zvol/" + datasetName; @@ -702,6 +703,14 @@ class FreeNASApiDriver extends CsiBaseDriver { ); } + // https://github.com/SCST-project/scst/blob/master/scst/src/dev_handlers/scst_vdisk.c#L203 + if (isScale && iscsiName.length > 64) { + throw new GrpcError( + grpc.status.FAILED_PRECONDITION, + `extent name cannot exceed 64 characters: ${iscsiName}` + ); + } + this.ctx.logger.info( "FreeNAS creating iscsi assets with name: " + iscsiName ); diff --git a/src/driver/freenas/ssh.js b/src/driver/freenas/ssh.js index 25f3869..7535eff 100644 --- a/src/driver/freenas/ssh.js +++ b/src/driver/freenas/ssh.js @@ -733,6 +733,7 @@ class FreeNASSshDriver extends ControllerZfsBaseDriver { // According to RFC3270, 'Each iSCSI node, whether an initiator or target, MUST have an iSCSI name. Initiators and targets MUST support the receipt of iSCSI names of up to the maximum length of 223 bytes.' // https://kb.netapp.com/Advice_and_Troubleshooting/Miscellaneous/What_is_the_maximum_length_of_a_iSCSI_iqn_name // https://tools.ietf.org/html/rfc3720 + // https://github.com/SCST-project/scst/blob/master/scst/src/dev_handlers/scst_vdisk.c#L203 iscsiName = iscsiName.toLowerCase(); let extentDiskName = "zvol/" + datasetName; @@ -747,7 +748,15 @@ class FreeNASSshDriver extends ControllerZfsBaseDriver { if (extentDiskName.length > maxZvolNameLength) { throw new GrpcError( grpc.status.FAILED_PRECONDITION, - `extent disk name cannot exceed ${maxZvolNameLength} characters: ${extentDiskName}` + `extent disk name cannot exceed ${maxZvolNameLength} characters: ${extentDiskName}` + ); + } + + // https://github.com/SCST-project/scst/blob/master/scst/src/dev_handlers/scst_vdisk.c#L203 + if (isScale && iscsiName.length > 64) { + throw new GrpcError( + grpc.status.FAILED_PRECONDITION, + `extent name cannot exceed 64 characters: ${iscsiName}` ); }