Skip to content

Commit 8f0817f

Browse files
committed
Add documentation for unified limits
This adds documentation for unified limits and signals deprecation of the nova.quota.DbQuotaDriver. Related to blueprint unified-limits-nova-tool-and-docs Change-Id: I3951317111396aa4df36c5700b4d4dd33e721a74
1 parent 395501c commit 8f0817f

File tree

9 files changed

+389
-11
lines changed

9 files changed

+389
-11
lines changed

doc/source/admin/cells.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,13 @@ them far over quota when the unreachable cell returns.
755755
counting of quota usage from the placement service and API database
756756
to make quota usage calculations resilient to down or poor-performing
757757
cells in a multi-cell environment. See the :doc:`quotas documentation
758-
</user/quotas>` for more details.
758+
</admin/quotas>` for more details.
759+
760+
Starting in the 2023.2 Bobcat (28.0.0) release, it is possible to configure
761+
unified limits quotas, which stores quota limits as Keystone unified limits
762+
and counts quota usage from the placement service and API database. See the
763+
:doc:`unified limits documentation </admin/unified-limits>` for more
764+
details.
759765

760766
Performance of listing instances
761767
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

doc/source/admin/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ Once you have an OpenStack deployment up and running, you will want to manage
126126
it. The below guides cover everything from creating initial flavor and image to
127127
log management and live migration of instances.
128128

129-
* :doc:`Quotas </admin/quotas>`: Managing project quotas in nova.
129+
* :doc:`Quotas </admin/unified-limits>`: Managing project quotas in nova.
130130

131131
* :doc:`Scheduling </admin/scheduling>`: How the scheduler is
132132
configured, and how that will impact where compute instances land in your
@@ -158,7 +158,7 @@ log management and live migration of instances.
158158
config-drive
159159
image-caching
160160
metadata-service
161-
quotas
161+
unified-limits
162162
networking
163163
security-groups
164164
security

doc/source/admin/quotas.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
1+
:orphan:
2+
13
=============
24
Manage quotas
35
=============
46

7+
.. warning::
8+
9+
As of Nova release 28.0.0 (2023.2 Bobcat), the ``nova.quota.DbQuotaDriver``
10+
has been deprecated and the default quota driver configuration will be
11+
changed to the ``nova.quota.UnifiedLimitsDriver`` in the 29.0.0. (2024.1
12+
Caracal) release. See the :doc:`unified limits documentation
13+
</admin/unified-limits>`.
14+
515
.. note::
616

717
This section provides deployment information about the quota feature. For
Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
============================
2+
Manage Unified Limits Quotas
3+
============================
4+
5+
.. note::
6+
7+
This section provides deployment information about the quota feature. For
8+
end-user information about quotas, including information about the type of
9+
quotas available, refer to the :doc:`user guide </user/unified-limits>`.
10+
11+
Since the Nova 28.0.0 (2023.2 Bobcat) release, it is recommended to use
12+
`Keystone unified limits`_ for Nova quota limits.
13+
14+
For information about legacy quota limits, see the :doc:`legacy quota
15+
documentation </admin/quotas>`.
16+
17+
To enable unified limits quotas, set the quota driver in the Nova
18+
configuration:
19+
20+
.. code-block:: ini
21+
22+
[quota]
23+
driver = nova.quota.UnifiedLimitsDriver
24+
25+
Quota limits are set and retrieved for enforcement using the `Keystone API`_.
26+
27+
.. _Keystone unified limits: https://docs.openstack.org/keystone/latest/admin/unified-limits.html
28+
.. _Keystone API: https://docs.openstack.org/api-ref/identity/v3/index.html#unified-limits
29+
30+
To prevent system capacities from being exhausted without notification, you can
31+
set up quotas. Quotas are operational limits. For example, the number of
32+
servers allowed for each project can be controlled so that cloud resources
33+
are optimized. Quotas can be enforced at both the global (default) and the
34+
project level.
35+
36+
Resource usage is counted from the placement service with unified limits.
37+
38+
39+
Checking quota
40+
--------------
41+
42+
When calculating limits for a given resource and project, the following checks
43+
are made in order:
44+
45+
#. Project-specific limits
46+
47+
Depending on the resource, is there a project-specific limit on the resource
48+
in Keystone limits? If so, use that as the limit. You can create these
49+
resource limits using:
50+
51+
.. code-block:: console
52+
53+
$ openstack limit create --service nova --project <project> --resource-limit 5 servers
54+
55+
#. Default limits
56+
57+
Use the Keystone registered limit for the resource as the limit. You can
58+
create these default limits using:
59+
60+
.. code-block:: console
61+
62+
$ openstack registered limit create --service nova --default-limit 5 servers
63+
64+
65+
Rechecking quota
66+
~~~~~~~~~~~~~~~~
67+
68+
If :oslo.config:option:`quota.recheck_quota` is True (this is the default),
69+
Nova will perform a second quota check after allocating resources. The first
70+
quota check is performed before resources are allocated. Rechecking quota
71+
ensures that quota limits are strictly enforced and prevents any possibility of
72+
resource allocation going over the quota limit in the event of racing parallel
73+
API requests.
74+
75+
It can be disabled by setting :oslo.config:option:`quota.recheck_quota` to
76+
False if strict quota enforcement is not important to the operator.
77+
78+
79+
Quota usage from placement
80+
--------------------------
81+
82+
With unified limits quotas, it is required that quota resource usage is counted
83+
from placement. As such, the
84+
:oslo.config:option:`quota.count_usage_from_placement` configuration option is
85+
ignored when :oslo.config:option:`quota.driver` is set to
86+
``nova.quota.UnifiedLimitsDriver``.
87+
88+
There are some things to note when quota resource usage is counted from
89+
placement:
90+
91+
* Counted usage will not be accurate in an environment where multiple Nova
92+
deployments are sharing a placement deployment because currently placement
93+
has no way of partitioning resource providers between different Nova
94+
deployments. Operators who are running multiple Nova deployments that share a
95+
placement deployment should not use the ``nova.quota.UnifiedLimitsDriver``.
96+
97+
* Behavior will be different for resizes. During a resize, resource allocations
98+
are held on both the source and destination (even on the same host, see
99+
https://bugs.launchpad.net/nova/+bug/1790204) until the resize is confirmed
100+
or reverted. Quota usage will be inflated for servers in this state.
101+
102+
* The ``populate_queued_for_delete`` and ``populate_user_id`` online data
103+
migrations must be completed before usage can be counted from placement.
104+
Until the data migration is complete, the system will fall back to legacy
105+
quota usage counting from cell databases depending on the result of an EXISTS
106+
database query during each quota check. Use
107+
``nova-manage db online_data_migrations`` to run online data migrations.
108+
109+
* Behavior will be different for unscheduled servers in ``ERROR`` state. A
110+
server in ``ERROR`` state that has never been scheduled to a compute host
111+
will not have placement allocations, so it will not consume quota usage for
112+
cores and ram.
113+
114+
* Behavior will be different for servers in ``SHELVED_OFFLOADED`` state. A
115+
server in ``SHELVED_OFFLOADED`` state will not have placement allocations, so
116+
it will not consume quota usage for cores and ram. Note that because of this,
117+
it will be possible for a request to unshelve a server to be rejected if the
118+
user does not have enough quota available to support the cores and ram needed
119+
by the server to be unshelved.
120+
121+
122+
Configuration
123+
-------------
124+
125+
View and update default quota values
126+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
127+
128+
To list all default quotas for a project, run:
129+
130+
.. code-block:: console
131+
132+
$ openstack registered limit list
133+
134+
.. note::
135+
136+
This lists default quotas for all services and not just nova.
137+
138+
To create a default quota limit, run:
139+
140+
.. code-block:: console
141+
142+
$ openstack registered limit create --service nova --default-limit <value> <resource-name>
143+
144+
.. note::
145+
146+
Creating or updating registered limits requires a system-scoped
147+
authorization token by default. See the `Keystone tokens documentation`_ for
148+
more information.
149+
150+
.. _Keystone tokens documentation: https://docs.openstack.org/keystone/latest/admin/tokens-overview.html#operation_create_system_token
151+
152+
To update a default value, run:
153+
154+
.. code-block:: console
155+
156+
$ openstack registered limit set --default-limit <value> <registered-limit-id>
157+
158+
View and update quota values for a project
159+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
160+
161+
To list quotas for a project, run:
162+
163+
.. code-block:: console
164+
165+
$ openstack limit list --project <project>
166+
167+
.. note::
168+
169+
This lists project quotas for all services and not just nova.
170+
171+
To list quotas for all projects, you must have a system-scoped authorization
172+
token and run:
173+
174+
.. code-block:: console
175+
176+
$ openstack limit list
177+
178+
To update quotas for a project, run:
179+
180+
.. code-block:: console
181+
182+
$ openstack limit set --resource-limit <value> <limit-id>
183+
184+
185+
Migration to unified limits quotas
186+
----------------------------------
187+
188+
There is a `nova-manage limits migrate_to_unified_limits`_ command available
189+
to help with moving from legacy Nova database quotas to Keystone unified limits
190+
quotas. The command will read quota limits from the Nova database and call the
191+
Keystone API to create the corresponding unified limits. Per-user quota limits
192+
will **not** be copied into Keystone because per-user quotas are not supported
193+
in unified limits.
194+
195+
.. _nova-manage limits migrate_to_unified_limits: https://docs.openstack.org/nova/latest/cli/nova-manage.html#limits-migrate-to-unified-limits

doc/source/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ Once you are running nova, the following information is extremely useful.
180180
* :doc:`Flavors </user/flavors>`: What flavors are and why they are used.
181181
* :doc:`Upgrades </admin/upgrades>`: How nova is designed to be upgraded for minimal
182182
service impact, and the order you should do them in.
183-
* :doc:`Quotas </user/quotas>`: Managing project quotas in nova.
183+
* :doc:`Quotas </user/unified-limits>`: Managing project quotas in nova.
184184
* :doc:`Aggregates </admin/aggregates>`: Aggregates are a useful way of grouping
185185
hosts together for scheduling purposes.
186186
* :doc:`Scheduling </admin/scheduling>`: How the scheduler is
@@ -200,7 +200,7 @@ Once you are running nova, the following information is extremely useful.
200200
admin/index
201201
user/flavors
202202
admin/upgrades
203-
user/quotas
203+
user/unified-limits
204204
admin/vendordata
205205

206206
Reference Material

doc/source/user/quotas.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
1+
:orphan:
2+
13
======
24
Quotas
35
======
46

7+
.. warning::
8+
9+
As of Nova release 28.0.0 (2023.2 Bobcat), the ``nova.quota.DbQuotaDriver``
10+
has been deprecated and the default quota driver configuration will be
11+
changed to the ``nova.quota.UnifiedLimitsDriver`` in the 29.0.0 (2024.1
12+
Caracal) release. See the :doc:`unified limits documentation
13+
</user/unified-limits>`.
14+
515
Nova uses a quota system for setting limits on resources such as number of
616
instances or amount of CPU that a specific project or user can use.
717

0 commit comments

Comments
 (0)