Brains4Cloud
ESEN
Practice

Topic 3 of 5

D1 · Setting up a cloud solution environment

APIs, quotas, and locations

Three checks before any deployment: the service API is enabled in the project, there is enough quota, and the product exists in the chosen region or zone. The exam guide lists them as "Enabling APIs", "Assessing quotas and requesting increases", and "Verifying product availability across geographical locations".

Enabling APIs in a project

Google Cloud services are enabled project by project with Service Usage, including private services created with Cloud Endpoints. The console covers most cases; for scripts you use the Google Cloud CLI and, for programmatic access, the Service Usage API client libraries.

Required role

Service Usage Admin (roles/serviceusage.serviceUsageAdmin) on the project.

Console

APIs & Services → find the API → Enable. To turn it off, open the API and click Disable API.

gcloud services enable bigquery.googleapis.com pubsub.googleapis.com
gcloud services disable bigquery.googleapis.com
gcloud services operations describe operations/OPERATION_ID
  • You can enable or disable several services in one command. Each operation returns an ID you can check with gcloud services operations describe.
  • The Service Usage API itself is enabled by default. If you disable it in the project that makes the requests, calls to enable or disable services fail until you turn it back on from the console or gcloud.

What are quotas?

A quota restricts how much of a resource a project can use: API calls, load balancers in use, projects you can create. Quotas protect the user community by preventing overload and help you manage your own consumption.

The Cloud Quotas system monitors consumption, restricts it, and lets you request changes and automate adjustments. If you try to consume more than allowed, access is usually blocked and the task fails.

Quota

An adjustable value per project, folder, or organization. You can ask for it to go up or down.

System limit

A fixed constraint, such as a maximum file size or a schema limit. It can't be increased or decreased.

Free trial accounts may have lower quota values. When you enable billing on the project, most of them increase.

Quota types

TypeWhat it limitsExample
AllocationHow much of a resource is allocated to youNumber of VMs in a project
RateHow much you can consume over a time period1,000 requests per day to an API
ConcurrentSimultaneous operations, mostly long-running onesCompute Engine insert operations that run up to an hour

Quota hierarchy level and location

By hierarchy level

  • Project (the most common): usage in one project doesn't affect another. Within the project, quota is shared across all applications and IP addresses.
  • Folder and organization: they add up the usage of all children.
  • User: e.g. how many projects a user or service account can create.

By location

  • Global: usage in any region reduces the quota for all of them.
  • Regional: counts usage in every zone of the region.
  • Zonal: limits each zone. If there is also a regional quota, usage in one zone reduces the shared regional quota.

Example from the Compute Engine docs: with a global quota of 50 target pools, creating 25 in one region and 25 in another uses up the project quota in every region. With a regional quota of 7 reserved IP addresses, you can reserve only 7 per region.

When you run out of quota

The task fails with a quota error and keeps failing until there is enough room. If you don't want to change the quota value:

Allocation

Free up unused resources. With a quota of 100 VMs and 99 created, asking for 10 more fails entirely (even though one would fit): delete nine so they fit.

Rate

Wait for the next period. Per-day quotas reset at midnight Pacific Time; per-minute quotas reset one minute after the first request, in a rolling window.

Requesting a quota adjustment

1

Go to IAM & Admin → Quotas & System Limits. Select the project.

2

Select the quota and click Edit. Use the filter to find it.

3

Enter the new value. If it exceeds the maximum in the dialog, choose Apply for higher quota and add a description.

4

Submit the request. If it needs review, you get an acknowledgment email and later another with the decision.

  • Roles: Quota Viewer (roles/servicemanagement.quotaViewer) to view and Quota Administrator (roles/servicemanagement.quotaAdmin) to request adjustments.
  • Most increases are requested at the project level; few products support organization-level increases. Decreases can be requested at the project, folder, and organization levels.
  • Most requests are evaluated by automated systems based on resource availability, how long you have used Google Cloud, and other factors. Some are escalated to human reviewers. You might be asked to pay in advance.
  • You don't need a paid support contract to request an adjustment. If you can't do it from the console, ask Cloud Customer Care.
  • Group requests by product and area (for example, networking in one and Compute Engine VMs in another): batching many in one request lengthens the review.
  • The quota adjuster requests adjustments automatically as you approach the limit, if there is enough usage history to predict.
  • To create more projects without an organization, use the Request Project Quota Increase form.

Quota alerts

The Cloud Quotas dashboard is integrated with Cloud Monitoring. From Quotas & System Limits, in a quota's menu, Create usage alert opens an alert policy template: you choose the notification channel (email, SMS, Pub/Sub…) and get notified when usage reaches a percentage of the maximum. This basic alert exists only for project-level quotas. In Metrics Explorer, the Consumer Quota resource shows quota usage metrics.

Region

An independent geographic area with three or more zones in three or more physical data centers. Stockholm, Osaka, and Montreal have three zones in one or two data centers and are expanding.

Zone

A deployment area within a region. It is considered a single failure domain. Name: region + letter, e.g. us-central1-a.

  • Zones in a region have high-bandwidth, low-latency connections to each other.
  • For high availability, Google recommends deploying across multiple zones and multiple regions, and having a recovery plan in case you lose a whole region.
  • AI zones are specialized zones with high-capacity GPUs and TPUs for training and inference. Their name adds ai, a number, and a letter: us-west4-ai2b shares the update rollout wave of us-west4-b.
  • Communication within a region is generally cheaper and faster than across regions.
  • Pick a region close to your users to reduce latency, and wherever your data residency requirements demand.

Zonal, regional, and multi-regional resources

ScopeBehaviorExamples
ZonalRuns in one zone; a zone outage affects it. Only resources in the same zone can use itVM instances, zonal disks
RegionalRedundant across zones in a region; any resource in the region can use itStatic external IP addresses, regional MIGs, App Engine
Multi-regionalGoogle distributes it across regions and it keeps working if one is lostCloud Storage, Spanner, Firestore, Cloud KMS, Artifact Registry. Note: a BigQuery multi-region stores data in a single region
GlobalUsable from any locationCompute Engine images

Rule of thumb

To attach a zonal persistent disk to a VM, both must be in the same zone. To assign a static IP address to a VM, both must be in the same region.

Verifying availability by location

Not every product or piece of hardware is available everywhere. To check:

  • The Cloud locations page and "Products available by location" show which services each region offers.
  • For Compute Engine, gcloud compute machine-types list shows which zones offer each machine type.
  • Confidential VM is only in certain machine series and zones; sole-tenancy, wherever machine series with sole-tenant node types exist.
  • If you don't know which zone to pick, the console lets you choose Any and Google decides based on machine type and capacity. The bulk instance creation API and regional MIGs with a target distribution shape also pick zones automatically.
gcloud compute machine-types list --filter="name=c4d-standard-4"

Transparent maintenance

Google maintains its infrastructure without interrupting VMs: by default, most are set to live migrate, which moves them to another host in the same zone without shutting them down. The alternative is stop and reboot: the VM shuts down cleanly and restarts away from the event. Some machine series support only this second option. It is set in the VM's host maintenance policy, covered in domain D2.

Exam scenarios

SituationAnswerWhy
A script must turn on BigQuery and Pub/Sub in a new projectgcloud services enable bigquery.googleapis.com pubsub.googleapis.comEnables several services in one command.
Quota error creating VM number 101 with a quota of 100Delete unused VMs or request an adjustmentIt is an allocation quota.
An API returns a daily quota error at 6 PMWait until midnight Pacific Time or request an adjustmentPer-day quotas reset at that time.
Request more quota without a paid support planQuotas & System Limits → EditNo Customer Care contract needed.
Get notified at 80% of a quotaCreate usage alert in Quotas & System LimitsUses Cloud Monitoring and a notification channel.
Find which zones offer a machine typegcloud compute machine-types list --filterAvailability varies by zone.
Keep the app running if a zone failsSpread across several zones in the regionA zone is a single failure domain.

Common exam traps

❓ Can you request an increase to a system limit?

No. System limits are fixed; only quotas can be adjusted.

❓ Does using up one project's quota affect other projects?

Not for project-level quotas. It does for folder or organization quotas, which add up the usage of all children.

❓ Do you need paid support to request more quota?

No. You request it from Quotas & System Limits without a Customer Care contract.

❓ Which role do you need to enable an API?

Service Usage Admin (roles/serviceusage.serviceUsageAdmin) on the project.

❓ Can a VM in us-central1-a use a zonal disk in us-central1-b?

No. Zonal resources can only be used by resources in the same zone.

❓ What is the minimum number of zones in a region?

Three. Google intends to offer at least three zones in every general-purpose region.

❓ When do per-day quotas reset?

At midnight Pacific Time.

Did you get this topic?

Test what you just learned

A team needs to launch 200 VMs for a batch job, but the project's regional CPU quota only allows 120. They want to be warned before they run short again. What should they do?

Ready to test "APIs, quotas, and locations"?

Original questions, each with a full explanation.

Start a mock exam