After some tests in my devstack deployment(there are now 3 DB - nova, nova_api and nova_cell0), it seems that when booting, the quota is calculated and recorded in nova DB, if it booted successfully, cool, no bugs. But if it failed to boot, the instance will end up in cell0, and when delete this instance, the quota cannot be freed correctly in nova DB as we transformed the db connection to nova_cell0, and the usage in nova DB will still exist. I will try to study more to see if this is due to the devstack all-in-one deployment or this could be a general bug.
After some tests in my devstack deployment(there are now 3 DB - nova, nova_api and nova_cell0), it seems that when booting, the quota is calculated and recorded in nova DB, if it booted successfully, cool, no bugs. But if it failed to boot, the instance will end up in cell0, and when delete this instance, the quota cannot be freed correctly in nova DB as we transformed the db connection to nova_cell0, and the usage in nova DB will still exist. I will try to study more to see if this is due to the devstack all-in-one deployment or this could be a general bug.