Skip to content

PVC status should show false for resizing wrong values  #1228

Open
@saurabhwani5

Description

@saurabhwani5

Describe the bug

When we expand PVC size to more than expected values then PVC status should show to false to resizing

  conditions:
  - lastProbeTime: null
    lastTransitionTime: "2024-10-03T06:53:14Z"
    status: "True"
    type: Resizing
  phase: Bound

How to Reproduce?

Please list the steps to help development teams reproduce the behavior

  1. Install CSI with following images
Operator : quay.io/ibm-spectrum-scale-dev/ibm-spectrum-scale-csi-operator@sha256:1e579401a52f4ae12eff2b0b61b83af12d37d354a80d2ee6b83b9ac6b7cc01e2
Driver : quay.io/badri_pathak/ibm-spectrum-scale-csi-driver:pvc_max_size_v1
  1. Create PVC as following :
[root@ocppr1226]# cat pvc.yaml
apiVersion: v1
kind: Pod
metadata:
  name: csi-scale-fsetdemo-pod-2
  labels:
    app: nginx
spec:
  containers:
   - name: web-server
     image: nginx:1.22.0
     volumeMounts:
       - name: mypvc
         mountPath: /usr/share/nginx/html/scale
     ports:
     - containerPort: 80
  volumes:
   - name: mypvc
     `persistentVolumeClaim:`
       claimName: scale-advance-pvc-1
       readOnly: false

---

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: scale-advance-pvc-1
spec:
  accessModes:
  - ReadWriteMany
  resources:
    requests:
      storage: 1Gi
  storageClassName: ibm-spectrum-scale-csi-advance

---

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
   name: ibm-spectrum-scale-csi-advance
provisioner: spectrumscale.csi.ibm.com
parameters:
   volBackendFs: "fs0"
   version: "2"
reclaimPolicy: Delete
allowVolumeExpansion: true
[root@ocppr1226]# oc apply -f pvc.yaml
pod/csi-scale-fsetdemo-pod-2 created
persistentvolumeclaim/scale-advance-pvc-1 created
storageclass.storage.k8s.io/ibm-spectrum-scale-csi-advance created
[root@ocppr1226]# oc get pods
NAME                                                  READY   STATUS    RESTARTS   AGE
csi-scale-fsetdemo-pod-2                              1/1     Running   0          62s
ibm-spectrum-scale-csi-attacher-5d58777ffc-75c6d      1/1     Running   0          34m
ibm-spectrum-scale-csi-attacher-5d58777ffc-d4mpl      1/1     Running   0          34m
ibm-spectrum-scale-csi-cfmnq                          3/3     Running   0          34m
ibm-spectrum-scale-csi-operator-75f546c65c-q8vt2      1/1     Running   0          35m
ibm-spectrum-scale-csi-provisioner-7f698474dd-xmhjf   1/1     Running   0          34m
ibm-spectrum-scale-csi-resizer-67d499dc54-h892q       1/1     Running   0          34m
ibm-spectrum-scale-csi-snapshotter-b9b67b997-5fw2t    1/1     Running   0          34m
ibm-spectrum-scale-csi-vzvt8                          3/3     Running   0          34m
ibm-spectrum-scale-csi-z5sl5                          3/3     Running   0          34m
[root@ocppr1226]# oc get pvc
NAME                  STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS                     VOLUMEATTRIBUTESCLASS   AGE
scale-advance-pvc-1   Bound    pvc-0b6af8a8-39d2-43e1-9535-465548222926   1Gi        RWX            ibm-spectrum-scale-csi-advance   <unset>                 63s
[root@ocppr1226]#
  1. Increase PVC size to 9223372036854775807Gi:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: scale-advance-pvc-1
spec:
  accessModes:
  - ReadWriteMany
  resources:
    requests:
      storage: 9223372036854775807Gi
  storageClassName: ibm-spectrum-scale-csi-advance
[root@ocppr1226]# oc apply -f pvc.yaml
pod/csi-scale-fsetdemo-pod-2 configured
persistentvolumeclaim/scale-advance-pvc-1 configured
storageclass.storage.k8s.io/ibm-spectrum-scale-csi-advance unchanged
  1. Check PVC description :
[root@ocppr1226]# oc apply -f pvc.yaml
pod/csi-scale-fsetdemo-pod-2 configured
persistentvolumeclaim/scale-advance-pvc-1 configured
storageclass.storage.k8s.io/ibm-spectrum-scale-csi-advance unchanged
[root@ocppr1226]# oc describe pvc
Name:          scale-advance-pvc-1
Namespace:     ibm-spectrum-scale-csi
StorageClass:  ibm-spectrum-scale-csi-advance
Status:        Bound
Volume:        pvc-0b6af8a8-39d2-43e1-9535-465548222926
Labels:        <none>
Annotations:   pv.kubernetes.io/bind-completed: yes
               pv.kubernetes.io/bound-by-controller: yes
               volume.beta.kubernetes.io/storage-provisioner: spectrumscale.csi.ibm.com
               volume.kubernetes.io/storage-provisioner: spectrumscale.csi.ibm.com
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:      1Gi
Access Modes:  RWX
VolumeMode:    Filesystem
Used By:       csi-scale-fsetdemo-pod-2
Conditions:
  Type       Status  LastProbeTime                     LastTransitionTime                Reason  Message
  ----       ------  -----------------                 ------------------                ------  -------
  Resizing   True    Mon, 01 Jan 0001 00:00:00 +0000   Wed, 02 Oct 2024 23:52:58 -0700
Events:
  Type     Reason                 Age                 From                                                                                                                Message
  ----     ------                 ----                ----                                                                                                                -------
  Warning  ProvisioningFailed     2m6s                persistentvolume-controller                                                                                         storageclass.storage.k8s.io "ibm-spectrum-scale-csi-advance" not found
  Normal   Provisioning           119s                spectrumscale.csi.ibm.com_ibm-spectrum-scale-csi-provisioner-7f698474dd-xmhjf_e8c67c0b-ed68-46ab-b105-d4f95529af26  External provisioner is provisioning volume for claim "ibm-spectrum-scale-csi/scale-advance-pvc-1"
  Normal   ExternalProvisioning   97s (x3 over 119s)  persistentvolume-controller                                                                                         Waiting for a volume to be created either by the external provisioner 'spectrumscale.csi.ibm.com' or manually by the system administrator. If volume creation is delayed, please verify that the provisioner is running and correctly registered.
  Normal   ProvisioningSucceeded  90s                 spectrumscale.csi.ibm.com_ibm-spectrum-scale-csi-provisioner-7f698474dd-xmhjf_e8c67c0b-ed68-46ab-b105-d4f95529af26  Successfully provisioned volume pvc-0b6af8a8-39d2-43e1-9535-465548222926
  Warning  ExternalExpanding      26s                 volume_expand                                                                                                       waiting for an external controller to expand this PVC
  Normal   Resizing               13s (x6 over 26s)   external-resizer spectrumscale.csi.ibm.com                                                                          External resizer is resizing volume pvc-0b6af8a8-39d2-43e1-9535-465548222926
  Warning  VolumeResizeFailed     13s (x6 over 26s)   external-resizer spectrumscale.csi.ibm.com                                                                          resize volume "pvc-0b6af8a8-39d2-43e1-9535-465548222926" by resizer "spectrumscale.csi.ibm.com" failed: rpc error: code = Internal desc = ControllerExpandVolume - Volume expansion volID:[1;1;2815005349453165873;614A0B0A:66FAF656;933d520f-c34b-4f75-a75a-3777f6c4551b-ibm-spectrum-scale-csi;pvc-0b6af8a8-39d2-43e1-9535-465548222926;/mnt/fs0/933d520f-c34b-4f75-a75a-3777f6c4551b-ibm-spectrum-scale-csi/pvc-0b6af8a8-39d2-43e1-9535-465548222926] with  requested volSize:[9223372036854775807] is not allowed beyond max PV size:[1023999368203599872]
[root@ocppr1226]#
  1. Check PVC status :
[root@ocppr1226]# oc get pvc scale-advance-pvc-1 -oyaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"v1","kind":"PersistentVolumeClaim","metadata":{"annotations":{},"name":"scale-advance-pvc-1","namespace":"ibm-spectrum-scale-csi"},"spec":{"accessModes":["ReadWriteMany"],"resources":{"requests":{"storage":"9223372036854775807Gi"}},"storageClassName":"ibm-spectrum-scale-csi-advance"}}
    pv.kubernetes.io/bind-completed: "yes"
    pv.kubernetes.io/bound-by-controller: "yes"
    volume.beta.kubernetes.io/storage-provisioner: spectrumscale.csi.ibm.com
    volume.kubernetes.io/storage-provisioner: spectrumscale.csi.ibm.com
  creationTimestamp: "2024-10-03T06:51:05Z"
  finalizers:
  - kubernetes.io/pvc-protection
  name: scale-advance-pvc-1
  namespace: ibm-spectrum-scale-csi
  resourceVersion: "1426612"
  uid: 0b6af8a8-39d2-43e1-9535-465548222926
spec:
  accessModes:
  - ReadWriteMany
  resources:
    requests:
      storage: "9223372036854775807"
  storageClassName: ibm-spectrum-scale-csi-advance
  volumeMode: Filesystem
  volumeName: pvc-0b6af8a8-39d2-43e1-9535-465548222926
status:
  accessModes:
  - ReadWriteMany
  capacity:
    storage: 1Gi
  conditions:
  - lastProbeTime: null
    lastTransitionTime: "2024-10-03T06:53:14Z"
    status: "True"
    type: Resizing
  phase: Bound

Expected behavior

PVC status should show false to resizing value when it is invalid value

Data Collection and Debugging

[root@ocp D.1228]# pwd
/scale-csi/D.1228
[root@ocp D.1228]# ls
mustgather.tar.gz

Metadata

Metadata

Assignees

Labels

Customer Impact: Localized high impact(3) Reduction of function. Significant impact to workload.Customer Probability: Low(1) Issue only occurs during failure condition - disk, server, network, test assert, ...Found In: 2.13.0For Bug issues to identify what release level issue was found in 2.13.0Severity: 2Indicates that the issue is critical and must be addressed before milestone.Type: BugIndicates issue is an undesired behavior, usually caused by code error.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions