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

Missing rbd API components: function rbd_encryption_load2 #1059

Open
idryomov opened this issue Jan 22, 2025 · 3 comments · May be fixed by #1061
Open

Missing rbd API components: function rbd_encryption_load2 #1059

idryomov opened this issue Jan 22, 2025 · 3 comments · May be fixed by #1061
Assignees

Comments

@idryomov
Copy link

go-ceph is missing a binding for rbd_encryption_load2() which allows loading encryption for a clone image which is encrypted differently from a parent image.

@idryomov idryomov added ceph-libs Fix or enhancement needed in ceph libraries enhancement labels Jan 22, 2025
@phlogistonjohn phlogistonjohn removed the ceph-libs Fix or enhancement needed in ceph libraries label Jan 22, 2025
@phlogistonjohn phlogistonjohn self-assigned this Jan 22, 2025
@phlogistonjohn
Copy link
Collaborator

@idryomov I started looking at this but I can't find any tests that seem to exercise passing >1 spec to the *_load2 function. I did write a test that functionally replaces the _load version with the _load2 version with a single element array. In particular I'm not sure how to create a clone that has a different encryption from the parent. Any pointers? (C/C++ or python code examples are fine)

phlogistonjohn added a commit to phlogistonjohn/go-ceph that referenced this issue Jan 22, 2025
Add a new Image method EncryptionLoad2 implementing rbd_encryption_load2.
This method adds the ability to have different encryption schemes across
parent images.

Signed-off-by: John Mulligan <[email protected]>
Fixes: ceph#1059
@phlogistonjohn phlogistonjohn linked a pull request Jan 22, 2025 that will close this issue
5 tasks
@idryomov
Copy link
Author

I started looking at this but I can't find any tests that seem to exercise passing >1 spec to the *_load2 function.

Search for encryption_load2 in src/test/librbd/test_librbd.cc.

I did write a test that functionally replaces the _load version with the _load2 version with a single element array.

If go-ceph continues to expose EncryptionLoad, I'd prefer for that to still map to rbd_encryption_load().

In particular I'm not sure how to create a clone that has a different encryption from the parent.

Simply clone as usual and call EncryptionFormat on the clone right after opening it. There are examples in src/test/librbd/test_librbd.cc, typically a few lines before the call to rbd_encryption_load2() (C API) or Image::encryption_load2() (C++ API).

phlogistonjohn added a commit to phlogistonjohn/go-ceph that referenced this issue Jan 23, 2025
Add a new Image method EncryptionLoad2 implementing rbd_encryption_load2.
This method adds the ability to have different encryption schemes across
parent images.

Signed-off-by: John Mulligan <[email protected]>
Fixes: ceph#1059
@phlogistonjohn
Copy link
Collaborator

I started looking at this but I can't find any tests that seem to exercise passing >1 spec to the *_load2 function.

Search for encryption_load2 in src/test/librbd/test_librbd.cc.

Thanks. Don't know how I missed that the first time. It certainly helped.

I did write a test that functionally replaces the _load version with the _load2 version with a single element array.

If go-ceph continues to expose EncryptionLoad, I'd prefer for that to still map to rbd_encryption_load().

There will be no change to EncryptionLoad. The new EncryptionLoad2 needed a test and that test was basically a copy of the test for EncryptionLoad but with the calls to EncryptionLoad swapped with EncryptionLoad2. I felt this was a borderline insufficient.

The PR #1061 has been updated with a new test now and that should have better coverage of the EncyptionLoad2 functionality. It is ready for review.

phlogistonjohn added a commit to phlogistonjohn/go-ceph that referenced this issue Jan 23, 2025
Add a new Image method EncryptionLoad2 implementing rbd_encryption_load2.
This method adds the ability to have different encryption schemes across
parent images.

Signed-off-by: John Mulligan <[email protected]>
Fixes: ceph#1059
phlogistonjohn added a commit to phlogistonjohn/go-ceph that referenced this issue Jan 24, 2025
Add a new Image method EncryptionLoad2 implementing rbd_encryption_load2.
This method adds the ability to have different encryption schemes across
parent images.

Signed-off-by: John Mulligan <[email protected]>
Fixes: ceph#1059
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants