Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some typos in admin docs and note about operator role #104

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions docs/admin.md
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ An example configuration:

For information on writing a plugin, see [Plugin System](#plugin-system).
By default, CloudAPI ships with some example plugins to limit provisioning based
on number of customer machines, or resouces used by customer machines, as well
on the number of customer machines, or resources used by customer machines, as well
as providing a free tier of machines for customers to use.

**Field** | **Type** | **Description**
Expand Down Expand Up @@ -593,7 +593,7 @@ those VMs' RAM, and/or the total sum of those VM's disk quota. Each of these
three sums can be optionally constrainted by: VM brand, VM OS (specifically, the
"os" attribute in the VM's image), and/or VM image name.

When this plugin is enabled, end users will be to request to see how much of the
When this plugin is enabled, end users will be able to check how much of the
limit they have used - through the
[GetAccountLimits](./index.md#GetAccountLimits) API.

Expand All @@ -603,7 +603,7 @@ different options for this plugin:


{
"name": "provisioning_limits",
"name": "provision_limits",
"enabled": true,
"config": {
"defaults": [{
Expand Down Expand Up @@ -685,7 +685,7 @@ an entire datacenter to 900GiB:
Several limits can apply to the same account at once. All the examples above
were meant as one-liners, but adding several limits to an account will work
as desired. Each limit is applied to a new provision, and if any of the
limits, the provision is rejected.
limits are reached, the provision is rejected.

As an example, to allow an account to have up to 25 VMs, a maximum of
25600MiB RAM and 2.5TiB disk across the datacenter, and specifically only
Expand Down Expand Up @@ -714,13 +714,16 @@ support has vetted the account, they can add a limit in ufds for that account
to override the defaults, thus bumping the amount of RAM or VMs the account
can provision.

Note that accounts with the `operator` role are considered admin/root
accounts and don't get any limits applied upon provision.

Limits are added to CloudAPI through sapi by adding a configuration for
this CloudAPI plugin:

CLOUDAPI_UUID=$(sdc-sapi /services?name=cloudapi | json -Ha uuid)
sdc-sapi /services/$CLOUDAPI_UUID -X PUT -d '{
"metadata": {
"CLOUDAPI_PLUGINS": "[{\"name\":\"provision_limits\", \
"CLOUDAPI_PLUGINS": "[{\"name\":\"provision_limits\",
\"enabled\": true,\"config\":{\"defaults\":[{\"value\":2 }]}}]"
}
}'
Expand All @@ -731,7 +734,7 @@ sdc-docker:
DOCKER_UUID=$(sdc-sapi /services?name=docker | json -Ha uuid)
sdc-sapi /services/$DOCKER_UUID -X PUT -d '{
"metadata": {
"DOCKER_PLUGINS": "[{\"name\":\"provision_limits\", \
"DOCKER_PLUGINS": "[{\"name\":\"provision_limits\",
\"enabled\": true,\"config\":{\"defaults\":[{\"value\":2 }]}}]"
}
}'
Expand Down
2 changes: 1 addition & 1 deletion plugins/provision_limits.js
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@ function allowProvisionOrResize(api, cfg) {
return cb();
}

log.debug({ limits: limits }, 'Will apply provison/resize limits');
log.debug({ limits: limits }, 'Will apply provision/resize limits');

var disallow = limits.some(function (limit) {
return limit.value <= -1;
Expand Down