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

feat(cstor-operator): add a support to create pools on unclaimed BD in manual mode #1255

Merged
merged 9 commits into from
Jun 7, 2019

Conversation

mittachaitu
Copy link

@mittachaitu mittachaitu commented Jun 6, 2019

What this PR does / why we need it:
This PR adds the support to create pool on unclaimed block devices.

Steps to create a pool on unclaimed block devices:

  1. Deploy latest openebs-operator.yaml using kubectl apply -f <file_name>.
  2. Check whether the openebs components are in running state or not
kubectl get po -n openebs
NAME                                         READY   STATUS             RESTARTS   AGE
maya-apiserver-78f66545fc-j5kvp              1/1     Running            0          15m
node-disk-operator-6c58d8596c-qk7rv          1/1     Running         0          15m
openebs-admission-server-f798484fd-v854b     1/1     Running            0          15m
openebs-localpv-provisioner-76ff6fd9-s9zwj   1/1     Running            0          15m
openebs-ndm-7547s                            1/1     Running            0          15m
openebs-provisioner-7f8fc569c4-nngjs         1/1     Running            0          15m
openebs-snapshot-operator-59b56fb897-rgt9p   2/2     Running            0          15m
  1. Get the blockdevice CR's using kubectl get blockdevice -n <openebs_namespace>
kubectl get blockdevice -n openebs
NAME                                      SIZE          CLAIMSTATE   STATUS   AGE
sparse-177b6bc2ae2dd332c7a384a02179368b   10737418240   Unclaimed    Active   7h
sparse-37a7de580322f43a13338bf2467343f5   10737418240   Unclaimed    Active   7h
sparse-5a92ced3e2ee21eac7b930f670b5eab5   10737418240   Unclaimed    Active   7h
sparse-5e508018b4dd2c8e2530fbdae8e44bb6   10737418240   Unclaimed    Active   7h
sparse-72971f3b2e173c1b79db9a43e4cb841f   10737418240   Unclaimed    Active   7h
sparse-a205e38ff5ec89c223654fdf1361f182   10737418240   Unclaimed    Active   7h
sparse-b6ffc62c1e15edd30c1b4150d897d5cb   10737418240   Unclaimed    Active   7h
sparse-c1f2bcd14c0c74e492f74651893eecee   10737418240   Unclaimed    Active   7h
  1. Use above blockdevices in spc.yaml to create cstor pools (block devices should be unclaimed)
    Manual provisioning (supported): Manual provisioning implies specifying exact blockdevices on which cStor pools need to be created. In other words, update blockDeviceList field with unclaimed blockdevices available on which pools need to be created.
apiVersion: openebs.io/v1alpha1
kind: StoragePoolClaim
metadata:
  name: cstor-disk
spec:
  name: cstor-disk
  type: blockdevice
  poolSpec:
    poolType: mirrored
  blockDevices:
    blockDeviceList:
    - sparse-177b6bc2ae2dd332c7a384a02179368b
    - sparse-37a7de580322f43a13338bf2467343f5
    - sparse-5a92ced3e2ee21eac7b930f670b5eab5
    - sparse-5e508018b4dd2c8e2530fbdae8e44bb6
    - sparse-72971f3b2e173c1b79db9a43e4cb841f
    - sparse-a205e38ff5ec89c223654fdf1361f182
    - sparse-b6ffc62c1e15edd30c1b4150d897d5cb
    - sparse-c1f2bcd14c0c74e492f74651893eecee

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

Special notes for your reviewer:
TODO:

  1. Make the use of builder pattern to claim BD and to filter eligible block device.(In next PR)
  2. UnitTest cases need to be written(some testcases will be handled in next PR])
  3. Unclaim the claimed block device after deleting the spc(Done)
  4. Make changes in travis of maya(Done)

Checklist:

  • Fixes #
  • Labelled this PR & related issue with documentation tag
  • PR messages has document related information
  • Labelled this PR & related issue with breaking-changes tag
  • PR messages has breaking changes related information
  • Labelled this PR & related issue with requires-upgrade tag
  • PR messages has upgrade related information
  • Commit has unit tests
  • Commit has integration tests

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

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).

@mittachaitu mittachaitu requested a review from sonasingh46 June 6, 2019 12:45
…and removes unwanted code

Signed-off-by: mittachaitu <[email protected]>
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

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).

…during manual provisioning

Signed-off-by: mittachaitu <[email protected]>
Copy link
Contributor

@sonasingh46 sonasingh46 left a comment

Choose a reason for hiding this comment

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

Have some comments. PTAL

Copy link
Contributor

@vishnuitta vishnuitta left a comment

Choose a reason for hiding this comment

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

Filter in GetBlockDevice need to be specific to auto and manual modes

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

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).

pkg/blockdeviceclaim/v1alpha1/build.go Show resolved Hide resolved
pkg/blockdeviceclaim/v1alpha1/kubernetes_test.go Outdated Show resolved Hide resolved
pkg/blockdeviceclaim/v1alpha1/kubernetes_test.go Outdated Show resolved Hide resolved
pkg/blockdeviceclaim/v1alpha1/kubernetes_test.go Outdated Show resolved Hide resolved
pkg/blockdeviceclaim/v1alpha1/kubernetes_test.go Outdated Show resolved Hide resolved
pkg/blockdeviceclaim/v1alpha1/blockdeviceclaim_test.go Outdated Show resolved Hide resolved
@mittachaitu mittachaitu changed the title [WIP]feat(cstor-operator): add a support to create pools on unclaimed BD in manual mode feat(cstor-operator): add a support to create pools on unclaimed BD in manual mode Jun 7, 2019
Copy link
Contributor

@vishnuitta vishnuitta left a comment

Choose a reason for hiding this comment

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

changes are good

Copy link
Contributor

@sonasingh46 sonasingh46 left a comment

Choose a reason for hiding this comment

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

lgtm -- Some test cases and minor comments can be taken in a new PR.

@vishnuitta vishnuitta merged commit d12a67e into openebs-archive:master Jun 7, 2019
@vishnuitta
Copy link
Contributor

For some reason, travis is showing as 'in-progress' in the PR, but, clicking on the travis link shows that travis is passed. Hence, merging the PR.

mittachaitu pushed a commit to mittachaitu/maya that referenced this pull request Jun 7, 2019
prateekpandey14 pushed a commit that referenced this pull request Jun 7, 2019
…unclaimed BD in manual mode (#1267)

* refact(cstor-pool,sparse): Update SPC type to blockdevice (#1264)

With latest changes, to create StoragePoolClaim we have to
use spc type blockdevice as common type instead of sparse/disk
for creating sparse or disk based cstor pools

```
apiVersion: openebs.io/v1alpha1
kind: StoragePoolClaim
metadata:
  name: sparse-claim-auto
spec:
  name: sparse-claim-auto
  type: blockdevice
  maxPools: 1
  minPools: 1
  poolSpec:
    poolType: striped
    cacheFile: /var/openebs/sparse/sparse-claim-auto.cache
    overProvisioning: false
```

Signed-off-by: prateekpandey14 <[email protected]>

* feat(cstor-operator): add a support to create pools on unclaimed BD in manual mode (#1255)

Signed-off-by: mittachaitu <[email protected]>
AmitKumarDas pushed a commit that referenced this pull request Jun 8, 2019
…ckdeviceclaim (#1270)

* refact(cstor-pool,sparse): Update SPC type to blockdevice (#1264)

With latest changes, to create StoragePoolClaim we have to
use spc type blockdevice as common type instead of sparse/disk
for creating sparse or disk based cstor pools

```
apiVersion: openebs.io/v1alpha1
kind: StoragePoolClaim
metadata:
  name: sparse-claim-auto
spec:
  name: sparse-claim-auto
  type: blockdevice
  maxPools: 1
  minPools: 1
  poolSpec:
    poolType: striped
    cacheFile: /var/openebs/sparse/sparse-claim-auto.cache
    overProvisioning: false
```

Signed-off-by: prateekpandey14 <[email protected]>

* feat(cstor-operator): add a support to create pools on unclaimed BD in manual mode (#1255)

Signed-off-by: mittachaitu <[email protected]>

* fix(blockdeviceclaims): fix openebs version type in blockdeviceclaim (#1269)

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

Successfully merging this pull request may close these issues.

5 participants