Generated banner for Hyperpod Cluster Debugger
Generated logo for Hyperpod Cluster Debugger

Hyperpod Cluster Debugger

AWS LabsOfficialPublished by AWS Labs

  • Skill
  • Review and audit
  • Cloud and DevOps
  • Apache-2.0
  • Low risk
  • Has scripts

From the author

Diagnose and remediate cluster-wide HyperPod (EKS or Slurm) problems — creation / deployment failures (CloudFormation, EFA health check, lifecycle scripts, capacity), EKS access, node replacement, CloudFormation nested-stack errors, post-maintenance rollback state, dangling nodes, autoscaler conflicts. Includes `--validate` pre-flight. Read-only.
— the description by AWS Labs

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

The HyperPod Cluster Debugger is a read-only diagnostic tool designed to identify and resolve common failures in HyperPod clusters, including deployment errors, EFA health checks, lifecycle script failures, and capacity issues. It provides a structured workflow to collect cluster state via AWS APIs and SSM, mapping findings to specific remediation runbooks. The tool emphasizes safe operations by providing suggested commands for users to execute manually, ensuring that IaC-managed environments are not inadvertently drifted.

What it does

  • Collects cluster state via AWS APIs and SSM for comprehensive diagnostic reporting.
  • Validates pre-flight requirements including SGs, subnets, IAM, and capacity.
  • Maps detected failures to specific remediation runbooks for EFA, EKS, SSM, and CloudFormation.
  • Provides actionable, read-only diagnostic commands to identify root causes.
  • Offers guidance on distinguishing between manual fixes and IaC-managed configurations.
  • Generates diagnostic bundles to streamline escalation to AWS Support.

When to use it

  • When a HyperPod cluster fails during creation or deployment.
  • When diagnosing EKS access, node replacement, or autoscaler conflicts.
  • When troubleshooting lifecycle script timeouts or failures.
  • When verifying capacity availability in specific AZs before cluster creation.
  • When investigating post-maintenance rollback states or dangling nodes.

Advantages

  • Reduces manual troubleshooting time by automating the collection of cluster state.
  • Provides clear, categorized remediation steps for complex HyperPod error signals.
  • Promotes safe practices by preventing unintended configuration drift in IaC environments.
  • Standardizes the diagnostic output for efficient escalation to AWS Support.
  • Includes pre-flight validation to catch configuration errors before cluster deployment.

Usage examples

“Diagnose my existing HyperPod cluster named my-cluster in us-west-2.”
The tool runs the diagnostic script, collects state, and outputs a list of [PASS], [FAIL], or [WARN] items with pointers to specific remediation documentation.
“Validate my network and IAM configuration before creating a new HyperPod cluster.”
The tool performs a pre-flight check using the provided SG IDs and subnet IDs, verifying capacity and permissions to ensure a successful cluster creation.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/awslabs/hyperpod-cluster-debugger/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip hyperpod-cluster-debugger.zip -d .agents/skills

Documentation by AWS Labs

HyperPod Cluster Debugger

Operating policy. Run read-only diagnostics yourself. Never run a command that changes cluster, node, or workload state — present each one as a Suggested command (run this yourself) block and wait for the customer to run it. Destructive order: investigate → reboot → replace (replace destroys root + secondary volumes; not supported on Slurm controller nodes).

Before any state-changing CLI: ask if it's IaC-managed. HyperPod clusters, SGs, EKS access entries, and IAM are usually provisioned via CloudFormation / CDK / Terraform. If yes, the fix belongs in IaC — running the CLI will drift and the next deploy reverts it. Use the CLI only when IaC is unavailable (locked out, predates IaC, mid-review).

scripts/diagnose-cluster.sh is read-only: it collects state via AWS APIs (and SSM for Slurm controller health) and prints each issue as [FAIL] ... → references/<file>.md § <section>.

ReferenceOpen when
cluster-diagnostics-detail.mdPer-finding remediation runbook (§ A–L)
cluster-operations.mdOperational deep-dives (EFA SG, EKS access, SSM, Slurm, filesystem)
cloudformation-errors.md§ H needs the full per-resource CFN error catalog
capacity-planning.md§ B or --validate flags capacity / subnet sizing
lifecycle-scripts.md§ C points at a specific lifecycle failure
iam-permissions.mdFull IAM policy for the diagnostic

Workflow

  1. Collect HyperPod cluster name (not EKS name), region, exact error string.

  2. Run scripts/diagnose-cluster.sh (or --validate for pre-create).

  3. For every [FAIL] line, Read the referenced section.

  4. Present finding, root cause, and the Suggested-command block verbatim. Wait for customer approval.

  5. Re-run the diagnostic to confirm.


Step 1: Run diagnostics

# Diagnose an existing cluster:
bash scripts/diagnose-cluster.sh --cluster <CLUSTER_NAME_OR_ARN> --region <REGION>

# Pre-flight (no cluster needed) — validates SGs, subnets, IAM, VPC endpoints,
# optionally S3 lifecycle scripts and per-AZ capacity:
bash scripts/diagnose-cluster.sh --validate --region <REGION> \
  --sg-ids <sg-1,sg-2> --subnet-ids <sub-1,sub-2> [--iam-role <role-arn>] \
  [--s3-uri s3://<BUCKET>/path/] [--instance-type ml.p5.48xlarge]

Pass --instance-type when the target instance type is known — enables the per-AZ capacity check (warns if none of the provided subnets are in an AZ that offers that type, which causes insufficient-capacity failures at creation time).

Tags: [PASS] · [FAIL] (counted, has → references/... pointer) · [WARN] · [INFO]. Priorities: P0 blocks operation · P1 degraded · P2 informational.


Step 2: Match signal → section

Error messages / events:

SignalSection
"EFA health checks did not run successfully" (public-doc verbatim signal)A: EFA Health Checks
Insufficient-capacity or AZ-mismatch failure at creationB: Capacity & AZ
Lifecycle-script failure or timeout during provisioningC: Lifecycle Scripts
kubectl auth error (server asks for credentials / no API group list)D: EKS Access
InService but not all instances visibleE: Cluster Provisioning
"Target is not connected" / SSM errorsF: SSM Connectivity
Node replacement not happening / batch-replace not workingG: Node Replacement
"Embedded stack failed" / any CloudFormation errorH: CloudFormation Errors
UpdateClusterSoftware failed or cluster in post-maintenance rollback stateJ: AMI & Cluster Updates
Dangling / orphaned nodes in EKS vs list-cluster-nodesK: Dangling Nodes & Cleanup
Cluster Autoscaler breaks after HyperPod attachedL: Autoscaler Compatibility
Slow I/O, FSx throughput saturatedcluster-operations.md § 9
Slurm node name → instance ID lookupI: Utilities

A: EFA Health Checks

SG missing self-reference. Add inbound + outbound self-ref to every SG on the cluster, plus least-privilege egress for the AWS APIs the node needs (HTTPS 443 to S3 / ECR / SageMaker / SSM / STS / CloudWatch Logs — via VPC-endpoint prefix-lists when possible). Full procedure: cluster-diagnostics-detail.md § A.

B: Capacity & AZ

Instance type unavailable in the requested AZ. Verify with describe-instance-type-offerings, then change AZ, use Flexible Training Plans, or request ODCR. Full: § B · strategy: capacity-planning.md.

C: Lifecycle Scripts

Script failed or timed out during provisioning. Read CloudWatch under /aws/sagemaker/Clusters/<name>/<id> — common causes: missing S3 VPC endpoint, IAM gap, CRLF line endings, instance-group name mismatch. Full: § C · layout: lifecycle-scripts.md.

D: EKS Access / kubectl

IAM identity not in EKS access entries. Verify with sts get-caller-identity, create an access entry with admin policy, update kubeconfig. Full: § D.

E: Cluster Provisioning

InService without all instances is expected under Continuous Provisioning — failures surface as events, not cluster errors. For stuck Creating/Updating/Deleting: check CFN nested stacks (§ H), IAM, capacity, events; if stuck Deleting check VPC ENI dependencies. Full: § E.

F: SSM Connectivity

Target is not connected: use sagemaker-cluster:<CLUSTER_ID>_<GROUP>-<INSTANCE_ID> format (not raw EC2 ID), install session-manager-plugin, confirm node Running. Check IAM + VPC endpoints on timeouts. Full: § F.

G: Node Replacement

Auto-repair: confirm NodeRecovery=Automatic, check Health Monitoring Agent (HMA) logs + node labels / Slurm reason, confirm capacity. Manual: reboot first, replace only if reboot fails. Replace requires the cluster to have been patched via UpdateClusterSoftware at least once and cannot target a Slurm controller node. Full: § G.

H: CloudFormation Errors

Embedded stack failed hides the real error. Drill into nested stacks via Events tab (filter Failed) until you reach a non-stack resource. CLI: describe-stack-events --query 'StackEvents[?ResourceStatus==\CREATE_FAILED`]'`. Also covers SLR creation failures and permission-boundary denials. Full: § H · catalog: cloudformation-errors.md.

I: Utilities

Map Slurm node names (ip-10-x-y-z) to HyperPod instance IDs via list-cluster-nodes or on-node /opt/ml/config/resource_config.json. Full: § I.

J: AMI & Cluster Updates

UpdateClusterSoftware fails and rolls back, or the cluster stays in a post-maintenance rollback state. Common causes: lifecycle script incompatible with new AMI, HMA version too old, insufficient rolling-update capacity. If the cluster has active nodes, collect diagnostics and escalate rather than delete-and-recreate. Full: § J.

K: Dangling Nodes & Cleanup

Nodes in kubectl get nodes but not in list-cluster-nodes (ghost EKS nodes), or the inverse (HyperPod nodes that never registered kubelet). Script flags both. Full: § K.

L: Autoscaler Compatibility

Cluster Autoscaler errors on HyperPod provider IDs and breaks autoscaling for all node groups. No officially endorsed workaround — escalate to AWS Support. Karpenter does not conflict with HyperPod nodes by default. Full: § L.


Prerequisites

  • aws CLI v2.13+ authenticated to the cluster's account

  • jq, python3, bash 4.2+

  • kubectl authenticated to the EKS cluster (EKS checks skipped if absent)

  • session-manager-plugin (Slurm controller health checks only)

IAM policy: references/iam-permissions.md.

Defaults

  • Region — required: pass --region or set $AWS_DEFAULT_REGION.

  • Mode — --cluster <NAME> (diagnose) or --validate (pre-create).

  • Event window — up to 500 most recent events (5 × 100, paginated).

  • Colors — auto-disabled on non-TTY; --no-color to force off.

Error handling

FailureScriptTell the customer
aws sts get-caller-identity failsExit 1"Fix AWS credentials and rerun."
Cluster not foundExit 1 after listing region's clusters"Confirm HyperPod cluster name (not EKS) and region."
sagemaker:* / ec2:* / eks:* / logs:* deniedWarn, add Missing IAM permission for <API>, continue"Grant the listed IAM action and rerun."
kubectl absent or unauthenticatedSkip EKS checks (access entries, add-ons, aws-auth, nodes)"Install/authenticate kubectl."
session-manager-plugin absent (Slurm)Skip Slurm controller probe"Install session-manager-plugin."
SSM throttled / times out (180s)Retry with backoff; warn and continue if still failing"Rerun later — script is idempotent."
CloudWatch log group not foundSkip CloudWatch check"CloudWatch not configured on this cluster."

Exit codes: 0 no critical failures · 1 one or more critical failures (cluster not found, fatal prerequisite missing, or any [FAIL] in diagnose or --validate mode). [WARN] lines do not affect the exit code.

Skill delegation

NeedUse
Shell on nodeshyperpod-ssm
Version comparison across nodeshyperpod-version-checker

Escalate to AWS Support

Escalate when:

  1. EFA health checks fail despite correct SG rules.

  2. Capacity errors persist despite a valid Flexible Training Plan / ODCR.

  3. Node replacement fails repeatedly without clear events / log signal.

  4. Cluster stuck in a non-terminal state (Creating, Updating, or a post-maintenance rollback state) for an extended period.

  5. CloudFormation root-cause is an internal service error.

Before opening the case

Run these commands and attach the output. Goal: AWS Support has everything at case open.

# 1. Cluster identity + status (confirms region, ARN, orchestrator, instance groups)
aws sagemaker describe-cluster --cluster-name <CLUSTER> --region <REGION>

# 2. Full cluster-level diagnostic bundle
bash scripts/diagnose-cluster.sh --cluster <CLUSTER> --region <REGION> > diag.txt

# 3. Per-node log/config bundle to S3 (delegates to hyperpod-issue-report skill)
#    See skills/hyperpod-issue-report/SKILL.md for the exact invocation.
Include in the case
  • Cluster name + ARN (or ClusterId suffix) and AWS region

  • ClusterStatus + FailureMessage from describe-cluster

  • Timestamp window (UTC start / end) of the failure

  • Exact error strings observed (copy verbatim from events / logs / console)

  • Affected instance IDs / NodeLogicalIds / instance group names

  • diag.txt from step 2 above

  • S3 URI of the hyperpod-issue-report bundle from step 3

Files

references/cluster-diagnostics-detail.md

Cluster Diagnostics — Detailed Procedures

Full diagnostic and fix procedures for each section referenced from SKILL.md.


A: EFA Health Checks

Signals: "EFA health checks did not run successfully. Ensure that your VPC and security groups are properly configured before attempting to create a new cluster."

Root cause: Security group missing self-referencing rules — a common cluster-creation failure.

Diagnose
bash scripts/diagnose-cluster.sh --cluster <CLUSTER> --region <REGION>

# Or directly:
SG=$(aws sagemaker describe-cluster --cluster-name <CLUSTER> --region <REGION> \
  --query 'VpcConfig.SecurityGroupIds[0]' --output text)
aws ec2 describe-security-groups --group-ids $SG --region <REGION> \
  --query 'SecurityGroups[0].{Inbound:IpPermissions,Outbound:IpPermissionsEgress}' \
  --output json

Look for self-referencing rules where source/destination is the SG itself.

Fix — apply to every SG on the cluster

Customer-run. Apply the two self-ref rules to each SG in describe-cluster → VpcConfig.SecurityGroupIds, then add least-privilege egress for the AWS APIs the node needs to reach. Idempotent: InvalidPermission.Duplicate = already exists, treat as success.

SG=<security-group-id>
REGION=<region>

# Inbound self-ref (inter-node communication, EFA)
aws ec2 authorize-security-group-ingress --group-id $SG --region $REGION \
  --ip-permissions '[{"IpProtocol":"-1","UserIdGroupPairs":[{"GroupId":"'"$SG"'"}]}]'

# Outbound self-ref (EFA RDMA)
aws ec2 authorize-security-group-egress --group-id $SG --region $REGION \
  --ip-permissions '[{"IpProtocol":"-1","UserIdGroupPairs":[{"GroupId":"'"$SG"'"}]}]'

Egress for AWS APIs. The node needs HTTPS (443) outbound to reach the AWS services HyperPod uses: S3 (lifecycle scripts), ECR (container images), SageMaker (HyperPod control plane), SSM / SSMMessages / EC2Messages (Session Manager), STS, and CloudWatch Logs. The narrowest practical rule is TCP 443 to the VPC-endpoint prefix-lists for those services (com.amazonaws.<region>.<service> resolves to a pl-XXXXXXXX ID via aws ec2 describe-prefix-lists), referenced in authorize-security-group-egress --ip-permissions as PrefixListIds. See the AWS docs on VPC endpoint prefix lists for the exact CLI shape. aws ec2 describe-vpc-endpoints lists which services the cluster VPC already has endpoints for.

Self-ref opens all ports between instances in this SG (intended for intra-cluster EFA). For multi-SG clusters see cluster-operations.md § 1.


B: Capacity & AZ

Signals: "We currently do not have sufficient capacity in the Availability Zone you requested" (public doc); also seen: subnets not in the AZ where capacity is available.

aws ec2 describe-instance-type-offerings \
  --location-type availability-zone \
  --filters "Name=instance-type,Values=<INSTANCE_TYPE>" \
  --region <REGION> \
  --query 'InstanceTypeOfferings[*].Location' --output table

Fix: add subnet in an AZ where the type is available, or use Flexible Training Plans / ODCR. Full strategy: capacity-planning.md.


C: Lifecycle Scripts

Signals: cluster-creation event indicates lifecycle script execution error or timeout; creation fails during provisioning.

CLUSTER_ID=$(aws sagemaker describe-cluster --cluster-name <CLUSTER> --region <REGION> \
  --query 'ClusterArn' --output text | cut -d/ -f2)
LOG_GROUP="/aws/sagemaker/Clusters/<CLUSTER_NAME>/${CLUSTER_ID}"

aws logs describe-log-streams --log-group-name "$LOG_GROUP" --region <REGION> \
  --query 'logStreams[?starts_with(logStreamName,`LifecycleConfig`)].logStreamName' --output table

aws logs get-log-events --log-group-name "$LOG_GROUP" \
  --log-stream-name "LifecycleConfig/<group-name>/<instance-id>" \
  --region <REGION> --query 'events[*].message' --output text
Log errorFix
Connect timeout on endpoint URL: s3://Add S3 Gateway VPC endpoint to subnet route table
AccessDenied on S3Add s3:GetObject + s3:ListBucket to execution role
Script never exits / timeoutAdd set -euo pipefail; test locally; add network timeouts
ASCII text, with CRLF line terminatorsdos2unix script.sh before uploading
provisioning_parameters.json mismatchInstance group names must match between config and API call

Full S3 layout, node-type detection, and on-node debug: lifecycle-scripts.md.


D: EKS Access / kubectl

Signals: "couldn't get current server API group list: the server has asked for the client to provide credentials", kubectl get nodes fails or returns nothing.

# Your identity
aws sts get-caller-identity

# EKS cluster behind the HyperPod cluster
EKS_ARN=$(aws sagemaker describe-cluster --cluster-name <HYPERPOD> --region <REGION> \
  --query 'Orchestrator.Eks.ClusterArn' --output text)
EKS_NAME=$(echo $EKS_ARN | awk -F'/' '{print $NF}')

# Existing access entries
aws eks list-access-entries --cluster-name $EKS_NAME --region <REGION>

# Auth mode
aws eks describe-cluster --name $EKS_NAME --region <REGION> \
  --query 'cluster.accessConfig.authenticationMode' --output text
Suggested command — grant yourself EKS access (run this yourself)

Preconditions: $MY_ARN is the IAM role ARN, not the assumed-role session ARN. EKS auth mode is API or API_AND_CONFIG_MAP.

Command:

MY_ARN=$(aws sts get-caller-identity --query 'Arn' --output text)

aws eks create-access-entry \
  --cluster-name $EKS_NAME --region <REGION> --principal-arn $MY_ARN

aws eks associate-access-policy \
  --cluster-name $EKS_NAME --region <REGION> --principal-arn $MY_ARN \
  --policy-arn arn:aws:eks::aws:cluster-access-policy/AmazonEKSClusterAdminPolicy \
  --access-scope '{"type": "cluster"}'

aws eks update-kubeconfig --name $EKS_NAME --region <REGION>
kubectl get nodes

Blast radius: AmazonEKSClusterAdminPolicy grants cluster-wide admin on the EKS cluster — use a narrower policy (AmazonEKSEditPolicy / AmazonEKSViewPolicy + namespace scope) for day-to-day operators. update-kubeconfig overwrites the current kubectl context.

If the EKS cluster's auth mode is CONFIG_MAP only, access entries are not available. Switching auth mode is a cluster-level, administrator-level change — review the EKS access-entries documentation before proceeding and coordinate with anyone who depends on the existing aws-auth ConfigMap.


E: Cluster Provisioning

Signals: Cluster InService but instances not visible, kubectl get nodes returns nothing, list-cluster-nodes shows fewer nodes than expected.

With Continuous Provisioning, the cluster goes InService before all instances are created. Instance creation is asynchronous; failures appear as events.

aws sagemaker describe-cluster --cluster-name <CLUSTER> --region <REGION> \
  --query '{Status:ClusterStatus,Groups:InstanceGroups[*].{Name:InstanceGroupName,Count:CurrentCount,Target:InstanceCount,Status:InstanceGroupStatus}}' \
  --output table

aws sagemaker list-cluster-events --cluster-name <CLUSTER> --region <REGION> \
  --query 'ClusterEventSummaries[*].{Time:EventTime,Type:EventType,Message:Message}' \
  --output table

aws sagemaker list-cluster-nodes --cluster-name <CLUSTER> --region <REGION> \
  --query 'ClusterNodeSummaries[*].{ID:InstanceId,Group:InstanceGroupName,Status:InstanceStatus.Status}' \
  --output table
ObservationCauseAction
CurrentCount < InstanceCount, events show provisioningContinuous provisioning in progressWait; monitor events
Events: "Insufficient capacity"No capacity in AZSee B
Events: lifecycle script failureScript errorSee C
Events: "EFA health checks"SG misconfigurationSee A
Nodes in list-cluster-nodes but not kubectl get nodesEKS registration issueCheck lifecycle logs, kubelet via SSM

See cluster-operations.md § 5.


F: SSM Connectivity

Signals: "Target is not connected", SSM session fails.

For interactive shell or repeated SSM access, use the hyperpod-ssm skill — it wraps the cluster-ID derivation, target-format construction, and session start shown below. The block here is for one-off connectivity diagnosis; hyperpod-ssm is the right tool for actually working on nodes.


G: Node Replacement

G.1: Auto-replacement not triggering

Diagnose (read-only):

# Is NodeRecovery enabled?
aws sagemaker describe-cluster --cluster-name <CLUSTER> --region <REGION> \
  --query 'InstanceGroups[*].{Group:InstanceGroupName,Recovery:NodeRecovery}' --output table

# Replacement activity
aws sagemaker list-cluster-events --cluster-name <CLUSTER> --region <REGION> \
  --query 'ClusterEventSummaries[?contains(Message,`replace`) || contains(Message,`reboot`) || contains(Message,`hardware`) || contains(Message,`recovery`)]' \
  --output table

# Health-monitoring-agent logs (pattern: SagemakerHealthMonitoringAgent/<group>/<instance>)
CLUSTER_ID=$(aws sagemaker describe-cluster --cluster-name <CLUSTER> --region <REGION> \
  --query 'ClusterArn' --output text | cut -d/ -f2)
aws logs describe-log-streams \
  --log-group-name "/aws/sagemaker/Clusters/<CLUSTER>/${CLUSTER_ID}" \
  --region <REGION> \
  --query 'logStreams[?starts_with(logStreamName,`SagemakerHealthMonitoringAgent`)].logStreamName' \
  --output table

# EKS node health labels — the sagemaker.amazonaws.com/node-health-status
# label on each node indicates the action HyperPod has decided on.
kubectl get nodes --show-labels
kubectl describe node <NODE>

sinfo -o "%N %T %30E"

Common blockers: NodeRecovery=None, health agent hasn't detected (wait for next cycle), lifecycle script failing on new instance (same log group, LifecycleConfig/... stream), no capacity (see B), cluster not InService.

Suggested command — enable NodeRecovery (run this yourself)

Destructive — replaces the whole InstanceGroups list. Any group omitted from the payload is deleted; any field drift (instance type, count, lifecycle config) is applied as-is. Re-run describe-cluster first and copy every existing field into the payload below before adding NodeRecovery=Automatic. If unsure, use the SageMaker console — it preserves existing fields by default. Never run this command yourself; present it to the customer.

Preconditions: NodeRecovery=None confirmed above. Derive every field for every instance group from the current describe-cluster output — update-cluster replaces the whole InstanceGroups list; any field drift is applied as-is.

Command:

aws sagemaker update-cluster --cluster-name <CLUSTER> --region <REGION> \
  --instance-groups '[{"InstanceGroupName":"<G>","InstanceType":"ml.p5.48xlarge",
    "InstanceCount":<N>,
    "LifeCycleConfig":{"SourceS3Uri":"<URI>","OnCreate":"<SCRIPT>"},
    "ExecutionRole":"<ROLE>",
    "OnStartDeepHealthChecks":["InstanceStress","InstanceConnectivity"],
    "NodeRecovery":"Automatic"}]'

Blast radius: any instance group omitted from the list is deleted; any field drift (instance type, count, lifecycle config) is applied as-is. If unsure, use the console, which preserves existing fields by default.

G.2: Manual replacement

Diagnose (read-only):

aws sagemaker list-cluster-nodes --cluster-name <CLUSTER> --region <REGION> \
  --query 'ClusterNodeSummaries[*].{ID:InstanceId,Group:InstanceGroupName,Status:InstanceStatus.Status}' \
  --output table

aws sagemaker describe-cluster --cluster-name <CLUSTER> --region <REGION> \
  --query 'ClusterStatus' --output text
Suggested command — reboot (run this yourself)

Preconditions: <INSTANCE_ID> belongs to the cluster (confirmed from list-cluster-nodes above); workload can tolerate a restart; on Slurm clusters, rebooting will not disrupt critical cluster operations (per the API doc). NodeIds batch size: 1-25 per call.

Command:

aws sagemaker batch-reboot-cluster-nodes --cluster-name <CLUSTER> --region <REGION> \
  --node-ids '["<INSTANCE_ID>"]'

aws sagemaker list-cluster-events --cluster-name <CLUSTER> --region <REGION> \
  --query 'ClusterEventSummaries[0:5].{Time:EventTime,Message:Message}' --output table

Blast radius: soft recovery via EC2 RebootInstances — preserves instance identity, root volume, and secondary volumes. Training processes on the node are interrupted.

Suggested command — replace (run this yourself, only if reboot did not clear the fault)

Preconditions:

  • Reboot attempted first and did not clear the fault.

  • Hardware fault confirmed (uncorrectable ECC, GPU-bus errors, EFA hardware failure); not a software / config issue.

  • Data on root + secondary volumes is backed up — per the API doc: "Replacing nodes destroys all instance volumes, including both root and secondary volumes. All data stored on these volumes will be permanently lost and cannot be recovered."

  • Cluster has been patched via UpdateClusterSoftware — per the API doc: "If you want to invoke this API on an existing cluster, you'll first need to patch the cluster by running the UpdateClusterSoftware API."

  • Target is NOT a Slurm controller — per the API doc: "For SageMaker HyperPod clusters using the Slurm workload manager, you cannot replace instances that are configured as Slurm controller nodes."

  • NodeIds batch size: 1-25 per call (API limit).

Command:

aws sagemaker batch-replace-cluster-nodes --cluster-name <CLUSTER> --region <REGION> \
  --node-ids '["<INSTANCE_ID>"]'

Blast radius: destroys root + secondary volumes on the replaced instance (permanent data loss). New hardware is provisioned with the same AMI and instance configuration.

Karpenter note (per the HyperPod EKS manual-recovery doc): on Karpenter-managed clusters, BatchReplaceClusterNodes terminates the node but does not guarantee a replacement — Karpenter only creates a new node if pending pods cannot be rescheduled onto remaining capacity. Per-workload configuration (pod anti-affinity, resource requests) can force a new node.


H: CloudFormation Errors

Signals: "Embedded stack failed", CREATE_FAILED / ROLLBACK_COMPLETE, generic console error.

Navigate to root cause
  1. CloudFormation console → correct region

  2. Find the failed HyperPod stack

  3. Events tab → filter by CREATE_FAILED (earliest failure is the real one; later ones are cascades)

  4. If error is "Embedded stack failed", open Resources → find AWS::CloudFormation::Stack with CREATE_FAILED

  5. Click Physical ID → opens the nested stack

  6. Repeat until you reach a non-stack leaf resource

  7. The Status reason on the leaf is the actionable error

CLI alternative:

aws cloudformation describe-stack-events --stack-name <STACK> --region <REGION> \
  --query 'StackEvents[?ResourceStatus==`CREATE_FAILED`]'

For Custom::Resource failures, find the Lambda function name and check its logs.

Failed resource typeCommon errors
AWS::SageMaker::ClusterCapacity, subnet, SG, lifecycle script
AWS::IAM::RolePermissions, trust relationship
AWS::IAM::ServiceLinkedRoleSLR creation denied — see below
AWS::Lambda::FunctionExecution error, timeout
AWS::EC2::VPCCIDR conflict, quota
Custom::ResourceLambda-backed error — check Lambda CloudWatch logs

Full resource-by-resource catalog: cloudformation-errors.md.

Service-linked role (SLR)

SageMaker HyperPod uses the SLR AWSServiceRoleForSageMakerHyperPod (attached to the AmazonSageMakerHyperPodServiceRolePolicy managed policy). It is created automatically on first cluster creation — you do not need to pre-create it. If cluster creation fails with an SLR error, the cause is almost always an SCP or permission boundary blocking iam:CreateServiceLinkedRole for the caller.

# Verify the SLR exists in the account
aws iam get-role --role-name AWSServiceRoleForSageMakerHyperPod

If iam:CreateServiceLinkedRole is denied by an SCP, have an account admin either:

  • Grant the permission to the caller and retry cluster creation, or

  • Request the SCP be adjusted to allow the specific SLR creation.

Permission boundary denials

Even when a role's inline policy grants a permission, an attached permission boundary can deny it.

ROLE_NAME=$(aws sagemaker describe-cluster --cluster-name <C> --region <R> \
  --query 'Orchestrator.Eks.ExecutionRoleArn' --output text | awk -F/ '{print $NF}')
aws iam get-role --role-name "$ROLE_NAME" --query 'Role.PermissionsBoundary'

If PermissionsBoundary is non-null, inspect the boundary policy — any denial there overrides all grants.

Cluster in Failed terminal state

ClusterStatus=Failed cannot be updated. Options:

  1. Collect diagnostics (diagnose-cluster.sh + CFN events above)

  2. Fix root cause (usually IAM / VPC / SG)

  3. aws sagemaker delete-cluster and recreate

Deletion is destructive — migrate active workloads first.

Multi-AZ and EFA

EFA is intra-AZ only. Cross-AZ collectives fall back to TCP. For EFA-accelerated training, keep all training instance groups in a single AZ. describe-instance-type-offerings to pick one.

Service quotas

Check SageMaker HyperPod, EC2 EFA, and VPC quotas before creation — see capacity-planning.md § service quotas. Quota increases take 1-3 business days.


I: Utilities

Slurm node name → instance ID

Slurm nodes use IP-named hostnames (ip-10-1-123-45). Quick lookup:

# Works from anywhere
aws sagemaker list-cluster-nodes --cluster-name <CLUSTER> --region <REGION> \
  --query 'ClusterNodeSummaries[*].{ID:InstanceId,DNS:PrivateDnsHostname,Group:InstanceGroupName}' \
  --output table

# On head node
IP=$(echo "ip-10-1-123-45" | sed 's/ip-//; s/-/./g')
sudo cat /opt/ml/config/resource_config.json | jq | grep -A 3 "$IP"

For bulk lookups, list-cluster-nodes output can be piped to jq to produce a CSV of node → instance ID (there are also community scripts in public AWS sample repositories).


J: AMI & Cluster Updates

UpdateClusterSoftware fails and rolls back, or the cluster remains in a post-maintenance rollback state. Common causes: lifecycle script incompatible with new AMI, insufficient capacity during rolling update, IAM gaps.

aws sagemaker list-cluster-events --cluster-name <NAME> --region <REGION> \
  --query 'ClusterEventSummaries[?contains(Message, `Update`) || contains(Message, `Rollback`)]'

aws sagemaker describe-cluster --cluster-name <NAME> --region <REGION> \
  --query '{Status:ClusterStatus,FailureMsg:FailureMessage}'

# Per-instance-group lifecycle logs on the nodes that were rolled over:
aws logs describe-log-streams \
  --log-group-name "/aws/sagemaker/Clusters/<NAME>/<CLUSTER_ID>" \
  --region <REGION>
Decisions
SymptomLikely causeAction
Rollback on new AMILifecycle script failed on new AMIFix the script (test on one instance group), retry UpdateClusterSoftware
Cluster stays in a post-maintenance rollback stateCluster-state machine requires service-side interventionCollect diagnostics and escalate; do not delete and recreate if there are active nodes
Insufficient capacity mid-updateNo rolling-update capacityPause the update; use Flexible Training Plans / ODCR; retry
Large-fleet migrationRolling update is high-risk at scaleBlue/green: new instance group on the new AMI, drain old, validate, delete old

K: Dangling Nodes & Cleanup

After a failed scale-up or rollback, EKS may show nodes that HyperPod no longer manages ("dangling"). The inverse — HyperPod nodes not registered in EKS — usually means kubelet or bootstrap failed.

kubectl get nodes -l sagemaker.amazonaws.com/compute-type=hyperpod \
  -o jsonpath='{range .items[*]}{.spec.providerID}{"\n"}{end}' \
  | sed 's|.*/||' | sort > /tmp/eks-nodes.txt

aws sagemaker list-cluster-nodes --cluster-name <NAME> --region <REGION> \
  --query 'ClusterNodeSummaries[*].InstanceId' --output text \
  | tr '\t' '\n' | sort > /tmp/hp-nodes.txt

# EKS-only (dangling) — registered in EKS but not in HyperPod
comm -23 /tmp/eks-nodes.txt /tmp/hp-nodes.txt

# HyperPod-only (kubelet never registered) — in HyperPod but not in EKS
comm -13 /tmp/eks-nodes.txt /tmp/hp-nodes.txt
Remediation
Fix — delete a dangling EKS node

Customer-run. Only delete when the EKS node has no matching HyperPod instance (confirmed by comm above) AND the EC2 instance is terminated — confirm with the first command below.

aws ec2 describe-instances --instance-ids <IID> --region <REGION> \
  --query 'Reservations[0].Instances[0].State.Name'
kubectl delete node <NODE_NAME>

If the EC2 instance is still running and registered, kubelet re-registers the node — the delete is a no-op with transient scheduling churn.

Orphaned HyperPod node (not in EKS): kubelet never registered. Triage with hyperpod-node-debugger — common causes are instance IAM role misconfigured, VPC endpoints missing, or lifecycle script failure.


L: Autoscaler Compatibility

Cluster Autoscaler (CAS) in the same EKS cluster can fail to parse HyperPod node provider IDs, which can break autoscaling for every node group in the cluster — not only HyperPod. Diagnose via CAS logs: look for node-info parse errors tied to HyperPod-managed nodes. If hit, escalate to AWS Support; do not apply untested CAS flags.

Karpenter does not manage HyperPod nodes directly and should not conflict. If Karpenter is attempting to disrupt HyperPod training pods, the standard Karpenter annotation karpenter.sh/do-not-disrupt: "true" on the pod prevents disruption (see the Karpenter upstream documentation for current annotation syntax).

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Needs a command-line tool, Needs Python, Needs Node.js

Security

What our scanner noticed· Low risk

  • Scripts that your agent may run

This skill includes scripts that your agent may run. Read them before you use it.

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Published by
AWS Labs
Publisher
AWS Labs (Official)
Source
awslabs/agent-plugins · plugins/sagemaker-ai/skills/hyperpod-cluster-debugger · commit fbefb37
Licence
Apache License 2.0 (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • NOTICE (added by AutoGineer from NOTICE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by AWS Labs or AWS Labs.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download hyperpod-cluster-debugger.zip