[Openstack] [OpenStack][Nova] Behavior of ""until_refresh"" and ""max_age""

Shinobu Kinjo shinobu.kj at gmail.com
Mon Dec 14 05:37:06 UTC 2015


Hello,

To refresh quota usage in the Nova, we are able to use 2 parameters which
are:

   until_refresh
   max_age

   * We can also use setting less than 0 in ""quota_usage.in_use""

Reading this Blog Post which is quite nice to be honest,


http://www.dorm.org/blog/nova-max_age-and-until_refresh-settings-for-easing-quotas-pain/

It will happen to refresh quota when ""max_age"" or ""until_refresh"" is
reached to the number you set.

    """
    When used together, the quota usage will be refreshed when either
method is
    triggered: when the max_age or the until_refresh count is reached,
whichever
    comes first.
    """

But seeing this, it seems not to be able to use both.


https://github.com/openstack/nova/blob/master/nova/db/sqlalchemy/api.py#L3455-L3463

If you're using ""until_refresh"", this block will be evaluated:

  elif quota_usage.until_refresh is not None:

If you're using ""max_age"", this block will be evaluated unless you are
not using ""until_refresh""

  elif max_age and (timeutils.utcnow()
             quota_usage.updated_at).seconds >= max_age:

If I've been missing anything, please point it out to me.
It's important since the Nova quota usage is a bit tricky thing to me...

Thank you,
Shinobu

-- 
Email:
shinobu at linux.com
GitHub:
shinobu-x <https://github.com/shinobu-x/>
Blog:
Life with Distributed Computational System based on OpenSource
<http://i-shinobu.hatenablog.com/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20151214/78e96e22/attachment.html>


More information about the Openstack mailing list