← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1773542] [NEW] The quota_usage_refresh counts wrong when there exists soft-deleted instances

 

Public bug reported:

Description
===========
When there exists soft-deleted instances in my openstack, 

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 counted as in used.

Environment
===========
This bug was found in Ocata. But Pike, Queens and master don't have this bug. As they have filtered out soft-deleted instances in quota usage counting.

** 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/1773542

Title:
  The quota_usage_refresh counts wrong when there exists soft-deleted
  instances

Status in OpenStack Compute (nova):
  New

Bug description:
  Description
  ===========
  When there exists soft-deleted instances in my openstack, 

  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 counted as in used.

  Environment
  ===========
  This bug was found in Ocata. But Pike, Queens and master don't have this bug. As they have filtered out soft-deleted instances in quota usage counting.

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


Follow ups