AWSSupport-TroubleshootAWSBatchJob - AWS Systems Manager 自动化运行手册参考

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

AWSSupport-TroubleshootAWSBatchJob

描述

AWSSupport-TroubleshootAWSBatchJob运行手册可帮助您解决导致AWS Batch任务无法从状态升级RUNNABLESTARTING状态的问题。

如何工作?

此运行手册执行以下检查:

重要
  • 此 Runbook 必须与处于RUNNABLE状态的任务在同一个AWS区域启动。

  • 可以为在亚马逊 ECS AWS Fargate 或亚马逊弹性计算云 (Amazon EC2) 实例上安排的AWS Batch任务启动本运行手册。如果在亚马逊 Elastic Kubernetes Service(亚马逊 EKS)上为AWS Batch任务启动自动化,则启动将停止。

  • 如果实例可用于运行任务,但无法注册 Amazon ECS 集群,则此运行手册将启动AWSSupport-TroubleshootECSContainerInstance自动化运行手册以尝试确定原因。有关更多信息,请参阅 AWSSupport-Troubleshot ContainerInstance ecs 运行手册。

运行此自动化(控制台)

文档类型

自动化

所有者

Amazon

平台

Linux、macOS、Windows

参数

  • AutomationAssumeRole

    类型:字符串

    描述:(可选)允许 Systems Manager Automation 代表您执行操作 AWS Identity and Access Management (IAM) 角色的 Amazon 资源名称(ARN)。如果未指定角色,Systems Manager Automation 将使用启动此运行手册的用户的权限。

  • JobId

    类型:字符串

    描述:(必填)处于RUNNABLE状态的 AWS Batch Job 的 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. 导航到AWS Systems Manager控制台AWSBatchJob中的 AWSSupport-疑难解答

  2. 选择 Execute automation(执行自动化)

  3. 要输入参数,请输入内容:

    • AutomationAssumeRole (可选):

      AWS Identity and Access Management (IAM) 角色的 Amazon 资源名称(ARN)允许 Systems Manager Automation 代表您执行操作。如果未指定任何角色,则 Systems Manager Automation 使用启动此运行手册的用户的权限。

    • JobId (必填):

      处于RUNNABLE状态的 AWS Batch Job 的 ID。

  4. 选择执行

  5. 请注意,自动化已启动。

  6. 文档将执行以下步骤:

    • PreflightPermissionChecks:

      对初始用户/角色执行预检 IAM 权限检查。如果缺少任何权限,则此步骤将提供全局输出部分中缺少的 API 操作。

    • ProceedOnlyIfUserHasPermission:

      根据您是否有权执行运行手册的所有必要操作进行分支。

    • AWSBatchJobEvaluation:

      对 AWS Batch Job 执行检查,以验证其存在且处于RUNNABLE状态。

    • ProceedOnlyIfBatchJobExistsAndIsinRunnableState:

      根据任务是否存在以及是否处于RUNNABLE状态进行分支。

    • BatchComputeEnvironmentEvaluation:

      对AWS Batch计算环境进行检查。

    • ProceedOnlyIfComputeEnvironmentChecksAreOK:

      根据计算环境检查是否成功进行分支。

    • UnderlyingInfraEvaluation:

      根据底层 Auto Scaling 组或 Spot 队列请求执行检查。

    • ProceedOnlyIfInstancesNotJoiningEcs集群:

      根据是否有未加入 Amazon ECS 集群的实例进行分支。

    • EcsAutomationRunner:

      为未加入集群的实例运行 Amazon ECS 自动化。

    • ExecutionResults:

      根据之前的步骤生成输出。

  7. 完成后,将提供评估报告 HTML 文件的 URI:

    运行手册成功执行后该报告的 S3 控制台链接和 Amazon S3 URI

参考

Systems Manager Automation