Skip to content

Update volume ID format for metro volumes#345

Merged
lukeatdell merged 27 commits into
mainfrom
usr/luke-lau/metro-volume-handle
Sep 17, 2024
Merged

Update volume ID format for metro volumes#345
lukeatdell merged 27 commits into
mainfrom
usr/luke-lau/metro-volume-handle

Conversation

@lukeatdell

@lukeatdell lukeatdell commented Sep 13, 2024

Copy link
Copy Markdown
Contributor

Description

Volume ID format for metro volumes will build on the existing volume ID format, adding the remote volume and system information separated by a colon.
{vol-uuid}/{PS-globalID}/{protocol} -> {vol-uuid}/{PS-globalID}/{protocol}:{remote-vol-uuid}/{remote-PS-globalID}

  • ParseVolumeID function updated to support parsing metro volume IDs.
  • Updated all implementations of ParseVolumeID to support the new return format.
  • ParseVolumeID unit test coverage increased to avoid regressions.
  • CreateVolume function updated to apply the new volume ID format to metro volumes on creation.
  • Added and refactored unit tests for CreateVolume with respect to metro volumes. Reorganized tests to group metro replication tests together.

GitHub Issues

List the GitHub issues impacted by this PR:

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

Checklist:

  • I have performed a self-review of my own code to ensure there are no formatting, vetting, linting, or security issues
  • I have verified that new and existing unit tests pass locally with my changes
  • I have not allowed coverage numbers to degenerate
  • I have maintained at least 90% code coverage
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • Backward compatibility is not broken

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Please also list any relevant details for your test configuration

Current code coverage

  • Unit tests
    For those interested in viewing current coverage: coverage.zip

image

  • Integration test: Metro volume provisioned on a k8s cluster. Confirmed corresponding backend resources present on primary and secondary PowerStore array.
    image

  • Regression test: Full cert-csi with ext4 iSCSI
    image

Comment thread pkg/array/array.go Outdated
//
// Example:
//
// ParseVolumeID("1cd254s/192.168.0.1/scsi") will return

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.

IP in the example here can also be updated to reflect global ID.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Actually, this is one of the supported legacy formats. Give it an IP and it should return the global ID.
I will update the example var names tho.

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.

I don't think we should still support this legacy format. Not sure if such upgrade paths are supported.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It would be nice to get away from the legacy format, but I'm also unsure. We could potentially add a k8s job workload that validates and updates existing volume names, but it would be a non-trivial request.

Comment thread pkg/array/array.go Outdated
Comment thread pkg/controller/controller_test.go Outdated
santhoshatdell
santhoshatdell previously approved these changes Sep 13, 2024
Base automatically changed from configure-metro-volume to main September 13, 2024 19:38
@santhoshatdell santhoshatdell dismissed their stale review September 13, 2024 19:38

The base branch was changed.

Comment thread Makefile
Comment thread pkg/array/array.go
//
// Example:
//
// ParseVolumeID("9f840c56-96e6-4de9-b5a3-27e7c20eaa77/PSabcdef0123/scsi:9f840c56-96e6-4de9-b5a3-27e7c20eaa77/PS0123abcdef") returns

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.

For any chance can this (volume ID) go beyond 253 char in any case?

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.

Luke may not be able to respond in time. What are the concerns?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

All components of the volume are known and handled by the CreateVolume k8s gRPC implementation in controller.go, so this is as long as it should ever be.

@adarsh-dell adarsh-dell 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.

LGTM

Comment thread pkg/array/array.go
@lukeatdell lukeatdell merged commit 47f4d69 into main Sep 17, 2024
@lukeatdell lukeatdell deleted the usr/luke-lau/metro-volume-handle branch September 17, 2024 15:46
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.

6 participants