

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

# Amazon EC2 Auto Scaling の問題をトラブルシューティングする
<a name="CHAP_Troubleshooting"></a>

Amazon EC2 Auto Scaling では、固有かつ説明的なエラー情報を出力するので、問題のトラブルシューティングに役立てられます。エラーメッセージは規模の拡大や縮小の説明から取得できます。

**Topics**
+ [スケーリングアクティビティからのエラーメッセージを取得する](#RetrievingErrors)
+ [スケーリングアクティビティをオフにする](#turn-off-scaling-activities)
+ [その他のトラブルシューティングリソース](#additional-troubleshooting-resources)
+ [Amazon EC2 Auto Scaling をトラブルシューティングする: EC2 インスタンス起動の失敗](ts-as-instancelaunchfailure.md)
+ [Amazon EC2 Auto Scaling をトラブルシューティングする: AMI 問題](ts-as-ami.md)
+ [Amazon EC2 Auto Scaling をトラブルシューティングする: ロードバランサー問題](ts-as-loadbalancer.md)
+ [Amazon EC2 Auto Scaling をトラブルシューティングする: 起動テンプレート](ts-as-launch-template.md)

## スケーリングアクティビティからのエラーメッセージを取得する
<a name="RetrievingErrors"></a>

スケーリングのアクティビティの説明からエラーメッセージを取得するには、[describe-scaling-activities](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/autoscaling/describe-scaling-activities.html) コマンドを使用します。スケーリングについては、6 週間前からの記録が保存されています。このためのリストでは、最新のスケーリングを最上位に、スケーリングが開始時刻順に並べられます。

**注記**  
スケーリングアクティビティは、Amazon EC2 Auto Scaling コンソールの Auto Scaling グループ用の **[Activity]** (アクティビティ) タブにあるアクティビティ履歴にも表示されています。

特定の Auto Scaling グループのスケーリングを表示するには、次のコマンドを使用します。

```
aws autoscaling describe-scaling-activities --auto-scaling-group-name {{my-asg}}
```

以下は、`StatusCode` で現在のスケーリングのステータスを示し、`StatusMessage` でエラーメッセージを示している応答の例です。

```
{
    "Activities": [
        {
            "ActivityId": "3b05dbf6-037c-b92f-133f-38275269dc0f",
            "AutoScalingGroupName": "my-asg",
            "Description": "Launching a new EC2 instance: i-003a5b3ffe1e9358e.  Status Reason: Instance failed to complete user's Lifecycle Action: Lifecycle Action with token e85eb647-4fe0-4909-b341-a6c42d8aba1f was abandoned: Lifecycle Action Completed with ABANDON Result",
            "Cause": "At 2021-01-11T00:35:52Z a user request created an AutoScalingGroup changing the desired capacity from 0 to 1.  At 2021-01-11T00:35:53Z an instance was started in response to a difference between desired and actual capacity, increasing the capacity from 0 to 1.",
            "StartTime": "2021-01-11T00:35:55.542Z",
            "EndTime": "2021-01-11T01:06:31Z",
            "StatusCode": "Cancelled",
            "StatusMessage": "Instance failed to complete user's Lifecycle Action: Lifecycle Action with token e85eb647-4fe0-4909-b341-a6c42d8aba1f was abandoned: Lifecycle Action Completed with ABANDON Result",
            "Progress": 100,
            "Details": "{\"Subnet ID\":\"subnet-5ea0c127\",\"Availability Zone\":\"us-west-2b\"...}",
            "AutoScalingGroupARN": "arn:aws:autoscaling:us-west-2:123456789012:autoScalingGroup:283179a2-f3ce-423d-93f6-66bb518232f7:autoScalingGroupName/my-asg"
        },
     ...
    ]
}
```

出力の各フィールドについては、「*Amazon EC2 Auto Scaling API Reference*」(Amazon EC2 Auto Scaling API リファレンス) の「[Activity](https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_Activity.html)」(アクティビティ) を参照してください。

**削除されたグループのスケーリングアクティビティを表示するには**  
Auto Scaling グループが削除された後にスケーリングのアクティビティを表示するには、次のように [describe-scaling-activities](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/autoscaling/describe-scaling-activities.html) コマンドに `--include-deleted-groups` オプションを追加します。

```
aws autoscaling describe-scaling-activities --auto-scaling-group-name {{my-asg}} --include-deleted-groups
```

下記は、削除されたグループのスケーリングに関する応答の例です。

```
{
    "Activities": [
        {
            "ActivityId": "e1f5de0e-f93e-1417-34ac-092a76fba220",
            "AutoScalingGroupName": "my-asg",
            "Description": "Launching a new EC2 instance.  Status Reason: Your Spot request price of 0.001 is lower than the minimum required Spot request fulfillment price of 0.0031. Launching EC2 instance failed.",
            "Cause": "At 2021-01-13T20:47:24Z a user request update of AutoScalingGroup constraints to min: 1, max: 5, desired: 3 changing the desired capacity from 0 to 3.  At 2021-01-13T20:47:27Z an instance was started in response to a difference between desired and actual capacity, increasing the capacity from 0 to 3.",
            "StartTime": "2021-01-13T20:47:30.094Z",
            "EndTime": "2021-01-13T20:47:30Z",
            "StatusCode": "Failed",
            "StatusMessage": "Your Spot request price of 0.001 is lower than the minimum required Spot request fulfillment price of 0.0031. Launching EC2 instance failed.",
            "Progress": 100,
            "Details": "{\"Subnet ID\":\"subnet-5ea0c127\",\"Availability Zone\":\"us-west-2b\"...}",
            "AutoScalingGroupState": "Deleted",
            "AutoScalingGroupARN": "arn:aws:autoscaling:us-west-2:123456789012:autoScalingGroup:283179a2-f3ce-423d-93f6-66bb518232f7:autoScalingGroupName/my-asg"
        },
     ...
    ]
}
```

## スケーリングアクティビティをオフにする
<a name="turn-off-scaling-activities"></a>

スケーリングポリシーやスケジュールされたアクションに影響を受けずに問題を調査する必要がある場合、次のオプションがあります。
+ `AlarmNotification` プロセスと `ScheduledActions` プロセスを中断することで、すべての動的スケーリングポリシーとスケジュールされたアクションによってグループの希望するキャパシティが変更されるのを防ぎます。詳細については、「[Amazon EC2 Auto Scaling プロセスの中断と再開](as-suspend-resume-processes.md)」を参照してください。
+ 個々の動的スケーリングポリシーを無効にして、負荷の変化に応じてグループの希望するキャパシティを変更しないようにします。詳細については、「[Auto Scaling グループのスケーリングポリシーを無効化する](as-enable-disable-scaling-policy.md)」を参照してください。
+ 個々のターゲット追跡スケーリングポリシーを更新して、ポリシーのスケールイン部分を無効にしてスケールアウト (キャパシティを追加) のみを行います。この方法では、グループの希望するキャパシティが縮小しないようになりますが、負荷が増加するとキャパシティを増やすことができます。詳細については、「[Amazon EC2 Auto Scaling のターゲットトラッキングスケーリングポリシー](as-scaling-target-tracking.md)」を参照してください。
+ 予測スケーリングポリシーを*予測のみ*モードに更新します。予測のみモードでは、予測スケーリングは予測を生成し続けますが、自動的にキャパシティを増やすことはありません。詳細については、「[Auto Scaling グループの予測スケーリングポリシーを作成する](predictive-scaling-create-policy.md)」を参照してください。

## その他のトラブルシューティングリソース
<a name="additional-troubleshooting-resources"></a>

以下のページには、Amazon EC2 Auto Scaling での問題のトラブルシューティングに関する追加の情報が記載されています。
+ [Auto Scaling グループのスケーリングアクティビティを検証する](as-verify-scaling-activity.md) 
+ [Amazon EC2 Auto Scaling コンソールでモニタリンググラフを表示する](viewing-monitoring-graphs.md) 
+ [Auto Scaling グループでのインスタンスのヘルスチェック](ec2-auto-scaling-health-checks.md) 
+ [ライフサイクルフックの考慮事項と制限考慮事項と制限事項](lifecycle-hooks.md#lifecycle-hook-considerations)
+  [Auto Scaling グループでライフサイクルアクションを完了する](completing-lifecycle-hooks.md)
+  [Amazon VPC を使用して Auto Scaling インスタンスにネットワーク接続を提供する](asg-in-vpc.md) 
+ [Auto Scaling グループからインスタンスを一時的に削除する](as-enter-exit-standby.md) 
+ [Auto Scaling グループのスケーリングポリシーを無効化する](as-enable-disable-scaling-policy.md) 
+  [Amazon EC2 Auto Scaling プロセスの中断と再開](as-suspend-resume-processes.md) 
+ [スケールイン中に終了する Auto Scaling インスタンスを制御する](as-instance-termination.md) 
+ [Auto Scaling インフラストラクチャを削除する](as-process-shutdown.md) 
+ [Auto Scaling リソースとグループのクォータ](ec2-auto-scaling-quotas.md) 

以下の AWS リソースも役立ちます。
+ [AWS ナレッジセンターの Amazon EC2 Auto Scaling トピック](https://repost.aws/knowledge-center) 
+ [AWS re:Post に関する Amazon EC2 Auto Scaling の質問](https://repost.aws/tags/TA5Ef3s6KtTiqT0mCRhR79ig/amazon-ec2-auto-scaling)
+ [コンピューティングブログの Amazon EC2 Auto Scaling AWS の投稿](https://aws.amazon.com/blogs/compute/category/compute/auto-scaling/) 
+ [「*CloudFormation ユーザーガイド*」の「CloudFormation のトラブルシューティング」](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/troubleshooting.html) 

トラブルシューティングには、エキスパート、またはヘルパーコミュニティによる反復的な照会と検出が必要になることがよくあります。このセクションの提案を試した後も問題が解決しない場合は、 AWS サポート (「」の AWS マネジメントコンソール**「 サポート**」、**「 サポートセンター**」をクリック、または[AWS 「re:Post](https://repost.aws/)」で **Amazon EC2 Auto Scaling** タグを使用して質問してください。