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

Support drive anti-affinity for volumes #823

Merged
merged 2 commits into from
Sep 15, 2023

Conversation

Praveenrajmani
Copy link
Collaborator

@Praveenrajmani Praveenrajmani commented Aug 11, 2023

Some optimal setups would require volumes to be allocated on unique disks. ie, not more than one volume per disk.

By default, the volume scheduling algorithm choses the drive based on most free capacity. This will end up allocating more than one volumes per disk.

This PR provides a way for such optimal setups, by using the storage class parameters. Using a storage class with directpv.min.io/volume-claim-id: XXX parameter enables unique allocation for PVCs. This unique allocation id enables the one-to-one cardinality for the drives and volumes.

Steps to test :

  • Install DirectPV
  • Create another storage class with directpv.min.io/volume-claim-id: <any-uid>
create-storage-class.sh <new-storage-class-name> 'directpv.min.io/volume-claim-id: <any-uid>'
  • Use the storage class and deploy the statefulset. No two volumes will be created in the same drive.

@Praveenrajmani Praveenrajmani force-pushed the unique-alloc branch 3 times, most recently from e9268a4 to 988c1a6 Compare August 14, 2023 10:26
@Praveenrajmani Praveenrajmani marked this pull request as ready for review August 14, 2023 10:28
@Praveenrajmani Praveenrajmani force-pushed the unique-alloc branch 2 times, most recently from 2d86a32 to 3dc3f03 Compare August 18, 2023 05:39
@Praveenrajmani
Copy link
Collaborator Author

pkg/apis/directpv.min.io/types/label.go Outdated Show resolved Hide resolved
docs/volume-scheduling.md Outdated Show resolved Hide resolved
docs/volume-scheduling.md Outdated Show resolved Hide resolved
pkg/apis/directpv.min.io/v1beta1/drive.go Outdated Show resolved Hide resolved
pkg/apis/directpv.min.io/v1beta1/volume.go Show resolved Hide resolved
docs/volume-scheduling.md Outdated Show resolved Hide resolved
pkg/apis/directpv.min.io/v1beta1/drive.go Outdated Show resolved Hide resolved
docs/volume-scheduling.md Show resolved Hide resolved
docs/volume-scheduling.md Outdated Show resolved Hide resolved
@Praveenrajmani Praveenrajmani force-pushed the unique-alloc branch 2 times, most recently from fcc663d to 967c749 Compare September 13, 2023 09:29
docs/tools/create-storage-class.sh Outdated Show resolved Hide resolved
docs/tools/create-storage-class.sh Outdated Show resolved Hide resolved
docs/tools/create-storage-class.sh Outdated Show resolved Hide resolved
pkg/csi/controller/utils.go Outdated Show resolved Hide resolved
pkg/csi/controller/utils.go Show resolved Hide resolved
pkg/csi/controller/utils.go Outdated Show resolved Hide resolved
pkg/apis/directpv.min.io/v1beta1/drive.go Show resolved Hide resolved
docs/volume-scheduling.md Show resolved Hide resolved
docs/volume-scheduling.md Outdated Show resolved Hide resolved
docs/tools/create-storage-class.sh Outdated Show resolved Hide resolved
docs/tools/create-storage-class.sh Outdated Show resolved Hide resolved
docs/tools/create-storage-class.sh Outdated Show resolved Hide resolved
docs/tools/create-storage-class.sh Outdated Show resolved Hide resolved
docs/volume-scheduling.md Outdated Show resolved Hide resolved
docs/volume-scheduling.md Show resolved Hide resolved
pkg/csi/controller/server.go Outdated Show resolved Hide resolved
docs/volume-scheduling.md Show resolved Hide resolved
pkg/csi/controller/utils.go Outdated Show resolved Hide resolved
Some optimal setups would require volumes to be allocated on unique disks.
ie, not more than one volume per disk.

By default, the volume scheduling algorithm choses the drive based on most
free capacity. This will end up allocating more than one volumes per disk.

This PR provides a way for such optimal setups, by using the storage class
parameters. Using a storage class with `directpv.min.io/volume-claim-id: <uuid>`
parameter enables unique allocation for PVCs. This unique allocation id enables
the one-to-one cardinality for the drives and volumes.
@Praveenrajmani Praveenrajmani merged commit 8fe0838 into minio:master Sep 15, 2023
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants