Getting started with Yandex Cloud Quota Manager
Note
The service is at the Preview stage.
When designing a cloud infrastructure, it is important to take quotas and limits into consideration. Cloud Quota Manager allows you to manage quotas of all your Yandex Cloud services using different interfaces.
Quotas are limits on the number of resources you can use in your cloud. These are organizational constraints that can be changed as needed. Quotas help you avoid overspending and excessive use of resources through sensible budget planning and consumption management.
There are two terms that describe the use of quotas:
-
Quota limit: Current limit in place for a cloud or organization resource.
-
Quota usage: Amount or size of the actually used resource.
Potentially, you can increase quotas to the limits.
Limits are technical constraints of the Yandex Cloud architecture, hardware physical characteristics, or external limitations.
The diagram below illustrates the relationship between quotas and limits.
Currently, you can use the following quota management interfaces:
- Console
: Get information and request quota updates. - CLI: Get information about quotas.
- API: Get information about quotas.
Going forward, you will also be able to request quota updates via the CLI and API.
Getting information about quotas
-
In the management console
, select the cloud to view quotas for. -
Select the Quotas tab.
The page will display a list of services used in your cloud.
-
Expand a service section and view the values in the Usage column.
-
Two numbers mean
quota consumption / quota value
. For example,2 / 20
or1.203 / 5,120 GB
. -
A single number is a non-adjustable
limit
.
-
-
To estimate resource consumption, at the top right, select:
- Actively used: Resources consuming over a half of the quota.
- Almost exhausted: Resources that are almost exhausted.
Configure operations via the CLI
If you do not have the Yandex Cloud CLI yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameters.
The account must have the quota-manager.viewer
role to view quotas.
View the quotas
-
View the list of services with quotas.
yc quota-manager quota-limit list-services --resource-type=<resource_type>
Where
--resource-type
is the resource type:resource-manager.cloud
: Cloud.organization-manager.organization
: Organization.billing.account
: Billing account.
Example:
yc quota-manager quota-limit list-services --resource-type=resource-manager.cloud
The output will return the list of cloud-level services with available quotas.
-
View a list of quotas for a specific service as well as all quota values and usage.
yc quota-manager quota-limit list \ --service=<service_name> \ --resource-type=<resource_type> \ --resource-id=<resource_ID>
Where:
--service
: Service name you obtained at the previous step. You can also look up the name of the service in the YC CLI reference.--resource-id
is the resource ID: organization, cloud, folder, or billing account ID.--resource-type
: Resource type,resource-manager.cloud
,organization-manager.organization
, orbilling.account
.
Example:
yc quota-manager quota-limit list --service=iam --resource-type=resource-manager.cloud --resource-id=b1gflhy********
The output will return the IDs of quotas available in IAM within the
b1gflhy********
cloud together with their values and usage. -
View the value and usage of a given quota.
yc quota-manager quota-limit get \ --quota-id=<quota_ID> \ --resource-id <resource_ID> \ --resource-type <resource_type>
Where:
--quota-id
: Quota ID you got in the previous step.--resource-id
: ID of the resource (organization, cloud, or billing account).--resource-type
: Resource type,resource-manager.cloud
,organization-manager.organization
, orbilling.account
.
Example:
yc quota-manager quota-limit get --quota-id=iam.apiKeys.count --resource-id=b1gflhy******** --resource-type=resource-manager.cloud
The output will return the value and usage of the quota for the number of API keys in the
b1gflhy********
cloud.quota_id: iam.apiKeys.count limit: 1000 usage: 27
Where:
limit
: Quota value.usage
: Quota usage.
Configure operations via the API
-
To check that you can work with quotas via the API, install these utilities:
-
Create a service account with the
quota-manager.viewer
role. -
Get an IAM token for the created service account.
View the quotas
-
View the list of services with quotas.
To do this, use the listServices REST API method for the QuotaLimit resource or the QuotaLimitService/ListServices gRPC API call.
To test the REST API method, send this request:
curl -X GET \ --header "Authorization: Bearer <IAM_token>" \ "https://quota-manager.api.cloud.yandex.net/quota-manager/v1/quotaLimits/services?resourceType=<resourceType>"
Where:
<resourceType>
: Resource type,resource-manager.cloud
,organization-manager.organization
, orbilling.account
.<IAM_token>
: Service account IAM token or the environment variable containing the token.
Request example:
curl -X GET \ --header "Authorization: Bearer $IAM_TOKEN" \ 'https://quota-manager.api.cloud.yandex.net/quota-manager/v1/quotaLimits/services?resourceType=resource-manager.cloud'
-
View a list of quotas for a specific service as well as all quota values and usage.
To do this, use the list REST API method for the QuotaLimit resource or the QuotaLimitService/List gRPC API call.
To test the REST API method, run this request:
curl -X GET \ --header "Authorization: Bearer <IAM_token>" \ "https://quota-manager.api.cloud.yandex.net/quota-manager/v1/quotaLimits?service=<serviceName>&resource.id=<resourceId>&resource.type=<resourceType>"
Where:
<resourceId>
: ID of the resource: organization, cloud, or billing account.<resourceType>
: Resource type,resource-manager.cloud
,organization-manager.organization
, orbilling.account
.<serviceName>
: Service name.<IAM_token>
: Service account IAM token or the environment variable containing the token.
Request example:
curl -X GET \ --header "Authorization: Bearer $IAM_TOKEN" \ 'https://quota-manager.api.cloud.yandex.net/quota-manager/v1/quotaLimits?service=iam&resource.id=b1gflhy********&resource.type=resource-manager.cloud'
-
View the value and usage of a given quota.
To do this, use the get REST API method for the QuotaLimit resource or the QuotaLimitService/Get gRPC API call.
To test the REST API method, send this request:
curl -X GET \ --header "Authorization: Bearer <IAM_token>" \ "https://quota-manager.api.cloud.yandex.net/quota-manager/v1/quotaLimits/<quotaId>?resource.id=<resourceId>&resource.type=<resourceType>"
Where:
<quotaId>
: Quota ID you got in the previous step.<resourceId>
: ID of the resource (organization, cloud, or billing account).<resourceType>
: Resource type,resource-manager.cloud
,organization-manager.organization
, orbilling.account
.<IAM_token>
: Service account IAM token or the environment variable containing the token.
Request example:
curl -X GET \ --header "Authorization: Bearer $IAM_TOKEN" \ 'https://quota-manager.api.cloud.yandex.net/quota-manager/v1/quotaLimits/iam.accessKeys.count?resource.id=b1gflhy********&resource.type=resource-manager.cloud'
Requesting a quota increase
Currently, you can request quota updates via the management console
- Make sure your account
has thequota-manager.requestOperator
role or higher (editor
oradmin
). - Request a quota update using one of the following methods:
- Select the resources on the quota page
and click Increase. - Contact support
and describe which quotas you want increased and by how much.
- Select the resources on the quota page