LATEST VERSION: 1.10 - CHANGELOG
Pivotal Cloud Foundry v1.9

Creating and Modifying Quota Plans

Page last updated:

Quota plans are named sets of memory, service, and instance usage quotas. For example, one quota plan might allow up to 10 services, 10 routes, and 2 GB of RAM, while another might offer 100 services, 100 routes, and 10 GB of RAM. Quota plans have user-friendly names, but are referenced in Cloud Foundry (CF) 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.

Org Quota Plan Attributes

Name Description Valid Values Example Value
nameThe name you use to identify the planA sequence of letters, digits, and underscore characters. Quota plan names within an account must be unique.silver_quota
memory_limitMaximum memory usage allowedAn integer and a unit of measurement like M, MB, G, or GB2048M
app_instance_limitMaximum app instances allowed.

Stopped apps do not count toward this instance limit. Crashed apps count toward the limit because their desired state is starting.
An integer 25
non_basic_services_allowedDetermines whether users can provision instances of non-free service plans. Does not control plan visibility. When false, non-free service plans may be visible in the marketplace but instances can not be provisioned.true or falsetrue
total_routesMaximum routes allowedAn integer500
total_reserved_route_portsMaximum routes with reserved portsAn integer not greater than total_routes60
total_servicesMaximum services allowedAn integer25
trial_db_allowedLegacy Field. Value can be ignored.true or falsetrue

Default Quota Plan for an Org

Cloud Foundry installs with a quota plan named default with the following values:

  • Memory Limit: 10240 MB

  • Total Routes: 1000

  • Total Services: 100

  • Non-basic Services Allowed: True

  • Trial DB Allowed: True

Create a New Quota Plan for an Org

Note: The org manager sets and manages quotas. See the Orgs, Spaces, Roles, and Permissions topic for more information.

You must set an org quota. You can create a new quota plan for an org in one of two ways:

Modify the CF Deployment Manifest

The CF Deployment manifest specifies the default quota plans applied to orgs. Follow the steps below to modify the default quota plans by locating and editing the manifest.

  1. In a terminal window, run bosh edit deployment to open the deployment manifest YAML file in your default text editor.
  2. Search for quota_definitions.
  3. 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
          non_basic_services_allowed: true
          total_routes: 1000
          total_services: 100
          trial_db_allowed: true
        silver_quota:
          memory_limit: 2048M
          non_basic_services_allowed: true
          total_routes: 500
          total_services: 25
          trial_db_allowed: true
    

  4. Save and close the deployment manifest.

  5. Run bosh deploy to apply the change.

Note: Any subsequent updates to the quota in the manifest are not applied to your environment after the initial deploy, even though BOSH updates the controller instance with new settings.

Use cf create-quota

In a terminal window, run the following command. Replace the placeholder attributes with the values for this quota plan:

cf create-quota QUOTA [-m TOTAL_MEMORY] [-i INSTANCE_MEMORY] [-r ROUTES] [-s SERVICE_INSTANCES] [--allow-paid-service-plans]

This command accepts the following flags:

  • -m: Total amount of memory
  • -i: Maximum amount of memory an application instance can have (-1 represents an unlimited amount)
  • -r: Total number of routes
  • -s: Total number of service instances
  • -allow-paid-service-plans: Can provision instances of paid service plans

Example:

$ cf create-quota small -m 2048M -i 1024M -r 10 -s 10 --allow-paid-service-plans

Modify an Existing Quota Plan for an Org

You can modify an existing quota plan for an org in one of two ways:

Modify the Manifest

  1. In a terminal window, run bosh edit deployment to open the deployment manifest YAML file in your default text editor.
  2. Search for quota_definitions.
  3. Modify the value of the attribute.
  4. Save and close the deployment manifest.

Use cf update-quota

  1. Run cf quotas to find the names of all quota definitions available to your org. Note the name of the quota plan to be modified.

    $ cf quotas
    Getting quotas as admin@example.com...
    OK
    
    name           total memory limit   instance memory limit   routes       service instances   paid service plans
    free           0                    0                       1000         0                   disallowed
    paid           10G                  0                       1000        -1                   allowed
    small          2G                   0                         10        10                   allowed
    trial          2G                   0                       1000        10                   disallowed
    
  2. Run the following command, replacing QUOTA with the name of your quota.

    cf update-quota QUOTA [-i INSTANCE_MEMORY] [-m MEMORY] [-n NEW_NAME] [-r ROUTES] [-s SERVICE_INSTANCES] [--allow-paid-service-plans | --disallow-paid-service-plans]

    This command accepts the following flags:

    • -i: Maximum amount of memory an application instance can have (-1 represents an unlimited amount)
    • -m: Total amount of memory a space can have
    • -n: New name
    • -r: Total number of routes
    • -s: Total number of service instances
    • --allow-paid-service-plans: Can provision instances of paid service plans
    • --disallow-paid-service-plans: Can not provision instances of paid service plans

    Example:

     $ cf update-quota small -i 2048M -m 4096M -n medium -r 20 -s 20 --allow-paid-service-plans

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, CF verifies that resources do not exceed the allocated space limit. For example, when a Space Developer deploys an application, CF first checks the memory allocation at the space level, then at the org level.

Perform the following procedures to create and modify quota plans for individual spaces within an org.

Create a New Quota Plan for a Space

In a terminal window, run the following command to create a quota for a space. Replace the placeholder attributes with the values for this quota plan:

cf create-space-quota QUOTA [-i INSTANCE_MEMORY] [-m MEMORY] [-r ROUTES] [-s SERVICE_INSTANCES] [--allow-paid-service-plans]

Example:

$ cf create-space-quota big -i 1024M -m 4096M -r 20 -s 20 --allow-paid-service-plans

Modify a Quota Plan for a Space

Run cf space-quotas to find the names of all space quota available to your org. Note the name of the quota plan to be modified.

$ cf space-quotas
Getting quotas as admin@example.com...
OK

name           total memory limit   instance memory limit   routes       service instances   paid service plans
big            2G                   unlimited               0            10                  allowed
trial          2G                   0                       0            10                  allowed

To modify that quota, use the update-space-quota command. Replace the placeholder attributes with the values for this quota plan.

cf update-space-quota SPACE-QUOTA-NAME [-i MAX-INSTANCE-MEMORY] [-m MEMORY] [-n NEW_NAME] [-r ROUTES] [-s SERVICES] [--allow-paid-service-plans | --disallow-paid-service-plans]

Example:

 $ cf update-space-quota big -i 20 -m 4096M -n bigger -r 20 -s 20 --allow-paid-service-plans

Run cf help

For more information regarding quotas, run cf help to view a list and brief description of all cf CLI commands. Scroll to view org and space quotas usage and information.

$ cf help
...
ORG ADMIN:
   quotas                                 List available usage quotas
   quota                                  Show quota info
   set-quota                              Assign a quota to an org

   create-quota                           Define a new resource quota
   delete-quota                           Delete a quota
   update-quota                           Update an existing resource quota

   share-private-domain                   Share a private domain with an org
   unshare-private-domain                 Unshare a private domain with an org

SPACE ADMIN:
   space-quotas                           List available space resource quotas
   space-quota                            Show space quota info
   create-space-quota                     Define a new space resource quota
   update-space-quota                     update an existing space quota
   delete-space-quota                     Delete a space quota definition and unassign the space quota from all spaces
   set-space-quota                        Assign a space quota definition to a space
   unset-space-quota                      Unassign a quota from a space

Create a pull request or raise an issue on the source for this page in GitHub