tokman
tokman

Reputation: 81

Does GCP have an API call to check resource availability?

We keep getting ZONE_RESOURCE_POOL_EXHAUSTED when we try to deploy VMs in the zones of the us-central1 region. Apparently, GCP doesn't have enough VMs to fill the request.

We tried other regions one by one us-east1, us-east4, etc. all returned the same error until finally found that us-east5 have VMs available and we're now temporarily using it.

Is there an API call to check GCP resource availability so we can directly deploy VMs in that zone?

For example,

# call
r = get_resources(machine_type, zone)
# returns:
[{
  'service': 'compute_engine',
  'machine_type': '2-standard4',
  'available': True
  'stock': 4560
}, ...
]

Note

  1. Machine type we're using e2-custom-2-4096 (Custom E2 family machine).
  2. The desired API call would check if GCP itself has resources in that zone or region, not the project quota!

Upvotes: 2

Views: 868

Answers (1)

Veera Nagireddy
Veera Nagireddy

Reputation: 1904

No such dashboards, API method (or) Feature to give the resource availability in GCP.

But while creating resources if you face any issues like ZONE_RESOURCE_POOL_EXHAUSTED, please follow the guidelines mentioned in the official document for Troubleshooting errors that you might encounter while creating or updating VMs

Upvotes: 1

Related Questions