Consumers never get deleted

Bug #1778763 reported by Eric Fried on 2018-06-26
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)

Bug Description

We don't have an API to delete a consumer. It gets created implicitly when allocations are created against it, but it doesn't get deleted when the consumer's last allocation is removed. In some uses of placement, such as nova's, there is a high rate of turnover of consumers (instances, in nova) so this leakage has the potential to be problematic.

(Note that we have the same issue for aggregates, but don't currently have a known use case with a lot of aggregate turnover, so it is less likely to be a problem soon.)

Possible solutions:
- Delete a consumer record automatically when its last allocation goes away. This is nice and symmetrical, but a behavior change for the guy *recreating* a consumer (today he has to use the current generation; with this change he would have to use ``null``).
- Provide an operation for deleting consumers. This is an extra step for callers (which is okay). But do we also provide an explicit (redundant) operation for creating them, just for the sake of symmetry?
- Your idea here.

Chris Dent (cdent) wrote :

See some of the IRC conversation from on for a bit more info/ideas.

I'd prefer to not see a DELETE /consumer/{uuid} (or similar) as that seems a pretty meaningless step to have to do. The world has moved on since those times, but there was a time when all a consumer was an identifier that existed as an association with an allocation. What we're seeing now is a consequence of them existing as "a thing". This is not necessarily a bad thing, but we have some catch up to address all the consequences.

The issues in bug are strongly tied to this one.

Eric Fried (efried) wrote :

I don't get how it's meaningless to delete a consumer.

It seems like the only reason we're resisting treating a consumer as a thing is because we haven't thus far. We haven't thus far purely out of momentum from when the concept was originally created. And it was created as a non-thing because there were originally no other fields associated with a consumer.

Consider resource providers. The only associated datum for a provider was a name; absent that, we might have done the same thing, implicitly creating the provider when we created its inventory. But that's not how we chose to go. We chose to have endpoints and real records for providers. And if you want to delete a provider, you have to go through a (certainly not meaningless) separate step.

Back to consumers: they now possess additional fields: project and user ID and generation. So why shouldn't they be a thing just like a provider?

See comment #3 at for more.

Matt Riedemann (mriedem) wrote :

Is this resolved via:


Those won't clean out any existing orphaned consumers but that's probably not a huge deal at the moment.

Jay Pipes (jaypipes) wrote :

This should be closed out now that auto-created consumers are deleted and consumers with no allocations are auto-deleted.

Changed in nova:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers