Smaller project quota value than user quota value can be set
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
In Progress
|
Undecided
|
Mitsuhiro Tanino |
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_
Steps to reproduce
==================
$ openstack user create test --domain default --password password
…
| id | a22c08f37f34447
…
$ openstack project create test-project --domain default --property=
…
| id | c9a3b873f10947f
…
$ 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 c9a3b873f10947f
| instances | 10 |
$ nova quota-show --user a22c08f37f34447
| instances | 10 |
(b) Update project quota to unlimited
$ nova quota-update --instances -1 c9a3b873f10947f
| instances | -1 |
(c) Update user quota to 20.
$ nova quota-update --user a22c08f37f34447
| instances | 20 |
(d) Update project quota to 10 which is smaller than user quota.
$ nova quota-update --instances 10 c9a3b873f10947f
| 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 0c861c29c12c209
Merge: 170fd5a 791fa59
Author: Zuul <email address hidden>
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-
summary: |
- Smaller project quota than user quota value can be set + Smaller project quota value than user quota value can be set |
Changed in nova: | |
assignee: | nobody → Mitsuhiro Tanino (mitsuhiro-tanino) |
tags: | added: quotas |
Fix proposed to branch: master /review. opendev. org/678183
Review: https:/