SkillAgentSearch skills...

compute-resource-availability-troubleshooting

Diagnoses, mitigates, and prevents Google Compute Engine resource availability and capacity stockout errors (ZONE_RESOURCE_POOL_EXHAUSTED, ZONE_RESOURCE_POOL_EXHAUSTED_WITH_DETAILS, and machine type or accelerator unavailable in zone).

Install / Use

npx skills add google/skills --skill compute-resource-availability-troubleshooting

Installs into whichever agent you are using.

About this skill
📄

SKILL.md

Installable skill definition

Quality Score

90/100

Supported Platforms

Universal

Tags

Our assessment of compute-resource-availability-troubleshooting

compute-resource-availability-troubleshooting scores 90/100 on our quality scale, 1190th of 4,700 Development & Engineering skills we index (top 26%).

Its SKILL.md is 26 KB long, well organised into 26 sections with 8 code examples: a thorough specification that gives an agent plenty to work with.

With 20,340 GitHub stars, it is one of the more widely adopted skills in the catalogue.

Substance
30/30
Structure
20/20
Description
15/15
Adoption
18/20
Freshness
15/15

Maintenance, license and trust

  • The repository was last updated about 2 months ago, so compute-resource-availability-troubleshooting is actively maintained.
  • It is released under the Apache-2.0 license, a permissive license that allows use, modification and commercial use with attribution.
  • Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.

compute-resource-availability-troubleshooting compared with similar skills

All 4 of these similar skills score higher than compute-resource-availability-troubleshooting; compare them before choosing.

SkillScoreStarsUpdatedFormat
compute-resource-availability-troubleshooting (this skill)by google9020.3k2mo agoSKILL.md
taste-skillby Leonxlnx100121.1ktodayCLAUDE.md
hyperframesby heygen-com10089.6ktodayCLAUDE.md
ai-job-searchby ai-job-search-dev10073.3k1d agoCLAUDE.md
claude-howtoby luongnv8910047.6k4d agoCLAUDE.md

Frequently asked questions

How do I install compute-resource-availability-troubleshooting?
Run npx skills add google/skills --skill compute-resource-availability-troubleshooting. The install tabs above show the steps for each supported agent.
Which AI agents does compute-resource-availability-troubleshooting work with?
It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
Is compute-resource-availability-troubleshooting safe to use?
It is Apache-2.0-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
Is compute-resource-availability-troubleshooting still maintained?
The repository was last updated about 2 months ago, so compute-resource-availability-troubleshooting is actively maintained.

name: compute-resource-availability-troubleshooting description: >- Diagnoses, mitigates, and prevents Google Compute Engine resource availability and capacity stockout errors (ZONE_RESOURCE_POOL_EXHAUSTED, ZONE_RESOURCE_POOL_EXHAUSTED_WITH_DETAILS, and machine type or accelerator unavailable in zone). Use ONLY when VM creation, Managed Instance Group (MIG) scale-out, or stopped instance startup fails due to regional or zonal hardware capacity exhaustion for GPUs, TPUs, or specific CPU shapes. DO NOT read or use for IAM permission errors, project quota limit increases without stockouts, general greenfield VM creation, or unexpected host reboots on already-running VMs. metadata: version: "1.0.0" category: Compute

Compute Engine Resource Availability and Stockout Troubleshooting

MCP Tools: list_machine_types, list_accelerator_types, get_zone_operation, list_instance_group_managers, list_managed_instances, list_reservations, get_reservation_details

This skill diagnoses and resolves Google Compute Engine resource availability errors (capacity stockouts). It provides immediate tactical workarounds to get blocked workloads running and long-term architectural mitigations using Regional Managed Instance Group (MIG) distribution shapes, Instance Flexibility, Dynamic Workload Scheduler (DWS) Flex-Start, and On-Demand Capacity Reservations.

Usage Attribution

MUST READ: Before executing any gcloud, REST API, or MCP command, you MUST read and follow the instructions in Usage Attribution.


Prerequisites & Environment Setup

Any host, project, IAM, or Compute Engine resource modifications (installing gcloud, configuring MCP, enabling APIs or Log Analytics, creating instances or reservations, updating MIGs, or deleting resources) must be explicitly approved by the user before execution.

  1. Google Cloud SDK: Verify gcloud is installed (gcloud --version). If missing or outdated, ask the user for approval before installing via Install the Google Cloud SDK.
  2. Compute Engine MCP Server & Capability Boundary: When the Compute Engine MCP server is configured (see Use the Compute Engine MCP server; requires roles/mcp.toolUser), prefer its read-only discovery tools before falling back to gcloud:
    • list_machine_types and list_accelerator_types to check whether a machine shape or GPU accelerator is offered in a target zone.
    • get_zone_operation to inspect a failed zonal operation's error.errors array (ZONE_RESOURCE_POOL_EXHAUSTED, ZONE_RESOURCE_POOL_EXHAUSTED_WITH_DETAILS, or QUOTA_EXCEEDED).
    • list_instance_group_managers and list_managed_instances to inspect zonal MIGs and per-instance currentAction / lastAttempt.errors (note: all Compute Engine MCP MIG tools—list_instance_group_managers, list_managed_instances, and get_instance_group_manager_basic_info—only accept a zone parameter and cannot inspect regional MIGs; use gcloud with --region={region} or REST for regional MIGs).
    • list_reservations and get_reservation_details to inspect existing zonal reservation capacity (specificReservation.count vs. specificReservation.inUseCount).
    • MCP Limitations (Use gcloud or REST Instead): MCP create_instance does not expose provisioning_model (FLEX_START / SPOT), max_run_duration, instance_termination_action, or reservation_affinity. MCP also lacks tools for Cloud Logging queries (gcloud logging read), Spot Capacity Advisor (gcloud beta compute advice capacity), Bulk Insert (gcloud compute instances bulk create), MIG distribution updates (gcloud compute instance-groups managed update), and reservation creation or deletion (gcloud compute reservations create / delete). Always use gcloud or the Compute Engine REST API for those operations.
  3. Authentication: Local CLI (gcloud auth login), Application Default Credentials (gcloud auth application-default login), or headless/CI-CD via GOOGLE_APPLICATION_CREDENTIALS or Workload Identity Federation.
  4. Project, Region, Billing & API Enablement:
    gcloud config set project {project_id}
    gcloud config set compute/region {region}
    gcloud config set compute/zone {zone}
    gcloud services enable compute.googleapis.com logging.googleapis.com
    
    Note: An active billing account attachment is required (even for Free Tier eligible resources such as e2-micro). Never hardcode regions or zones; confirm {project_id}, {region}, and {zone} (defaulting to a well-supported region such as us-central1 / us-central1-a if unspecified), and consult Google Cloud Locations to verify regional and zonal availability (preview features and specialized GPUs/TPUs are restricted to specific locations).
  5. Required IAM Roles:
    • Read-Only Diagnostics & Capacity Advice: roles/compute.viewer and roles/logging.viewer.
    • Log Analytics SQL (_Default._AllLogs): roles/logging.viewAccessor (plus roles/bigquery.jobUser and roles/bigquery.dataViewer when querying via a linked BigQuery dataset).
    • Instance & MIG Remediation: roles/compute.instanceAdmin.v1 (plus roles/iam.serviceAccountUser when attaching a service account to VMs).
    • Reservation Creation & Teardown: roles/compute.admin (or a custom role granting compute.reservations.create, compute.reservations.update, and compute.reservations.delete, which are not included in roles/compute.instanceAdmin.v1).
    • MCP Tool Invocation: roles/mcp.toolUser.

Step 1: Verify Stockout Scope & Distinguish from Quota Errors

A. Core Domain Rules (Explain to User)

Before taking action, clarify these three foundational Compute Engine behaviors (see Troubleshooting resource availability errors):

  1. Stockout != Quota: ZONE_RESOURCE_POOL_EXHAUSTED (and ZONE_RESOURCE_POOL_EXHAUSTED_WITH_DETAILS) means physical hardware capacity for that specific resource pool in that specific zone is temporarily full. Increasing project quota (IAM & Admin > Quotas & System Limits) will not resolve a physical stockout. Conversely, QUOTA_EXCEEDED means the project's administrative quota ceiling has been reached regardless of physical hardware availability. When returned, ZONE_RESOURCE_POOL_EXHAUSTED_WITH_DETAILS also includes errorInfo.reason (such as configuration_availability for unsupported hardware combinations that will not succeed on retry) and errorInfo.metadata.zonesAvailable listing sibling zones with capacity.
  2. Scoped to Specific Shape & Zone: A stockout applies only to the exact machine shape or accelerator (for example, g2-standard-4 or c4-standard-32) in that zone (for example, us-central1-a). Sibling zones (us-central1-b, us-central1-c, us-central1-f) or smaller shapes (c4-standard-16) frequently have ample capacity.
  3. Existing Running VMs Are Safe: Resource availability errors affect only new capacity allocations (creating new VMs, starting stopped TERMINATED VMs, changing machine types, or MIG scale-out). Currently running RUNNING VMs in the zone are unaffected.

B. Query Cloud Audit Logs for Resource Availability vs. Quota Failures

Run gcloud logging read with an explicit --freshness window (gcloud logging read defaults to 1d, so multi-day investigations require --freshness=7d or --freshness=14d). Inspect protoPayload.response.error.errors[0].code (not .reason) to distinguish ZONE_RESOURCE_POOL_EXHAUSTED / ZONE_RESOURCE_POOL_EXHAUSTED_WITH_DETAILS from QUOTA_EXCEEDED:

gcloud logging read \
    'resource.type="gce_instance" AND log_id("cloudaudit.googleapis.com/activity") AND (protoPayload.status.message:("ZONE_RESOURCE_POOL_EXHAUSTED" OR "does not have enough resources available" OR "resource pool exhausted" OR "does not exist in zone" OR "QUOTA_EXCEEDED" OR "Quota") OR protoPayload.response.error.errors.code:("ZONE_RESOURCE_POOL_EXHAUSTED" OR "ZONE_RESOURCE_POOL_EXHAUSTED_WITH_DETAILS" OR "QUOTA_EXCEEDED"))' \
    --project={project_id} --freshness=7d --limit=20 \
    --format="table(timestamp, resource.labels.zone, protoPayload.resourceName, protoPayload.response.error.errors[0].code, protoPayload.status.message)"
  • If code is QUOTA_EXCEEDED (Always Include Regional Quota Inspection): Do not treat this as a physical stockout. Always provide gcloud compute regions describe to inspect regional quota limits and usage, and direct the user to IAM & Admin > Quotas & System Limits (or switch to a machine family with quota headroom):
    gcloud compute regions describe {region} --project={project_id} \
        --format="table(quotas:format='table(metric,limit,usage)')"
    
  • If a MIG is failing to scale out: Also inspect MIG provisioning errors directly (via Compute Engine MCP list_managed_instances for zonal MIGs, or gcloud):
    # Zonal MIG (--zone={zone}) vs. Regional MIG (--region={region}):
    gcloud compute instance-groups managed list-errors {mig_name} \
        --project={project_id} --zone={zone}
    gcloud compute instance-groups managed list-errors {mig_name} \
        --project={project_id} --region={region}
    

C. Analyze Historical Stockout Frequency with Log Analytics SQL

Because failed cloudaudit.googleapis.com/activity entries have severity ERROR (severity_number >= 500), Cloud Logging routes them to the _Default log bucket ({project_id}.global._Default._AllLogs), whereas _Required._AllLogs only stores Admin Activity logs below ERROR and System Event logs.

  • Prerequisite: Upgrade _Default to Log Analytics (see Query and view logs in Log Analytics):
    gcloud logging buckets update _Default \
        --project={project_id} --location=global --enable-analytics
    
  • JSON Column Extraction Rule: In _AllLogs, resource.labels and proto_payload.audit_log.request have BigQuery type JSON. Never reference resource.labels.zone directly in GROUP BY—always extract scalar STRING values with JSON_VALUE(...):
    SELECT
      JSON_VALUE(resource.labels.zone) AS zone,
      REGEXP_EXTRACT(JSON_VALUE(proto_payload.audit_log.request.machineType), r'([^/]+)$') AS machine_type,
      proto_payload.audit_log.status.message AS status_message,
      COUNT(*) AS stockout_count,
      MIN(timestamp) AS first_seen,
      MAX(timestamp) AS last_seen
    FROM `{project_id}.global._Default._AllLogs`
    WHERE
      timestamp >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 14 DAY)
      AND log_id = 'cloudaudit.googleapis.com/activity'
      AND resource.type = 'gce_instance'
      AND (
        proto_payload.audit_log.status.message LIKE '%ZONE_RESOURCE_POOL_EXHAUSTED%'
        OR proto_payload.audit_log.status.message LIKE '%does not have enough resources available%'
        OR TO_JSON_STRING(proto_payload.audit_log.response.error.errors) LIKE '%ZONE_RESOURCE_POOL_EXHAUSTED%'
      )
    GROUP BY zone, machine_type, status_message
    ORDER BY stockout_count DESC;
    

Step 2: Immediate Tactical Mitigations (Unblock Workload Now)

Execute these five steps in priority order to provision the blocked workload immediately:

1. Discover Sibling Zones Supporting the Machine Shape or GPU

If a zone returns ZONE_RESOURCE_POOL_EXHAUSTED or `Machine type with name '...' does

Truncated for display — read the full file on GitHub.

Related Skills

View on GitHub
GitHub Stars20.3k
CategoryDevelopment
Updated2mo ago
Forks1.7k

Languages

Python

Trust signals

100/100

From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.

No cautions
compute-resource-availability-troubleshooting — Universal Skill: Install & Safety Check | SkillAgent