The records in quotausages table for floatingip are not updated immediately after delete some (or all) floatingips.
For example, if we set quota for floatingip to 5, create 5 floatingips and remove all of them, after that we can't create new floatingip:
The error "Quota exceeded for resources: ['floatingip']." occurs.
And at this time in mysql db we can see following:
mysql> select * from quotausages;
+----------------------------------+------------+-------+--------+----------+
| tenant_id | resource | dirty | in_use | reserved |
+----------------------------------+------------+-------+--------+----------+
| fae4b729e0d543199331d6be300074fc | floatingip | 0 | 5 | 0 |
| fae4b729e0d543199331d6be300074fc | network | 0 | 1 | 0 |
+----------------------------------+------------+-------+--------+----------+
Steps to reproduce:
1. $ neutron quota-update --floatingip 5
2. $ for i in $(seq 1 5); do neutron floatingip-create public; done
3. Try to create another one floatingip (should not be created):
$ neutron floatingip-create public
Quota exceeded for resources: ['floatingip'].
4. $ for ip in $(neutron floatingip-list -f csv -c id --quote=none | grep -v id); do neutron floatingip-delete $ip done
5. Try to create another one floatingip:
$ neutron floatingip-create public
Quota exceeded for resources: ['floatingip'].
6. Check quotas info in db:
mysql> use neutron
mysql> select * from quotausages;
The records in quotausages table for floatingip are not updated immediately after delete some (or all) floatingips. ------- ------- ------- ------- +------ ------+ ------- +------ --+---- ------+ ------- ------- ------- ------- +------ ------+ ------- +------ --+---- ------+ 99331d6be300074 fc | floatingip | 0 | 5 | 0 | 99331d6be300074 fc | network | 0 | 1 | 0 | ------- ------- ------- ------- +------ ------+ ------- +------ --+---- ------+
For example, if we set quota for floatingip to 5, create 5 floatingips and remove all of them, after that we can't create new floatingip:
The error "Quota exceeded for resources: ['floatingip']." occurs.
And at this time in mysql db we can see following:
mysql> select * from quotausages;
+------
| tenant_id | resource | dirty | in_use | reserved |
+------
| fae4b729e0d5431
| fae4b729e0d5431
+------
Steps to reproduce:
1. $ neutron quota-update --floatingip 5
2. $ for i in $(seq 1 5); do neutron floatingip-create public; done
3. Try to create another one floatingip (should not be created):
$ neutron floatingip-create public
Quota exceeded for resources: ['floatingip'].
4. $ for ip in $(neutron floatingip-list -f csv -c id --quote=none | grep -v id); do neutron floatingip-delete $ip done
5. Try to create another one floatingip:
$ neutron floatingip-create public
Quota exceeded for resources: ['floatingip'].
6. Check quotas info in db:
mysql> use neutron
mysql> select * from quotausages;
Full log here: http:// paste.openstack .org/show/ 483767/