feat(spc): add feature to limit overprovisioning of cstor volumes#1577
Merged
vishnuitta merged 6 commits intoopenebs-archive:masterfrom Jan 22, 2020
Merged
feat(spc): add feature to limit overprovisioning of cstor volumes#1577vishnuitta merged 6 commits intoopenebs-archive:masterfrom
vishnuitta merged 6 commits intoopenebs-archive:masterfrom
Conversation
ghost
reviewed
Jan 7, 2020
ghost
left a comment
There was a problem hiding this comment.
Found some fixes!
P.S. share your ideas, feedbacks or issues with us at https://github.com/fixmie/feedback (this message will be removed after the beta stage).
golangcibot
reviewed
Jan 7, 2020
f5d5b75 to
97a8412
Compare
golangcibot
reviewed
Jan 7, 2020
97a8412 to
72474d1
Compare
golangcibot
reviewed
Jan 7, 2020
Signed-off-by: Ashutosh Kumar <ashutosh.kumar@openebs.io>
72474d1 to
2880fd8
Compare
golangcibot
reviewed
Jan 7, 2020
sonasingh46
commented
Jan 7, 2020
AmitKumarDas
reviewed
Jan 8, 2020
AmitKumarDas
reviewed
Jan 8, 2020
AmitKumarDas
reviewed
Jan 8, 2020
AmitKumarDas
reviewed
Jan 8, 2020
AmitKumarDas
reviewed
Jan 8, 2020
AmitKumarDas
reviewed
Jan 8, 2020
AmitKumarDas
reviewed
Jan 8, 2020
mittachaitu
reviewed
Jan 10, 2020
added 2 commits
January 17, 2020 13:01
Signed-off-by: Ashutosh Kumar <ashutosh.kumar@mayadata.io>
Signed-off-by: Ashutosh Kumar <ashutosh.kumar@mayadata.io>
added 2 commits
January 17, 2020 14:43
Signed-off-by: Ashutosh Kumar <ashutosh.kumar@mayadata.io>
Signed-off-by: Ashutosh Kumar <ashutosh.kumar@mayadata.io>
vishnuitta
reviewed
Jan 22, 2020
vishnuitta
reviewed
Jan 22, 2020
| var totalcapcity resource.Quantity | ||
| cstorVolumeMap := make(map[string]bool) | ||
| label := string(apis.CStorPoolKey) + "=" + csp.Name | ||
| cstorVolumeReplicaObjList, err := cstorvolumereplica.NewKubeclient().WithNamespace(p.openebsNamespace).List(metav1.ListOptions{LabelSelector: label}) |
Contributor
There was a problem hiding this comment.
does CVRs always stay in openebsNamespace?
Contributor
Author
There was a problem hiding this comment.
openebsNamespace is the namespace where openebs is installed. And CVRs always stay in a namespace where openebs is installed.
vishnuitta
reviewed
Jan 22, 2020
|
|
||
| // getCStorVolumeCapacity returns the capacity present on a CStorVolume CR. | ||
| func (p *scheduleWithOverProvisioningAwareness) getCStorVolumeCapacity(name string) (resource.Quantity, error) { | ||
| cv, err := cstorvolume.NewKubeclient().WithNamespace(p.openebsNamespace).Get(name, metav1.GetOptions{}) |
Contributor
There was a problem hiding this comment.
does cv stays in openebsNamespace?
Signed-off-by: Ashutosh Kumar <ashutosh.kumar@mayadata.io>
vishnuitta
reviewed
Jan 22, 2020
| func getVolumeCapacity(values ...string) (resource.Quantity, error) { | ||
| var capacity string | ||
| for _, val := range values { | ||
| if strings.Contains(val, string(volumeCapacityLabel)) { |
Contributor
There was a problem hiding this comment.
where are we filling this label with total capacity?
Contributor
There was a problem hiding this comment.
ok.. got it.. this is the capacity of the volume to be provisioned
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a feature to limit the over-provisioning of a CStor volume on SPC pools and hence fixes the issue openebs/openebs#2855 for cStor volume provisioned on SPC.
A similar feature for CSPC would be introduced in upcoming PRs.
Refer to following doc for solution approach:
https://docs.google.com/document/d/1JFsrZsOiV9GLG4IJ6mDrbNf5flvS1BKExCzI8J3hX2I/edit
Example :
All the pools created under above SPC YAML will obey the over provisioning policy ( i.e. disabled).
Consider an example, if a CStor volume is created with 7G of capacity with
nreplicas thennpools should be available with availableSpaceOnPool>incomingVolumeCapacity(7G in this case) according to below formula:availableSpaceOnPool:= (PoolCapacity*threshold/100 - Sum of all existing Volumes Capacities on the pool)
(Here
thresholdis by default 70% and can be overridden with OpenEBS annotations. A separate PR needs to be raised for this threshold overriding ability.)If
nsuch pools are not found -- the provisioning will fail.One more point to note is that, if overprovisioning is disabled on SPC then all the pools(CSP) of that SPC will have overprovisioning disabled. There is no such case where one pool of SPC will have overprovisioning disabled and another one enabled.
In short, the overprovisioning policy specified on SPC applies homogenously to all the CSPs(pools) of the SPC.
Signed-off-by: Ashutosh Kumar ashutosh.kumar@openebs.io
Special notes for your reviewer:
Needs an e2e verification of the current feature.
Needs an e2e verification to check for regression(if any) of other existing policies of CVR placement.