Bug 1608289 - [WhnpxDH8] Expand button should be enabled as long as the size don't exceed limit
Summary: [WhnpxDH8] Expand button should be enabled as long as the size don't exceed l...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console
Version: 3.11.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 3.11.0
Assignee: Ankush Behl
QA Contact: Yadan Pei
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-07-25 09:17 UTC by Yadan Pei
Modified: 2018-10-11 07:22 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-11 07:22:15 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:2652 0 None None None 2018-10-11 07:22:40 UTC

Description Yadan Pei 2018-07-25 09:17:21 UTC
Description of problem:
When Expand PVC with Storage quota set, temporary reaching limit error will block further updatees.

Version-Release number of selected component (if applicable):
openshift v3.11.0-0.9.0
OpenShift Web Console:    v3.11.0-0.9.0

How reproducible:
Always

Steps to Reproduce:
1.Create StorageClass with allowVolumeExpansion set to true
$ cat storageclass.yaml << EOF
apiVersion: storage.k8s.io/v1beta1
kind: StorageClass
metadata:
  name: slow
  annotations:
    storageclass.beta.kubernetes.io/is-default-class: "false"
provisioner: kubernetes.io/gce-pd
parameters:
  type: pd-ssd
allowVolumeExpansion: true
EOF
$ oc create -f storageclass.yaml
2.Create ResourceQuota with pvc number limit to 1 and storage request as 1Gi
$ oc create -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/storage/misc/quota-pvc-storage.yaml
3.Create PVC using storageclass/slow and set size to 0.5Gi on web console or CLI
4.Wait PVC becomes bound, go to PVC page, Actions -> Expand PVC, set Capacity to  a value great than limit 1Gi, eg 2GiB
5.Clear the value and set to 0.9GiB

Actual results:
3.After create one PVC, Storage quota limit will reach
4.There will be a error message:Storage quota will be exceeded and Expand button disabled
5. Expand button could not be enabled again, no matter what value we set

Expected results:
5. The intermediate reaching limit error should not block further setting, Expand button should be enabled as long as the size don't exceed the limit

Additional info:

Comment 2 Yadan Pei 2018-07-27 01:44:03 UTC
Hi Ankush,

Where does your OCP instance live, EC2 or other cloud platform? The gce-pd provisioner in my bug only applies to GCE instances, apologies.

Comment 3 Ankush Behl 2018-07-30 19:58:10 UTC
@yapei Thanks for providing the setup.


So when we request a pvc of 0.5 GiB and quota is set to 1 GiB. The requested value is 512 MiB and the Bound capacity is 1 GiB. So even if the I unable the button on 513 MiB and above till 1024 MiB. The end user will be able to click the button requested capacity but the bound value will still remain the same.

Fix:

We can compare the large value between the requested capacity and bound value and show that in the textbox and apply validation on top of it.

Example:
If the quota is set to 1 GiB, requested capacity is 512 MiB and bound value is 1 GiB then will should show 1 GiB in the text box with button disabled. If user tries to edit the value to lower number(0.9 GiB) it will give validation("the requested capacity must not be less then current capacity") and if we go above 1.1 GiB then will say("storage Quota will be exceeded").

Does that makes sense?

Comment 4 Yadan Pei 2018-08-01 08:38:51 UTC
> If the quota is set to 1 GiB, requested capacity is 512 MiB and bound value is 1 GiB then will should show 1 GiB in the text box with button disabled

I only have different opinion on above sentence, If the quota is set to 1GiB, and requested capacity is 512MiB, no matter what bound value is, we still need do validation on requested capacity & quota, that means: 

If the quota is set to 1GiB, requested capacity is 512 MiB, when user open Expand PVC dialog, the value should show 512MiB not 1GiB or other Capacity value, then If user tries to edit the value to lower number(eg 500MiB) it will give validation("the requested capacity must not be less then current capacity") and if we go above 1.1 GiB then will say("storage Quota will be exceeded").


Since Expand PVC only changes pvc.spec.resources.requests.storage NOT pvc.status.capacity.storage.

Otherwise it looks good to me.

Comment 5 Yadan Pei 2018-08-01 09:39:52 UTC
Also I found some regression errors brought by https://github.com/openshift/origin-web-console/pull/3040, I didn't open bugs for regression issue, I would like to wait this bug to be fixed then to test the features again.

Thank you!

Comment 6 Yadan Pei 2018-08-01 09:40:25 UTC
Or let me know if need me open a separate bug for regression error

Comment 7 Yadan Pei 2018-08-01 11:17:56 UTC
bug 1610739 is created for regression error, please help check thanks

Comment 9 Yadan Pei 2018-08-13 06:11:04 UTC
Scenario 1:
1. Create project quota limit pvc number to 1 and storage request to 2GiB
# cat quota.yaml 
apiVersion: v1
kind: ResourceQuota
metadata:
  name: quota-pvc-storage
spec:
  hard:
    persistentvolumeclaims: "1"
    requests.storage: "2Gi"
2. Create storageclass and PVC with capacity request to 300MiB
3. When PVC becomes bound, Expand PVC
4. Set new capacity to a value larger then 300MiB, eg 400MiB, 1GiB, but Expand button are always disabled, user is unable to expand the pvc size
5. Use CLI to edit PVC request capacity to 400MiB, it could succeed.(compare with web behavior)

Scenario 2:
1. Create project quota only limit storage request to 2GiB
apiVersion: v1
kind: ResourceQuota
metadata:
  name: quota-pvc-storage
spec:
  hard:
    requests.storage: "2Gi"
2. Create storageclass and PVC with capacity request to 300MiB
3. When PVC becomes bound, Expand PVC
4. Set new capacity to a larger value, eg 400MiB, 1GiB, Expand will succeed, when set value larger than 2GiB, it will give error "Storage quota will be exceeded" and Expand button is disabled.

Scenario 2 works well and as expected. But in Scenario 1, PVC number reaching Quota limit blocks web expanding PVC is unexpected.

Comment 10 openshift-github-bot 2018-08-18 17:55:22 UTC
Commits pushed to master at https://github.com/openshift/origin-web-console

https://github.com/openshift/origin-web-console/commit/bb612504f78b65016ed9def6385f4d8923dfe901
[Bug 1608289] Expand button should be enabled as long as the size don't exceed limit

Signed-off-by: Ankush Behl <cloudbehl>

https://github.com/openshift/origin-web-console/commit/a92e441297b3189366e85b4d082b621c717662fe
Merge pull request #3062 from cloudbehl/bug#1608289

[Bug 1608289] Expand button should be enabled as long as the size don…

Comment 12 Yadan Pei 2018-08-28 01:35:39 UTC
Fixed merged in OpenShift Web Console:    v3.11.0-0.24.0 

Scenario 1 in comment 9 works well now

Comment 14 errata-xmlrpc 2018-10-11 07:22:15 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:2652


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