On 1/19/2016 6:32 AM, Zhenyu Zheng wrote:
This is a bug, as tenant and user is maintained by keystone and quota are stored in nova db, so it has the cleanup problems. On Tue, Jan 19, 2016 at 8:12 PM, jialiang_song517 <[email protected] <mailto:[email protected]>> wrote: __ __ Hi guys, I am working on bug #1449498, <the command “nova quota-show” Should not display the quota of a user has been deleted>. Reproduction steps w/ devstack and Liberty: 1) create a tenant bug_test 2) create a user test1 in tenant bug_test 3) update the quota instances of test1 as 5 (the default instances value is 10) 4) delete user test1 5) query the quota information for user test1 in tenant bug_test in step5, the expected result should indicate user test1 doesn't exist, while nova returned the deleted user test1's quota infomation with instances as 5. After investigation, it is found that quota_get_all_by_project_and_user() and quota_get_all_by_project() will invoke model_query(context, model, args=None, session=None, use_slave=False, *read_deleted=None*, project_only=False) to query the quota information specified by project or project & user. While the model_query() doesnot work as expected, that is, in case a user was deleted, even *read_deleted *is set as *no*, the quota information associated with the deleted user will also be returned. I am not sure if this is a design behavior or this could be problem in oslo_db? Could you give some instruction on the further direction? Thanks. Any other comments are welcome. Best Regards, Jialiang ------------------------------------------------------------------------ jialiang_song517 __ __________________________________________________________________________ OpenStack Development Mailing List (not for usage questions) Unsubscribe: [email protected]?subject:unsubscribe <http://[email protected]?subject:unsubscribe> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev __________________________________________________________________________ OpenStack Development Mailing List (not for usage questions) Unsubscribe: [email protected]?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
As noted, the quota information is in the nova database, the user/project information is in keystone. So even if you delete the user in keystone, that id is mapped into the nova database and you can do lookups on the quotas since the quota REST API isn't checking with keystone to see if the user/project actually exists anymore.
This was already discussed in some detail in another thread here: http://lists.openstack.org/pipermail/openstack-dev/2015-December/081753.html -- Thanks, Matt Riedemann __________________________________________________________________________ OpenStack Development Mailing List (not for usage questions) Unsubscribe: [email protected]?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
