Working with Resource Limit Templates

Resource limit templates enable you to easily apply a set of resource limits. For example, you can create a template to apply one set of resource limits to two different tenancies and create another template to apply a second set of resource limits to three other tenancies. You can apply no more than one template to a tag.

Templates only need to specify limit values that are different from the default. If a limit is not specified, then its value is the default value from the limit definition if the template's default value behavior is set to INHERIT.

The commands in this topic create a resource limit template, list the available templates, show more information about the specified template, assign a template to a tag, unassign a template, and delete the template.

Viewing Resource Limit Templates

This topic describes how to list the available limit templates and show more information about the specified template.

Using the Service Web UI

  1. On the navigation menu, select Limits, and then select Limit Templates.

    For each limit template, the table shows the name of the template, whether the template allows tag overrides, and the default value behavior: Inherit or Zero.

  2. To show the details of a particular limit template, either select the name of the limit override in the list, or select the Actions menu for that limit override and select View Details.

    The Resources section of the details page shows overrides that have already been created for this limit template. You can edit or delete an override in that list, view details of an override, or use the button above the list to create a new override for this template. See Creating Resource Limit Overrides.

Using the Service CLI

The list LimitTemplate command lists all available resource limit templates. Both templates shown in the following example allow you to override the limit values in the template.

PCA-ADMIN> list LimitTemplate
Command: list LimitTemplate
Status: Success
Time: 2025-05-06 16:57:24,796 UTC
Data: 
  id           Name         Allows Overrides   Default Value Behavior
  --           ----         ----------------   ----------------------
  template1    template1    true               INHERIT
  template2    template2    true               ZERO

The show LimitTemplate command shows more information for the specified template, particularly overrides. Provide the template id from the output of the list LimitTemplate command.

In the following example, the default value of 100 for identity~users was overridden by using create LimitOverride (see Setting Resource Limit Overrides).

PCA-ADMIN> show LimitTemplate id=template1
Command: show LimitTemplate id=template1
Status: Success
Time: 2025-05-06 16:58:02,694 UTC
Data: 
  Id = template1
  Type = LimitTemplate
  Name = template1
  Allows Overrides = true
  Default Value Behavior = INHERIT
  Overrides 1 - Limit Name = users
  Overrides 1 - Service Name = identity
  Overrides 1 - Value = 200

Creating Resource Limit Templates

This topic describes how to create a resource limit template.

By default (Allow Overrides is True), if the same limit is set both in the template and directly on the tag, the limit that is set directly on the tag is used.

When Allow Overrides is false, limits set by the template are used; any limits set directly on the tag are ignored. If a limit for the tag to which the template is assigned is not explicitly set in the template, then the default value of that limit is used or 0 is used, depending on the value of Default Value Behavior.

By default (the value of Default Value Behavior is Inherit), any limit values that are not explicitly set in this template inherit their default value from their limit definition.

When the value of Default Value Behavior is Zero, any limit values that are not explicitly set in this template are set to 0: No new resources of that type can be created. Existing resources are not affected. Unassigning this template restores the ability to create new resources for the tag.

Using the Service Web UI

  1. On the navigation menu, select Limits, and then select Limit Templates.

  2. Select the Create Limit Template button above the list.

  3. On the Create Limit Template dialog, enter the following information:

    • Name: Maximum 40 characters.

    • Default Value Behavior: Select either Inherit or Zero. Inherit is selected by default.

    • Allow Overrides: Select either True or False. True is selected by default.

  4. Select the Create Limit Template button in the dialog.

    On the details page for this template, scroll to the Resources section to define limit overrides for this template. See Creating Resource Limit Overrides.

Using the Service CLI

Use the create LimitTemplate command to create a new template with the specified template name.

The following examples create resource limit templates. The create LimitTemplate command does not set any limit values. Use the create LimitOverride command, specifying a template instead of a tag, to set limit values for the specified template. See Setting Resource Limit Overrides.

In the following example, defaultValueBehavior is set to INHERIT by default:

PCA-ADMIN> create LimitTemplate name=template1
Command: create LimitTemplate name=template1
Status: Success
Time: 2025-05-06 16:59:13,531 UTC
JobId: a2f6df33-e70e-408b-aee5-7583b24e53ce

In the following example, defaultValueBehavior is explicitly set to ZERO:

PCA-ADMIN> create LimitTemplate name=template2 defaultValueBehavior=ZERO
Command: create LimitTemplate name=template2
Status: Success
Time: 2025-05-06 16:59:13,531 UTC
JobId: a2f6df33-e70e-408b-aee5-7583b24e53ce

Assigning Resource Limit Templates

This topic describes how to assign a limit template to a tag.

At most one limit template can be assigned to a given tag. If you assign a second template to a tag, the second template replaces the first template; you do not need to unassign the first template.

If you assign a template to a tag and a limit for that tag is directly applied to the tag, then the Allow Overrides setting determines which limit value is used:

  • If Allow Overrides is false for the template, then the limit value specified in the template is used. If a limit value is not explicitly set in the template, then the default value of that limit is used or 0 is used, depending on the value of Default Value Behavior.

  • If Allow Overrides is true for the template, then the limit value that was already specified on the tag is used.

Using the Service Web UI

  1. On the navigation menu, select Limits, and then select Limit Template Assignments.

    For each limit template assignment, the template name and the tag are shown.

  2. To assign a limit template, select the Assign Limit Template button above the template assignments list.

  3. On the Create Limit Template Assignment dialog, enter the following information:

    • Template Name: Select the template name from the drop-down menu.

    • Tag: Select the tag from the drop-down menu.

    • Allow Overrides: Select either True or False. True is selected by default.

  4. Select the Create Limit Template Assignment button on the dialog.

Using the Service CLI

Use the assignLimitTemplate command to assign the specified template to the specified tag.

PCA-ADMIN> assignLimitTemplate templateName=template1 tag=ocid1.tenancy.unique_ID1
Command: assignLimitTemplate templateName=template1 tag=ocid1.tenancy.unique_ID1
Status: Success
Time: 2025-05-06 11:17:53,557 UTC
JobId: 4fe99f37-554d-4ce8-8084-639f6069cc44

Use the list LimitTemplateAssignment command to list all templates and the tags to which they are assigned. In the following example, template1 is assigned to two different tags:

PCA-ADMIN> list LimitTemplateAssignment
Status: Success
Time: 2025-05-06 11:18:01,309 UTC
Data: 
  Template Name   Tag     
  -------------   ---     
  template1       ocid1.tenancy.unique_ID1
  template1       ocid1.tenancy.unique_ID2
  template3       SYSTEM

Unassigning Resource Limit Templates

This topic describes how to unassign a limit template from a tag.

When a template is unassigned, the limits set in that template are removed from the affected tags.

  • If you specify only a template name, that template is unassigned from all tags to which it had been assigned.

  • If you specify both a template name and a tag, the specified template is unassigned from the specified tag.

  • If you specify only a tag, any template that had been assigned to that tag is unassigned from that tag.

Using the Service Web UI

  1. On the navigation menu, select Limits, and then select Limit Template Assignments.

    For each limit template assignment, the template name and the tag are shown.

  2. To unassign a limit template, select the Actions menu for that template and then select the Unassign option, or select the Unassign Limit Templates button above the template assignments list.

  3. On the Unassign Limit Templates dialog, enter the following information:

    • Template Name: Select the template name from the drop-down menu.

    • Tag: Select the tag from the drop-down menu.

    You must specify at least one template name or tag. You can specify multiple template names or tags, or multiple template name and tag pairs. See the rules at the beginning of this topic.

  4. Select the Unassign Limit Templates button on the dialog.

Using the Service CLI

Use the unassignLimitTemplate command to unassign a limit template.

PCA-ADMIN> unassignLimitTemplate templateName=template1 tag=ocid1.tenancy.unique_ID2
Command: unassignLimitTemplate templateName=template1 tag=ocid1.tenancy.unique_ID2
Status: Success
Time: 2025-05-06 11:18:44,481 UTC
JobId: 48fa692d-a997-48da-8b60-309bc4be7ad1

Deleting Resource Limit Templates

This topic describes how to delete a resource limit template. If the template overrides a limit that is set per tenancy, you might want to check which tenancies the template is assigned to. See Assigning Resource Limit Templates.

Using the Service Web UI

  1. On the navigation menu, select Limits, and then select Limit Templates.

  2. For the limit template that you want to delete, select the Actions menu, and select the Delete option.

  3. Confirm the delete operation.

Delete a Resource Limit Template

Use the delete LimitTemplate command to delete the specified template.

PCA-ADMIN> delete LimitTemplate id=template2
Command: delete LimitTemplate id=template2
Status: Success
Time: 2025-05-06 17:01:36,806 UTC
JobId: 62ae5905-3150-4724-a921-727f61dcdcdc