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

External: configure sc properties for external cluster EC RBD pool #1440

Merged

Conversation

subhamkrai
Copy link
Contributor

@subhamkrai subhamkrai commented Dec 16, 2021

Adding extra field in storageClass "dataPool" when pool is
erasure coded pool in case of RBD.

Links:

  1. storageClass https://github.com/rook/rook/blob/master/deploy/examples/csi/rbd/storageclass-ec.yaml#L45
  2. Json Blob in case of EC RBD pool pool: add rbd ec pool support in external cluster rook/rook#9276 (comment)

Signed-off-by: subhamkrai srai@redhat.com

@subhamkrai
Copy link
Contributor Author

@leseb ^^

@subhamkrai subhamkrai marked this pull request as draft December 16, 2021 08:28
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 16, 2021
@subhamkrai
Copy link
Contributor Author

marked as draft as I need to check how to test external cluster changes.

@subhamkrai subhamkrai marked this pull request as ready for review December 16, 2021 10:30
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 16, 2021
@@ -228,6 +228,12 @@ func newCephBlockPoolStorageClassConfiguration(initData *ocsv1.StorageCluster) S
disable: managementSpec.DisableStorageClass,
isClusterExternal: initData.Spec.ExternalStorage.Enable,
}
if dataPool != "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

We are checking whether the dataPool argument is empty or not, but where are we using it?
In the line#233, we are directly creating a value (using the function generateNameForEcCephBlockPool()) for the dataPool key.

Copy link
Contributor

@leseb leseb Dec 21, 2021

Choose a reason for hiding this comment

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

That's a good point. Where is dataPool used? With EC, the SC config looks like this:

https://github.com/rook/rook/blob/fffb86295600196389de81905c3402f9aec6e751/deploy/examples/csi/rbd/storageclass-ec.yaml#L45-L46

EDIT: actually the code is a bit confusing but this is where parameters are set:

for k, v := range d.Data {
scc.storageClass.Parameters[k] = v
}

So dataPool and pool will be populated according to the JSON blob content.

@agarwal-mudit
Copy link
Member

/cc @aruniiird

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 16, 2021

@agarwal-mudit: GitHub didn't allow me to request PR reviews from the following users: aruniiird.

Note that only red-hat-storage members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @aruniiird

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

controllers/storagecluster/external_resources_test.go Outdated Show resolved Hide resolved
controllers/storagecluster/external_resources.go Outdated Show resolved Hide resolved
@@ -228,6 +228,12 @@ func newCephBlockPoolStorageClassConfiguration(initData *ocsv1.StorageCluster) S
disable: managementSpec.DisableStorageClass,
isClusterExternal: initData.Spec.ExternalStorage.Enable,
}
if dataPool != "" {
Copy link
Contributor

@leseb leseb Dec 21, 2021

Choose a reason for hiding this comment

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

That's a good point. Where is dataPool used? With EC, the SC config looks like this:

https://github.com/rook/rook/blob/fffb86295600196389de81905c3402f9aec6e751/deploy/examples/csi/rbd/storageclass-ec.yaml#L45-L46

EDIT: actually the code is a bit confusing but this is where parameters are set:

for k, v := range d.Data {
scc.storageClass.Parameters[k] = v
}

So dataPool and pool will be populated according to the JSON blob content.

controllers/storagecluster/generate.go Outdated Show resolved Hide resolved
controllers/storagecluster/storageclasses.go Outdated Show resolved Hide resolved
controllers/storagecluster/storageclasses.go Outdated Show resolved Hide resolved
controllers/storagecluster/external_resources_test.go Outdated Show resolved Hide resolved
controllers/storagecluster/external_resources_test.go Outdated Show resolved Hide resolved
Comment on lines 233 to 237
if data["dataPool"] != "" {
sc.storageClass.Parameters["pool"] = generateNameForErasureCodedCephBlockPool(initData)
sc.storageClass.Parameters["dataPool"] = generateNameForCephBlockPool(initData)
}
return sc
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if this block is actually needed since the cluster is external and we don't support EC in converged AFAIK.
@aruniiird to confirm?

Copy link
Contributor

Choose a reason for hiding this comment

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

You are right, we don't require dataPool value to be set here.
IMO, we don't even have to touch the function newCephBlockPoolStorageClassConfiguration() at all because, as you mentioned in the above comment, that for loop will provide appropriate values for both pool and dataPool parameters.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So, basically we don't need any change just adding unit test to verify working.

Adding unit test to verify erasure coded pool in case of RBD in external
cluster.

Links:
1) storageClass https://github.com/rook/rook/blob/master/deploy/examples/csi/rbd/storageclass-ec.yaml#L45
2) Json Blob in case of EC RBD pool rook/rook#9276 (comment)

Signed-off-by: subhamkrai <srai@redhat.com>
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 22, 2021

@subhamkrai: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/red-hat-storage-ocs-ci-e2e-aws 951032a link false /test red-hat-storage-ocs-ci-e2e-aws

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

actualSC.storageClass.Parameters[k] = v
}
assert.NotEmpty(t, actualSC.storageClass.Parameters["clusterID"])
assert.Equal(t, extR.Data["dataPool"], actualSC.storageClass.Parameters["dataPool"])
Copy link
Contributor

Choose a reason for hiding this comment

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

Where do you test that the dataPool name is ec-data-pool?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"dataPool": "ec-data-pool", this what I'm passing as JSON blob

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes and it should be in the SC parameters, so the unit test should validate this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

maybe I'm missing something but I'm passing "dataPool": "ec-data-pool" in the JSON blob and checking it with storage class parameters actualSC.storageClass.Parameters["dataPool"]) if provided is equal to expected.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 22, 2021
Copy link
Contributor

@aruniiird aruniiird left a comment

Choose a reason for hiding this comment

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

LGTM

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 23, 2021

@aruniiird: changing LGTM is restricted to collaborators

In response to this:

LGTM

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link
Member

@agarwal-mudit agarwal-mudit left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 23, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: agarwal-mudit, aruniiird, leseb, subhamkrai

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 23, 2021
@openshift-merge-robot openshift-merge-robot merged commit b1e4ef1 into red-hat-storage:main Dec 23, 2021
@subhamkrai subhamkrai deleted the external-ec-rbd branch December 23, 2021 04:21
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. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants