{"data":{"slug":"github-google-skills-skills-cloud-gke-ai-troubleshooting-tpu-reservation-stockout-f283f590e994","title":"Troubleshoot GKE TPU Reservation Stockouts Caused by Leaked Node Pool Capacity","summary":"Diagnose and resolve GKE TPU node pool creation or scale-up failures due to Compute Engine reservation stockouts when existing node pools hold reserved capacity. The user receives a detailed analysis and actionable fixes to apply themselves.","url":"https:\/\/skillshunter.net\/skills\/github-google-skills-skills-cloud-gke-ai-troubleshooting-tpu-reservation-stockout-f283f590e994","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-google-skills-skills-cloud-gke-ai-troubleshooting-tpu-reservation-stockout-f283f590e994","markdown_url":"https:\/\/skillshunter.net\/skills\/github-google-skills-skills-cloud-gke-ai-troubleshooting-tpu-reservation-stockout-f283f590e994.md","download_url":"https:\/\/skillshunter.net\/skills\/github-google-skills-skills-cloud-gke-ai-troubleshooting-tpu-reservation-stockout-f283f590e994\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Before executing any `gcloud`, REST API, or MCP command, you MUST read [Usage Attribution](references\/attribution.md). For commands executed directly in the terminal, prefix `gcloud` with `CLOUDSDK_METRICS_REQUEST_ATTRIBUTION=\"agent-skills\/1.0 (skill:gke-ai-troubleshooting-tpu-reservation-stockout)\"` and append `agent-skills\/1.0 (skill:gke-ai-troubleshooting-tpu-reservation-stockout)` to `User-Agent` headers. Required IAM roles include Logs Viewer, Monitoring Viewer, Kubernetes Engine Viewer, and Compute Viewer. Ensure the target project has an active Google Cloud billing account and required APIs are enabled.","instructions":"---\nname: gke-ai-troubleshooting-tpu-reservation-stockout\ndescription: >-\n  Diagnose and resolve cluster-wide GKE TPU node pool creation or scale-up\n  failures caused by Compute Engine reservation stockouts (GCE_STOCKOUT,\n  ZONE_RESOURCE_POOL_EXHAUSTED) when existing unhealthy or NotReady TPU node\n  pools in the cluster have node auto-repair disabled and hold reserved TPU\n  capacity. Use when TPU node pool creation or scale-up fails with GCE_STOCKOUT,\n  ZONE_RESOURCE_POOL_EXHAUSTED, or ZONE_RESOURCE_POOL_EXHAUSTED_WITH_DETAILS\n  despite having a specific Compute Engine TPU reservation. Don't use for\n  general pod scheduling without a TPU reservation or workload-level container\n  crashes.\nmetadata:\n  version: \"1.0.1\"\n  category: Containers\n---\n\n# Troubleshoot GKE TPU reservation stockouts caused by leaked node pool capacity\n\nUse this skill to diagnose and resolve GKE TPU node pool creation or scale-up\nfailures that fail with `GCE_STOCKOUT`, `ZONE_RESOURCE_POOL_EXHAUSTED`, or\n`ZONE_RESOURCE_POOL_EXHAUSTED_WITH_DETAILS` (or queue due to lack of capacity)\neven though they target a specific Compute Engine TPU reservation.\n\nIf node auto-repair is disabled on an existing TPU node pool, GKE doesn't repair\nits nodes when they become `NotReady`. While their VMs are still running, they\nkeep consuming slots in the reservation (`inUseCount` is the number of running\ninstances that consume the reservation). Per\n[Ensure reservation availability](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/tpus.md.txt),\nthe reservation must have sufficient available TPU chips at the time of node\npool creation, and per\n[Multi-host TPU slice node pools](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/concepts\/tpus.md.txt),\nif GKE is unable to deploy one node in a slice, no nodes in the TPU slice node\npool are deployed. When the free slots in the reservation\n(`specificReservation.count - specificReservation.inUseCount`; see\n[Consumable instances in a reservation](https:\/\/docs.cloud.google.com\/compute\/docs\/instances\/reservations-view.md.txt))\nare fewer than the number of nodes that the new TPU node pool needs, creation\nfails with `GCE_STOCKOUT` or `ZONE_RESOURCE_POOL_EXHAUSTED` (or queues due to\nlack of capacity).\n\n## Attribution\n\n**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you\nMUST read [Usage Attribution](references\/attribution.md). For commands executed\ndirectly in the terminal (never in generated scripts, Terraform, or user code),\nprefix `gcloud` with\n`CLOUDSDK_METRICS_REQUEST_ATTRIBUTION=\"agent-skills\/1.0 (skill:gke-ai-troubleshooting-tpu-reservation-stockout)\"`\nand append `agent-skills\/1.0 (skill:gke-ai-troubleshooting-tpu-reservation-stockout)` to `User-Agent` headers.\n\n## Prerequisites\n\n- **Required IAM Roles**:\n  - Logs Viewer (`roles\/logging.viewer`): Query Cloud Audit Logs in Cloud\n    Logging.\n  - Monitoring Viewer (`roles\/monitoring.viewer`): Query GKE node readiness\n    metrics in Cloud Monitoring.\n  - Kubernetes Engine Viewer (`roles\/container.viewer`): Inspect GKE node pools\n    (`management.autoRepair`), cluster operations, and node conditions.\n  - Compute Viewer (`roles\/compute.viewer`): Inspect Compute Engine reservation\n    utilization (`specificReservation.inUseCount` vs\n    `specificReservation.count`), consuming instances, and VM labels (including\n    in the reservation's owner project if using a shared reservation).\n  - For remediation (`[High Risk]` steps): Kubernetes Engine Cluster Admin\n    (`roles\/container.clusterAdmin`)\n- **API Enablement & Billing**:\n  - Ensure the target project has an active Google Cloud billing account\n    attached: `gcloud billing projects describe {project_id}`.\n  - Enable required APIs: `container.googleapis.com`, `compute.googleapis.com`,\n    `logging.googleapis.com`, and `monitoring.googleapis.com`.\n- **CLI & Authentication Setup**:\n  - Install Google Cloud SDK (`gcloud`) and `kubectl`:\n    https:\/\/cloud.google.com\/sdk\/docs\/install.\n- **Cluster mode**: This skill applies to Standard clusters. Autopilot clusters\n  always auto-repair nodes, and you can't turn this off (see\n  [Settings for Autopilot and Standard](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/node-auto-repair.md.txt)).\n- **Reference Documentation**:\n  - [Auto-repair nodes](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/node-auto-repair.md.txt)\n    (Sections: \"Settings for Autopilot and Standard\", \"Repair criteria\", \"Node\n    repair process\", \"Verify node auto-repair is enabled for a Standard node\n    pool\", \"Node auto repair in TPU slice nodes\", \"Enable auto-repair for an\n    existing Standard node pool\", \"Get information about recent automated repair\n    events\")\n  - [Troubleshoot GKE Standard node pools](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/troubleshooting\/node-pools.md.txt)\n    (Sections: \"Issue: Node pool creation fails due to insufficient resources\")\n  - [Troubleshoot TPUs in GKE](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/troubleshooting\/tpus.md.txt)\n    (Sections: \"How GKE handles capacity issues\", \"Insufficient TPU resources to\n    satisfy the TPU request\")\n  - [About TPUs in GKE](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/concepts\/tpus.md.txt)\n    (Sections: \"Multi-host TPU slice node pools\")\n  - [Consuming reserved zonal resources](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/consuming-reservations.md.txt)\n    (Sections: \"Consuming a specific shared reservation\")\n  - [About reservations](https:\/\/docs.cloud.google.com\/compute\/docs\/instances\/reservations-overview.md.txt)\n    (Sections: \"How reservations work\")\n  - [View reservations or future reservation requests](https:\/\/docs.cloud.google.com\/compute\/docs\/instances\/reservations-view.md.txt)\n    (Sections: \"Limitations\", \"View reservations\", \"Consumable instances in a\n    reservation\", \"View a list of instances that are consuming a reservation\")\n  - [Organize resources using labels](https:\/\/docs.cloud.google.com\/compute\/docs\/labeling-resources.md.txt)\n    (Sections: \"View labels\")\n  - [Create and manage cluster and node pool labels](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/creating-managing-labels.md.txt)\n    (Sections: \"Automatically applied labels\")\n  - [Deploy TPU workloads in GKE Standard](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/tpus.md.txt)\n    (Sections: \"Ensure reservation availability\", \"Monitor health metrics for\n    TPU nodes and node pools\", \"Configure auto repair for TPU slice nodes\")\n  - [Add and manage node pools](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/node-pools.md.txt)\n    (Sections: \"Delete a node pool\")\n\n> **Read-only rule**: Run read-only diagnostic commands only. Never drain,\n> delete, or re-create nodes, or run any other command that changes the cluster.\n> Give the user any fix to apply themselves.\n\nWhen you recommend a fix, link the doc section that describes it.\n\n---\n\n## Diagnostic workflow\n\n### Step 0: Collect context and set the investigation window\n\nIdentify the following environment parameters from the user prompt or cluster\ncontext:\n- `{project_id}`, `{cluster_name}`, `{location}`, `{failing_nodepool_name}`,\n  `{reservation_name}`, `{reservation_project_id}` (the project that owns\n  `{reservation_name}`, which defaults to `{project_id}` for a single-project\n  reservation or is the owner project for a shared reservation; see\n  [Consuming a specific shared reservation](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/consuming-reservations.md.txt)),\n  `{zone}` (the zone of the reservation), and `{issue_time}`.\n- **Time window**: By default, query a 60-minute window `[{issue_time} - 30m,\n  {issue_time} + 30m]` (`{start_time}` to `{end_time}`).\n\n---\n\n### Step 1: Confirm the stockout error and reservation utilization `[Low Risk]`\n\n1. **Check Cloud Audit Logs and GKE operations for stockout or capacity\n   errors**:\n   - Run the query in\n     [Issue: Node pool creation fails due to insufficient resources](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/troubleshooting\/node-pools.md.txt)\n     across `[{start_time}, {end_time}]` and look for the documented error\n     messages, such as `ZONE_RESOURCE_POOL_EXHAUSTED` or\n     `ZONE_RESOURCE_POOL_EXHAUSTED_WITH_DETAILS`.\n   - Per\n     [Insufficient TPU resources to satisfy the TPU request](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/troubleshooting\/tpus.md.txt),\n     TPU errors can also contain `GCE_STOCKOUT`.\n   - Per\n     [How GKE handles capacity issues](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/troubleshooting\/tpus.md.txt),\n     GKE sometimes queues a TPU node pool creation request instead of failing it\n     immediately, surfacing a `... cannot be created ... due to lack of\n     capacity` message instead of `GCE_STOCKOUT`. List the node pool creation\n     operation with `gcloud container operations list`\n     (`--filter=\"operationType=CREATE_NODE_POOL\"`).\n2. **Check Compute Engine reservation utilization**:\n   - Per\n     [Limitations](https:\/\/docs.cloud.google.com\/compute\/docs\/instances\/reservations-view.md.txt),\n     query shared reservations in the owner project where they were created\n     (`{reservation_project_id}`).\n   - Follow the\n     [View reservations](https:\/\/docs.cloud.google.com\/compute\/docs\/instances\/reservations-view.md.txt)\n     section to run `gcloud compute reservations describe {reservation_name}\n     --zone={zone} --project={reservation_project_id}` or `gcloud compute\n     reservations list --project={reservation_project_id}`, and compare\n     `specificReservation.inUseCount` against `specificReservation.count`.\n\n#### Interpret the results\n- Don't suggest deleting any node pool until you have identified which existing\n  VMs and node pools hold the reserved capacity (Step 2).\n- **Stockout confirmed**: Per\n  [Ensure reservation availability](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/tpus.md.txt)\n  and\n  [Multi-host TPU slice node pools](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/concepts\/tpus.md.txt),\n  if GKE can't deploy one node in a multi-host slice, no nodes in the slice are\n  deployed. If a stockout or lack-of-capacity message is present and the free\n  slots (`specificReservation.count - specificReservation.inUseCount`; see\n  [Consumable instances in a reservation](https:\/\/docs.cloud.google.com\/compute\/docs\/instances\/reservations-view.md.txt))\n  are fewer than the number of nodes that `{failing_nodepool_name}` needs,\n  proceed to Step 2.\n\n---\n\n### Step 2: Find which VMs and node pools hold the reservation `[Low Risk]`\n\n1. **Check which VMs are consuming `{reservation_name}`**:\n   - Per\n     [How reservations work](https:\/\/docs.cloud.google.com\/compute\/docs\/instances\/reservations-overview.md.txt),\n     a specifically targeted reservation can be used by VMs in the reservation's\n     project (`{reservation_project_id}`) or, for a shared reservation, in any\n     project that it's shared with.\n   - Follow\n     [View a list of instances that are consuming a reservation](https:\/\/docs.cloud.google.com\/compute\/docs\/instances\/reservations-view.md.txt)\n     to list the VMs that use `{reservation_name}`.\n   - Follow\n     [View labels](https:\/\/docs.cloud.google.com\/compute\/docs\/labeling-resources.md.txt)\n     to view each VM's labels, and check the GKE labels in\n     [Automatically applied labels](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/creating-managing-labels.md.txt)\n     (`goog-k8s-cluster-name`, `goog-k8s-cluster-location`, and\n     `goog-k8s-node-pool-name`) to find each VM's cluster and node pool.\n2. **Check node readiness in `{cluster_name}`**:\n   - Query the Cloud Monitoring metric `kubernetes_io:node_status_condition`\n     (`monitored_resource=\"k8s_node\"`, `cluster_name=\"{cluster_name}\"`,\n     `condition=\"Ready\"`) described in\n     [Monitor health metrics for TPU nodes and node pools](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/tpus.md.txt).\n     The `status` label value is `True`, `False`, or `Unknown` (capitalized);\n     use `status!=\"True\"` to find nodes whose `Ready` condition is `False` or\n     `Unknown`.\n   - List TPU nodes and their node pool labels with `kubectl get nodes -l\n     cloud.google.com\/gke-tpu-accelerator -L cloud.google.com\/gke-nodepool`.\n3. **Exclude the failing node pool**: Leave `{failing_nodepool_name}` out of the\n   unhealthy list. It's the node pool that couldn't get capacity, not the one\n   holding it.\n\n#### Interpret the results\n- **VMs outside `{cluster_name}`**: If some of the VMs consuming\n  `{reservation_name}` aren't nodes in `{cluster_name}` (for example, their\n  labels show another GKE cluster or they are Compute Engine VMs without GKE\n  labels), tell the user which VMs or other clusters hold those reservation\n  slots.\n- **Fewer listed VMs than `specificReservation.inUseCount`**: Per\n  [View a list of instances that are consuming a reservation](https:\/\/docs.cloud.google.com\/compute\/docs\/instances\/reservations-view.md.txt),\n  the list only includes VMs in one project. If the list has fewer VMs than\n  `specificReservation.inUseCount`, tell the user that VMs in other projects\n  that share `{reservation_name}` are consuming the remaining slots.\n- **Unhealthy node pool in `{cluster_name}` (`{leaking_nodepool_name}`)**: If\n  the VMs consuming `{reservation_name}` belong to an existing `NotReady` node\n  pool in `{cluster_name}` (`{leaking_nodepool_name}`), proceed to Step 3.\n- **Healthy reservation (rule out a leak)**: If the reserved slots are held by\n  healthy, in-use node pools, there is no leak. Explain that healthy node pools\n  hold the reserved slots, so too few slots are free for\n  `{failing_nodepool_name}`. Tell the user not to delete or restart those\n  healthy node pools, and point the user to the consumption options in\n  [Insufficient TPU resources to satisfy the TPU request](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/troubleshooting\/tpus.md.txt).\n\n---\n\n### Step 3: Verify node auto-repair on the leaking node pool `[Low Risk]`\n\nFollow\n[Verify node auto-repair is enabled for a Standard node pool](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/node-auto-repair.md.txt)\nfor `{leaking_nodepool_name}`:\n- **Auto-repair is disabled (`management.autoRepair: false`)**: GKE doesn't\n  repair the `NotReady` nodes in `{leaking_nodepool_name}`. Their running VMs\n  keep counting toward `specificReservation.inUseCount` in `{reservation_name}`,\n  so `{failing_nodepool_name}` can't get reserved capacity. Proceed to Step 4.\n- **Auto-repair is enabled (`management.autoRepair: true`), but nodes are still\n  `NotReady`**:\n  - Check whether the nodes have been `NotReady` for less than the repair time\n    threshold (approximately 10 minutes), per\n    [Repair criteria](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/node-auto-repair.md.txt).\n  - Check the repair status and the failure reason in the operation history, per\n    [Configure auto repair for TPU slice nodes](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/tpus.md.txt)\n    and\n    [Get information about recent automated repair events](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/node-auto-repair.md.txt).\n\n---\n\n### Step 4: Recover or release the reservation capacity `[High Risk]`\n\n> **Guardrail**: Don't modify GKE-managed instance groups or VMs directly\n> through Compute Engine. Manage node pools through GKE. Never delete healthy\n> node pools that run active jobs.\n\n1. **If the user wants to repair `{leaking_nodepool_name}` in place, enable node\n   auto-repair (doesn't free slots for `{failing_nodepool_name}`)**:\n   - Per\n     [Node repair process](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/node-auto-repair.md.txt),\n     GKE drains and re-creates an unhealthy node.\n   - Per\n     [Node auto repair in TPU slice nodes](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/node-auto-repair.md.txt)\n     and\n     [Configure auto repair for TPU slice nodes](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/tpus.md.txt),\n     GKE re-creates the entire multi-host TPU slice node pool when a node in it\n     needs repair. The re-created VMs still consume `{reservation_name}`, so\n     `specificReservation.inUseCount` doesn't drop: enabling auto-repair makes\n     the nodes in `{leaking_nodepool_name}` healthy again, **but\n     `{failing_nodepool_name}` still can't get their slots**.\n   - Link the user to\n     [Enable auto-repair for an existing Standard node pool](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/node-auto-repair.md.txt)\n     to turn on auto-repair for `{leaking_nodepool_name}`.\n2. **If `{leaking_nodepool_name}` is stale or the user wants to free its slots\n   for `{failing_nodepool_name}`, delete it through GKE**: Link the user to\n   [Delete a node pool](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/node-pools.md.txt)\n   to delete `{leaking_nodepool_name}`, which frees the reserved slots its VMs\n   use.\n3. **After the user deletes `{leaking_nodepool_name}`, verify that enough\n   reservation slots are free**: Follow\n   [View reservations](https:\/\/docs.cloud.google.com\/compute\/docs\/instances\/reservations-view.md.txt)\n   to run `gcloud compute reservations describe {reservation_name} --zone={zone}\n   --project={reservation_project_id}` and confirm that\n   `specificReservation.inUseCount` drops so the free slots\n   (`specificReservation.count - specificReservation.inUseCount`) are at least\n   the number of nodes that `{failing_nodepool_name}` needs before retrying\n   `{failing_nodepool_name}`.\n","use_cases":["Resolve GKE TPU node pool creation failures with GCE_STOCKOUT or ZONE_RESOURCE_POOL_EXHAUSTED errors.","Investigate TPU node pool scale-up issues caused by reserved capacity being held by unhealthy or NotReady node pools."],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/google\/skills\/blob\/e3c591afe426ea585e4c21799e5199d6d47cd1be\/skills\/cloud\/gke-ai-troubleshooting-tpu-reservation-stockout\/SKILL.md","source_commit":"e3c591afe426ea585e4c21799e5199d6d47cd1be","license":null,"version":null,"listing_approved_at":"2026-11-17","created_at":"2026-11-16T15:17:49.000000Z","updated_at":"2026-11-17T10:20:00.000000Z","seo_title":"Troubleshoot GKE TPU Reservation Stockouts","seo_description":"Diagnose and resolve GKE TPU node pool creation or scale-up failures due to Compute Engine reservation stockouts when existing node pools hold reserved capacity.","seo_keywords":["GKE TPU reservation stockout","TPU node pool creation failure","GCE_STOCKOUT error resolution","GKE TPU capacity issues","TPU reservation troubleshooting"]}}