-
Notifications
You must be signed in to change notification settings - Fork 256
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
Add support for rbd_image_options_t #111
Conversation
Well, yes, it is expected that this fails on Ceph Luminous... I'll consider commenting |
5366b6b
to
f6b91ab
Compare
6403328
to
c3cf7d0
Compare
On Tue, Dec 03, 2019 at 06:07:01AM -0800, Yaniv Kaul wrote:
mykaul commented on this pull request.
> +package rbd_test
+
+import (
+ "github.com/ceph/go-ceph/rbd"
+ "github.com/stretchr/testify/assert"
+ "testing"
+)
+
+func TestRbdOptions(t *testing.T) {
+ var i uint64
+ var s string
+ var err error
+
+ options := rbd.NewRbdImageOptions()
+
+ err = options.SetUint64(rbd.RbdImageOptionFormat, 1)
<did not read fully the code>
Are you setting the Image Format to v1 here?
</did not read fully the code>
If you do, it should be v2.
If I misread - please ignore this comment ;-)
It is just a test, it might be possible to set any integer value. The
actual checking of the contents of the options might be done while
calling rbd_create4().
This test only checks if setting an integer succeeds, and setting a
string fails. The intepretation (range-check) of the value is not part
of the test.
|
f65d1a5
to
04f0359
Compare
I think this is ready, all concerns/remarks should have been addressed. |
@phlogistonjohn can you please take a look at this ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM Thanks.
@nixpanic I merged the other PR (splitting out the other create functions) first. Please rebase this at your convenience. |
Prepare for adding support for RbdImageOptions with RBD_IMAGE_OPTION_FLATTEN that has been introduced in Ceph Mimic. Nautilus is the most recent supported versions, so use that for testing. Signed-off-by: Niels de Vos <[email protected]>
There are several RbdImageOptions that can be used to configure features of an RBD image while creating, cloning, migrating and copying. A follow-up patch will add Create4() where the RbdImageOptions can be used. Signed-off-by: Niels de Vos <[email protected]>
This allows to set additional options while creating RBD images. Ceph-CSI will initially consume this to configure an optionally different pool for data. Signed-off-by: Niels de Vos <[email protected]>
04f0359
to
b371bc7
Compare
On Wed, Dec 11, 2019 at 06:10:55AM -0800, John Mulligan wrote:
@nixpanic I merged the other PR (splitting out the other create functions) first. Please rebase this at your convenience.
Rebase is done. Thanks!
|
While rewriting Ceph-CSI to use go-ceph instead of the
rbd
command, some functionality is missing in go-ceph. One of the missing pieces is support for setting certain options while creating an image (optional data-pool).This series adds support for
rbd_image_options_t
with getter/setter functions and the like based onlibrbd.h
.Note that Mimic added a new option, hence updating the tests to consume a more recent version (Nautilus, was Luminous).
In order to keep this working with Luminous,(Does not work as expected)rbd/rbd_options_list.pgo
is used to generaterbd/rbd_options_list.go
which may, or may not includeRBD_IMAGE_OPTION_FLATTEN
, depending on the Ceph version.As Travis CI has been configured to run on Luminous,
RBD_IMAGE_OPTION_FLATTEN
has been disabled and will not be available for now.