Skip to content

Metro volume publish/unpublish and mount/unmount#349

Merged
santhoshatdell merged 9 commits into
mainfrom
metro-attach-detach
Sep 30, 2024
Merged

Metro volume publish/unpublish and mount/unmount#349
santhoshatdell merged 9 commits into
mainfrom
metro-attach-detach

Conversation

@santhoshatdell

@santhoshatdell santhoshatdell commented Sep 27, 2024

Copy link
Copy Markdown
Contributor

Description

  • Updated the current controller and node calls to support Metro volume. Both local and remote backend volumes are published and mounted to the k8s node, and unpublished and unmounted during delete operation.
  • ControllerPublishVolume() also maps the remote volume to the same node/host in addition to local volume.
  • ControllerUnpublishVolume() also unmaps the remote volume from the node/host.
  • NodeStageVolume() also stages the remote volume.
  • NodeUnstageVolume() also unstages the remote volume, thereby allowing the Metro PV to be deleted successfully (i.e volumeattachment is removed).

Note:

  • NodePublishVolume call formats and mounts the multipath device, my understanding is that we do not need to repeat that process for remote volume since both local and remote paths are already staged for that device with same WWN. Same applies with NodeUnpublishVolume call.
  • LUN does not seem to be required consistent for the local and remote volume mappings. I saw no issues in testing. PowerMax Metro in CSM has done the same.

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 (controller 86.1% to 86.3% and node 81.7% to 82.0%)
  • I have commented my code, particularly in hard-to-understand areas
  • 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?

With pre-requisite of multipath and iscsi steps from CSM doc:

  • Pod state moved to 'running' after successful PV creation and above-mentioned calls in description.
  • multipath command on the k8s node showed paths from both storage arrays.
  • As I removed the host mapping on the array, the corresponding path is shown as faulty and it became active as the mapping is added back with LUN used.
  • Pod was able to write continously to the device throughout the testing. PowerStore UI showed gradual increase of 'logical used size' for the volume on both arrays.
  • PV was successfully deleted once the pod and pvc are deleted.
  • Driver and node logs are attached to ticket 23544.
  • Verified that non-metro PV mount/unmount continues to work, with tests in tests/simple/simple.yaml from CSM doc.

Comment thread pkg/controller/controller.go
Comment thread pkg/node/node.go Outdated
lukeatdell
lukeatdell previously approved these changes Sep 30, 2024
node, err := remoteArray.GetClient().GetHostByName(ctx, kubeNodeID)
if err != nil {
return nil, status.Errorf(codes.Internal,
"failure checking host '%s' status for volume unpublishing on remote array: %s", kubeNodeID, err.Error())

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.

The style seems to not quote things, like host. For example you did not quote the remoteArrayId at line 745. No need to change this.

Comment thread pkg/controller/publisher.go
Comment thread pkg/controller/publisher.go
Comment thread pkg/controller/publisher.go
@santhoshatdell santhoshatdell merged commit 2c7db64 into main Sep 30, 2024
@santhoshatdell santhoshatdell deleted the metro-attach-detach branch September 30, 2024 20:12
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