openebs / lvm-localpv

Dynamically provision Stateful Persistent Node-Local Volumes & Filesystems for Kubernetes that is integrated with a backend LVM2 data storage stack.
Apache License 2.0
245 stars 92 forks source link

Support custom volume group priority algorithm #177

Closed sleepymole closed 1 month ago

sleepymole commented 2 years ago

Describe the problem/challenge you have

When there are multiple volume groups on a node, the lvm-driver always creates volume on the first volume group if possible.It seems this is expected as the getVgPriorityList says: https://github.com/openebs/lvm-localpv/blob/e41d25a0cd22d1deef2058fb99fae003bfd9f584/pkg/mgmt/volume/volume.go#L140-L143

However, we'd like to create volumes on different volume groups in our scenario, so that all underlying disks can be utilized for better performance.

Describe the solution you'd like [A clear and concise description of what you want to happen.]

Support custom volume group priority algorithm like the node schedule algorithm VolumeWeighted and CapacityWeighted.

Anything else you would like to add: [Miscellaneous information that will assist in solving the issue.]

Environment:

SHIKHER09 commented 2 years ago

hello, Can I work on it

pawanpraka1 commented 2 years ago

Hi @SHIKHER09, sure, you can work on it. Please let me know if you need any help. You can join our slack channel #openebs-dev in K8s workspace and ask the questions there.

abhilashshetty04 commented 3 months ago

Hi @sleepymole , Support has already been added to incorporate volumeWeighted and capacityWeighted algorithm. However, by default we run spaceWeighted if not specified.

These algorithms are used to select a lvmnode to place a lvmVolume CR. After that lvmvolume controller picks the CR and chooses a VG within it for lvcreate.

So if you want to have more control on lv placement in terms of vg selection. Id suggest you use vgpattern.

sleepymole commented 3 months ago

@abhilashshetty04 Awesome work!