Bug 1312757 - Quota limit of child project can be set bigger than limit of parent project
Summary: Quota limit of child project can be set bigger than limit of parent project
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-cinder
Version: 8.0 (Liberty)
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 9.0 (Mitaka)
Assignee: Tom Barron
QA Contact: lkuchlan
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-29 08:31 UTC by lkuchlan
Modified: 2016-05-23 13:11 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-23 13:11:53 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1548645 0 None None None 2016-02-29 08:31:00 UTC
OpenStack gerrit 282068 0 None None None 2016-04-02 14:24:51 UTC

Description lkuchlan 2016-02-29 08:31:01 UTC
Description of problem:
There is an option to set the quota limit of child project to be bigger than his parent project
It is not reasonable to enable this behaviour.
The maximum quota limit of child project should be as his parent project and not bigger than that

Version-Release number of selected component (if applicable):
python-cinderclient-1.5.0-1.el7ost.noarch
openstack-cinder-7.0.1-6.el7ost.noarch
python-cinder-7.0.1-6.el7ost.noarch

How reproducible:
100%


Steps to Reproduce:
1. Create two projects A and B, when A is the parent of B 
2. Update the quota volumes limit of B(child project) to be bigger than A(parent project) 


Actual results:
Quota limit of child project can be set bigger than limit of his parent project 


Expected results:
Quota limit of child project should not be set bigger than limit of his parent project 

Additional info:

* Creating a parent project:

[stack@instack ~]$  curl -X POST -H "x-auth-token:d8b6ef221a5c41008944030a388a1d81" -H "content-type:application/json" http://192.168.200.180:5000/v3/projects -d '{"project": {"name": "parent_project"}}' |python -mjson.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   314  100   275  100    39   6279    890 --:--:-- --:--:-- --:--:--  6395
{
    "project": {
        "description": "",
        "domain_id": "default",
        "enabled": true,
        "id": "2f2cb727036e436595309cccbf8ee713",
        "is_domain": false,
        "links": {
            "self": "http://192.168.200.180:5000/v3/projects/2f2cb727036e436595309cccbf8ee713"
        },
        "name": "parent_project",
        "parent_id": null
    }
}

* Creating a child project:

[stack@instack ~]$  curl -X POST -H "x-auth-token:d8b6ef221a5c41008944030a388a1d81" -H "content-type:application/json" http://192.168.200.180:5000/v3/projects -d '{"project": {"name": "child_project", "parent_id": "2f2cb727036e436595309cccbf8ee713"}}' |python -mjson.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   391  100   304  100    87   5676   1624 --:--:-- --:--:-- --:--:--  5735
{
    "project": {
        "description": "",
        "domain_id": "default",
        "enabled": true,
        "id": "eb91f621211b482d9f30903d9bb3ab1c",
        "is_domain": false,
        "links": {
            "self": "http://192.168.200.180:5000/v3/projects/eb91f621211b482d9f30903d9bb3ab1c"
        },
        "name": "child_project",
        "parent_id": "2f2cb727036e436595309cccbf8ee713"
    }
}


[stack@instack ~]$ cinder quota-show parent_project
+----------------------+-------+
|       Property       | Value |
+----------------------+-------+
|   backup_gigabytes   |  1000 |
|       backups        |   10  |
|      gigabytes       |  1000 |
|  gigabytes_netapp1   |   -1  |
|  gigabytes_netapp2   |   -1  |
| per_volume_gigabytes |   -1  |
|      snapshots       |   10  |
|  snapshots_netapp1   |   -1  |
|  snapshots_netapp2   |   -1  |
|       volumes        |   10  |
|   volumes_netapp1    |   -1  |
|   volumes_netapp2    |   -1  |
+----------------------+-------+

* Setting quota limit volumes of child project bigger than his parent quota limit

[stack@instack ~]$ cinder quota-update child_project --volumes 20
+----------------------+-------+
|       Property       | Value | 
+----------------------+-------+
|   backup_gigabytes   |  1000 |
|       backups        |   10  |
|      gigabytes       |  1000 |
|  gigabytes_netapp1   |   -1  |
|  gigabytes_netapp2   |   -1  |
| per_volume_gigabytes |   -1  |
|      snapshots       |   10  |
|  snapshots_netapp1   |   -1  |
|  snapshots_netapp2   |   -1  |
|       volumes        |   20  |
|   volumes_netapp1    |   -1  |
|   volumes_netapp2    |   -1  |
+----------------------+-------+

Comment 2 Sergey Gotliv 2016-03-02 10:59:50 UTC
This is something that would nice to backport to 8.0z but its not a blocker for GA.

Comment 3 Sean Cohen 2016-05-05 13:08:45 UTC
Merged upstream in Mitaka https://review.openstack.org/#/c/282068/


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