Skip to content

support cloning host-based nfs volumes#467

Merged
lukeatdell merged 3 commits into
mainfrom
usr/lukeatdell/hbnfs-clone
Apr 17, 2025
Merged

support cloning host-based nfs volumes#467
lukeatdell merged 3 commits into
mainfrom
usr/lukeatdell/hbnfs-clone

Conversation

@lukeatdell

@lukeatdell lukeatdell commented Apr 17, 2025

Copy link
Copy Markdown
Contributor

Description

Requests to CreateVolume() with another host-based NFS volume as the content source (a clone operation) would have a source volume ID containing the "nfs-" prefix. That volume ID would be passed to the driver for volume provisioning, and because the prefix is not parsed and removed, the driver will submit volume queries to the PowerStore API with volume UUIDs in the form of "nfs-" causing the requests to return errors, because of the malformed volume UUID.

For host-based NFS volume clone operations, these changes will confirm the volume source is another host-based NFS volume by checking for and removing the "nfs-" prefix before submitting any requests to the PowerStore API.

GitHub Issues

List the GitHub issues impacted by this PR:

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

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?

  • cert-csi certify for iscsi block
$ cert-csi certify --cert-config=.../cert-csi-config.yaml --vsc powerstore-snapshot
[2025-04-17 14:39:42]  INFO Starting cert-csi; ver. 1.6.0
[2025-04-17 14:39:42]  INFO Suites to run with powerstore-iscsi storage class:
[2025-04-17 14:39:42]  INFO 1. VolumeIoSuite {volumes: 2, volumeSize: 5Gi chains: 2-2}
[2025-04-17 14:39:42]  INFO 2. ScalingSuite {replicas: 2, volumes: 5, volumeSize: 5Gi}
[2025-04-17 14:39:42]  INFO 3. CloneVolumeSuite {pods: 2, volumes: 1, volumeSize: 5Gi}
[2025-04-17 14:39:42]  INFO 4. VolumeExpansionSuite {pods: 1, volumes: 1, size: 5Gi, expSize: 10Gi, block: false}
[2025-04-17 14:39:42]  INFO 5. VolumeExpansionSuite {pods: 1, volumes: 1, size: 5Gi, expSize: 10Gi, block: true}
[2025-04-17 14:39:42]  INFO 6. SnapSuite {snapshots: 3, volumeSize; 5Gi}
[2025-04-17 14:39:42]  INFO 7. ReplicationSuite {pods: 2, volumes: 5, volumeSize: 5Gi}
[2025-04-17 14:39:42]  INFO 8. MultiAttachSuite {pods: 5, rawBlock: true, size: 5Gi, accMode: ReadWriteMany}
[2025-04-17 14:39:42]  INFO 9. MultiAttachSuite {pods: 5, rawBlock: false, size: 5Gi, accMode: ReadWriteOncePod}
[2025-04-17 14:39:42]  INFO 10. EphemeralVolumeSuite {driver: csi-powerstore.dellemc.com, podNumber: 2, volAttributes: map[arrayid:<redacted> protocol:iSCSI size:5Gi]}
...
[2025-04-17 14:46:29]  INFO During this run 100.0% of suites succeeded
  • cert-csi certify for host-based NFS
$ cert-csi certify --cert-config=.../cert-csi-config.yaml --vsc powerstore-snapshot
[2025-04-17 14:12:09]  INFO Starting cert-csi; ver. 1.6.0
[2025-04-17 14:12:09]  INFO Suites to run with powerstore-hbnfs storage class:
[2025-04-17 14:12:09]  INFO 1. VolumeIoSuite {volumes: 2, volumeSize: 5Gi chains: 2-2}
[2025-04-17 14:12:09]  INFO 2. ScalingSuite {replicas: 2, volumes: 5, volumeSize: 5Gi}
[2025-04-17 14:12:09]  INFO 3. VolumeExpansionSuite {pods: 1, volumes: 1, size: 5Gi, expSize: 10Gi, block: false}
[2025-04-17 14:12:09]  INFO 4. SnapSuite {snapshots: 3, volumeSize; 5Gi}
[2025-04-17 14:12:09]  INFO 5. ReplicationSuite {pods: 2, volumes: 5, volumeSize: 5Gi}
[2025-04-17 14:12:09]  INFO 6. MultiAttachSuite {pods: 5, rawBlock: false, size: 5Gi, accMode: ReadWriteMany}
[2025-04-17 14:12:09]  INFO 7. MultiAttachSuite {pods: 5, rawBlock: false, size: 5Gi, accMode: ReadWriteOncePod}
[2025-04-17 14:12:09]  INFO 8. EphemeralVolumeSuite {driver: csi-powerstore.dellemc.com, podNumber: 2, volAttributes: map[arrayid:<redacted> protocol:NFS size:5Gi]}
...
[2025-04-17 14:19:51]  INFO During this run 100.0% of suites succeeded
  • cert-csi certify for PowerStore native NFS
$ cert-csi certify --cert-config=.../cert-csi-config.yaml --vsc powerstore-snapshot
[2025-04-17 14:51:07]  INFO Starting cert-csi; ver. 1.6.0
[2025-04-17 14:51:07]  INFO Suites to run with powerstore-nfs storage class:
[2025-04-17 14:51:07]  INFO 1. VolumeIoSuite {volumes: 2, volumeSize: 5Gi chains: 2-2}
[2025-04-17 14:51:07]  INFO 2. ScalingSuite {replicas: 2, volumes: 5, volumeSize: 5Gi}
[2025-04-17 14:51:07]  INFO 3. CloneVolumeSuite {pods: 2, volumes: 1, volumeSize: 5Gi}
[2025-04-17 14:51:07]  INFO 4. VolumeExpansionSuite {pods: 1, volumes: 1, size: 5Gi, expSize: 10Gi, block: false}
[2025-04-17 14:51:07]  INFO 5. SnapSuite {snapshots: 3, volumeSize; 5Gi}
[2025-04-17 14:51:07]  INFO 6. ReplicationSuite {pods: 2, volumes: 5, volumeSize: 5Gi}
[2025-04-17 14:51:07]  INFO 7. MultiAttachSuite {pods: 5, rawBlock: false, size: 5Gi, accMode: ReadWriteMany}
[2025-04-17 14:51:07]  INFO 8. EphemeralVolumeSuite {driver: csi-powerstore.dellemc.com, podNumber: 2, volAttributes: map[arrayid:<redacted> nasname:<redacted> protocol:NFS size:5Gi]}
...
[2025-04-17 15:01:06]  INFO During this run 100.0% of suites succeeded

xuluna
xuluna previously approved these changes Apr 17, 2025
@github-actions

Copy link
Copy Markdown
Contributor

Merging this branch will not change overall coverage

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

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/dell/csi-powerstore/pkg/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-powerstore/pkg/service/controller_test.go

@santhoshatdell santhoshatdell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the 'volume clone' too get created with 'nfs' prefix?

@lukeatdell

Copy link
Copy Markdown
Contributor Author

Does the volume clone get created with 'nfs' prefix?

@santhoshatdell, yes it does.
If the storage class is determined to be a host-based NFS storage class, the CreateVolume() func, here, will call csm-hbnfs's CreateVolume() and add the prefix after provisioning the volume

@lukeatdell lukeatdell merged commit 6ff4e23 into main Apr 17, 2025
@lukeatdell lukeatdell deleted the usr/lukeatdell/hbnfs-clone branch April 17, 2025 20:37
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.

4 participants