Bug 1528643

Summary: Nova reports wrong quota usage
Product: [Community] RDO Reporter: David Manchado <dmanchad>
Component: openstack-novaAssignee: Eoghan Glynn <eglynn>
Status: CLOSED UPSTREAM QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: OcataCC: kforde
Target Milestone: ---   
Target Release: trunk   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-01-12 00:22:05 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:

Description David Manchado 2017-12-22 14:18:38 UTC
Description of problem:
Nova reports unaccurate quota usage. This can even lead to prevent spawning new instances when the project should have still room for more resources


Version-Release number of selected component (if applicable):
Ocata.
Nova related RPMs:
openstack-nova-scheduler-15.0.9-0.20171201203754.bbfc423.el7.centos.noarch
openstack-nova-console-15.0.9-0.20171201203754.bbfc423.el7.centos.noarch
python-nova-15.0.9-0.20171201203754.bbfc423.el7.centos.noarch
openstack-nova-conductor-15.0.9-0.20171201203754.bbfc423.el7.centos.noarch
puppet-nova-10.4.2-0.20171127233709.eb1fafa.el7.centos.noarch
openstack-nova-api-15.0.9-0.20171201203754.bbfc423.el7.centos.noarch
openstack-nova-compute-15.0.9-0.20171201203754.bbfc423.el7.centos.noarch
openstack-nova-placement-api-15.0.9-0.20171201203754.bbfc423.el7.centos.noarch
openstack-nova-cert-15.0.9-0.20171201203754.bbfc423.el7.centos.noarch
openstack-nova-common-15.0.9-0.20171201203754.bbfc423.el7.centos.noarch
python2-novaclient-7.1.2-1.el7.noarch
openstack-nova-novncproxy-15.0.9-0.20171201203754.bbfc423.el7.centos.noarch



How reproducible:
Not sure. We got to this situation during an upgrade from Newton to Ocata.
I guess it might be due to instance deletion while some services like galera and/or rabbit were not behaving properly

Steps to Reproduce:
1.
2.
3.

Actual results:
Nova reports a given project to be using 39 instances while openstack server list reports 17.

openstack limits show --absolute --project XXXX | grep Instances
| maxTotalInstances        |     48 |
| totalInstancesUsed       |     39 |

openstack server list --project XXXX  --format csv | wc -l
18 (note there is an extra line for the csv header)

Expected results:
Match openstack server list (accurate) and openstack limits show (unaccurate)

Additional info:
While doing some troubleshooting on nova.quota_usages I have found several projects and resources defined more than once.
SELECT * FROM (SELECT project_id,resource,COUNT(*) times FROM nova.quota_usages GROUP BY project_id, resource) as T WHERE times > 1;

Comment 2 Alan Pevec (Fedora) 2018-01-12 00:22:05 UTC
Since it's not RDO packaging issue, moved upstream https://bugs.launchpad.net/nova/+bug/1742826