nvmeof: Add external client support #6251
Conversation
ba8d811 to
9e8560e
Compare
9e8560e to
b22de20
Compare
b22de20 to
d9bc798
Compare
|
This PR is not tested yet. There is an issue in ODF Jenkins. Once it will resolve I will test this PR. UPDATE: |
d9bc798 to
6f8aef8
Compare
6f8aef8 to
d8185d1
Compare
There was a problem hiding this comment.
Pull request overview
This PR extends the NVMe-oF controller path to better support external (non-Kubernetes) clients by making subsystem host access mutable via VolumeAttributesClass parameters and by auto-generating a subsystem NQN when one is not provided.
Changes:
- Auto-generate a default NVMe-oF subsystem NQN during CreateVolume when
subsystemNQNis not provided. - Add gateway-side host listing and host reconciliation (add/remove) to match a desired
allowHostNQNslist. - Extend
ControllerModifyVolume()to handle both QoS updates and host allow-list updates, using a shared gateway-connection helper.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| internal/nvmeof/volume.go | Makes subsystemNQN optional by generating a default based on volumeID. |
| internal/nvmeof/volume_test.go | Adds coverage for default subsystem NQN generation when missing. |
| internal/nvmeof/nvmeof.go | Adds ListHosts() and UpdateHostsForSubsystem() reconciliation logic. |
| internal/nvmeof/controller/controllerserver.go | Parses allowHostNQNs, wires host/QoS updates into ControllerModifyVolume, and passes volumeID for default NQN generation. |
Comments suppressed due to low confidence (1)
internal/nvmeof/controller/controllerserver.go:1121
- The comment for
AllowHostNQNsdocuments that users can set the value to "" to allow any host, butparseHostsParametersonly accepts a YAML list of strings and will fail to parse "". Either implement explicit support for the wildcard value (and define how it maps to gateway behavior), or update the documentation/validation to disallow it.
// AllowHostNQNs is the VolumeAttributesClass mutable parameter key for specifying
// a YAML list of host NQNs to allow access to a volume. Use "*" to allow any host.
// Example:
//
// allowHostNQNs: |
// - nqn.2014-08.org.nvmexpress:host1
// - nqn.2014-08.org.nvmexpress:host2
const AllowHostNQNs = "allowHostNQNs"
d8185d1 to
852fd6c
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (2)
internal/nvmeof/controller/controllerserver.go:561
parseHostsParametersreturns a nil slice whenallowHostNQNsis present but empty. Downstream callers usehostsList != nilto decide whether to reconcile, so settingallowHostNQNs: ""cannot remove all currently-allowed hosts (it is treated like the parameter is absent). Return a non-nil empty slice (or return an explicitpresentboolean) when the key exists but is empty so ControllerModifyVolume can reconcile to an empty allow-list.
func parseHostsParameters(params map[string]string) ([]string, error) {
allowHostNQNs, exists := params[AllowHostNQNs]
if !exists {
return nil, nil
}
var allowHostsList []string
if allowHostNQNs == "" {
return allowHostsList, nil
}
internal/nvmeof/controller/mutable_params_test.go:175
- The test case for empty
allowHostNQNscurrently expects a nil slice, which matches the current parsing but also hides the need to distinguish “parameter present but empty list” from “parameter absent”. Update this test to expect a non-nil empty slice (or otherwise assert the presence semantics) so regressions in host reconciliation (clearing all hosts) are caught.
852fd6c to
b16bc7d
Compare
nixpanic
left a comment
There was a problem hiding this comment.
looks good, just one unit-test is missing.
|
Wait for #6314 to be merged, then |
|
@Mergifyio rebase |
Extracted common gateway connection logic into `withGatewayConnection()` helper to avoid code duplication between QoS and host management operations (in the next commit). The helper manages: - Secret retrieval - NVMe-oF metadata extraction from volume - Gateway connection with automatic cleanup - Operation execution via callback function Refactored modifyNVMeoFQoS to use the new helper. Signed-off-by: gadi-didi <gadi.didi@ibm.com>
Implements dynamic host access control for NVMe-oF volumes to support
external(non-Kubernetes) clients through VolumeAttributesClass.
Changes:
- Add `parseHostsParameters()` to parse YAML host list from VAC
- Implement `modifyNVMeoFHosts()` for runtime host updates
- Add `ListHosts()` and `UpdateHostsForSubsystem()` for host updateing
- Support allowHostNQNs parameter in CreateVolume and ControllerModifyVolume
- Auto-generate subsystem NQN from volumeID if not provided
Users can now specify external hosts in VAC mutable parameters:
allowHostNQNs: |
- nqn.2014-08.org.nvmexpress:host1
- nqn.2014-08.org.nvmexpress:host2
Signed-off-by: gadi-didi <gadi.didi@ibm.com>
c686822 to
c754bd6
Compare
✅ Branch has been successfully rebased |
|
/test ci/centos/upgrade-tests-cephfs |
|
/test ci/centos/k8s-e2e-external-storage/1.34 |
|
/test ci/centos/upgrade-tests-rbd |
|
/test ci/centos/mini-e2e-helm/k8s-1.34 |
|
/test ci/centos/k8s-e2e-external-storage/1.33 |
|
/test ci/centos/k8s-e2e-external-storage/1.35 |
|
/test ci/centos/mini-e2e/k8s-1.34 |
|
/test ci/centos/mini-e2e-helm/k8s-1.33 |
|
/test ci/centos/mini-e2e-helm/k8s-1.35 |
|
/test ci/centos/mini-e2e/k8s-1.33 |
|
/test ci/centos/mini-e2e/k8s-1.35 |
|
Deprecation notice: This pull request comes from a fork and was queued with |
Merge Queue Status
This pull request spent 58 seconds in the queue, including 9 seconds running CI. Required conditions to merge
|
@nixpanic
Add external client support
Support
allowHostNQNsin VAC for external (non-K8s) clients. Hosts can be managed via mutable parameters.Add host reconciliation logic (add/remove) for NVMe-oF subsystems.
auto-generate subsystem NQN if not provided (for external Client- they have dedicated StorageClass, without
SubsystemNQNlabel) .In this design, each PVC gets its own NVMe-oF subsystem. That means:
SubsystemNQNin the SC) .issue: #6240
Checklist:
guidelines in the developer
guide.
Request
notes
updated with breaking and/or notable changes for the next major release.
Show available bot commands
These commands are normally not required, but in case of issues, leave any of
the following bot commands in an otherwise empty comment in this PR:
/retest ci/centos/<job-name>: retest the<job-name>after unrelatedfailure (please report the failure too!)