-
Notifications
You must be signed in to change notification settings - Fork 109
/
quota-plans.html.md.erb
517 lines (386 loc) · 21.1 KB
/
quota-plans.html.md.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
---
title: Creating and modifying quota plans in Cloud Foundry
owner: CAPI
---
<%# Reset page title based on platform type %>
<% if vars.platform_code != 'CF' %>
<% set_title("Creating and modifying quota plans in", vars.app_runtime_abbr) %>
<% end %>
You can use quota plans in <%= vars.app_runtime_abbr %>, including creating and modifying quota plans for orgs and spaces.
## <a id='quota-plans-overview'></a>Quota plans overview
Quota plans are named sets of memory, service, log rate, and instance usage quotas. For example, one quota plan might allow up to 10 services, 10 routes,
2 GB of RAM, and 2 KB of generated logs, while another might offer 100 services, 100 routes, 10 GB of RAM, and 16 KB of generated logs.
Quota plans have user-friendly names, but are referenced in <%= vars.app_runtime_first %> internal systems by unique GUIDs.
Quota plans are not directly associated with user accounts. Instead, every org has a list of available quota plans, and the account admin assigns a specific
quota plan from the list to the org. Everyone in the org shares the quotas described by the plan. There is no limit to the number of defined quota plans an
account can have, but only one plan can be assigned at a time.
You must set a quota plan for an org, but you can choose whether to set a space quota. For more information, see the [Orgs](../concepts/roles.html#orgs) and
[Spaces](../concepts/roles.html#spaces) sections of the _Orgs, Spaces, Roles, and Permissions_ topic.
For information about managing network policy quotas, see [Manage Network Policy Quotas](../devguide/deploy-apps/cf-networking.html#policy-quotas) in
_Configuring Container-to-Container Networking_.
## <a id='attributes'></a> Org quota plan attributes
<table>
<thead>
<tr>
<th><strong>Name</strong></th>
<th><strong>Description</strong></th>
<th><strong>Valid Values</strong></th>
<th><strong>Example Value</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>The name used to identify the plan</td>
<td>A sequence of letters, digits, and underscore characters. Quota plan names within an account must be unique.</td>
<td>silver_quota</td>
</tr>
<tr>
<td><code>total_memory_in_mb</code></td>
<td>Total memory allowed for all the started processes and running tasks in an organization</td>
<td>An integer</td>
<td>2048</td>
</tr>
<tr>
<td><code>total_instances</code></td>
<td>Total instances of all the started processes allowed in an organization.</td>
<td>An integer</td>
<td>25</td>
</tr>
<tr>
<td><code>per_process_memory_in_mb</code></td>
<td>Maximum memory for a single process or task</td>
<td>An integer</td>
<td>2048</td>
</tr>
<tr>
<td><code>log_rate_limit_in_bytes_per_second</code></td>
<td>Total log rate limit allowed for all the started processes and running tasks in an organization</td>
<td>An integer</td>
<td>1024</td>
</tr>
<tr>
<td><code>per_app_tasks</code></td>
<td>Maximum number of running tasks in an organization</td>
<td>An integer</td>
<td>5</td>
</tr>
<tr>
<td><code>paid_services_allowed</code></td>
<td>Specifies whether instances of paid service plans can be created.</td>
<td><code>true</code> or <code>false</code></td>
<td>true</td>
</tr>
<tr>
<td><code>total_service_instances</code></td>
<td>Total number of service instances allowed in an organization.</td>
<td>An integer</td>
<td>10</td>
</tr>
<tr>
<td><code>total_service_keys</code></td>
<td>Total number of service keys allowed in an organization.</td>
<td>An integer</td>
<td>20</td>
</tr>
<tr>
<td><code>total_routes</code></td>
<td>Total number of routes allowed in an organization.</td>
<td>An integer</td>
<td>500</td>
</tr>
<tr>
<td><code>total_reserved_ports</code></td>
<td>Total number of ports that are reservable by routes in an organization.</td>
<td>An integer not greater than <code>routes.total_routes</code></td>
<td>60</td>
</tr>
<tr>
<td><code>total_domains</code></td>
<td>Total number of domains that can be scoped to an organization.</td>
<td>An integer</td>
<td>6</td>
</tr>
<tr>
<td><code>organizations</code></td>
<td>A relationship to the organizations where the quota is applied.</td>
<td>A list of organization guids</td>
<td>9b370018-c38e-44c9-86d6-155c76801104, 12370033-458e-44c2-12d6-789c76801005</td>
</tr>
<tr>
<td><code>trial_db_allowed</code></td>
<td>This is a legacy field. Value can be ignored.</td>
<td><code>true</code> or <code>false</code></td>
<td>true</td>
</tr>
</tbody>
</table>
## <a id='default-org-plan'></a> Default quota plan for an org
<%= vars.app_runtime_abbr %> installs with a quota plan named `default` with the following values:
* Memory limit: `10240 MB`
* Total routes: `1000`
* Total services: `100`
* Non-basic aervices allowed: `true`
* Trial DB allowed: `true`
* Log rate limit: `unlimited`
<% if vars.platform_code == 'CF' %>
## <a id='new-org-plan'></a> Create a quota plan for an org
<p> The org manager sets and manages quotas. For more information, see <a href="../concepts/roles.html">Orgs, Spaces,
Roles, and Permissions</a>.</p>
You must create an org quota plan. You can create a quota plan for an org in one of following ways:
* Directly modify the manifest for your <%= vars.app_runtime_abbr %> deployment before deploying. For more information, see [Create a Quota Plan for an Org
Through the Deployment Manifest](#new-edit-manifest).
* Create an org quota plan through the Cloud Foundry Command Line Interface (cf CLI) after deploying. For more information, see [Create a Quota Plan for an
Org Through the cf CLI](#create-org-quota).
### <a id='new-edit-manifest'></a> Create a quota plan for an org through the deployment manifest
The manifest for your <%= vars.app_runtime_abbr %> deployment specifies the default quota plans applied to orgs. You can modify the default quota plans by
locating and editing the manifest.
To modify the deployment manifest:
1. In a text editor, open the deployment manifest YAML file.
1. Search for `quota_definitions`.
1. Add a new quota definition with values that you specify. Use the default quota definition as a formatting template. The following example shows the
`quota_definitions` portion of the `cf.yml` manifest after adding the `silver_quota` plan:
```
quota_definitions:
default:
memory_limit: 1024M
log_rate_limit: 8K
non_basic_services_allowed: true
total_routes: 1000
total_services: 100
trial_db_allowed: true
silver_quota:
memory_limit: 2048M
log_rate_limit: 16K
non_basic_services_allowed: true
total_routes: 500
total_services: 25
trial_db_allowed: true
```
1. Save and close the deployment manifest.
1. Apply the deployment manifest by running:
```
bosh -e ENV -d DEPLOYMENT deploy MANIFEST.yml
```
Where:
* `ENV` is your BOSH Director alias.
* `DEPLOYMENT` is the name of your deployment.
* `MANIFEST` is the filename of the deployment manifest.
<p> Any subsequent updates to the quota in the manifest are not applied to your environment after the initial deploy, even
though BOSH updates the Cloud Controller instance with new settings.</p>
<% else %>
## <a id='new-org-plan'></a> Creating a quota plan for an org
<p> The org manager sets and manages quotas. For more information, see <a href="../concepts/roles.html">Orgs, Spaces,
Roles, and Permissions</a>.</p>
You must create a quota plan for the org. To create a new quota plan for org, see [Create a Quota Plan for an Org Through the cf CLI](#create-org-quota).
<% end %>
### <a id='create-org-quota'></a> Creating a quota plan for an org through the cf CLI
To create a new quota plan for an org through the cf CLI:
1. Run:
```
cf create-org-quota QUOTA-NAME -m TOTAL-MEMORY -i INSTANCE-MEMORY -l LOG-RATE-LIMIT -r NUMBER-OF-ROUTES -s NUMBER-OF-SERVICE-INSTANCES
```
Where:
<ul>
<li><code>QUOTA-NAME</code> is the name you want to give the quota plan.</li>
<li><code>TOTAL-MEMORY</code> is the total amount of memory you want to allocate to all app instances in the org.</li>
<li><code>INSTANCE-MEMORY</code> is the maximum amount of memory an app instance can use. Specify <code>-1</code> to allow app instances to use an unlimited amount of memory.</li>
<li><code>LOG-RATE-LIMIT</code> is the total number of logs per second you want to allow all app instances in the org to send to Loggregator.</li>
<li><code>NUMBER-OF-ROUTES</code> is the total number of routes you want to allow all app instances in the org.</li>
<li><code>NUMBER-OF-SERVICE-INSTANCES</code> is the total number of service instances you want to allow all app instances in the org.</li>
<li>(Optional) Include the <code>--allow-paid-service-plans</code> flag to allow the quota plan to provision instances of paid service plans.</li>
</ul>
For example:
```
cf create-org-quota small -m 2048M -i 1024M -l 2K -r 10 -s 10 --allow-paid-service-plans
```
## <a id='modify-org-plan'></a> Modifying a quota plan for an org
<% if vars.platform_code == 'CF' %>
You can modify an existing quota plan for an org in one of two ways:
* Directly modify the manifest for your <%= vars.app_runtime_abbr %> deployment before deploying. For more information, see [Modify a Quota Plan for an Org
Through the the Deployment Manifest](#modify-edit-manifest).
* Modify the quota plan for the org through the cf CLI after deploying. For more information, see [Modify a Quota Plan for an Org Through the cf
CLI](#update-org-quota).
### <a id='modify-edit-manifest'></a> Modify a quota plan for an org through the deployment manifest
To modify the <%= vars.app_runtime_abbr %> deployment manifest:
1. In a text editor, open the deployment manifest YAML file.
1. Search for `quota_definitions`.
1. Modify the value of the attribute.
1. Save and close the deployment manifest.
<% end %>
### <a id='update-org-quota'></a> Modify a quota plan for an org through the cf CLI
To modify an existing quota plan for an org through the cf CLI:
1. View all existing quota plans for your org by running:
```
cf org-quotas
```
This command returns output similar to the following example:
<pre class="terminal">
Getting org quotas as admin...
name total memory instance memory routes service instances paid service plans app instances route ports log volume per second
default 100G unlimited 1000 unlimited allowed unlimited 100 unlimited
free 0 unlimited 1000 0 disallowed unlimited 0 4K
paid 10M unlimited 1000 unlimited allowed unlimited 0 unlimited
small 1G 1G 10 10 allowed unlimited 0 2K
trial 2G 1G 1000 0 disallowed unlimited 0 1K
</pre>
1. Record the name of the quota plan you want to modify.
1. Run:
```
cf update-org-quota QUOTA-NAME -n NEW-QUOTA-NAME -m TOTAL-MEMORY -i INSTANCE-MEMORY -r NUMBER-OF-ROUTES -s NUMBER-OF-SERVICE-INSTANCES
```
Where:
<ul>
<li><code>QUOTA-NAME</code> is the name of the quota plan you want to modify.</li>
<li>(Optional) <code>NEW-QUOTA-NAME</code> is the new name you want to give the quota plan.</li>
<li>(Optional) <code>TOTAL-MEMORY</code> is the total amount of memory you want to allocate to all app instances in the org.</li>
<li>(Optional) <code>INSTANCE-MEMORY</code> is the maximum amount of memory an app instance can use. Specify <code>-1</code> to allow app instances to use an unlimited amount of
memory.</li>
<li>(Optional) <code>LOG-RATE-LIMIT</code> is the total number of logs per second you want to allow all app instances in the org to send to Loggregator.</li>
<li>(Optional) <code>NUMBER-OF-ROUTES</code> is the total number of routes you want to allow all app instances in the org.</li>
<li>(Optional) <code>NUMBER-OF-SERVICE-INSTANCES</code> is the total number of service instances you want to allow all app instances in the org.</li>
<li>(Optional) To allow the quota plan to provision instances of paid service plans, include the <code>--allow-paid-service-plans</code> flag. To prevent the quota
plan from provisioning instances of paid service plans, include the <code>--disallow-paid-service-plans</code> flag.</li>
</ul>
For example:
```
cf update-org-quota small -n medium -m 4096M -i 2048M -l 8K -r 20 -s 20 --allow-paid-service-plans
```
## <a id='set-org-quota'></a> Assign a quota plan to an org
To assign a quota plan to an org:
1. Run:
```
cf set-org-quota ORG QUOTA-NAME
```
Where:
<ul>
<li><code>ORG</code> is the name of the org to which you want to assign the quota plan.</li>
<li><code>QUOTA-NAME</code> is the name of the quota plan you want to assign to the org.</li>
</ul>
## <a id='space'></a> Create and modify quota plans for a space
For each org, Org Managers create and modify quota plans for spaces in the org. If an Org Manager allocates a space quota, <%= vars.app_runtime_abbr %>
verifies that resources do not exceed the allocated space limit. For example, when a Space Developer deploys an app, <%= vars.app_runtime_abbr %> first checks
the memory allocation at the space level, then at the org level.
To create a quota plan for an individual space within an org, see [Create a Quota Plan for a Space](#new-space-plan).
To modify a quota plan for an individual space within an org, see [Modify a Quota Plan for a Space](#modify-space-plan).
### <a id='new-space-plan'></a> Creating a quota plan for a space
To create a quota plan for an individual space within an org:
1. Run:
```
cf create-space-quota QUOTA-NAME -m TOTAL-MEMORY -i INSTANCE-MEMORY -l LOG-RATE-LIMIT -r NUMBER-OF-ROUTES -s NUMBER-OF-SERVICE-INSTANCES
```
Where:
<ul>
<li><code>TOTAL-MEMORY</code> is the total amount of memory you want to allocate to all app instances in the space.</li>
<li><code>INSTANCE-MEMORY</code> is the maximum amount of memory an app instance can use. Specify <code>-1</code> to allow app instances to use an unlimited amount of memory.</li>
<li><code>LOG-RATE-LIMIT</code> is the total number of logs per second you want to allow all app instances in the org to send to Loggregator.</li>
<li><code>NUMBER-OF-ROUTES</code> is the total number of routes you want to allow all app instances in the space.</li>
<li><code>NUMBER-OF-SERVICE-INSTANCES</code> is the total number of service instances you want to allow all app instances in the space.</li>
<li>(Optional) Include the <code>--allow-paid-service-plans</code> flag to allow the quota plan to provision instances of paid service plans.</li>
</ul>
For example:
```
cf create-space-quota big -m 4096M -i 1024M -l 16K -r 20 -s 20 --allow-paid-service-plans
```
### <a id='modify-space-plan'></a> Modifying a quota plan for a space
To modify a quota plan for an individual space within an org:
1. View all existing quota plans for all of the spaces in your org by running:
```
cf space-quotas
```
The above command returns output similar to the following example:
<pre class="terminal">
Getting space quotas for org example-org as admin...
name total memory instance memory routes service instances paid service plans app instances route ports log volume per second
big 4G 1G 20 20 allowed unlimited 0 16K
trial 2G 1G 20 20 allowed unlimited 0 2K
</pre>
1. Record the name of the quota plan you want to modify.
1. Run:
```
cf update-space-quota QUOTA-NAME -n NEW-QUOTA-NAME -m TOTAL-MEMORY -i INSTANCE-MEMORY -r NUMBER-OF-ROUTES -s NUMBER-OF-SERVICE-INSTANCES
```
Where:
<ul>
<li><code>QUOTA-NAME</code> is the name of the quota plan you want to modify.</li>
<li>(Optional) <code>NEW-QUOTA-NAME</code> is the new name you want to give the quota plan.</li>
<li>(Optional) <code>TOTAL-MEMORY</code> is the total amount of memory you want to allocate to all app instances in the space.</li>
<li>(Optional) <code>INSTANCE-MEMORY</code> is the maximum amount of memory an app instance can use. Specify <code>-1</code> to allow app instances to use an unlimited amount of
memory.</li>
<li>(Optional) <code>LOG-RATE-LIMIT</code> is the total number of logs per second you want to allow all app instances in the org to send to Loggregator.</li>
<li>(Optional) <code>NUMBER-OF-ROUTES</code> is the total number of routes you want to allow all app instances in the space.</li>
<li>(Optional) <code>NUMBER-OF-SERVICE-INSTANCES</code> is the total number of service instances you want to allow all app instances in the space.</li>
<li>
(Optional) To allow the quota plan to provision instances of paid service plans, include the <code>--allow-paid-service-plans</code> flag. To prevent the quota
plan from provisioning instances of paid service plans, include the <code>--disallow-paid-service-plans</code> flag.
</li>
</ul>
For example:
```
cf update-space-quota big -n bigger -m 4096M -i 20 -l 32K -r 20 -s 20 --allow-paid-service-plans
```
## <a id='set-space-quota'></a> Assign a quota plan to a space
To assign a quota to a space, run the following command. Replace the placeholder attributes with the values for this quota plan:
To assign a quota plan to a space:
1. In a terminal window, run:
```
cf set-space-quota SPACE QUOTA-NAME
```
Where:
<ul>
<li><code>SPACE</code> is the name of the space to which you want to assign the quota plan.</li>
<li><code>QUOTA-NAME</code> is the name of the quota plan you want to assign to the space.</li>
</ul>
<p class="note important">
If you attempt to assign a quota plan with a log rate limit to a space containing apps that are already configured to
send an unlimited number of logs to Loggregator, the command returns an error. To remedy this issue, see
<a href="#update-log-rate-limit">Configure apps with unlimited Log Rate Limits</a>.
</p>
### <a id='update-log-rate-limit'></a> Configure apps with unlimited log rate limits
If you assign a quota plan with a log rate limit to a space containing apps that are already configured to send an unlimited number of logs to Loggregator,
you see an error similar to the following example:
<pre class="terminal">
Setting space quota big to space example-space as admin...
Current usage exceeds new quota values. The space(s) being assigned this quota contain apps running with an unlimited log rate limit.
FAILED
</pre>
Before you can assign a quota plan to the space, you must configure each app in the space with a log rate limit that is lower than the log rate limit
specified in the quota plan.
To update the log rate limit for an app in the space to which you want to assign a quota plan:
1. Run:
```
cf scale -l LOG-RATE-LIMIT APP-NAME
```
Where:
<ul>
<li><code>LOG-RATE-LIMIT</code> is the log rate limit in bytes per second that you want to configure for the app.</li>
<li><code>APP-NAME</code> is the name of the app for which you want to configure a log rate limit.</li>
</ul>
After you have configured a log rate limit for each app in the space, follow the procedure in [Assign a Quota Plan to a Space](#set-space-quota).
## <a id='cf-help'></a> View list of space and org quota commands
To view a list and brief description of all cf CLI commands related to space and org quotas:
1. Run:
```
cf help -a
```
1. In the terminal output, find the following commands:
<pre class="terminal">
...
ORG ADMIN:
org-quotas List available organization quotas
org-quota Show organization quota
set-org-quota Assign a quota to an organization
create-org-quota Define a new quota for an organization
delete-org-quota Delete an organization quota
update-org-quota Update an existing organization quota
share-private-domain Share a private domain with a specific org
unshare-private-domain Unshare a private domain with a specific org
SPACE ADMIN:
space-quotas List available space quotas
space-quota Show space quota info
create-space-quota Define a new quota for a space
update-space-quota Update an existing space quota
delete-space-quota Delete a space quota
set-space-quota Assign a quota to a space
unset-space-quota Unassign a quota from a space
</pre>