Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update volume ID format for metro volumes #345

Merged
merged 27 commits into from
Sep 17, 2024

Conversation

lukeatdell
Copy link
Contributor

@lukeatdell lukeatdell commented Sep 13, 2024

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 #
dell/csm#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

@@ -254,30 +254,54 @@ func GetPowerStoreArrays(fs fs.Interface, filePath string) (map[string]*PowerSto
return arrayMap, mapper, defaultArray, nil
}

// ParseVolumeID parses volume id in from CO (Kubernetes) and tries to understand what in it are PowerStore volume id, and what is ip, protocol.
// "/" is used as a delimiter.
// ParseVolumeID parses a volume id from the CO (Kubernetes) and tries to extract the PowerStore volume id, Global ID, and protocol.
//
// Example:
//
// ParseVolumeID("1cd254s/192.168.0.1/scsi") will return
Copy link
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
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
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
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.

pkg/array/array.go Outdated Show resolved Hide resolved
pkg/controller/controller_test.go Outdated Show resolved Hide resolved
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.

Makefile Show resolved Hide resolved
//
// Example:
//
// ParseVolumeID("9f840c56-96e6-4de9-b5a3-27e7c20eaa77/PSabcdef0123/scsi:9f840c56-96e6-4de9-b5a3-27e7c20eaa77/PS0123abcdef") returns
Copy link
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
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
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.

Copy link
Contributor

@adarsh-dell adarsh-dell left a comment

Choose a reason for hiding this comment

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

LGTM

@lukeatdell lukeatdell merged commit 47f4d69 into main Sep 17, 2024
5 checks passed
@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