Quota usage is not updated if an instance is deleted while booting
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Expired
|
Undecided
|
Unassigned |
Bug Description
OpenStack version: Ocata
Description
===========
If you delete an instance while booting (i.e. vm_state=building, task_state=
Steps to reproduce
==================
1) edit /etc/nova/
$ cat /etc/nova/
[conductor]
topic=my_topic
and restart nova-api service
# systemctl restart openstack-
2) check the project usage (project_
MariaDB [nova]> select * from quota_usages where project_
+------
| created_at | updated_at | deleted_at | id | project_id | resource | in_use | reserved | until_refresh | deleted | user_id |
+------
| 2017-05-23 09:42:02 | 2017-07-25 10:18:22 | NULL | 1 | 01ab8de5387547d
| 2017-05-23 09:42:02 | 2017-07-25 10:18:22 | NULL | 2 | 01ab8de5387547d
| 2017-05-23 09:42:02 | 2017-07-25 10:18:22 | NULL | 3 | 01ab8de5387547d
| 2017-05-23 13:21:26 | 2017-05-23 13:21:26 | NULL | 4 | 01ab8de5387547d
+------
4 rows in set (0,00 sec)
3) create a new instance (the task_state will be "scheduling" and vm_state = "building")
$ openstack server create --flavor m1.tiny --image cirros --nic net-id=admin_net --security-group default test
+------
| Field | Value |
+------
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-STS:vm_state | building |
| OS-SRV-
| OS-SRV-
| accessIPv4 | |
| accessIPv6 | |
| addresses | |
| adminPass | 4i8zTGZZ3u9w |
| config_drive | |
| created | 2017-07-
| flavor | m1.tiny (5cdecdda-
| hostId | |
| id | aab25cc8-
| image | cirros (03d54ef8-
| key_name | None |
| name | test |
| progress | 0 |
| project_id | 01ab8de5387547d
| properties | |
| security_groups | name='default' |
| status | BUILD |
| updated | 2017-07-
| user_id | 4469ff06d1e247e
| volumes_attached | |
+------
$ openstack server show aab25cc8-
+------
| Field | Value |
+------
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-STS:vm_state | building |
| OS-SRV-
| OS-SRV-
| accessIPv4 | |
| accessIPv6 | |
| addresses | |
| config_drive | |
| created | 2017-07-
| flavor | m1.tiny (5cdecdda-
| hostId | |
| id | aab25cc8-
| image | cirros (03d54ef8-
| key_name | None |
| name | test |
| progress | 0 |
| project_id | 01ab8de5387547d
| properties | |
| status | BUILD |
| updated | 2017-07-
| user_id | 4469ff06d1e247e
| volumes_attached | |
+------
4) check the quota usage for project_
MariaDB [nova]> select * from quota_usages where project_
+------
| created_at | updated_at | deleted_at | id | project_id | resource | in_use | reserved | until_refresh | deleted | user_id |
+------
| 2017-05-23 09:42:02 | 2017-07-25 10:18:22 | NULL | 1 | 01ab8de5387547d
| 2017-05-23 09:42:02 | 2017-07-25 10:18:22 | NULL | 2 | 01ab8de5387547d
| 2017-05-23 09:42:02 | 2017-07-25 10:18:22 | NULL | 3 | 01ab8de5387547d
| 2017-05-23 13:21:26 | 2017-05-23 13:21:26 | NULL | 4 | 01ab8de5387547d
+------
4 rows in set (0,00 sec)
5) delete the instance
$ openstack server delete aab25cc8-
$ openstack server show aab25cc8-
No server with a name or ID of 'aab25cc8-
6) check again the quota usage
MariaDB [nova]> select * from quota_usages where project_
+------
| created_at | updated_at | deleted_at | id | project_id | resource | in_use | reserved | until_refresh | deleted | user_id |
+------
| 2017-05-23 09:42:02 | 2017-07-25 10:18:22 | NULL | 1 | 01ab8de5387547d
| 2017-05-23 09:42:02 | 2017-07-25 10:18:22 | NULL | 2 | 01ab8de5387547d
| 2017-05-23 09:42:02 | 2017-07-25 10:18:22 | NULL | 3 | 01ab8de5387547d
| 2017-05-23 13:21:26 | 2017-05-23 13:21:26 | NULL | 4 | 01ab8de5387547d
+------
4 rows in set (0,00 sec)
Expected result
===============
The quota usage should be decreased
description: | updated |
I feel like this might have been addressed with melanie's new quota work