This is invalid for Rocky, so marking the Rocky series version of the bug as Invalid.
** Also affects: nova/queens Importance: Undecided Status: New ** Also affects: nova/ocata Importance: Undecided Status: New ** Also affects: nova/pike Importance: Undecided Status: New ** Changed in: nova Status: In Progress => Invalid ** Changed in: nova/queens Assignee: (unassigned) => huanhongda (hongda) ** Changed in: nova/queens Importance: Undecided => Medium ** Changed in: nova/queens Status: New => In Progress ** Changed in: nova/pike Importance: Undecided => Medium ** Changed in: nova/ocata Importance: Undecided => Medium ** Tags added: quotas -- 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/1773542 Title: The quota_usage_refresh counts wrong when there exists soft-deleted instances Status in OpenStack Compute (nova): Invalid Status in OpenStack Compute (nova) ocata series: New Status in OpenStack Compute (nova) pike series: New Status in OpenStack Compute (nova) queens series: In Progress Bug description: Description =========== When there exists soft-deleted instances in my openstack, executing "nova-manage project quota_usage_refresh" will get wrong values in quota_usages. Steps to reproduce ================== 1) Set reclaim_instance_interval>0 to enable soft-delete; 2) Boot a new instance, then check quota_usages tables. Assume instances' in_use is 1, ram's in_use is 512, cores' in_use is 4. 3) Delete that instance, and it's status will migrate to SOFT_DELETED. 4) Check quota_usages tables. Both instances, ram and cores in_use is 0. 5) Execute "nova-manage project quota_usage_refresh --project <project-id> --user <user-id>". 6) Check quota_usages tables. The instances' in_use is 1, ram's in_use is 512, cores' in_use is 4. Expected result =============== After the execution of quota_usage_refresh, both instances, ram and cores in_use should be 0. Actual result ============= The instances' in_use is 1, ram's in_use is 512, cores' in_use is 4. That's because quota_usage_refresh will count all instances whose "deleted" field is 0 in "instances" table. And soft-deleted instance's "deleted" field is 0, so it will be counted as in used. Environment =========== This bug was found in Ocata. Pike, Queens and master don't have this bug. The quota_usage_refresh command has been removed in 17.0.0 (Queens). Since quota usage is counted from resources instead of being tracked separately. https://docs.openstack.org/nova/pike/cli/nova-manage.html And they have filtered out soft-deleted instances while counting from resources: https://github.com/openstack/nova/blob/5bf9aa7fd455e93b73dc13aba66ccb7ec00f23a5/nova/objects/instance.py#L1475-L1489 To manage notifications about this bug go to: https://bugs.launchpad.net/nova/+bug/1773542/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : yahoo-eng-team@lists.launchpad.net Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp