Amazon EC2 Auto Scaling をトラブルシューティングする
Amazon EC2 Auto Scaling では、固有かつ説明的なエラー情報を出力するので、問題のトラブルシューティングに役立てられます。エラーメッセージは規模の拡大や縮小の説明から取得できます。
トピック
スケーリングアクティビティからのエラーメッセージを取得する
スケーリングのアクティビティの説明からエラーメッセージを取得するには、describe-scaling-activities コマンドを使用します。スケーリングについては、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」(アクティビティ) を参照してください。
削除されたグループのスケーリングアクティビティを表示するには
Auto Scaling グループが削除された後にスケーリングのアクティビティを表示するには、次のように describe-scaling-activities コマンドに --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"
},
...
]
}
その他のトラブルシューティングリソース
以下のページには、Amazon EC2 Auto Scaling での問題のトラブルシューティングに関する追加の情報が記載されています。
以下の AWS リソースも役に立ちます。
トラブルシューティングには、エキスパート、またはヘルパーコミュニティによる反復的な照会と検出が必要になることがよくあります。このセクションにある提案事項を試しても問題が引き続き発生する場合は、AWS Support に問い合わせるか (AWS Management Consoleで [Support] (サポート)、[Support Center] (サポートセンター) の順にクリック)、Amazon EC2 Auto Scaling