Bug 1410291 - "Deprecated: Default quota for resource" is output when executing cinder quota-defaults admin
Summary: "Deprecated: Default quota for resource" is output when executing cinder quot...
Keywords:
Status: CLOSED INSUFFICIENT_DATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-cinder
Version: 8.0 (Liberty)
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 8.0 (Liberty)
Assignee: Eric Harney
QA Contact: Tzach Shefi
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-05 02:08 UTC by Chen
Modified: 2020-08-13 08:47 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-11-22 14:37:06 UTC
Target Upstream Version:
Embargoed:
tshefi: automate_bug-


Attachments (Terms of Use)

Description Chen 2017-01-05 02:08:58 UTC
Description of problem:

"Deprecated: Default quota for resource" is output when executing cinder quota-defaults admin in api.log

2016-12-30 05:42:34.756 30384 WARNING cinder.quota [req-223a20d0-cf69-4cec-86df-0039c4e562bb 5e1991ffc63a4c04855e012e2ea909b9 4784468a061e43d4a6dfa01298c5d12c - - -] Deprecated: Default quota for resource: backups is set by the default quota flag: quota_backups, it is now deprecated. Please use the default quota class for default quota.


Version-Release number of selected component (if applicable):

OSP8 deployed by Director 8
OSP8 deployed Packstack

How reproducible:

100%

Steps to Reproduce:
1.
2.
3.

Actual results:

We can see not all the quotas are in default class for example, "backups" quota.

MariaDB [cinder]> select class_name,resource,hard_limit from quota_classes;
+------------+-------------------+------------+
| class_name | resource          | hard_limit |
+------------+-------------------+------------+
| default    | volumes           |         10 |
| default    | snapshots         |         10 |
| default    | gigabytes         |       1000 |
| default    | consistencygroups |         10 |
+------------+-------------------+------------+

For other deployment tool, all the quotas are added in default class.

https://bugs.launchpad.net/cinder/+bug/1435807

Expected results:

No deprecated messages should be output.

Additional info:

Comment 1 Sean Cohen 2017-01-25 14:43:32 UTC
Closing upstream (Invalid)

Comment 2 Chen 2017-01-25 23:21:46 UTC
Sorry for reopening the bug.

Would you please explain more about why you close the bug ? The upstream bug is not the solution for our product as they are using different deployment tool.

Best Regards,
Chen

Comment 3 Elise Gafford 2017-02-01 14:22:21 UTC
Please triage for upcoming releases.

Comment 4 Chen 2017-02-06 01:37:50 UTC
Hi,

This issue can be 100% reproduced. backups and gigabytes_backups can not be added to database using cinder command line. 

Best Regards,
Chen

Comment 5 Martin Schuppert 2017-02-08 09:26:35 UTC
With this change to the cinder client we can set the quota-class for backups/backup-gigabytes:

# diff -u /usr/lib/python2.7/site-packages/cinderclient/v2/shell.py.org /usr/lib/python2.7/site-packages/cinderclient/v2/shell.py
--- /usr/lib/python2.7/site-packages/cinderclient/v2/shell.py.org       2017-02-08 03:37:51.185121349 -0500
+++ /usr/lib/python2.7/site-packages/cinderclient/v2/shell.py   2017-02-08 03:38:51.847084920 -0500
@@ -1139,6 +1139,14 @@
            metavar='<volume_type_name>',
            default=None,
            help='Volume type. Default=None.')
+@utils.arg('--backups',
+           metavar='<backups>',
+           type=int, default=None,
+           help='The new "backups" quota value. Default=None.')
+@utils.arg('--backup-gigabytes',
+           metavar='<backup_gigabytes>',
+           type=int, default=None,
+           help='The new "backup_gigabytes" quota value. Default=None.')
 @utils.service_type('volumev2')
 def do_quota_class_update(cs, args):
     """Updates quotas for a quota class."""

# mysql -u root cinder -e "select * from quota_classes;"
+---------------------+---------------------+------------+---------+----+------------+----------------------+------------+
| created_at          | updated_at          | deleted_at | deleted | id | class_name | resource             | hard_limit |
+---------------------+---------------------+------------+---------+----+------------+----------------------+------------+
| 2016-11-17 05:11:28 | 2017-02-08 08:56:00 | NULL       |       0 |  1 | default    | volumes              |         -1 |
| 2016-11-17 05:11:28 | 2017-02-08 08:55:52 | NULL       |       0 |  2 | default    | snapshots            |         -1 |
| 2016-11-17 05:11:28 | 2017-02-08 08:56:07 | NULL       |       0 |  3 | default    | gigabytes            |         -1 |
| 2016-11-17 05:11:29 | NULL                | NULL       |       0 |  4 | default    | consistencygroups    |         10 |
| 2016-11-17 10:11:32 | NULL                | NULL       |       0 |  5 | default    | per_volume_gigabytes |         -1 |
| 2017-02-08 08:36:06 | 2017-02-08 08:45:10 | NULL       |       0 |  6 | default    | backups              |         20 |
| 2017-02-08 08:46:00 | 2017-02-08 09:13:36 | NULL       |       0 |  7 | default    | backup_gigabytes     |       1000 |
+---------------------+---------------------+------------+---------+----+------------+----------------------+------------+

Comment 6 Masaki Furuta ( RH ) 2017-02-24 15:23:01 UTC
(In reply to Martin Schuppert from comment #5)

This should be:

- Change I1fceeb9f: Support Volume Backup Quota | review.openstack Code Review
  https://review.openstack.org/#/c/111730/

~~~
Change 111730 - Merged

Python-cinderclient support update volume backup quota.

Cinder server side commit for this feature was:
https://review.openstack.org/#/c/111460/

blueprint volume-backup-quota

Change-Id: I1fceeb9fc0eb92370e249c46749a61e4b11420b0
~~~

Comment 8 Pranali Deore 2017-04-03 06:08:00 UTC
This bug is marked as invalid in Upstream because config options for quotas has been deprecated and without config option it's almost being difficult to add the missing values in DB.


For more information please refer the below LP bugs,
https://bugs.launchpad.net/cinder/+bug/1435807
https://bugs.launchpad.net/cinder/+bug/1465393

Comment 12 Chen 2017-05-08 09:55:38 UTC
Hi Furuta san,

Thank you for your help.

If we can backport I1fceeb9f to OSP8 then we can use cinder quota-class-update to add backup_* quotas into the DB. But currently we can only add volumes, snapshots and gigabytes. Since you mentioned in OSP9 we got --backup interface, then shall we open another bug to backport this to OSP8 ?

Besides, I'm not sure whether there would be any side effect if we turn off use_default_quota_class. So if use_default_quota_class=false, the quota values will be read from config file instead of DB am I right ?

Best Regards,
Chen

Comment 14 Pranali Deore 2017-05-11 06:26:34 UTC
Hi Furuta san,

As per my understanding, there should not be any negative side effects if we disable the use_default_quota_class because the quota_classes values in DB are also getting set on the basis of default values set in the config file[1].

[1]: https://github.com/openstack/cinder/blob/38aae0602b124742095044e34c7c9c61df361fab/cinder/db/sqlalchemy/migrate_repo/versions/073_cinder_init.py#L571

And if use_default_quota_class=false, same default values from the config file are getting used and if those are not correct the admin can update the desired values in the config file or update the missing entries in the quota_classes table(using mysql command) by keeping use_default_quota_class=true.

Actually, there was only solution [2] by adding the missing rows in the quota_classes table in DB but it also needs config options to set the quota values which was rejected in upstream.

[2]: https://review.openstack.org/#/c/174941/4


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