Changing the default project quotas

The default quotas are applied when creating a project via the OpenStack API. You can modify the following default quotas:

Parameter Configuration file Description Value
default_trait_quota /etc/kolla/placement-api/placement.conf Sets the maximum number of placements per project. Valid values are integer. The default value is set to 0. To make the parameter unlimited, set the value to -1.
default_load_balancer_quota /etc/kolla/octavia-api/octavia.conf Sets the maximum number of load balancers per project.
max_clusters_per_project /etc/kolla/magnum-api/magnum.conf Sets the maximum number of Kubernetes clusters per project.

If required, you can also change default quotas for other compute resources. To do this, refer to the official OpenStack documentation.

To change the default project quota

Use the following command:

vinfra service compute set [--custom-param <service_name> <config_file> <section> <property> <value>]
                           [--load-balancer-default-quota <value>] [--k8s-default-quota <value>]
                           [--placement-default-quota <value>]
--custom-param <service_name> <config_file> <section> <property> <value>

Set custom parameters for OpenStack configuration files:

  • service_name is the service name: octavia-api, magnum-api, or placement-api
  • config_file specifies the service configuration file: octavia.conf for octavia-api, magnum.conf for magnum-api, or placement.conf for placement-api
  • section specifies the section in the service configuration file where the parameter is defined: quotas in octavia.conf and magnum.conf, or quota in placement.conf
  • property is the parameter to be changed: default_load_balancer_quota in octavia.conf, max_clusters_per_project in magnum.conf, or default_trait_quota in placement.conf
  • value is a new parameter value
--load-balancer-default-quota <value>
Shortcut for --custom-param octavia-api octavia.conf quotas default_load_balancer_quota <value>
--k8s-default-quota <value>
Shortcut for --custom-param magnum-api magnum.conf quotas max_clusters_per_project <value>
--placement-default-quota <value>
Shortcut for --custom-param placement-api placement.conf quota default_trait_quota <value>

For example, to make the number of placements per project unlimited, but limit the maximum number of load balancers to 100 and Kubernetes clusters to 10 per project, run:

# vinfra service compute set --placement-default-quota -1 --load-balancer-default-quota 100 --k8s-default-quota 10

To check that the default project quotas are successfully modified, run:

# vinfra service compute show
+--------------+-----------------------------------------+
| Field        | Value                                   |
+--------------+-----------------------------------------+
| <...>        | <...>                                   |
| options      | cpu_model: ''                           |
|              | custom_params:                          |
|              | - config_file: octavia.conf             |
|              |   property: default_load_balancer_quota |
|              |   section: quotas                       |
|              |   service_name: octavia-api             |
|              |   value: 100                            |
|              | - config_file: magnum.conf              |
|              |   property: max_clusters_per_project    |
|              |   section: quotas                       |
|              |   service_name: magnum-api              |
|              |   value: 10                             |
|              | - config_file: placement.conf           |
|              |   property: default_trait_quota         |
|              |   section: quota                        |
|              |   service_name: placement-api           |
|              |   value: -1                             |
|              | notification_forwarding: disabled       |
| status       | active                                  |
+--------------+-----------------------------------------+