Instance quota exceeded with many self.driver.spawn errors

Bug #900939 reported by Nachi Ueno
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Opinion
Medium
Guangyu Suo

Bug Description

When we do the long running test, we got instance quota exceeded with many self.driver.spawn errors.
Because nova didn't cleanup db record when nova get self.driver.spawn error, then the number of instance reaches to the Quota value with no actual instance.

Tags: quotas
Thierry Carrez (ttx)
Changed in nova:
importance: Undecided → Medium
status: New → Confirmed
Guangyu Suo (yugsuo)
Changed in nova:
assignee: nobody → yugsuo (yugsuo)
Revision history for this message
Guangyu Suo (yugsuo) wrote :

Hello, I want to ask a question about this issue:

I added "raise Exception" before self.driver.spawn() to find this error, like follows:

raise Exception
self.driver.spawn(context, instance, image_meta,
                              injected_files, admin_password,
                              self._legacy_nw_info(network_info),
                              block_device_info)

then, I booted a new instance, and got the following result:

$nova list
+--------------------------------------+-------+--------+----------+
| ID | Name | Status | Networks |
+--------------------------------------+-------+--------+----------+
| 3da5acb5-4a45-46e6-a80a-519bf43a050a | test1 | ERROR | |
+--------------------------------------+-------+--------+----------+

$ mysql> select resource,in_use from quota_usages;
+-----------+--------+
| resource | in_use |
+-----------+--------+
| instances | 1 |
| ram | 512 |
| cores | 1 |
+-----------+--------+

then, I deleted this instance:
$ nova delete 3da5acb5-4a45-46e6-a80a-519bf43a050a

and the quota_usages is reset to 0 like normally:
$ mysql> select resource,in_use from quota_usages;
+-----------+--------+
| resource | in_use |
+-----------+--------+
| instances | 0 |
| ram | 0 |
| cores | 0 |
+-----------+--------+

What I want to ask is that it is a bug ? Even if we got an error instance, but it is still an instance. After you delete it, the resources belonging to it will be released, and quota_usages table will be normal too.

Am I right ?

Revision history for this message
Michael Still (mikal) wrote :

If the instance isn't running on the hypervisor when it is in the error state then I feel it shouldn't count towards the quota.

Revision history for this message
Tiantian Gao (gtt116) wrote :

As a user, I think error instance should not count quota. Because in most case the error instances are not caused by me. It's the system's fault, I just want a health instance to play. Couting the quota means I used the resource in the meantime I should pay for it. But error instance is useless to me that I don't need to pay it.

Revision history for this message
Guangyu Suo (yugsuo) wrote :

OK, thanks, I got it, I will try to fix it.

Nachi Ueno (nati-ueno)
Changed in openstack-qa:
status: New → Confirmed
Tom Fifield (fifieldt)
no longer affects: openstack-qa
Revision history for this message
Joe Gordon (jogo) wrote :

Error state instances should be counted against the quotas, we don't 100% know the state of what happened so we default to safe. Also having some error state count and some not count is even more confusing.

tags: added: quotas
Changed in nova:
status: Confirmed → Opinion
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.