Activity log for bug #1773542

Date Who What changed Old value New value Message
2018-05-26 14:31:51 huanhongda bug added bug
2018-05-28 05:26:13 jichenjc nova: assignee huanhongda (hongda)
2018-05-28 05:26:57 jichenjc bug added subscriber jichenjc
2018-05-28 07:59:52 OpenStack Infra nova: status New In Progress
2018-05-28 08:24:56 huanhongda 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. 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
2018-08-09 15:39:30 melanie witt nominated for series nova/queens
2018-08-09 15:39:30 melanie witt bug task added nova/queens
2018-08-09 15:39:30 melanie witt nominated for series nova/ocata
2018-08-09 15:39:30 melanie witt bug task added nova/ocata
2018-08-09 15:39:30 melanie witt nominated for series nova/pike
2018-08-09 15:39:30 melanie witt bug task added nova/pike
2018-08-09 15:40:17 melanie witt nova: status In Progress Invalid
2018-08-09 15:40:32 melanie witt nova/queens: assignee huanhongda (hongda)
2018-08-09 15:40:38 melanie witt nova/queens: importance Undecided Medium
2018-08-09 15:40:43 melanie witt nova/queens: status New In Progress
2018-08-09 15:41:33 melanie witt nova/pike: importance Undecided Medium
2018-08-09 15:41:37 melanie witt nova/ocata: importance Undecided Medium
2018-08-09 15:41:47 melanie witt tags quotas
2018-09-13 21:15:28 OpenStack Infra nova/pike: status New In Progress
2018-09-13 21:15:28 OpenStack Infra nova/pike: assignee Lee Yarwood (lyarwood)
2018-09-13 21:27:09 OpenStack Infra nova/ocata: status New In Progress
2018-09-13 21:27:09 OpenStack Infra nova/ocata: assignee Lee Yarwood (lyarwood)
2018-09-14 02:58:06 OpenStack Infra nova/queens: status In Progress Fix Committed
2018-09-14 14:43:53 OpenStack Infra nova/pike: assignee Lee Yarwood (lyarwood) Matt Riedemann (mriedem)
2018-09-14 14:53:01 OpenStack Infra nova/ocata: assignee Lee Yarwood (lyarwood) Matt Riedemann (mriedem)
2018-09-14 14:53:24 Matt Riedemann nova/ocata: assignee Matt Riedemann (mriedem) huanhongda (hongda)
2018-09-14 14:53:30 Matt Riedemann nova/pike: assignee Matt Riedemann (mriedem) huanhongda (hongda)
2018-09-15 00:25:42 OpenStack Infra nova/pike: status In Progress Fix Committed
2018-10-02 08:58:20 OpenStack Infra nova/ocata: status In Progress Fix Committed