0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

AWS AutoScalingGroup内のInstance手動作業時の注意点

Last updated at Posted at 2015-04-11

Auto Scaling Group 内 EC2 Instance 操作とその挙動まとめ

背景

ASG内のEC2 Instanceでいろいろ操作してみてうっかり、Stopしたりして思わずな挙動にでくわせた経験があったので、挙動をまとめてみました。
間違いがあれば、ご指摘ください。

Auto Scaling Group とは

http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/WhatIsAutoScaling.html
as-basic-diagram.png

EC2 Instance操作によるASG挙動まとめ

Action Option Auto Scaling Group EC2 Instance Remark
Attach Desired:+1 Running ASGにInstanceが追加される
Detach Desired:-1
or
Desired:維持
Running ASGとELBから削除される。但し、Min == Desiredの場合は別のInstanceが立ち上りASG内のDesired数は維持される Min == Desiredの場合はASG内のInstance Replace効果
Detach Add a new instance to the Auto Scaling group to balance the load Desired:維持 Running ASGとELBから削除される。別のInstanceが立ち上りASG内のDesired数は維持される ASGからあるInstanceを外し、別のInstanceを追加したい
Set to Standby Desired:-1 Running Increases the load on other instances in ASG as no traffic will be routed to this instance from the load balancer.

ELBからは削除されるが、ASGには属している。但し、Instance数が Desired == Min の場合はStandbyできない.
一時的にASGから退避
Set to Standby Add a new instance to the Auto Scaling group to balance the load Desired:維持 Running Adding a new instance to the ASG will keep the group at its current capacity thereby preventing extra load on the instances within the ASG

ELBからは削除されるが、ASGには属している。Standbyになる代わりにDesired数に合わせて新たなInstanceが起動される
一時的にASGから退避するが、Capacityは維持
ASGを削除 削除 Terminate ASG内の全InstanceがTerminateされる ASG設定だけを削除するには、まず、ASG内の全InstanceをASGから外してからじゃないと大変な目にあうので要注意
Terminate Instance within ASG Desired:維持 Terminate TerminateされるとDesired数を維持するため、別のInstanceが起動される。
Terminate Protection設定は効かない
ただInstanceをTerminateしたつもりでもASGのDesired数まで新たなInstanceが起動される
Stop Instance within ASG Desired:維持 StopTerminate StopされるとDesired数を維持するため、別のInstanceが起動されて、StopしたつもりのInstanceはTerminateされる(Standby状態にはならない)
Terminate Protection効かない
StopしたつもりのInstanceが全て無くなるので要注意
  • 因みに、Desired数を変更してASG内のInstance数を調整することは可能だが、その場合でも、ASGに設定されているTermination PolicyによってどのInstanceがTerminateされるか決まる
0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?