← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1841128] [NEW] Smaller project quota than user quota value can be set

 

Public bug reported:

Description
===========
Smaller project quota than user quota value can be set
This problems only happens when project quota value is unlimited with DbQuotaDriver driver.
In the quota calculation steps, _process_quotas() and get_settable_quotas() are called to calculate modification of quota. In these methods, "ramains" which indicates available amount of resource for user is set to wrong value when the project quota value is unlimited. As a result, this problem happens.


Steps to reproduce
==================
$ openstack user create test --domain default --password password
…
| id                  | a22c08f37f34447d81f597144b2b8831 |
…
$ openstack project create test-project --domain default --property=user_id=$(openstack user show test -f value -c id)
…
| id          | c9a3b873f10947fea01c833e25884b3e |
…
$ openstack role add --user test --project test-project member

(a) Confirm instances of project and user quota. Initial values are both of 10.
$ nova quota-show --tenant c9a3b873f10947fea01c833e25884b3e | grep instances
| instances            | 10    |
$ nova quota-show --user a22c08f37f34447d81f597144b2b8831 --tenant c9a3b873f10947fea01c833e25884b3e | grep instances
| instances            | 10    |

(b) Update project quota to unlimited
$ nova quota-update --instances -1 c9a3b873f10947fea01c833e25884b3e; nova quota-show --tenant c9a3b873f10947fea01c833e25884b3e | grep instances
| instances            | -1    |
(c) Update user quota to 20.
$ nova quota-update --user a22c08f37f34447d81f597144b2b8831 --instances 20 c9a3b873f10947fea01c833e25884b3e; nova quota-show --user a22c08f37f34447d81f597144b2b8831 --tenant c9a3b873f10947fea01c833e25884b3e | grep instances
| instances            | 20    |

(d) Update project quota to 10 which is smaller than user quota.
$ nova quota-update --instances 10 c9a3b873f10947fea01c833e25884b3e; nova quota-show --tenant c9a3b873f10947fea01c833e25884b3e | grep instances
| instances            | 10    |

Normally, project quota(=10) can not be set smaller value than user
quota(=20), however this update can be succeeded when previous project
quota value is unlimited.


Expected result
===============
Failed to update project quota value when the value is smaller than user's one.

Actual result
=============
Quota update was succeeded even though the project value is smaller than user's one.

Environment
===========
1. Exact version of OpenStack you are running. See the following
Devstack environment with latest master branch
$ git log -1
commit 0c861c29c12c2092c95ac45988ce2793e4aea20f
Merge: 170fd5a 791fa59
Author: Zuul <zuul@xxxxxxxxxxxxxxxxxx>
Date:   Thu Aug 22 23:49:25 2019 +0000

    Merge "Handle websockify v0.9.0 in console proxy"

2. Which hypervisor did you use?
  KVM, cent OS7.6
 $uname -a
 Linux devstack 3.10.0-957.27.2.el7.x86_64 #1 SMP Mon Jul 29 17:46:05 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

** Affects: nova
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1841128

Title:
  Smaller project quota than user quota value can be set

Status in OpenStack Compute (nova):
  New

Bug description:
  Description
  ===========
  Smaller project quota than user quota value can be set
  This problems only happens when project quota value is unlimited with DbQuotaDriver driver.
  In the quota calculation steps, _process_quotas() and get_settable_quotas() are called to calculate modification of quota. In these methods, "ramains" which indicates available amount of resource for user is set to wrong value when the project quota value is unlimited. As a result, this problem happens.

  
  Steps to reproduce
  ==================
  $ openstack user create test --domain default --password password
  …
  | id                  | a22c08f37f34447d81f597144b2b8831 |
  …
  $ openstack project create test-project --domain default --property=user_id=$(openstack user show test -f value -c id)
  …
  | id          | c9a3b873f10947fea01c833e25884b3e |
  …
  $ openstack role add --user test --project test-project member

  (a) Confirm instances of project and user quota. Initial values are both of 10.
  $ nova quota-show --tenant c9a3b873f10947fea01c833e25884b3e | grep instances
  | instances            | 10    |
  $ nova quota-show --user a22c08f37f34447d81f597144b2b8831 --tenant c9a3b873f10947fea01c833e25884b3e | grep instances
  | instances            | 10    |

  (b) Update project quota to unlimited
  $ nova quota-update --instances -1 c9a3b873f10947fea01c833e25884b3e; nova quota-show --tenant c9a3b873f10947fea01c833e25884b3e | grep instances
  | instances            | -1    |
  (c) Update user quota to 20.
  $ nova quota-update --user a22c08f37f34447d81f597144b2b8831 --instances 20 c9a3b873f10947fea01c833e25884b3e; nova quota-show --user a22c08f37f34447d81f597144b2b8831 --tenant c9a3b873f10947fea01c833e25884b3e | grep instances
  | instances            | 20    |

  (d) Update project quota to 10 which is smaller than user quota.
  $ nova quota-update --instances 10 c9a3b873f10947fea01c833e25884b3e; nova quota-show --tenant c9a3b873f10947fea01c833e25884b3e | grep instances
  | instances            | 10    |

  Normally, project quota(=10) can not be set smaller value than user
  quota(=20), however this update can be succeeded when previous project
  quota value is unlimited.

  
  Expected result
  ===============
  Failed to update project quota value when the value is smaller than user's one.

  Actual result
  =============
  Quota update was succeeded even though the project value is smaller than user's one.

  Environment
  ===========
  1. Exact version of OpenStack you are running. See the following
  Devstack environment with latest master branch
  $ git log -1
  commit 0c861c29c12c2092c95ac45988ce2793e4aea20f
  Merge: 170fd5a 791fa59
  Author: Zuul <zuul@xxxxxxxxxxxxxxxxxx>
  Date:   Thu Aug 22 23:49:25 2019 +0000

      Merge "Handle websockify v0.9.0 in console proxy"

  2. Which hypervisor did you use?
    KVM, cent OS7.6
   $uname -a
   Linux devstack 3.10.0-957.27.2.el7.x86_64 #1 SMP Mon Jul 29 17:46:05 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1841128/+subscriptions