This topic tells you how operators can set resource quotas for Redis for VMware Tanzu Application Service services.
On-Demand provisioning is intended to accelerate app development by eliminating the need for development teams to request and wait for operators to create a service instance. However, to control costs, operations teams and administrators must ensure responsible use of resources.
There are many ways to control the provisioning of on-demand service instances by setting various quotas at these levels:
After you set quotas, you can:
Each on-demand service has a separate service broker. A global quota at the service level sets the maximum number of service instances that can be created by a given service broker. If a service has more than one plan, then the number of service instances for all plans combined cannot exceed the global quota for the service.
You set a global quota for each service tile independently. For example, if you have two service tiles, you must set a separate global service quota for each of them.
When the global quota is reached for a service, no more instances of that service can be created unless the quota is increased, or some instances of that service are deleted.
A service might offer one or more plans. You can set a separate quota per plan so that instances of that plan cannot exceed the plan quota. For a service with multiple plans, the total number of instances created for all plans combined cannot exceed the global quota for the service.
When the plan quota is reached, no more instances of that plan can be created unless the plan quota is increased or some instances of that plan are deleted.
An org-level quota applies to all on-demand services and sets the maximum number of service instances an organization can create within their foundation. For example, if you set your org-level quota to 100, developers can create up to 100 service instances in that org using any combination of on-demand services.
When this quota is met, no more service instances of any kind can be created in the org unless the quota is increased or some service instances are deleted.
To create and set an org-level quota:
Run this command to create a quota for service instances at the org level:
cf create-org-quota QUOTA-NAME -m TOTAL-MEMORY -i INSTANCE-MEMORY -r ROUTES -s SERVICE-INSTANCES --allow-paid-service-plans
Where:
QUOTA-NAME
—A name for this quotaTOTAL-MEMORY
—Maximum memory used by all service instances combinedINSTANCE-MEMORY
—Maximum memory used by any single service instanceROUTES
—Maximum number of routes allowed for all service instances combinedSERVICE-INSTANCES
—Maximum number of service instances allowed for the orgFor example:
$ cf create-org-quota myquota -m 1024mb -i 16gb -r 30 -s 50 --allow-paid-service-plans
Associate the quota that you created with a specific org by running:
cf set-org-quota ORG-NAME QUOTA-NAME
For example:
$ cf set-org-quota dev_org myquota
For more information about managing org-level quotas, see Creating and modifying quota plans.
A space-level service quota applies to all on-demand services and sets the maximum number of service instances that can be created within a given space in a foundation. For example, if you set your space-level quota to 100, developers can create up to 100 service instances in that space using any combination of on-demand services.
When this quota is met, no more service instances of any kind can be created in the space unless the quota is updated or some service instances are deleted.
To create and set a space-level quota:
Run the following command to create the quota:
cf create-space-quota QUOTA-NAME -m TOTAL-MEMORY -i INSTANCE-MEMORY -r ROUTES -s SERVICE-INSTANCES --allow-paid-service-plans
Where:
QUOTA-NAME
—A name for this quotaTOTAL-MEMORY
—Maximum memory used by all service instances combinedINSTANCE-MEMORY
—Maximum memory used by any single service instanceROUTES
—Maximum number of routes allowed for all service instances combinedSERVICE-INSTANCES
—Maximum number of service instances allowed for the orgFor example:
$ cf create-space-quota myspacequota -m 1024mb -i 16gb -r 30 -s 50 --allow-paid-service-plans
Associate the quota you created with a specific space by run:
cf set-space-quota SPACE-NAME QUOTA-NAME
For example:
$ cf set-space-quota myspace myspacequota
For more information about managing space-level quotas, see Creating and modifying quota plans.
To view org quotas, run:
cf org ORG-NAME
To view space quotas, run:
cf space SPACE-NAME
For more information about managing org and space-level quotas, see the Creating and modifying quota plans.
Service-level and plan-level quota use, and total number of service instances, are available through the on-demand broker metrics emitted to Loggregator.
These are the listed metrics:
Metric Name | Description |
---|---|
on-demand-broker/SERVICE-NAME/quota_remaining |
Quota remaining for all instances across all plans |
on-demand-broker/SERVICE-NAME/PLAN-NAME/ |
Quota remaining for a specific plan |
on-demand-broker/SERVICE-NAME/total_instances |
Total instances created across all plans |
on-demand-broker/SERVICE-NAME/PLAN-NAME/ |
Total instances created for a specific plan |
Important Quota metrics are not emitted if no quota was set.
You can also view service instance use information in Apps Manager. For more information, see Reporting instance usage with Apps Manager.
On-Demand plans use dedicated VMs, disks, and various other resources from an IaaS, such as AWS. To calculate maximum resource cost for plans individually or combined, you multiply the quota by the cost of the resources selected in the plan configurations. The costs depend on your IaaS.
To view configurations for your Redis for Tanzu Application Service on-demand plan:
Go to Tanzu Operations Manager Installation Dashboard > Redis for VMware Tanzu Application Service > Settings.
Click On-Demand Plans.
The following image shows an example that includes the VM type and persistent disk selected for the server VMs, and the quota for this plan.
Although operators can limit on-demand instances with plan quotas and a global quota, as described earlier, IaaS resource use varies based on the number of on-demand instances provisioned.
To calculate the maximum cost of VMs and persistent disk for each plan, do the calculation as shown here:
plan quota x cost of selected resources
For example, if you selected the options shown in the image, you selected a VM type micro and a persistent disk type 20 GB, and the plan quota is 15. The VM and persistent disk types have an associated cost for the IaaS you are using. Therefore, to calculate the maximum cost of resources for this plan, multiply the cost of the resources selected by the plan quota:
(15 x cost of micro VM type) + (15 x cost of 20 GB persistent disk) = max cost per plan
To calculate the maximum cost for all plans combined, add together the maximum costs for each plan. Ensure that the sum of your individual plan quotas is less than the global quota.
For example:
(plan1 quota x plan1 resource cost) + ( plan2 quota x plan2 resource cost) = max cost for all plans
To calculate the current actual resource cost across all your on-demand plans:
Find the number of instances provisioned for each active plan by looking at the total_instance
metric for that plan.
Multiply the total_instance
count for each plan by that plan’s resource costs. Record the costs for each plan.
Add up the costs noted in Step 2 to get your total current resource costs.
For example:
(plan1 total_instances x plan1 resource cost) + (plan2 total_instances x plan2 resource cost) = current cost for all plans