← Back to team overview

openstack team mailing list archive

Re: nova-manage quota --headroom

 

On Thu, 2012-03-22 at 09:36 -0400, Eoghan Glynn wrote:
> It's ability to easily see the remaining headroom for each
> per-project quota, e.g.
> 
>  $ nova-manage quota --headroom --project=admin
>  ...
>  instances:    10  (of which 1 remaining)
>  floating_ips: 10  (of which 8 remaining)
>  ...

I recently got the quota classes stuff merged into master (after the RC
branch for Essex was cut, of course).  After I had completed that work,
I started thinking about quotas in general, and I think there's a better
way to organize how we do quotas in the first place.  One potential side
effect I see of that possible work would be to address this particular
feature.

My idea here is not really very well fleshed out or architected yet, and
I have other things I'm focusing on right now (caching), but perhaps I
should mention them on the list, in order to get a discussion going…and
perhaps a summit discussion of the topic would be in order?

The basic thought I had here was to create a "quota manager" or "quota
plugin" infrastructure, instead of a bunch of fixed functions in
quota.py that we use to test certain specific quotas.  Having it as a
plugin that you specify in configuration means you can easily substitute
out the default implementation, if necessary—maybe you want quotas to be
enforced across several cells instead of just one, for instance.  Then,
checking a quota would be a matter of simply calling a method on the
quota plugin class.

The side effect is that, in order to properly impose quotas in a
flexible architecture, you would need to keep the quota plugin
up-to-date on the current numbers of whatever resource is being limited
anyway—in the example above, of having one quota applied across a number
of cells, you don't want to have to ask each cell how many instances the
user currently has.  That makes implementation of your headroom concept
pretty trivial, and I could see it implemented by attaching a little
more data to the /limits endpoint's returned data.

(The current quota code has to count how many instances there are each
time it checks the quota; I think other parts that use quotas may do the
counting themselves and just ask quota.py what the upper limit is.)
-- 
Kevin L. Mitchell <kevin.mitchell@xxxxxxxxxxxxx>



Follow ups

References