-
Notifications
You must be signed in to change notification settings - Fork 28
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
Storage size requests lower than 1GiB are not respected #223
Comments
Hi, thank you for bug report. It is definitely a bug. Thanks. |
It was not clear in my message, but I tested adding a 100MB disk to a VM from the UI and it worked well. I don’t think there’s a minimum size requirement and the API allows you to set size in bytes. |
@johanfleury @sergelogvinov I think i has something to do with this line proxmox-csi-plugin/pkg/csi/utils.go Line 216 in c5769c1
which indicates that the size is rounded off to the nearest GB. |
Is it rounded to 1 Gibibyte or 1 Gigabyte? |
it should be Gibibytes (power of two) // RoundUpSize calculates how many allocation units are needed to accommodate
// a volume of given size. E.g. when user wants 1500MiB volume, while AWS EBS
// allocates volumes in gibibyte-sized chunks,
// RoundUpSize(1500 * 1024*1024, 1024*1024*1024) returns '2'
// (2 GiB is the smallest allocatable volume that can hold 1500MiB)
func RoundUpSize(volumeSizeBytes int64, allocationUnitBytes int64) int64 {
roundedUp := volumeSizeBytes / allocationUnitBytes
if volumeSizeBytes%allocationUnitBytes > 0 {
roundedUp++
}
return roundedUp
} |
I’m not sure I understand this. As far as I know, there are no storage backends in Proxmox that have a 1GB lower limit on the disk size. I know for a fact that ISCSI, LVM, ZFS and qcow files (local or remote) all support less-than-1GiB disks. I’m not entirely sure about CEPH and I couldn’t find an answer online.
From the UI maybe (probably for UX reasons), but from the API there’s no such limitation. |
I'm afraid I may have lost track of the main idea here. If the required size is less than 1Gb - I believe a good minimum would be 100Mb. |
My issue is that a PVC with
100MB seems reasonable to me. If you’re ok with lowering |
common behavior most of the clouds... Yeah, make sense to change it to 100M. |
I did some tests with
I don’t think this is what we want, so either we remove |
These are very interesting results. I hadn't checked them before, so thank you for sharing. I've reviewed #266, and I was thinking, what do you think about moving the Also, we should check the minimum size, at least. Someone could accidentally set the size to '10' (bytes), and Proxmox might return an error. Thank you for the effort. |
Bug Report
Description
When creating a PV with
spec.resources.requests.storage
lower than 1GiB, a volume of 1GiB is created.My understanding is that calls to
RoundUpSize
inCreateVolume
andExpandVolume
are forcing disk size to be a 1GiB multiple (i.e. 100Mi → 1Gi, 1.5Gi → 2Gi):proxmox-csi-plugin/pkg/csi/controller.go
Line 126 in 76c899e
proxmox-csi-plugin/pkg/csi/controller.go
Line 126 in 76c899e
I tested on my cluster (PVE 8.2) and creating a disk of 100Mi is working well, so I feel like this rounding up is not necessary.
Logs
Controller:
Node: not relevant
Environment
The text was updated successfully, but these errors were encountered: