Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1217956

Summary: Nova incorrect quota/Horizon usage values
Product: Red Hat OpenStack Reporter: Tzach Shefi <tshefi>
Component: openstack-novaAssignee: Rajesh Tailor <ratailor>
Status: CLOSED CURRENTRELEASE QA Contact: nlevinki <nlevinki>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0 (Juno)CC: berrange, dasmith, eglynn, kchamart, ratailor, sbauza, sferdjao, sgordon, srevivo, vromanso
Target Milestone: ---Keywords: Triaged, ZStream
Target Release: 7.0 (Kilo)   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-01-08 14:03:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Logs none

Description Tzach Shefi 2015-05-03 11:17:19 UTC
Description of problem: On my RHOS6A2 HA deployment, Nova quota usage count is wrong, my guess is that quota includes deleted instances, if they are not successfully deleted (tip upstream bugs link at the bottom). 

Version-Release number of selected component (if applicable):
RHEL7.1
python-nova-2014.2.2-19.el7ost.noarch
openstack-nova-api-2014.2.2-19.el7ost.noarch
python-novaclient-2.20.0-1.el7ost.noarch
openstack-nova-common-2014.2.2-19.el7ost.noarch

How reproducible:
Unsure, happened on two tenants on my setup. 

Steps to Reproduce:
1. Boot instances 
2. Delete instance, in my case they got stuck in deleting state on Horizon, not sure what caused this deletion problem. 
3. Restarting nova compute service deleted instances from Horizon.
4. Yet Horizon quota lists for example 5 out of 20 instances, where nova list has no instances running at all.

On logs this instanceID is one that I failed to delete:  
123ef280-967f-4f46-83df-880ad2afec4f 
(tenantID of instance owner ac7b9e85b8eb4061898278526c839d48) 

Nova list is blank for this user, while it's Horizon usage stats show instances 5 out of 20, vCPU 10 out of 40.. 

sql.quota_usages.txt ->output from DB quota_usages

Also happened to another tenant on same deployment, again case of instance deletion not completed causing wrong instance count. Other tenants quota figures look ok. 

5. If instance termination works without error, quota is updated correctly. 

Actual results:
Quota for instance count RAM/vCPU is wrong, possibly includes (guessing) old deleted instances. 

Expected results:
Quota should show updated/correct values. 

Additional info:
Adding two possible related upstream bugs, didn't find them searching bugzilla:
https://bugs.launchpad.net/tripleo/+bug/1284424
https://bugs.launchpad.net/nova/+bug/1296414

linking this one
https://bugzilla.redhat.com/show_bug.cgi?id=886332

Comment 2 Tzach Shefi 2015-05-03 11:17:57 UTC
Created attachment 1021309 [details]
Logs

Comment 4 Rajesh Tailor 2018-01-08 14:03:43 UTC
It was already reported in upstream-liberty and fixed in liberty. Also backported to stable/kilo as well as stable/juno.

https://bugs.launchpad.net/nova/+bug/1296414
https://review.openstack.org/#/c/188362/