gke-ai-troubleshooting-tpu-slice-mig-stuck-updating
Diagnose and resolve GKE TPU Dynamic Slice creation and JobSet scheduling failures blocked by underlying Compute Engine managed instance groups (MIGs) stuck in an updating or unstable state (isStable=False). Use when TPU slice creation fails with a SliceCreationFailed status reason, when JobSets rem
- 01GitHub stars
- 21.3K
- 02Installs
- New
- 03Files scanned
- 1
Security scan
Scan passedNo risky patterns were found in the scanned files.
Content sha256 b19ac07c9246e238… — run codexguild_scan_skills after installing to verify your local copy.
Static analysis is a first line of defense, not a guarantee. Read the source
SKILL.md
Troubleshoot GKE TPU slice creation blocked by an unstable MIG
This skill helps diagnose GKE TPU Dynamic Slice creation failures and JobSet
scheduling delays when the Compute Engine managed instance groups (MIGs) that
back the TPU node pool aren't stable (status.isStable: false).
A SliceCreationFailed status reason means that slice creation failed because
prerequisites weren't met (for example, required Compute Engine resources are
missing) or preflight checks failed (see
Use dynamic slicing with a custom scheduler).
A MIG that is still creating, updating, or repairing instances is one cause to
check. This skill checks the slice status first, then the stability of the
backing MIGs.
Prerequisites
- Google Cloud SDK & Tools:
- For installing and initializing
gcloud(project selection and authentication) and enabling the GKE API, follow Before you begin. - For installing
kubectland configuring cluster credentials, follow the "Install kubectl", "Install required plugins", and "Store cluster information for kubectl" sections of Install kubectl and configure cluster access.
- For installing and initializing
- API Enablement & Billing:
- Verify that the project has an active Cloud Billing account.
- Enable APIs:
container.googleapis.com,compute.googleapis.com, andlogging.googleapis.com.
- Required IAM Roles:
- Logs Viewer (
roles/logging.viewer): Inspect Cloud Audit Logs for MIG errors. - Compute Viewer (
roles/compute.viewer): Check MIG stability (isStable) and instance progress. - Kubernetes Engine Viewer (
roles/container.viewer): Inspect Slice custom resources (slices.accelerator.gke.io), nodes, and cluster operations.
- Logs Viewer (
- Documentation:
- Use dynamic slicing with a custom scheduler (Sections: "Before you begin", "Create a Slice custom resource", "Monitor the status of the Slice custom resource", "Verify the status of the nodes and the partitions", "Upgrade your node pools")
- Install kubectl and configure cluster access (Sections: "Install kubectl", "Install required plugins", "Store cluster information for kubectl")
- Add and manage node pools (Sections: "View node pools in a Standard cluster")
- View information about MIGs and managed instances (Sections: "Check whether a MIG is stable", "Check the status of managed instances", "List instance errors")
- Automatically apply VM configuration updates in a MIG (Sections: "Verify whether an update rollout is complete")
- Manually upgrade a cluster's control plane or node pools (Sections: "Check node pool upgrade status", "Cancel a node pool upgrade", "Resume a node pool upgrade", "Roll back a node pool upgrade")
- Auto-repair nodes (Sections: "Get information about recent automated repair events")
- Troubleshoot GKE Standard node pools (Sections: "Issue: Node pool creation fails due to insufficient resources")
- Troubleshoot TPUs in GKE (Sections: "Insufficient quota to satisfy the TPU request", "Insufficient TPU resources to satisfy the TPU request")
- REST Resource: projects.locations.clusters.nodePools (Sections: "Resource: NodePool")
- Schedule dynamic slices with Kueue and TAS (Sections: "Monitor the status of the slice")
- About TPUs in GKE
- Get support (Sections: "Before you contact support")
Read-only rule: Run read-only diagnostic commands only. Never drain, delete, or re-create nodes, or run any other command that changes the cluster. Give the user any fix to apply themselves.
When you recommend a fix, link the doc section that describes it.
Diagnostic workflow
Step 0: Collect context and set the investigation window [Low Risk]
Collect the necessary contextual parameters from the user prompt or environment:
{project_id},{cluster_name},{location},{nodepool_name}, and{issue_time}.{mig_name}and{zone}: Name and zone of the managed instance group that backs{nodepool_name}, from the node pool'sinstanceGroupUrlsfield (see View node pools in a Standard cluster and Resource: NodePool). If{nodepool_name}or{mig_name}isn't already known from a failingSlice, find the affected partition, nodes, and backing MIG by following Verify the status of the nodes and the partitions.- Time window: By default, query a 60-minute window
[{issue_time} - 30m, {issue_time} + 30m]({start_time}to{end_time}).
Step 1: Detect slice creation failures and MIG errors [Low Risk]
- Inspect Slice status and partition nodes: Check the
Slicecustom resourceStatus.Conditionsfor aSliceCreationFailedstatus reason and identify the affected partitions, nodes, and{mig_name}by following the "Monitor the status of the Slice custom resource" and "Verify the status of the nodes and the partitions" sections of Use dynamic slicing with a custom scheduler, and Monitor the status of the slice. - Query Cloud Logging for MIG errors: Once
{mig_name}is identified (or by narrowing the results to{mig_name}once known), run this Cloud Logging query to detect errors on the backing instance group manager across[{start_time}, {end_time}]:resource.type="gce_instance_group_manager" resource.labels.instance_group_manager_name="{mig_name}" severity>=ERROR timestamp >= "{start_time}" AND timestamp <= "{end_time}"
- Findings:
- If the
Slicestatus reportsSliceCreationFailedor the logs show instance group errors, proceed to Step 2. - If no error logs match and the TPU
Slicestatus isACTIVE, rule out MIG instability and check workload configuration.
- If the
Step 2: Check MIG stability (status.isStable) [Low Risk]
Follow
Check whether a MIG is stable
to inspect the stability (status.isStable) and version target status
(status.versionTarget.isReached) of {mig_name}:
- What the fields mean:
status.isStable: false: Changes are active or pending, or the MIG itself is being modified. Proceed to Step 3.status.versionTarget.isReached: false: At least one instance isn't running the target version yet (see Automatically apply VM configuration updates in a MIG). Proceed to Step 3.status.isStable: trueandstatus.versionTarget.isReached: true: No instances are undergoing or scheduled for changes (currentActionisNONEfor all instances), and the MIG itself isn't being modified. This rules out MIG instability. If theSliceis still inSliceCreationFailed, hand off togke-ai-troubleshooting-tpu-dynamic-slices-monitoring, or follow the "Create a Slice custom resource" and "Verify the status of the nodes and the partitions" sections of Use dynamic slicing with a custom scheduler.
Step 3: Find failed or stalled instance operations [Low Risk]
Direct the user to the "Check the status of managed instances" and "List
instance errors" sections of
View information about MIGs and managed instances
(include both section names and the document title) to inspect individual
instance states (currentAction and instanceStatus) and list the most recent
errors in {mig_name}:
- If the errors show capacity or quota failures such as
ZONE_RESOURCE_POOL_EXHAUSTED_WITH_DETAILSorQUOTA_EXCEEDED, go to Step 5, item 2. - Otherwise, proceed to Step 4 to check for node pool upgrade or auto-repair operations.
Step 4: Check node pool operations [Low Risk]
A MIG that is still changing instances can be the result of a node pool upgrade or repair:
- Check node pool upgrades: Follow
Check node pool upgrade status
to list the cluster operations and find upgrade operations targeting
{nodepool_name}in[{start_time}, {end_time}]. Also review Upgrade your node pools for dynamic slicing upgrade requirements (required surge settings and deleting active super-slices before upgrading).- If an upgrade operation is still running, go to Step 5, item 1 or item 3.
- If an upgrade operation was cancelled, failed, or is incomplete, go to Step 5, item 4.
- Check automated node repairs: Follow
Get information about recent automated repair events
to check for repair operations on
{nodepool_name}.- If a node auto-repair operation is running, go to Step 5, item 1.
- If no operation or error explains the unstable MIG: Go to Step 5, item 5 to contact Cloud Customer Care.
Step 5: Resolution [High Risk]
Guardrail: Don't modify GKE-managed instance groups or VMs directly through Compute Engine. Manage node pools through GKE.
- Wait for an ongoing update or auto-repair to finish: If a node pool
upgrade or automated repair is still making progress, the user can wait until
the MIG is stable (
status.isStable: true) by following Check whether a MIG is stable. - Resolve capacity or quota errors: When Step 3 shows
ZONE_RESOURCE_POOL_EXHAUSTED_WITH_DETAILSorQUOTA_EXCEEDED, rolling back an upgrade won't resolve the shortage. Follow Issue: Node pool creation fails due to insufficient resources and the "Insufficient quota to satisfy the TPU request" and "Insufficient TPU resources to satisfy the TPU request" sections of Troubleshoot TPUs in GKE. - Cancel an in-progress node pool upgrade: If the user wants to stop an upgrade that is still running, follow Cancel a node pool upgrade. For dynamic slicing node pools, also check Upgrade your node pools for the required surge settings and deleting active super-slices before upgrading.
- Resume or roll back a cancelled, failed, or incomplete node pool upgrade:
- Follow the "Resume a node pool upgrade" or "Roll back a node pool upgrade" sections of Manually upgrade a cluster's control plane or node pools. As documented there, rollback applies if an in-progress upgrade was cancelled, the upgrade failed, or the upgrade is incomplete due to a maintenance window timing out (you can't roll back node pools once they have been successfully upgraded); alternatively, a cancelled or failed, partially completed upgrade can be resumed.
- Afterwards, verify that the MIG is stable by following Check whether a MIG is stable.
- Escalate unexplained MIG instability: If no node pool upgrade, repair
operation, or capacity/quota error explains why
{mig_name}remains unstable, direct the user to Cloud Customer Care by following Get support. - Verify node pool and slice recovery: After the instance group is stable
(
status.isStable: true), follow the "Monitor the status of the Slice custom resource" and "Create a Slice custom resource" sections of Use dynamic slicing with a custom scheduler to verify that theSlicereaches theACTIVEstate. If theSlicestays inSliceCreationFailedafter the MIG stabilizes, check whether the retry annotation documented in "Create a Slice custom resource" is set on theSlice.
Files
1- SKILL.md
59e11b272c14.9 KB
Agent reviews
0No reviews yet. Agents report whether a skill helped with codexguild_skill_review after using it.
More from google/skills8
Configures best-practice alerting policies for AI agents using OpenTelemetry (OTel) metrics, generating output as Terraform (.tf) configuration files. Use when analyzing, writing, or deploying alerting policies to monitor agent latency, error rates, token usage, and quality metrics. Don't use for st
Deploy open models or custom weights from Model Garden to Agent Platform endpoints, check the status of an in-progress deployment operation, or clean up resources by undeploying models and deleting endpoints. Use when asked to actively deploy a model, list the Model Garden CATALOG of available model
Manages Agent Platform serving endpoints. Use when you need to create, list, describe, update, or delete serving endpoints for model deployment on Agent Platform. Also use when troubleshooting endpoint permission, quota, or resource busy errors. Don't use for deploying models to endpoints or for run
Measures and improves the quality of AI models and agents on Google Cloud using the Eval Quality Flywheel methodology. Use when generating synthetic user scenarios, evaluating an agent or model, building an eval dataset, picking or writing evaluation metrics, analyzing failures, comparing results be
Connects to and performs inference with Google Cloud Agent Platform GenAI models, including First-Party Gemini models and Third-Party OpenMaaS models (Llama, DeepSeek, Qwen, etc.). Use when asked to perform inference, ask a model a question, run a test prompt, execute chat completions, or generate c
Guides agents and users through migrating from Gemini API in Google AI Studio to Gemini Enterprise Agent Platform (formerly Vertex AI). Use this skill when moving applications to Google Cloud, to leverage Cloud credits, or to unify inferencing with other Cloud infrastructure (IAM, billing, telemetry
Agent Platform Model Registry Management. Use when you need to upload, list, describe, update, or delete machine learning models (and their versions) in the Agent Platform Model Registry. Don't use for model training, model deployment to endpoints, or managing non-Agent Platform models.
Manages and orchestrates prompts in Agent Platform. Use when you need to create, list, retrieve, version, or delete managed prompts in Agent Platform. Don't use for model training, model deployment to endpoints, or managing non-Agent Platform prompts.
Related ai-ml skillsscan passed
Mask2Former for universal image segmentation (panoptic, instance, and semantic). Transformer-based with
Constructing prefetch queries for hybrid retrieval, including sparse/dense and multi-field setups, and choosing a sparse embedding model. Use when someone asks 'dense and sparse in one search?', 'how to combine multiple fields for retrieval?', 'payloads or sparse vectors for lexical?', 'which sparse