TPU VM 修复卡住排查
gke-ai-troubleshooting-tpu-vm-repair-stuck
诊断 GKE TPU VM 实例在主机错误、维护事件或故障主机报告后卡在 Compute Engine 修复状态(REPAIRING)的问题,适用于单主机、多主机、动态切片及 TPU All Capacity 模式节点池。当 slice 节点池中的 TPU 实例持续处于 REPAIRING、审计日志中出现主机错误事件,或 TPU slice 因某个 VM 正在修复而不可调度时使用。不要用于以下情况:节点报告 Ready: Unknown 但无 VM 处于 REPAIRING(改用 gke-ai-troubleshooting-node-unresponsive-timeout)、无 VM 处于 REPAIRING 的其他 NotReady 节点(改用 gke-node-notready)、所有节点均为 Ready 时的 Pending Pod(改用 gke-workload-troubleshooting)、JobSet 抢占事件(改用 gke-ai-troubleshooting-jobset-interruption),或 Slice 自定义资源生命周期失败(改用 gke-ai-troubleshooting-tpu-dynamic-slices-monitoring)。
- License 许可
- Apache-2.0
- 所属仓库
- google/skills
- 最近更新
- 2026-11-14
- Stars
- ★ 2.4w
- Forks
- 2.0k
01 前言 Front Matter
- name
- gke-ai-troubleshooting-tpu-vm-repair-stuck
- metadata
- { "version": "1.0.1", "category": "Containers" }
- description
- Diagnose GKE TPU VM instances stuck in Compute Engine repair (REPAIRING state) after host errors, maintenance events, or faulty host reports in single-host, multi-host, dynamic slicing, and TPU All Capacity mode node pools. Use when TPU instances in a slice node pool remain in REPAIRING, host error events appear in audit logs, or TPU slices are unschedulable due to a VM in repair. Don't use for nodes reporting Ready: Unknown when no VM is in REPAIRING (use gke-ai-troubleshooting-node-unresponsive-timeout), other NotReady nodes when no VM is in REPAIRING (use gke-node-notready), Pending Pods when all nodes are Ready (use gke-workload-troubleshooting), JobSet preemption events (use gke-ai-troubleshooting-jobset-interruption), or Slice custom resource lifecycle failures (use gke-ai-troubleshooting-tpu-dynamic-slices-monitoring).
02 资源文件 1
- 参考文档references/attribution.md1.9 KB
03 SKILL.md 正文
Troubleshoot GKE TPU VMs stuck in Compute Engine repair (REPAIRING)
This skill checks the VM status, the host events, and the GKE repair status, and routes recovery through GKE instead of direct Compute Engine changes.
Attribution
MUST READ: Before executing any gcloud, REST API, or MCP command, you
MUST read Usage Attribution. For commands executed
directly in the terminal (never in generated scripts, Terraform, or user code),
prefix gcloud with
CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:gke-ai-troubleshooting-tpu-vm-repair-stuck)"
and append agent-skills/1.0 (skill:gke-ai-troubleshooting-tpu-vm-repair-stuck) to User-Agent headers.
Prerequisites
- Tools:
- For installing and initializing
gcloud(which covers authentication and project selection), follow Before you begin. - For installing
kubectland required plugins, follow Install kubectl and Install required plugins.
- For installing and initializing
- Cloud Billing & Project Configuration: Ensure the project has an active
Cloud Billing account. Follow
Before you begin
to initialize
gcloudand enable the Google Kubernetes Engine API (container.googleapis.com), ensure the Compute Engine API (compute.googleapis.com) and Cloud Logging API (logging.googleapis.com) are enabled, and follow Store cluster information for kubectl to configurekubectlcluster credentials. - Required IAM Roles:
- Kubernetes Engine Viewer (
roles/container.viewer) - Compute Viewer (
roles/compute.viewer) - Logs Viewer (
roles/logging.viewer) - For the user who enables node auto-repair in Step 5, item 1: Kubernetes
Engine Cluster Admin (
roles/container.clusterAdmin)
- Kubernetes Engine Viewer (
- Documentation:
- View information about MIGs and managed instances (Sections: "List MIGs", "Check the status of managed instances")
- Compute Engine instance lifecycle
(Sections: "
REPAIRINGstate") - Troubleshooting VM shutdowns and reboots (Sections: "Querying Cloud Audit Logs", "Reviewing Cloud Audit Logs")
- Configure cluster access for kubectl (Sections: "Install kubectl", "Install required plugins", "Store cluster information for kubectl")
- Add and manage node pools (Sections: "View node pools in a Standard cluster", "Deploy a Pod to a specific node pool")
- Troubleshoot NodeNotReady state (Sections: "Check the node's status and conditions", "Confirm node preemption")
- About TPUs in GKE (Sections: "Multi-host TPU slice node pools")
- Use dynamic slicing with a custom scheduler (Sections: "Requirements", "Verify the status of the nodes and the partitions", "Monitor the status of the Slice custom resource", "Hardware maintenance and failures")
- About GKE dynamic slicing (Sections: "Key characteristics of dynamic slicing configurations")
- Deploy TPUs in All Capacity mode in GKE (Sections: "Manage node failures", "Node failure and recovery")
- Report and repair faulty TPU hosts in All Capacity mode (Sections: "Understand the faulty host report process", "Review report faulty host operations")
- Auto-repair nodes (Sections: "Settings for Autopilot and Standard", "Repair criteria", "Node repair process", "Verify node auto-repair is enabled for a Standard node pool", "Enable auto-repair for an existing Standard node pool", "Get information about recent automated repair events", "Node auto repair in TPU slice nodes")
- Deploy TPU workloads in GKE Standard (Sections: "Before you begin", "Configure auto repair for TPU slice nodes")
- Get support (Sections: "Before you contact support", "Recommendations for efficient support")
- REST Resource: projects.locations.clusters.nodePools (Sections: "Resource: NodePool")
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 [Low Risk]
Collect the target parameters:
{project_id}: Google Cloud project ID{cluster_name}: GKE cluster name{location}: Cluster region or zone{cluster_mode}: Cluster mode (AutopilotorStandard){tpu_version}: TPU version (such as Ironwoodtpu7x, TPU v6e, v5p, v5e, or v4) and whether the node pool is a single-host or multi-host TPU slice node pool{nodepool_name}: TPU node pool name{group_name}and{zone}: Name and zone of the managed instance group (MIG) that backs the node pool:- In a Standard cluster, follow
View node pools in a Standard cluster
to describe
{nodepool_name}and read itsinstanceGroupUrlsfield (see Resource: NodePool). - In an Autopilot cluster (or if
{nodepool_name}isn't known), follow List MIGs to list the managed instance groups in{project_id}and find{group_name}and{zone}.
- In a Standard cluster, follow
View node pools in a Standard cluster
to describe
{instance_name}: Affected TPU VM name, if known. If the user doesn't know{instance_name}, Step 1 finds the instances inREPAIRING.{issue_time}: Incident timestamp in RFC3339 UTC, if known
Step 1: Check the VM status in the managed instance group [Low Risk]
To list the instances in {group_name} with their status (STATUS /
instanceStatus) and current action (ACTION / currentAction), follow the
instructions in
Check the status of managed instances.
- Analysis:
STATUS(instanceStatus) isREPAIRING: Compute Engine is repairing the VM because it encountered an internal error or its host server is unavailable due to maintenance. The VM can't be used during the repair. SeeREPAIRINGstate. Record{instance_name}and proceed to Step 2.- No instance is in
REPAIRING(every instance reportsRUNNINGwithACTIONNONE, or an instance reports another status or action such asACTIONRECREATING, which means "The instance is being replaced" per Check the status of managed instances): Check each node's status and conditions following Check the node's status and conditions and hand off to the matching sibling skill:- If a node's
Readycondition isUnknown(NodeStatusUnknown), hand off togke-ai-troubleshooting-node-unresponsive-timeout. - If a node isn't
Readyfor another reason, hand off togke-node-notready. - If every node is
Ready(per Repair criteria, "A node reporting a Ready status is considered healthy") but the workload's Pods are stillPending, hand off togke-workload-troubleshooting.
- If a node's
Step 2: Check Compute Engine system events [Low Risk]
To list the system events for {instance_name} around {issue_time}, follow
the instructions in the section
Querying Cloud Audit Logs.
Compare the method field with the table in the
Reviewing Cloud Audit Logs
section of the same document:
compute.instances.hostError,compute.instances.terminateOnHostMaintenance, orcompute.instances.automaticRestart: Record the matching system event log entries and timestamps, and continue to Steps 3 and 4.compute.instances.preempted: Compute Engine preempted a Spot VM or preemptible VM. If the affected workload is aJobSet, hand off togke-ai-troubleshooting-jobset-interruption. Otherwise, follow Confirm node preemption.- No method from the table, or another method: Per the note in
Reviewing Cloud Audit Logs,
if a VM rebooted and none of the listed methods appears in the query results,
the reboot likely happened because the VM's operating system initiated it. If
the VM is still in
REPAIRINGin Step 1 (or a method such ascompute.instances.reportHostAsFaultyappears), continue to Steps 3 and 4.
Step 3: Check the node status and slice impact [Low Risk]
Follow
Check the node's status and conditions
to check the status and conditions of the nodes in the cluster and match
{instance_name} using the node's ProviderID field. To filter nodes to
{nodepool_name}, use the cloud.google.com/gke-nodepool node label documented
in
Deploy a Pod to a specific node pool.
- If the node for
{instance_name}reportsReady(per Repair criteria, "A node reporting a Ready status is considered healthy") and the VM is no longer inREPAIRING, proceed to Step 5, item 4. - Otherwise, determine how the unhealthy node affects the node pool based on
the node pool configuration:
- Single-host TPU slice node pool: Per Configure auto repair for TPU slice nodes, "In a single-host TPU slice node pool, only the unhealthy TPU node is auto-repaired."
- Dynamic slicing node pool: To check whether
{nodepool_name}uses dynamic slicing, see Requirements: dynamic slicing requires a Standard cluster, Ironwood (tpu7x), and All Capacity mode reservations. For a Standard cluster with Ironwood (tpu7x), check whether the node hascloud.google.com/gke-accelerator-topology-mode: PROVISION_ONLYas shown in step 2 of Verify the status of the nodes and the partitions (per Key characteristics of dynamic slicing configurations, "dynamic slicing uses incremental provisioning"). Per Hardware maintenance and failures, "If you trigger customer-initiated maintenance or if a hardware failover occurs, only the targeted nodes are affected rather than the entire node pool." For an active dynamic sub-slice, theSlicecustom resource transitions toFAILEDand the scheduler attempts to re-create the slice on other available healthy nodes. Check theSlicestatus following Monitor the status of the Slice custom resource; if theSlicecustom resource is inFAILEDor another non-active state, hand offSlicetroubleshooting togke-ai-troubleshooting-tpu-dynamic-slices-monitoringalongside checking the VM repair in Step 4. - TPU All Capacity mode node pool: Per
Manage node failures
and
Node failure and recovery,
in TPU All Capacity mode, if a VM fails due to issues like hardware
failure, Google Cloud "attempts to recover the VM on the same host
(in-place repair)", failed nodes have a status of
NotReady, and the node pool's status doesn't change toERROR. - Multi-host TPU slice node pool (without dynamic slicing or All Capacity mode): Per the section Multi-host TPU slice node pools, the VMs in a multi-host TPU slice node pool are treated as a single atomic unit. When a node in the slice requires repairing, GKE shuts down all VMs in the TPU slice, forcing eviction of all the Kubernetes Pods in the workload, and the Pods can be scheduled again only after all VMs in the slice are up and running.
Step 4: Check node auto-repair status and faulty host reports [Low Risk]
Find out whether GKE or Compute Engine is repairing the node:
- Check whether node auto-repair is enabled:
- Autopilot clusters: Autopilot always repairs nodes, and you can't turn this off (see Settings for Autopilot and Standard).
- Standard clusters: Follow
Verify node auto-repair is enabled for a Standard node pool
to check whether
autoRepairis enabled on{nodepool_name}.
- Check the GKE repair operation history: Per
Configure auto repair for TPU slice nodes,
check the repair status, including any failure reason, in the operation
history described in
Get information about recent automated repair events:
- If a repair operation failed because of insufficient quota, tell the user to contact their Google Cloud account representative to increase the quota.
- If
autoRepairis enabled and no repair operation has appeared yet, check how long the node has been unhealthy (from{issue_time}or theReadycondition'sLastTransitionTimein Step 3). Per Repair criteria, GKE initiates a repair when a node reports aNotReadystatus, or doesn't report any status at all, over a given time threshold of approximately 10 minutes. If the node has reportedNotReady(or no status) for less than approximately 10 minutes, check the operation history again after that threshold has passed. If it has been longer than approximately 10 minutes and there is still no repair operation (and no All Capacity mode faulty host report in item 3), escalate in Step 5, item 3.
- For TPU All Capacity mode node pools, check for a faulty host report:
Per
Understand the faulty host report process,
after a user reports a faulty host, the TPU VM is stopped, its state changes
to
REPAIRING, and "The host repair process can take between 3 and 14 days, or longer." Before escalating a VM inREPAIRINGin an All Capacity mode reservation, follow Review report faulty host operations to check for acompute.instances.reportHostAsFaultyoperation on{instance_name}.
Step 5: Resolution [High Risk]
Guardrails:
- Never change GKE-managed instance groups or VMs directly through Compute Engine, for example with
gcloud compute instances deleteorgcloud compute instance-groups managedcommands that change the group. Manage the node pool through GKE.- Never run
kubectl delete nodeon nodes in the node pool. Per Settings for Autopilot and Standard, if you usekubectlto delete an unhealthy node when auto-repair is disabled, the underlying VM might become orphaned from the cluster, and you would continue to be billed for it.
- Enable node auto-repair (Standard clusters only):
- Autopilot clusters always auto-repair nodes, so skip this step.
- Before the user enables auto-repair on a multi-host TPU slice node pool that doesn't use dynamic slicing or All Capacity mode, tell them that GKE re-creates the entire node pool when a node in it needs repair (see item 2 of this step).
- If
autoRepairis disabled on{nodepool_name}, link the user (who needs theKubernetes Engine Cluster Adminrole,roles/container.clusterAdmin) to Enable auto-repair for an existing Standard node pool and Configure auto repair for TPU slice nodes so they can apply the change themselves.
- Let GKE or All Capacity mode repair the node or slice:
- Single-host TPU slice node pool: Per Configure auto repair for TPU slice nodes, "In a single-host TPU slice node pool, only the unhealthy TPU node is auto-repaired." Per Node repair process, for a single node repair, GKE drains the node and waits one hour for the drain to complete; if the drain doesn't complete, GKE shuts the node down and creates a new node.
- Multi-host TPU slice node pool (without dynamic slicing or All Capacity mode): Per Node auto repair in TPU slice nodes and Configure auto repair for TPU slice nodes, if a TPU slice node in a multi-host TPU slice node pool is unhealthy and requires auto repair, the entire node pool is re-created.
- Dynamic slicing node pool: Per
Hardware maintenance and failures,
only the targeted nodes are affected rather than the entire node pool, and
for dynamic sub-slicing the scheduler attempts to re-create failed slices
on other available healthy nodes. If
Slicecustom resources fail to form or remainFAILED, hand off togke-ai-troubleshooting-tpu-dynamic-slices-monitoring. - TPU All Capacity mode with a faulty host report: If Step 4, item 3
found a
compute.instances.reportHostAsFaultyoperation for{instance_name}(tracked via Review report faulty host operations), do not escalate the VM as stuck. Tell the user that per Understand the faulty host report process, the VM stops during the repair and restarts on the same host after the repair is complete, and "The host repair process can take between 3 and 14 days, or longer."
- Contact Cloud Customer Care if the repair doesn't start or complete:
- If the VM stays in
REPAIRING(and isn't waiting on a 3-to-14-day All Capacity mode faulty host repair), if the node has beenNotReady(or reported no status) for longer than the ~10-minute threshold in Repair criteria withautoRepairenabled and no repair operation in Step 4, or if the operation history shows a failed repair that isn't caused by quota, direct the user to Before you contact support and Recommendations for efficient support to contact Cloud Customer Care. In addition to the details listed in Recommendations for efficient support, include the node pool name, instance name, the system event log entries from Step 2, and the repair operation name from Step 4.
- If the VM stays in
- Verify recovery:
- Repeat Step 1 and Step 3. When recovery is complete, every instance in
{group_name}reportsRUNNINGwith actionNONE, and every node in{nodepool_name}isReady. - If the instances report
RUNNINGwith actionNONE(or another status or action) and a node still isn'tReady, follow the handoffs in Step 1 (gke-ai-troubleshooting-node-unresponsive-timeoutorgke-node-notready) or escalate to Cloud Customer Care in item 3 of this step.
- Repeat Step 1 and Step 3. When recovery is complete, every instance in
04 同仓库更多 Skills
cloud-operator-share-context
Shares Google Cloud operating context the user or their team already have — environments, projects, services and regions, product preferences, best practices, architecture guidance, runbooks — found in agent instruction files, local memory, skills and workflows, and the repository's GCP docs, with the operator agent's memory after the user reviews the list. Use when the user runs this skill, accepts the cloud-operator or cloud-operator-setup skill's offer to share their existing Google Cloud context, or asks to share, import or save that context or a GCP fact for the operator agent. Don't use for ordinary GCP requests, which go to the cloud-operator skill.
cloud-operator-setup
Sets up the operator agent in a Google Cloud project via the autocloud MCP server: picks the operator project, creates or checks the user's operator agent, saves the project, and offers to share the user's existing Google Cloud operating context with the operator agent's memory. Use when the user runs this skill, asks to set up the operator or create their operator agent, or chooses setup when the cloud-operator skill asks. Don't use for ordinary GCP requests or installing gcloud.
developer-device-platform-device-run
Runs automated, non-interactive jobs on remote Android devices with Developer Device Platform (DDP) Device Run using `gcloud beta device-run sessions`: native Android executables or shell scripts (for example CLI tools, custom runners, test harnesses or benchmarks) and Android instrumentation tests, on one or many devices, then waits for completion and collects per-device outputs and logs. Use when running a binary or test suite on remote devices without an interactive connection. Don't use it for interactive device reservations, adb tunnels or screen streaming (use developer-device-platform-basics), or for local devices.
compute-vm-creation
Guides the planning, configuration, and provisioning of standalone Google Compute Engine virtual machines (VMs) and bare metal (-metal) instances using gcloud CLI commands or direct MCP tool execution. Use ONLY when the user wants to create, configure, or provision a new standalone Compute Engine VM or bare metal instance from conversational intents (hardware sizing, region selection, OS image, networking, security defaults). DO NOT read or use for Google Kubernetes Engine (GKE) Autopilot or Standard clusters, Kubernetes node pools or Pods, container orchestration, managing existing VMs, Managed Instance Groups (MIGs), or Instance Templates.
agent-platform-autorater-customization
Customizes an autorater (evaluation metric) for an AI agent so its grades match the user's own judgment, starting from the agent's real trajectories. Use when a user wants a metric tailored to their agent, wants to turn failing trajectories into rubrics, says an existing autorater grades their agent wrong, or wants an autorater to agree with human labels (autorater hillclimbing, judge calibration). Don't use for quick evals with built-in metrics or for improving the agent itself (use agent-platform-eval-flywheel).
iap-agent-platform-troubleshooting
Diagnoses Identity-Aware Proxy (IAP) denials of outbound requests from Gemini Enterprise Agent Platform agents that run on Agent Runtime and send traffic through Agent Gateway. Use when an agent request fails with "Egress request is not authorized", when Cloud Audit Logs show an IAP egressViaIAP decision with granted false, when IAP audit entries are missing while debugging agent egress, or when Access policies, IAP allow policies, policy bindings, or Agent Registry entries might block agent egress. Don't use for Gemini model IAM permission errors (such as aiplatform.endpoints.predict), Agent Platform API errors, or Agent Runtime deployment or 500 errors (use agent-platform-troubleshooting instead). Don't use for setting up, creating, or connecting an Agent Gateway, or for IAP web apps, IAP TCP forwarding, or SSH.