[ops] [nova] Default nova quota for project user
melanie witt
melwittt at gmail.com
Fri Apr 17 16:52:30 UTC 2020
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
> [*]
> [root at controller-01 ~]# nova quota-show --tenant
> b4a1039f2f7c419596662950d8a1d397
> +----------------------+-------+
> | Quota | Limit |
> +----------------------+-------+
> | instances | 10 |
> | cores | 20 |
> | ram | 20480 |
> | metadata_items | 128 |
> | key_pairs | 100 |
> | server_groups | 10 |
> | server_group_members | 10 |
> +----------------------+-------+
> [root at controller-01 ~]# nova quota-show --tenant
> b4a1039f2f7c419596662950d8a1d397 --user ab573ba3ea014b778193b6922ffffe6d
> +----------------------+-------+
> | Quota | Limit |
> +----------------------+-------+
> | instances | 10 |
> | cores | 20 |
> | ram | 20480 |
> | metadata_items | 128 |
> | key_pairs | 100 |
> | server_groups | 10 |
> | server_group_members | 10 |
> +----------------------+-------+
>
> On Fri, Apr 17, 2020 at 4:23 PM melanie witt <melwittt at gmail.com
> <mailto:melwittt at gmail.com>> wrote:
>
> On 4/17/20 07:01, Massimo Sgaravatto wrote:
> > Hello
> >
> > As far as I understand by default each project user is given the
> quota
> > of the whole project.
> > Is it possible to set a different default quota for users of a
> certain
> > project ?
> > And in general I'd like to be able to define different default
> values
> > for different projects
> >
> > In:
> >
> > https://docs.openstack.org/nova/latest/admin/quotas.html
> >
> > it is explained how to update the quota for a specific project
> user, but
> > I can't find how to set the default user quota for a given project
>
> Hi, the steps for updating quota for a specific project are on the doc
> you linked here:
>
> https://docs.openstack.org/nova/latest/admin/quotas.html#view-and-update-quota-values-for-a-project-or-class
>
> $ openstack quota set --QUOTA QUOTA_VALUE PROJECT
>
> This will change the default quota for that project, so all existing
> users in the project will get that quota and all future users in the
> project will get that quota.
>
> Note that the ability to set specific user quota [1] is planned to be
> removed in a future release:
>
> "User-specific quotas are legacy and will be removed when migration to
> unified limits is complete. User-specific quotas were added as a way to
> provide two-level hierarchical quotas and this feature is already being
> offered in unified limits. For this reason, the below commands have not
> and will not be ported to openstackclient."
>
> Hope that helps.
>
> -melanie
>
> [1]
> https://docs.openstack.org/nova/latest/admin/quotas.html#view-and-update-quota-values-for-a-project-user
>
More information about the openstack-discuss
mailing list