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

rbd: use go-ceph rbd admin task api for 'trash remove' & 'flatten' #2633

Merged
merged 7 commits into from
Jan 6, 2022

Conversation

Rakshith-R
Copy link
Contributor

@Rakshith-R Rakshith-R commented Nov 11, 2021

  • rebase: use go-ceph v0.13.0
  • rbd: use go-ceph rbd admin task api instead of cli
  • rbd: remove redundant rbdVolume.connect() in flattneRbdImage()
  • rbd: remove redundant util.Credentials arg from flattenRbdImage()
  • rbd: refractor deleteImage() & trashRemoveImage()

Closes: #2186

New Mgr Not Supported errors thrown by go-ceph

  • API call not implemented server-side: No handler found for 'rbd task add trash remove' (rook 1.2.0, ceph v:14.2.2)
  • rados: ret=-13, Permission denied: "access denied: does your client key have mgr caps? See http://docs.ceph.com/en/latest/mgr/administrator/#client-authentication" (when user secret does not have mgr caps)

@mergify mergify bot added the component/rbd Issues related to RBD label Nov 11, 2021
@Rakshith-R Rakshith-R force-pushed the flatten-task-api branch 4 times, most recently from eae9bbf to 161fd06 Compare November 16, 2021 10:57
@Rakshith-R Rakshith-R marked this pull request as ready for review November 17, 2021 04:17
@Rakshith-R
Copy link
Contributor Author

/retest ci/centos/k8s-e2e-external-storage/1.22

@Rakshith-R
Copy link
Contributor Author

@Rakshith-R Rakshith-R requested review from a team November 17, 2021 04:18
build.env Outdated
@@ -13,7 +13,7 @@ CSI_IMAGE_VERSION=canary

# Ceph version to use
BASE_IMAGE=docker.io/ceph/ceph:v16
CEPH_VERSION=octopus
BUILD_TAGS=ceph_preview
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we document the ceph_preview thing ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

can we document the ceph_preview thing ?

Suggested change
BUILD_TAGS=ceph_preview
# ceph_preview tag is required to access go-ceph APIs which are under preview.
BUILD_TAGS=ceph_preview

@humblec is this sufficient ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

I do not think we should set ceph_preview as default. Make sure that APIs from go-ceph are stable and part of the latest release.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ceph_preview is removed and go-ceph is upgraded to v0.13.0 in this pr instead

@Rakshith-R Rakshith-R requested review from a team and humblec November 17, 2021 10:42
Copy link
Collaborator

@Madhu-1 Madhu-1 left a comment

Choose a reason for hiding this comment

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

LGTM . @Rakshith-R have you verified its working with older ceph releases where we don't have manager command support?

@@ -123,6 +123,16 @@ func (cc *ClusterConnection) GetRBDAdmin() (*ra.RBDAdmin, error) {
return ra.NewFromConn(cc.conn), nil
}

// GetTaskAdmin returns TaskAdmin to add tasks on rbd volumes.
Copy link
Collaborator

Choose a reason for hiding this comment

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

rbd volumes to rbd images

@Rakshith-R
Copy link
Contributor Author

LGTM . @Rakshith-R have you verified its working with older ceph releases where we don't have manager command support?

Yes, I ran it with ceph 14.2.2 where there's rbd task support, works as expected.

@Madhu-1
Copy link
Collaborator

Madhu-1 commented Nov 18, 2021

LGTM . @Rakshith-R have you verified its working with older ceph releases where we don't have manager command support?

Yes, I ran it with ceph 14.2.2 where there's rbd task support, works as expected.

you mean no rbd task support?

@Rakshith-R
Copy link
Contributor Author

LGTM . @Rakshith-R have you verified its working with older ceph releases where we don't have manager command support?

Yes, I ran it with ceph 14.2.2 where there's rbd task support, works as expected.

you mean no rbd task support?

yes 😅
*ceph 14.2.2 where there's * no * rbd task support, works as expected.

@Rakshith-R Rakshith-R requested review from humblec and removed request for humblec November 18, 2021 06:38
@Rakshith-R Rakshith-R force-pushed the flatten-task-api branch 2 times, most recently from 5c01d0b to 2ead05f Compare November 18, 2021 06:41
Madhu-1
Madhu-1 previously approved these changes Nov 18, 2021
Copy link
Member

@nixpanic nixpanic left a comment

Choose a reason for hiding this comment

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

Suggestion to squash the last two patches together (drop cr from flattenRbdImage()).

Having ceph_preview as default in the BUILD_TAGS is not very clean, we should probably wait until go-ceph provides a version where there is no need to set the build tag.

build.env Outdated
@@ -13,7 +13,7 @@ CSI_IMAGE_VERSION=canary

# Ceph version to use
BASE_IMAGE=docker.io/ceph/ceph:v16
CEPH_VERSION=octopus
BUILD_TAGS=ceph_preview
Copy link
Member

Choose a reason for hiding this comment

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

I do not think we should set ceph_preview as default. Make sure that APIs from go-ceph are stable and part of the latest release.

@nixpanic nixpanic added the dependency/go-ceph depends on go-ceph functionality label Nov 18, 2021
@mergify mergify bot added ci/skip/e2e skip running e2e CI jobs component/build Issues and PRs related to compiling Ceph-CSI component/testing Additional test cases or CI work labels Nov 23, 2021
Madhu-1
Madhu-1 previously approved these changes Jan 6, 2022
@Madhu-1
Copy link
Collaborator

Madhu-1 commented Jan 6, 2022

@humblec you have requested changes on this PR. PTAL

internal/rbd/migration.go Outdated Show resolved Hide resolved
internal/rbd/migration.go Outdated Show resolved Hide resolved
internal/rbd/rbd_util.go Outdated Show resolved Hide resolved
internal/rbd/rbd_util.go Show resolved Hide resolved
@github-actions
Copy link

github-actions bot commented Jan 6, 2022

/retest ci/centos/k8s-e2e-external-storage/1.21

@github-actions
Copy link

github-actions bot commented Jan 6, 2022

@Rakshith-R "ci/centos/k8s-e2e-external-storage/1.21" test failed. Logs are available at location for debugging

This commit removes `rv.Connect(cr)` since the rbdVolume should
have an active connection in this stage of the function call.

`rv.getCloneDepth(ctx)` will work after a connect to the cluster.

Signed-off-by: Rakshith R <rar@redhat.com>
@nixpanic nixpanic requested review from Madhu-1 and humblec January 6, 2022 09:07
@mergify mergify bot dismissed stale reviews from nixpanic and Madhu-1 January 6, 2022 09:07

Pull request has been modified.

Madhu-1
Madhu-1 previously approved these changes Jan 6, 2022
humblec
humblec previously approved these changes Jan 6, 2022
With introduction of go-ceph rbd admin task api, credentials are
no longer required to be passed as cli cmd is not invoked.

Signed-off-by: Rakshith R <rar@redhat.com>
This commit removes rbdVol.getTrashPath() function
since it is no longer being used due to introduction
of go-ceph rbd admin task api for deletion.

Signed-off-by: Rakshith R <rar@redhat.com>
This function returns new go-ceph TaskAdmin to add
tasks on rbd volumes.

Signed-off-by: Rakshith R <rar@redhat.com>
Signed-off-by: Rakshith R <rar@redhat.com>
@mergify mergify bot dismissed stale reviews from humblec and Madhu-1 January 6, 2022 10:01

Pull request has been modified.

@Rakshith-R
Copy link
Contributor Author

few lines creeped in to migration.go during rebase, fixed that.
PTAL

@Rakshith-R Rakshith-R requested review from nixpanic and humblec January 6, 2022 11:31
@humblec
Copy link
Collaborator

humblec commented Jan 6, 2022

few lines creeped in to migration.go during rebase, fixed that. PTAL

Thanks @Rakshith-R , I will let @nixpanic to confirm once, as I heard previous changes were tested too.

@mergify mergify bot merged commit 384ab42 into ceph:devel Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/retry/e2e Label to retry e2e retesting on approved PR's component/rbd Issues related to RBD dependency/go-ceph depends on go-ceph functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use go-ceph for ceph task manager commands
4 participants