Configure Cloud Quotas dimensions

Cloud Quotas dimensions represent different ways of measuring resource usage in Google Cloud. Dimensions are typically a region, zone, Google Cloud user, or product attribute.

The Cloud Quotas API represents dimensions as key-value pairs. The key is the dimension name (for example, region). The value is the assigned value for the dimension (for example, a region such as us-central1).

For example, Compute Engine measures VM use by using different dimensions. The region dimension measures the number of VMs you have in a given region. Compute Engine also has a number of product attribute dimensions, including gpu_family. The gpu_family dimension measures the number of GPUs of a given family in your Google Cloud project.

Dimension precedence

Some use cases for the Cloud Quotas API have complex dimension setups. Quotas can be configured at a more granular level than just regions and zones. You can accomplish this granularity when you use service-specific dimensions. For example, the gpu_family and network_id are service-specific dimensions in the Compute Engine service. Dimensions are defined by each individual service and each service might have a different set of service-specific dimensions.

When working with either location dimensions or service-specific dimensions, the following precedence is applied:

  1. A quota preference configuration with all location and service-specific dimensions specified takes precedence over any other configuration.

  2. Configurations that specify location dimensions only take precedence over configurations containing only service-specific dimensions.

Combining dimensions

In a quota preference configuration, you can combine dimensions in the following ways:

  1. The configuration may contain both location dimensions and service-specific dimensions. This is the highest order in precedence.

  2. The configuration may only contain location dimensions. This configuration applies to all service-specific dimensions, except the ones explicitly configured with method 1.

  3. The configuration may only contain service-specific dimensions. This configuration applies to all locations except those explicitly configured with method 1 or 2.

  4. If the configuration contains any service-specific dimensions, it must contain all service-specific dimensions.

  5. You can have configurations without any dimensions. Such configurations apply to all locations and all service-specific dimensions, except the ones explicitly configured.