Skip to content

Fixes for multiple topology labels in createvolume request when using min sc#531

Merged
JacobGros merged 7 commits into
mainfrom
getCapacity-adjustment-for-unzoned-arrays
Apr 29, 2025
Merged

Fixes for multiple topology labels in createvolume request when using min sc#531
JacobGros merged 7 commits into
mainfrom
getCapacity-adjustment-for-unzoned-arrays

Conversation

@JacobGros

@JacobGros JacobGros commented Apr 28, 2025

Copy link
Copy Markdown
Contributor

Description

There could be an error introduced in CreateVolume when no systemID or topology lebels are in the SC.
In these cases, K8s can give all available topology labels on the cluster to the CreateVolumeRequest, which would cause the request to fail.
If zoneA and ZoneC were the labels for one pmax array a, and zoneB and ZoneD were the labels for another pmax array b, this could occur:

time="2025-04-25T15:57:50Z" level=info msg="/csi.v1.Controller/CreateVolume: REQ 0261: Name=csivol-93ad481791, CapacityRange=required_bytes:5368709120 , VolumeCapabilities=[mount:<fs_type:\"ext4\" > access_mode:<mode:SINGLE_NODE_MULTI_WRITER > ], Parameters=map[csi.storage.k8s.io/pv/name:csivol-93ad481791 csi.storage.k8s.io/pvc/name:vol-create-test-xnr25 csi.storage.k8s.io/pvc/namespace:volumeio-test-0695e912], AccessibilityRequirements=requisite:<segments: segments:<key:\"zone.topology.kubernetes.io/region\" value:\"zoneA\" > segments:<key:\"zone.topology.kubernetes.io/zone\" value:\"zoneC\" > > requisite:<segments:<key:\"csi-<key:\"zone.topology.kubernetes.io/region\" value:\"zoneB\" > segments:<key:\"zone.topology.kubernetes.io/zone\" value:\"zoneD\" > > preferred:<segments:<key: segments:<key:\"zone.topology.kubernetes.io/region\" value:\"zoneB\" > segments:<key:\"zone.topology.kubernetes.io/zone\" value:\"zoneD\" > > preferred:<segments:<key:\"csi-p segments:<key:\"zone.topology.kubernetes.io/region\" value:\"zoneA\" > segments:<key:\"zone.topology.kubernetes.io/zone\" value:\"zoneC\" > > , XXX_NoUnkeyedLiteral={}, XXX_sizecache=0"
time="2025-04-25T15:57:50Z" level=debug msg="SYMID not provided in parameters, will check accessibility requirements"
time="2025-04-25T15:57:50Z" level=warning msg="topology requirements matched 2 storage arrays, expected one got [a b]"
time="2025-04-25T15:57:50Z" level=error msg="A SYMID parameter is required"

This PR introduces a few changes to fix this

  1. Instead of checking the requisite topology, the driver will now check the preferred first
  2. If multiple arrays match the topology constraints, driver will return the first array in list instead of an empty string

With the changes, we now see:


time="2025-04-28T18:57:47Z" level=info msg="/csi.v1.Controller/CreateVolume: REQ 0290: Name=csivol-001faee1d1, CapacityRange=required_bytes:5368709120 , VolumeCapabilities=[mount:<fs_type:\"ext4\" > access_mode:<mode:SINGLE_NODE_MULTI_WRITER > ], Parameters=map[csi.storage.k8s.io/pv/name:csivol-001faee1d1 csi.storage.k8s.io/pvc/name:vol-create-test-lnrw8 csi.storage.k8s.io/pvc/namespace:volumeio-test-cc1c13f6], AccessibilityRequirements=requisite:< segments:<key:\"zone.topology.kubernetes.io/region\" value:\"zoneA\" > segments:<key:\"zone.topology.kubernetes.io/zone\" value:\"zoneC\" > segments:<key:\"zone.topology.kubernetes.io/region\" value:\"zoneB\" > segments:<key:\"zone.topology.kubernetes.io/zone\" value:\"zoneD\" > > preferred:segments:<key:\"zone.topology.kubernetes.io/region\" value:\"zoneB\" >  segments:<key:\"zone.topology.kubernetes.io/region\" value:\"zoneA\" > segments:<key:\"zone.topology.kubernetes.io/zone\" value:\"zoneC\" > > , XXX_NoUnkeyedLiteral={}, XXX_sizecache=0"
time="2025-04-28T18:57:47Z" level=debug msg="SYMID not provided in parameters, will check accessibility requirements"
time="2025-04-28T18:57:47Z" level=warning msg="topology requirements matched 2 storage arrays, expected one got [a b]"
time="2025-04-28T18:57:47Z" level=info msg="returning a as ArrayID"

GitHub Issues

List the GitHub issues impacted by this PR:

GitHub Issue #
https://github.com/dell/csm/issues/1748

Checklist:

  • Have you run format,vet & lint checks against your submission?
  • Have you made sure that the code compiles?
  • Did you run the unit & integration tests successfully?
  • Have you maintained at least 90% code coverage?
  • Have you commented your code, particularly in hard-to-understand areas
  • Have you done corresponding changes to the documentation
  • Did you run tests in a real Kubernetes cluster?
  • Backward compatibility is not broken

How Has This Been Tested?

  • Ran certify suite:
nohup cert-csi certify --no-cleanup --sequential --cert-config cert-csi-config  --vsc powermax-snapclass & 

with both minimal storage class (no sys ID/ topology) and normal storage class. Results tracked internally

@JacobGros JacobGros changed the title Fixes for multiple topology in createvolume request with no field Fixes for multiple topology labels in createvolume request with no field Apr 28, 2025
@github-actions

Copy link
Copy Markdown
Contributor

Merging this branch will not change overall coverage

Impacted Packages Coverage Δ 🤖
github.com/dell/csi-powermax/service 0.00% (ø)

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/dell/csi-powermax/service/controller.go 0.00% (ø) 0 0 0

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/dell/csi-powermax/service/controller_test.go

@JacobGros JacobGros marked this pull request as ready for review April 29, 2025 16:49
@JacobGros JacobGros changed the title Fixes for multiple topology labels in createvolume request with no field Fixes for multiple topology labels in createvolume request when using min sc Apr 29, 2025
@JacobGros JacobGros merged commit c5a11f5 into main Apr 29, 2025
@JacobGros JacobGros deleted the getCapacity-adjustment-for-unzoned-arrays branch April 29, 2025 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants