监控和检查实例刷新的状态(AWS CLI)
使用以下 describe-instance-refreshes 命令。
aws autoscaling describe-instance-refreshes --auto-scaling-group-name my-asg
下面是示例输出。
实例刷新按开始时间排序。首先描述仍在进行的实例刷新。
{
"InstanceRefreshes":[
{
"InstanceRefreshId":"08b91cf7-8fa6-48af-b6a6-d227f40f1b9b",
"AutoScalingGroupName":"my-asg",
"Status":"InProgress",
"StatusReason":"Waiting for instances to warm up before continuing. For example: i-0645704820a8e83ff is warming up.",
"StartTime":"2023-11-24T16:46:52+00:00",
"PercentageComplete":50,
"InstancesToUpdate":0,
"Preferences":{
"MaxHealthyPercentage":120,
"MinHealthyPercentage":90,
"InstanceWarmup":60,
"SkipMatching":false,
"AutoRollback":true,
"ScaleInProtectedInstances":"Ignore",
"StandbyInstances":"Ignore"
}
},
{
"InstanceRefreshId":"0e151305-1e57-4a32-a256-1fd14157c5ec",
"AutoScalingGroupName":"my-asg",
"Status":"Successful",
"StartTime":"2023-11-22T13:53:37+00:00",
"EndTime":"2023-11-22T13:59:45+00:00",
"PercentageComplete":100,
"InstancesToUpdate":0,
"Preferences":{
"MaxHealthyPercentage":120,
"MinHealthyPercentage":90,
"InstanceWarmup":60,
"SkipMatching":false,
"AutoRollback":true,
"ScaleInProtectedInstances":"Ignore",
"StandbyInstances":"Ignore"
}
}
]
}
通过查看该组的扩缩活动,您可以进一步监控正在进行的活动是成功还是失败。扩缩活动还可以帮助您深入了解更多详细信息,以帮助您排查实例刷新问题。有关更多信息,请参阅 排查 Amazon EC2 Auto Scaling 中的问题。