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

[manila-csi-plugin] Add support for online volume expansion #1579

Merged

Conversation

gman0
Copy link
Member

@gman0 gman0 commented Jun 25, 2021

What this PR does / why we need it:

This PR implements online EXPAND_VOLUME controller capability.

Which issue this PR fixes(if applicable):
fixes #1475

Special notes for reviewers:

Release note:

[manila-csi-plugin] Add support for online volume expansion

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jun 25, 2021
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 25, 2021
@gman0
Copy link
Member Author

gman0 commented Jun 25, 2021

PTAL @gouthampacha @tombarron @ramineni

Copy link
Contributor

@gouthampacha gouthampacha left a comment

Choose a reason for hiding this comment

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

/ok-to-test

pkg/csi/manila/controllerserver.go Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Jun 25, 2021
@gman0
Copy link
Member Author

gman0 commented Jun 28, 2021

@lingxiankong is the CI disabled? No acceptance tests were run.

@lingxiankong
Copy link
Contributor

/retest

@lingxiankong
Copy link
Contributor

@lingxiankong is the CI disabled? No acceptance tests were run.

No idea, I checked the http://status.openlabtesting.org/status, seems fine

@lingxiankong
Copy link
Contributor

Maybe it was restarted, now I see the job is running.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Jun 28, 2021

Build succeeded.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Jun 28, 2021

Build succeeded.

@gman0
Copy link
Member Author

gman0 commented Jun 28, 2021

Weird... Thank you @lingxiankong !

@theopenlab-ci
Copy link

theopenlab-ci bot commented Jun 28, 2021

Build succeeded.

Copy link
Contributor

@gouthampacha gouthampacha left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 29, 2021
// Share is already larger than requested size

return &csi.ControllerExpandVolumeResponse{
CapacityBytes: currentSizeInBytes,
Copy link
Contributor

@ramineni ramineni Jun 30, 2021

Choose a reason for hiding this comment

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

Isnt it better to add NodeExpansionRequired: false, if node expansion not required? It says required field in csi spec.

          // Whether node expansion is required for the volume. When true
          // the CO MUST make NodeExpandVolume RPC call on the node. This field
          // is REQUIRED.
          bool node_expansion_required = 2;

Copy link
Member Author

Choose a reason for hiding this comment

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

NodeExpansionRequired bool is initialized to false by default

Copy link
Contributor

Choose a reason for hiding this comment

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

ok fine then

}

return &csi.ControllerExpandVolumeResponse{
CapacityBytes: int64(desiredSizeInGiB * bytesInGiB),
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

if _, isPending := pendingVolumes.LoadOrStore(share.Name, true); isPending {
return nil, status.Errorf(codes.Aborted, "volume named %s is already being processed", share.Name)
}
defer pendingVolumes.Delete(share.Name)
Copy link
Contributor

Choose a reason for hiding this comment

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

@gman0 Just wondering here, why we need to delete volumes here if some operation is in progress ?

Copy link
Member Author

Choose a reason for hiding this comment

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

pendingVolumes is a sync.Map. It acts like a try-lock: it tries to lock a resource (with share name as the key), protecting it against concurrent use. The Delete() just deletes a key from the map, freeing the lock for that volume.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, got it. Thanks

{
Type: &csi.PluginCapability_VolumeExpansion_{
VolumeExpansion: &csi.PluginCapability_VolumeExpansion{
Type: csi.PluginCapability_VolumeExpansion_ONLINE,
Copy link
Contributor

Choose a reason for hiding this comment

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

@gman0 Is OFFLINE capability not applicable for manila csi?

Copy link
Member Author

@gman0 gman0 Jun 30, 2021

Choose a reason for hiding this comment

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

I think VolumeExpansion.OFFLINE and VolumeExpansion.ONLINE pertain to what happens when the volume is in use while its being expanded, rather than if it's allowed to be online/offline.

This call MAY be made by the CO during any time in the lifecycle of the volume after creation if plugin has VolumeExpansion.ONLINE capability.
https://github.com/container-storage-interface/spec/blob/master/spec.md#controllerexpandvolume

Manila doesn't care whether a share is in use or not, so I think advertising online expansion only is enough. I asked at the CSI slack channel to make sure though.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll send a comment here once somebody replies.

Copy link
Member Author

Choose a reason for hiding this comment

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

Got a response: external-resizer doesn't check offline/online caps anyway, and they will be even deprecated from the CSI spec. See release notes at https://github.com/container-storage-interface/spec/releases/tag/v1.5.0

Copy link
Contributor

Choose a reason for hiding this comment

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

Agree that manila doesn't care if share is in use or not.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok

Copy link
Contributor

@tombarron tombarron left a comment

Choose a reason for hiding this comment

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

This change seems good to me if ramineni's questions have been answered.

@ramineni
Copy link
Contributor

ramineni commented Jul 1, 2021

Looks good to me

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ramineni

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 1, 2021
@k8s-ci-robot k8s-ci-robot merged commit 291d04b into kubernetes:master Jul 1, 2021
@gman0
Copy link
Member Author

gman0 commented Jul 1, 2021

Thank you all for reviews! I'll follow up with pull requests like we agreed: consolidating log messages and lowering verbosity levels.

powellchristoph pushed a commit to powellchristoph/cloud-provider-openstack that referenced this pull request Jan 19, 2022
…es#1579)

* implemented ControllerExpandVolume with online volume expansion support

* updated CSI sanity tests

* updated Helm chart

* updated k8s manifests

* updated docs

* updated examples

* docs: extend -> expand
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[manila-csi-plugin] allow share volume expansion
6 participants