[ops] [nova] Default nova quota for project user
melanie witt
melwittt at gmail.com
Fri Apr 17 17:07:31 UTC 2020
On 4/17/20 09:56, Sean McGinnis wrote:
> On 4/17/20 11:52 AM, melanie witt wrote:
>> On 4/17/20 08:51, Massimo Sgaravatto wrote:
>>> Thanks a lot, but I am afraid I am missing something.
>>> I have a project where the cores quota is 20.
>>> This project has 2 users:
>>>
>>> [root at controller-01 ~]# openstack user list --project
>>> b4a1039f2f7c419596662950d8a1d397
>>> +----------------------------------+------------------+
>>> | ID | Name |
>>> +----------------------------------+------------------+
>>> | ab573ba3ea014b778193b6922ffffe6d | sgaravat at infn.it
>>> <mailto:sgaravat at infn.it> |
>>> | 27ae90b9f42547f094d8c899f23c31c2 | sgaraprj99 |
>>> +----------------------------------+------------------+
>>>
>>> and by default each user is given 20 cores as quota [*]:
>>>
>>> I can decrease the cores quota for a specific user:
>>>
>>> [root at controller-01 ~]# nova quota-update --user
>>> 27ae90b9f42547f094d8c899f23c31c2 --cores 2
>>> b4a1039f2f7c419596662950d8a1d397
>>>
>>> and this works: the project keeps having 20 cores but that user can
>>> instantiate at most 2 VCPUs
>>>
>>>
>>> If I try the command you suggested:
>>>
>>> openstack quota set --cores 2 b4a1039f2f7c419596662950d8a1d397
>>>
>>> it seems to me that the result is changing the quota (from 20 to 2)
>>> for the project, while I would like to keep having 20 cores for the
>>> project, and 2 cores for each user of that project
>>
>> Apologies, I made a mistake in thinking that a project quota of 2
>> would give each user in the project of quota of 2. While it would, it
>> would also not let the total usage in the project exceed 2 (so
>> obviously that is not what you want).
>>
>> Unfortunately I don't think the quota system today can do what you
>> would like here -- to have an automatic per-user quota of 2 while
>> keeping the project total quota limited to 20. You would have to set a
>> per-user quota of 2 on every user in the project separately and make
>> sure to do it each time you add a new user to the project.
>>
>> -melanie
>>
> Not sure if this is relevant for you, but Cinder has the concept of
> nested quotas. You can read more about the concept here:
>
> https://docs.openstack.org/cinder/train/configuration/block-storage/nested-quota.html
>
>
> This maybe gets closer to what you want, but as far as I know, it is a
> Cinder-only thing.
>
> There was an effort started to make this a common thing, but due to
> resource limitations, I don't think that effort has made enough progress
> to be of any use yet.
We have work in progress to integrate with keystone unified limits [1]
which would provide a two-level hierarchy (nested) for quotas. However,
unless I'm missing something, I don't think it would behave differently
than per-user quotas today.
Using the same example, if you have project A with a quota of 20 and
nested sub-project B with a quota of 2, users in project B would not be
able to exceed the quota of 2 across all users in project B. You would
have to create a separate project per user, each with a quota of 2, to
get the behavior of each user limited to 2 and total across sub-projects
limited to 20. So, AFAICT it doesn't make the use case easier than it is
today.
-melanie
[1] https://review.opendev.org/#/q/topic:bp/unified-limits-nova
More information about the openstack-discuss
mailing list