

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# `AWSSupport-TroubleshootAWSBatchJob`
<a name="automation-aws-troubleshoot-aws-batch-job"></a>

 **説明** 

 `AWSSupport-TroubleshootAWSBatchJob` ランブックは、 AWS Batch ジョブが から `STARTING`ステータス`RUNNABLE`に進行するのを妨げる問題のトラブルシューティングに役立ちます。

 **動作の仕組み** 

このランブックは、次のチェックを実行します。
+ コンピューティング環境が `INVALID`または `DISABLED`状態の場合。
+ コンピューティング環境の `Max vCPU`パラメータが、ジョブキュー内のジョブボリュームに対応するのに十分な大きさである場合。
+ ジョブがコンピューティング環境のインスタンスタイプが提供できるよりも多くの vCPUs またはメモリリソースを必要とする場合。
+ ジョブを GPU ベースのインスタンスで実行する必要があるが、コンピューティング環境が GPU ベースのインスタンスを使用するように設定されていない場合。
+ コンピューティング環境の Auto Scaling グループがインスタンスの起動に失敗した場合。
+ 起動されたインスタンスが基盤となる Amazon Elastic Container Service (Amazon ECS) クラスターに参加できる場合は、[AWSSupport-TroubleshootECSContainerInstance](https://docs.aws.amazon.com//systems-manager-automation-runbooks/latest/userguide/automation-aws-troubleshoot-ecs-container-instance.html) ランブックを実行します。
+ アクセス許可の問題により、ジョブの実行に必要な特定のアクションがブロックされている場合。

**重要**  
このランブックは、`RUNNABLE`ステータスがスタックしているジョブと同じ AWS リージョンで開始する必要があります。
このランブックは、Amazon ECS AWS Fargate または Amazon Elastic Compute Cloud (Amazon EC2) インスタンスでスケジュールされた AWS Batch ジョブに対して開始できます。Amazon Elastic Kubernetes Service (Amazon EKS) の AWS Batch ジョブに対してオートメーションが開始されると、開始は停止します。
インスタンスでジョブを実行できますが、Amazon ECS クラスターの登録に失敗した場合、このランブックは`AWSSupport-TroubleshootECSContainerInstance`自動化ランブックを開始し、その理由を判断します。詳細については、[AWSSupport-TroubleshootECSContainerInstance](https://docs.aws.amazon.com//systems-manager-automation-runbooks/latest/userguide/automation-aws-troubleshoot-ecs-container-instance.html) ランブックを参照してください。

 [このオートメーションを実行する (コンソール)](https://console.aws.amazon.com/systems-manager/automation/execute/AWSSupport-TroubleshootAWSBatchJob) 

**ドキュメントタイプ**

オートメーション

**[所有者]**

Amazon

**[Platforms]** (プラットフォーム)

Linux、macOS、Windows

**パラメータ**
+ AutomationAssumeRole

  タイプ: 文字列

  説明: (オプション) Systems Manager Automation がユーザーに代わってアクションを実行できるようにする AWS Identity and Access Management (IAM) ロールの Amazon リソースネーム (ARN)。ロールを指定しない場合、Systems Manager Automation はこのランブックを開始するユーザーのアクセス許可を使用します。
+ JobId

  タイプ: 文字列

  説明: (必須) `RUNNABLE`ステータスのままになっている AWS Batch ジョブの ID。

  許可されたパターン: `^[a-f0-9]{8}(-[a-f0-9]{4}){3}-[a-f0-9]{12}(:[0-9]+)?(#[0-9]+)?$` 

**必要な IAM アクセス許可**

`AutomationAssumeRole` パラメータでは、ランブックを正常に使用するために、次のアクションが必要です。
+ `autoscaling:DescribeAutoScalingGroups`
+ `autoscaling:DescribeScalingActivities`
+ `batch:DescribeComputeEnvironments`
+ `batch:DescribeJobs`
+ `batch:DescribeJobQueues`
+ `batch:ListJobs`
+ `cloudtrail:LookupEvents`
+ `ec2:DescribeIamInstanceProfileAssociations`
+ `ec2:DescribeInstanceAttribute`
+ `ec2:DescribeInstances`
+ `ec2:DescribeInstanceTypeOfferings`
+ `ec2:DescribeInstanceTypes`
+ `ec2:DescribeNetworkAcls`
+ `ec2:DescribeRouteTables`
+ `ec2:DescribeSecurityGroups`
+ `ec2:DescribeSpotFleetInstances`
+ `ec2:DescribeSpotFleetRequests`
+ `ec2:DescribeSpotFleetRequestHistory`
+ `ec2:DescribeSubnets`
+ `ec2:DescribeVpcEndpoints`
+ `ec2:DescribeVpcs`
+ `ecs:DescribeClusters`
+ `ecs:DescribeContainerInstances`
+ `ecs:ListContainerInstances`
+ `iam:GetInstanceProfile`
+ `iam:GetRole`
+ `iam:ListRoles`
+ `iam:PassRole`
+ `iam:SimulateCustomPolicy`
+ `iam:SimulatePrincipalPolicy`
+ `ssm:DescribeAutomationExecutions`
+ `ssm:DescribeAutomationStepExecutions`
+ `ssm:GetAutomationExecution`
+ `ssm:StartAutomationExecution`
+ `sts:GetCallerIdentity`

 **指示** 

1. コンソールで [AWSSupport-TroubleshootAWSBatchJob](https://console.aws.amazon.com/systems-manager/automation/execute/AWSSupport-TroubleshootAWSBatchJob) AWS Systems Manager に移動します。

1. [**Execute automation**] (オートメーションを実行) を選択します。

1. 次の入力パラメータを入力できます。
   + **AutomationAssumeRole（オプション):**

     Systems Manager Automation がユーザーに代わってアクションを実行できるようにする AWS Identity and Access Management (IAM) ロールの Amazon リソースネーム (ARN)。ロールを指定しない場合、Systems Manager Automation はこのランブックを開始するユーザーのアクセス許可を使用します。
   + **JobId (必須):**

     `RUNNABLE` ステータスにスタックしている AWS Batch ジョブの ID。  
![\[Input parameters form with AutomationAssumeRole and JobId fields for AWS Batch job configuration.\]](http://docs.aws.amazon.com/ja_jp/systems-manager-automation-runbooks/latest/userguide/images/awssupport-troubleshoot-aws-batch-job_input_paramters.png)

1. **[実行]** を選択します。

1. 自動化が開始されることに注意してください。

1. ドキュメントは以下のステップを実行します。
   + **PreflightPermissionChecks:**

     開始するユーザー/ロールに対してプリフライト IAM アクセス許可チェックを実行します。欠落しているアクセス許可がある場合、このステップでは、グローバル出力セクションに欠落している API アクションが表示されます。
   + **ProceedOnlyIfUserHasPermission:**

     ランブックに必要なすべてのアクションに対するアクセス許可があるかどうかに基づくブランチ。
   + **AWSBatchJobEvaluation:**

      AWS Batch ジョブに対してチェックを実行し、ジョブが存在し、 `RUNNABLE`ステータスであることを確認します。
   + **ProceedOnlyIfBatchJobExistsAndIsinRunnableState:**

     ジョブが存在し、 `RUNNABLE`ステータスであるかどうかに基づいて分岐します。
   + **BatchComputeEnvironmentEvaluation:**

      AWS Batch コンピューティング環境に対してチェックを実行します。
   + **ProceedOnlyIfComputeEnvironmentChecksAreOK:**

     コンピューティング環境チェックが成功したかどうかに基づくブランチ。
   + **UnderlyingInfraEvaluation:**

     基盤となる Auto Scaling グループまたはスポットフリートリクエストに対してチェックを実行します。
   + **ProceedOnlyIfInstancesNotJoiningEcsCluster:**

      Amazon ECS クラスターに参加していないインスタンスがあるかどうかに基づいて分岐します。
   + **EcsAutomationRunner:**

     クラスターに参加していないインスタンスに対して Amazon ECS オートメーションを実行します。
   + **ExecutionResults:**

     前のステップに基づいて出力を生成します。

1. 完了すると、評価レポートの HTML ファイルの URI が提供されます。

   **ランブックが正常に実行された場合のレポートの S3 コンソールリンクと Amazon S3 URI**  
![\[Execution result summary showing errors in compute environment setup and job queue.\]](http://docs.aws.amazon.com/ja_jp/systems-manager-automation-runbooks/latest/userguide/images/awssupport-troubleshoot-aws-batch-job_outputs.png)

 **リファレンス** 

Systems Manager Automation
+ [このオートメーションを実行する (コンソール)](https://console.aws.amazon.com/systems-manager/automation/execute/AWSSupport-TroubleshootAWSBatchJob)
+ [オートメーションを実行する](https://docs.aws.amazon.com//systems-manager/latest/userguide/automation-working-executing.html)
+ [オートメーションの設定](https://docs.aws.amazon.com//systems-manager/latest/userguide/automation-setup.html)
+ [「自動化ワークフローをサポート」ランディングページ](https://aws.amazon.com/premiumsupport/technology/saw/)