SynologyOpenSource / synology-csi

Apache License 2.0
499 stars 107 forks source link

Make minimum volume capacity configurable #78

Open hotpheex opened 8 months ago

hotpheex commented 8 months ago

I'm getting this error when requesting a volume <1Gi: GRPC error: rpc error: code = InvalidArgument desc = Invalid input: required bytes is smaller than 1G

From what I can tell this is defaulting to a 1Gi minimum size if a custom range is not provided, but I cannot see a way for a user to configure the value. Is a 1Gi minimum volume size a limitation of Synology or is it possible to just add another flag to override it? Happy to raise a PR if its just a case of passing in a new value. https://github.com/SynologyOpenSource/synology-csi/blob/53cefcbc02878dd6982bc5f0666930f782694abe/pkg/driver/controllerserver.go#L46-L48

chihyuwu commented 8 months ago

hi @hotpheex, Yes, the 1Gi minimum size is a limitation of Synology LUNs, as specified in the documentation.

In Synology DSM, the minimum size for a LUN is 1GB(Gi), and the minimum quota for a shared folder is 1MB(Mi). In the current implementation of synology-csi, we have standardized the minimum volume size to 1GB. Perhaps a better approach would be allowing file protocols, such as SMB and NFS, to set the size smaller than 1Gi (but at least 1Mi).

Certainly appreciate your raising a PR! The earlier suggestion is something you might consider. Thank you in advance for your contribution!