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

[BUG]: Volume Size Rounding Issue in PowerFlex: Rounds Down Instead of Up for Multiples of 8GB #1608

Closed
KshitijaKakde opened this issue Nov 25, 2024 · 3 comments
Assignees
Labels
area/csi-powerflex Issue pertains to the CSI Driver for Dell EMC PowerFlex type/bug Something isn't working. This is the default label associated with a bug issue.
Milestone

Comments

@KshitijaKakde
Copy link

Bug Description

When creating a volume in PowerFlex, it appears to round down instead of up for sizes that are multiples of 8GB. For example:

A request for 53,690,000 KB results in a 56 GB disk.
However, a request for 50,000,000 KB (50 GB) only yields a 48 GiB disk, which should ideally be 56 GiB.
This behavior suggests that the conversion from decimal to binary may not be handled correctly. Specifically, when the requested size in GiB is close to the 8 GiB cutoff (approximately 48.8 GiB), it does not round up to the next 8 GiB size (56 GiB)

Logs

`

storage: 52428800k

Because the size is just over 48 GiB, we would expect the volume to be created for 56 GiB.

52428800000 | b | 52428800000 | b -- | -- | -- | -- 52428800 | KB | 51200000 | KiB 52428.8 | MB | 50000 | MiB 52.4288 | GB | 48.828125 | GiB

powerflex-controller-857877b59b-27mhm-driver

This is the first occurrence of the create that I see

time="2024-11-16T06:00:52Z" level=info msg="/csi.v1.Controller/CreateVolume: REQ 46438: Name=oce-np-gen-a01-k8s-b3dc71f418, CapacityRange=required_bytes:52428800000 , VolumeCapabilities=[block:<> access_mode:<mode:MULTI_NODE_MULTI_WRITER > ], Parameters=map[csi.storage.k8s.io/pv/name:oce-np-gen-a01-k8s-b3dc71f418 csi.storage.k8s.io/pvc/name:prime-7a45e8f1-60f2-4bb1-a852-2df671f0647d csi.storage.k8s.io/pvc/namespace:openshift-mtv storagepool:pd12_12c systemID:72a4faf37c8ea10f], AccessibilityRequirements=requisite:<segments:<key:\"csi-vxflexos.dellemc.com/72a4faf37c8ea10f\" value:\"csi-vxflexos.dellemc.com\" > > preferred:<segments:<key:\"csi-vxflexos.dellemc.com/72a4faf37c8ea10f\" value:\"csi-vxflexos.dellemc.com\" > > , XXX_NoUnkeyedLiteral={}, XXX_sizecache=0"
time="2024-11-16T06:00:52Z" level=info msg="getSystemIDFromParameters system 72a4faf37c8ea10f"
time="2024-11-16T06:00:52Z" level=info msg="Use systemID as 72a4faf37c8ea10f"
time="2024-11-16T06:00:52Z" level=info msg="Found topology constraint: VxFlex OS system: 72a4faf37c8ea10f"
time="2024-11-16T06:00:52Z" level=info msg="Added accessible topology segment for volume: oce-np-gen-a01-k8s-b3dc71f418, segment: csi-vxflexos.dellemc.com/72a4faf37c8ea10f = csi-vxflexos.dellemc.com"
time="2024-11-16T06:00:52Z" level=info msg="Accessible topology for volume: oce-np-gen-a01-k8s-b3dc71f418, segments: map[string]string{\"csi-vxflexos.dellemc.com/72a4faf37c8ea10f\":\"csi-vxflexos.dellemc.com\"}"
time="2024-11-16T06:00:52Z" level=info msg="Protection Domain name not provided; there could be conflicts if two storage pools share a name"
time="2024-11-16T06:00:52Z" level=info msg="Executing CreateVolume with following fields" name=oce-np-gen-a01-k8s-b3dc71f418 sizeInKiB=50331648 storagePool=pd12_12c volType=ThinProvisioned x-csi-pv-claimname=prime-7a45e8f1-60f2-4bb1-a852-2df671f0647d x-csi-pv-name=oce-np-gen-a01-k8s-b3dc71f418 x-csi-pv-namespace=openshift-mtv
time="2024-11-16T06:00:52Z" level=info msg="volume oce-np-gen-a01-k8s-b3dc71f418 (72a4faf37c8ea10f-63c9a5bf0000041a) created 2024-11-16 06:00:52 +0000 UTC\n"
time="2024-11-16T06:00:52Z" level=info msg="/csi.v1.Controller/CreateVolume: REP 46438: Volume=capacity_bytes:51539607552 volume_id:\"72a4faf37c8ea10f-63c9a5bf0000041a\" volume_context:<key:\"CreationTime\" value:\"2024-11-16 06:00:52 +0000 UTC\" > volume_context:<key:\"InstallationID\" value:\"43a9dcba1c3047a8\" > volume_context:<key:\"Name\" value:\"oce-np-gen-a01-k8s-b3dc71f418\" > volume_context:<key:\"StoragePoolID\" value:\"f4d1e8fb00000001\" > volume_context:<key:\"StoragePoolName\" value:\"pd12_12c\" > volume_context:<key:\"StorageSystem\" value:\"72a4faf37c8ea10f\" > volume_context:<key:\"fsType\" value:\"\" > accessible_topology:<segments:<key:\"csi-vxflexos.dellemc.com/72a4faf37c8ea10f\" value:\"csi-vxflexos.dellemc.com\" > > , XXX_NoUnkeyedLiteral={}, XXX_sizecache=0"

It then streams the CreateVolume REQ/REP for the rest of the logs.

powerflex-controller-857877b59b-27mhm-provisioner

First occurrence I see of this volume creation

I1118 16:42:58.609697       1 controller.go:1402] "Started" PVC="openshift-mtv/prime-7a45e8f1-60f2-4bb1-a852-2df671f0647d" StorageClass="pf-npsio-03-pd12-12c"
I1118 16:42:58.609894       1 connection.go:264] "GRPC call" method="/csi.v1.Controller/CreateVolume" request="{\"accessibility_requirements\":{\"preferred\":[{\"segments\":{\"csi-vxflexos.dellemc.com/72a4faf37c8ea10f\":\"csi-vxflexos.dellemc.com\"}}],\"requisite\":[{\"segments\":{\"csi-vxflexos.dellemc.com/72a4faf37c8ea10f\":\"csi-vxflexos.dellemc.com\"}}]},\"capacity_range\":{\"required_bytes\":52428800000},\"name\":\"oce-np-gen-a01-k8s-b3dc71f418\",\"parameters\":{\"csi.storage.k8s.io/pv/name\":\"oce-np-gen-a01-k8s-b3dc71f418\",\"csi.storage.k8s.io/pvc/name\":\"prime-7a45e8f1-60f2-4bb1-a852-2df671f0647d\",\"csi.storage.k8s.io/pvc/namespace\":\"openshift-mtv\",\"storagepool\":\"pd12_12c\",\"systemID\":\"72a4faf37c8ea10f\"},\"volume_capabilities\":[{\"AccessType\":{\"Block\":{}},\"access_mode\":{\"mode\":5}}]}"
I1118 16:42:58.609948       1 event.go:389] "Event occurred" object="openshift-mtv/prime-7a45e8f1-60f2-4bb1-a852-2df671f0647d" fieldPath="" kind="PersistentVolumeClaim" apiVersion="v1" type="Normal" reason="Provisioning" message="External provisioner is provisioning volume for claim \"openshift-mtv/prime-7a45e8f1-60f2-4bb1-a852-2df671f0647d\""
I1118 16:42:58.734345       1 connection.go:270] "GRPC response" response="{\"volume\":{\"accessible_topology\":[{\"segments\":{\"csi-vxflexos.dellemc.com/72a4faf37c8ea10f\":\"csi-vxflexos.dellemc.com\"}}],\"capacity_bytes\":51539607552,\"volume_context\":{\"CreationTime\":\"2024-11-18 16:42:58 +0000 UTC\",\"InstallationID\":\"43a9dcba1c3047a8\",\"Name\":\"oce-np-gen-a01-k8s-b3dc71f418\",\"StoragePoolID\":\"f4d1e8fb00000001\",\"StoragePoolName\":\"pd12_12c\",\"StorageSystem\":\"72a4faf37c8ea10f\",\"fsType\":\"\"},\"volume_id\":\"72a4faf37c8ea10f-63c9b0c1000002b4\"}}" err=null
I1118 16:42:58.734362       1 controller.go:853] create volume rep: {CapacityBytes:51539607552 VolumeId:72a4faf37c8ea10f-63c9b0c1000002b4 VolumeContext:map[CreationTime:2024-11-18 16:42:58 +0000 UTC InstallationID:43a9dcba1c3047a8 Name:oce-np-gen-a01-k8s-b3dc71f418 StoragePoolID:f4d1e8fb00000001 StoragePoolName:pd12_12c StorageSystem:72a4faf37c8ea10f fsType:] ContentSource:<nil> AccessibleTopology:[segments:<key:"csi-vxflexos.dellemc.com/72a4faf37c8ea10f" value:"csi-vxflexos.dellemc.com" > ] XXX_NoUnkeyedLiteral:{} XXX_unrecognized:[] XXX_sizecache:0}
I1118 16:42:58.734418       1 connection.go:264] "GRPC call" method="/csi.v1.Controller/DeleteVolume" request="{\"volume_id\":\"72a4faf37c8ea10f-63c9b0c1000002b4\"}"
I1118 16:42:58.770459       1 connection.go:270] "GRPC response" response="{}" err=null
I1118 16:42:58.770499       1 controller.go:1101] "Temporary error received, adding PVC to claims in progress" claimUID="b3dc71f4-1823-46c3-bcad-6e38584d7879"
I1118 16:42:58.770510       1 controller.go:951] "Retrying syncing claim" key="b3dc71f4-1823-46c3-bcad-6e38584d7879" failures=1979
E1118 16:42:58.770523       1 controller.go:974] error syncing claim "b3dc71f4-1823-46c3-bcad-6e38584d7879": failed to provision volume with StorageClass "pf-npsio-03-pd12-12c": created volume capacity 51539607552 less than requested capacity 52428800000
I1118 16:42:58.770643       1 event.go:389] "Event occurred" object="openshift-mtv/prime-7a45e8f1-60f2-4bb1-a852-2df671f0647d" fieldPath="" kind="PersistentVolumeClaim" apiVersion="v1" type="Warning" reason="ProvisioningFailed" message="failed to provision volume with StorageClass \"pf-npsio-03-pd12-12c\": created volume capacity 51539607552 less than requested capacity 52428800000" 
`

Screenshots

No response

Additional Environment Information

No response

Steps to Reproduce

Create a pvc with storage: 52428800k

Expected Behavior

When creating a volume in PowerFlex, the expected behavior should be:
Correct Size Allocation: The system should round up to the nearest multiple of 8 GiB when the requested size is close to the cutoff. For instance:
A request for 50,000,000 KB (approximately 47.7 GiB) should round up to 56 GiB instead of rounding down to 48 GiB.
Similarly, a request for 53,690,000 KB should correctly yield 56 GiB.

CSM Driver(s)

PowerFlex CSI Driver 2.11

Installation Type

No response

Container Storage Modules Enabled

No response

Container Orchestrator

N/A

Operating System

N/A

@KshitijaKakde KshitijaKakde added needs-triage Issue requires triage. type/bug Something isn't working. This is the default label associated with a bug issue. labels Nov 25, 2024
@KshitijaKakde KshitijaKakde self-assigned this Nov 25, 2024
@csmbot
Copy link
Collaborator

csmbot commented Nov 25, 2024

@KshitijaKakde: Thank you for submitting this issue!

The issue is currently awaiting triage. Please make sure you have given us as much context as possible.

If the maintainers determine this is a relevant issue, they will remove the needs-triage label and respond appropriately.


We want your feedback! If you have any questions or suggestions regarding our contributing process/workflow, please reach out to us at [email protected].

@suryagupta4 suryagupta4 added area/csi-powerflex Issue pertains to the CSI Driver for Dell EMC PowerFlex and removed needs-triage Issue requires triage. labels Nov 25, 2024
@suryagupta4
Copy link

link: 30633

@adarsh-dell
Copy link
Contributor

Changes are in main branch. Fix will be available in CSM 1.13. Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/csi-powerflex Issue pertains to the CSI Driver for Dell EMC PowerFlex type/bug Something isn't working. This is the default label associated with a bug issue.
Projects
None yet
Development

No branches or pull requests

4 participants