Bug 1532149 - Expand PVC failed message need to be more clear
Summary: Expand PVC failed message need to be more clear
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Storage
Version: 3.9.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 3.9.0
Assignee: Hemant Kumar
QA Contact: Qin Ping
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-01-08 07:36 UTC by Qin Ping
Modified: 2018-03-28 14:17 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-03-28 14:17:25 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0489 0 None None None 2018-03-28 14:17:57 UTC

Description Qin Ping 2018-01-08 07:36:40 UTC
Description of problem:
When expanding a PVC failed, it's conditions and event message need to be more clear.

Version-Release number of selected component (if applicable):
oc v3.9.0-0.15.0
openshift v3.9.0-0.15.0
kubernetes v1.9.0-beta1

How reproducible:
Always

Steps to Reproduce:
1. Enable feature gates: ExpandPersistentVolumes and admission controller: PersistentVolumeClaimResize
2. Create a PV and static provisioning PVC.
3. Expand PVC size from 10G to 20G
4. Using oc get pvc -o yaml and oc describe pvc to check PVC expand result.

Actual results:
oc get pvc -o yaml output:
 conditions:
 - lastProbeTime: null
   lastTransitionTime: 2018-01-08T06:19:10Z
   status: "True"
   type: Resizing

oc describe pvc output:
 Events:
  Type     Reason              Age                From           Message
  ----     ------              ----               ----           -------
  Warning  VolumeResizeFailed  2m (x10 over 10m)  volume_expand  Volume has no storage class


Expected results:
oc get pvc -o yaml output:
 conditions:
 - lastProbeTime: null
   lastTransitionTime: 2018-01-08T06:19:10Z
   status: "True"
   type: ResizeFailed

oc describe pvc output:
 Events:
  Type     Reason              Age                From           Message
  ----     ------              ----               ----           -------
  Warning  VolumeResizeFailed  2m (x10 over 10m)  volume_expand  Only dynamically provisioned volumes will be allowed to be expanded.



Additional info:
# cat pv.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
  name: pvc-static
spec:
  accessModes:
  - ReadWriteOnce
  capacity:
    storage: 10G
  glusterfs:
    endpoints: glusterfs-cluster
    path: testvol
  persistentVolumeReclaimPolicy: Delete

# cat pvc.json
{
    "apiVersion": "v1",
    "kind": "PersistentVolumeClaim",
    "metadata": {
        "name": "glusterc"
    },
    "spec": {
        "accessModes": [ "ReadWriteOnce" ],
        "resources": {
            "requests": {
                "storage": "5Gi"
            }
        }
    }
}

# oc describe pvc
Name:          glusterc
Namespace:     mytest
StorageClass:  
Status:        Bound
Volume:        pvc-static
Labels:        <none>
Annotations:   pv.kubernetes.io/bind-completed=yes
               pv.kubernetes.io/bound-by-controller=yes
Finalizers:    []
Capacity:      10G
Access Modes:  RWO
Events:
  Type     Reason              Age                From           Message
  ----     ------              ----               ----           -------
  Warning  VolumeResizeFailed  2m (x10 over 10m)  volume_expand  Volume has no storage class

# oc get pvc -o yaml
apiVersion: v1
items:
- apiVersion: v1
  kind: PersistentVolumeClaim
  metadata:
    annotations:
      pv.kubernetes.io/bind-completed: "yes"
      pv.kubernetes.io/bound-by-controller: "yes"
    creationTimestamp: 2018-01-08T06:07:46Z
    name: glusterc
    namespace: mytest
    resourceVersion: "26253"
    selfLink: /api/v1/namespaces/mytest/persistentvolumeclaims/glusterc
    uid: 3f6c5e0d-f43a-11e7-94f8-fa163e21b9b0
  spec:
    accessModes:
    - ReadWriteOnce
    resources:
      requests:
        storage: 20Gi
    volumeName: pvc-static
  status:
    accessModes:
    - ReadWriteOnce
    capacity:
      storage: 10G
    conditions:
    - lastProbeTime: null
      lastTransitionTime: 2018-01-08T06:19:10Z
      status: "True"
      type: Resizing
    phase: Bound
kind: List
metadata:
  resourceVersion: ""
  selfLink: ""

Comment 1 Hemant Kumar 2018-01-16 23:38:42 UTC
This is similar to the bug that - admission controller which is supposed to prevent this kind of errors is somehow not working as intended in Openshift. I need to double check.

Comment 2 Hemant Kumar 2018-01-17 20:38:03 UTC
The underlying problem was - resize admission plugin was not getting enabled because it needs additional code change in openshift to work.

fixed via : https://github.com/openshift/origin/pull/18146

After this - any PVC that does not have correct storageclass will throw:

"error: persistentvolumeclaims "resize" could not be patched: persistentvolumeclaims "resize" is forbidden: only dynamically provisioned pvc can be resized and the storageclass that provisions the pvc must support resize"

Comment 4 Qin Ping 2018-01-25 03:34:45 UTC
This bug is targeted to 3.9, while it was attached to 3.7/3.6/3.5 errata, move correct it.

Comment 8 Qin Ping 2018-01-29 05:25:22 UTC
Verified on OCP version: v3.9.0-0.31.0

Comment 11 errata-xmlrpc 2018-03-28 14:17:25 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:0489


Note You need to log in before you can comment on or make changes to this bug.