Amazon Ec2

EC2のリタイア通知が来たらどうする?

ごあいさつ

こんばんは。

「EC2のリタイア通知が来た」
「リタイア通知が来たらどうする」
「知らんのか」

もに倉です。

今回はたまーにやってくるEC2リタイア通知の対応について、メモ的なノリで書いていきます。

リタイアとは何ぞ

まずは公式のガイドを見てみましょう~。

インスタンスのリタイア

インスタンスをホストしている基盤のハードウェアで回復不可能な障害が検出されると、AWS によってインスタンスのリタイアが予定されます。
予定されたリタイア日になると、インスタンスは AWS によって停止または削除されます。

削除すな。
停止はまだしも削除すな。

とりあえず、インスタンスをホストしている基盤が寿命を迎えたとき、
インスタンスのリタイア(停止or削除)が行われるということです。
もちろん突然リタイアされるわけではなく、メールで通知が来ます。

リタイア通知の例

Hello,

EC2 has detected degradation of the underlying hardware hosting your Amazon EC2 instance (instance-ID: i-XXXXXXXXXXXXXXXXX) associated with your AWS account (AWS Account ID: XXXXXXXXXXXX) in the ap-northeast-1 region. Due to this degradation your instance could already be unreachable. We will stop your instance after 202X-XX-XX XX:XX:XX UTC. Please take appropriate action before this time.

The affected instances are listed below:

i-XXXXXXXXXXXXXXXXX

You can find more information about retirement events scheduled for your EC2 instances in the AWS Management Console https://console.aws.amazon.com/ec2/v2/home?region=ap-northeast-1#Events

You can also customize your event notification to include tags associated with your EC2 instances. For more information about customizing your event notifications see the EC2 user guide https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-instances-status-check_sched.html#customizing_scheduled_event_notifications

* What will happen to my instance?
Your instance will be stopped after the specified retirement date. You can start it again at any time after it’s stopped. Any data on local instance-store volumes will be lost when the instance is stopped or terminated.

* What do I need to do?
We recommend that you stop and start the instance which will migrate the instance to a new host. Please note that any data on your local instance-store volumes will not be preserved when you stop and start your instance. For more information about stopping and starting your instance, and what to expect when your instance is stopped, such as the effect on public, private and Elastic IP addresses associated with your instance, see Stop and Start Your Instance in the EC2 User Guide (https://docs.aws.amazon.com/en_us/AWSEC2/latest/UserGuide/Stop_Start.html). However, if you do not need this instance, you can stop it at any time yourself or wait for EC2 to stop it after the retirement date.

* Why is EC2 retiring my instance?
EC2 may schedule instances for retirement in cases where there is an unrecoverable issue with the underlying hardware. For more information about scheduled retirement events please see the EC2 user guide (https://docs.aws.amazon.com/en_us/AWSEC2/latest/UserGuide/instance-retirement.html).

If you have questions or issues, contact AWS Support at: https://aws.amazon.com/support .

Sincerely,

ぎゃーー英語です!
AWSからの通知って、英語と日本語両方で来たり、日本語だけで来たり、英語だけで来たり様々ですよね。
リタイア通知については、今のところ英語だけバージョンしか確認していません。

上記の英文を翻訳機にぶち込むと↓こんなかんじ。

こんにちは。

EC2は、ap-northeast-1リージョンでお客様のAWSアカウント(AWSアカウントID:XXXXXXXXXX)に関連するAmazon EC2インスタンス(インスタンスID:i-XXXXXXXXXXXX)をホストする基礎ハードウェアの劣化を検出しました。この劣化により、お客様のインスタンスはすでに到達不能になっている可能性があります。202X-XX-XX XX:XX:XX UTC以降にお客様のインスタンスを停止します。それまでに適切な対処をお願いいたします。

影響を受けるインスタンスは以下の通りです。

i-XXXXXXXXXXXXXXX

EC2インスタンスに予定されているリタイアメントイベントの詳細については、AWS Management Console https://console.aws.amazon.com/ec2/v2/home?region=ap-northeast-1#Events で確認することができます。

また、イベント通知をカスタマイズして、EC2インスタンスに関連するタグを含めることができます。イベント通知のカスタマイズの詳細については、EC2ユーザーガイドを参照してください https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-instances-status-check_sched.html#customizing_scheduled_event_notifications

* 私のインスタンスはどうなりますか?
インスタンスは指定されたリタイアメントの日付の後に停止します。停止後、いつでも再スタート可能です。インスタンスが停止または終了すると、インスタンスストアのローカルボリューム上のデータはすべて失われます。

* 私は何をする必要がありますか?
インスタンスを新しいホストに移行するインスタンスの停止と開始をお勧めします。インスタンスの停止と起動を行うと、ローカルのインスタンスストアボリューム上のデータは保存されないことに注意してください。インスタンスの停止と起動に関する詳細、およびインスタンスに関連するパブリック、プライベート、Elastic IPアドレスへの影響など、インスタンスの停止時に期待されることについては、EC2ユーザーガイド(https://docs.aws.amazon.com/en_us/AWSEC2/latest/UserGuide/Stop_Start.html)の「Stop and Start Your Instance」を参照してください。ただし、このインスタンスが不要な場合は、自分でいつでも停止することができますし、引退日以降にEC2が停止するのを待つこともできます。

* なぜEC2は私のインスタンスをリタイアさせるのですか?
EC2は、基礎となるハードウェアに回復不可能な問題がある場合、インスタンスを引退させるスケジュールを組むことがあります。スケジュールされた引退イベントの詳細については、EC2ユーザーガイド(https://docs.aws.amazon.com/en_us/AWSEC2/latest/UserGuide/instance-retirement.html)を参照してください。

ご質問や問題がある場合は、AWSサポート(https://aws.amazon.com/support)にお問い合わせください。

敬具

www.DeepL.com/Translator(無料版)で翻訳しました。

いっぱい教えてくれていますね。

このメールはインスタンス停止バージョンのリタイア通知でした。
停止後は自動で起動せず、止まったままになる様子。
削除されるよりだいぶんマシですが、やっぱりいやですよね……。

リタイア通知が来たらどうする

それでは、本題に入りましょう。
とは言っても、対応方法は公式のガイドや通知文に書いてあったのですが……笑

インスタンスを停止→起動する

そう、インスタンスを停止→起動すればよいわけです。
これだけで勝手に停止or削除を回避できます。単純。楽。

どうして停止→起動するだけでいいの?

AWSの仕様で、インスタンスの停止→起動をするとインスタンスをホストしている基盤が変更されます。

そのため、問題のあったホスト基盤から別のホスト基盤に移ることができ、強制的なリタイアを回避することができるというわけです。

リタイア時に強制停止されるのも、おそらく「強制ホスト基盤変更」を行うためですね。

再起動じゃだめなの?

再起動だと、インスタンスをホストしている基盤が変更されません。
そのため、必ず停止→起動と段階を踏んで作業をしましょう!

詳しくはこちら→再起動、停止、休止、削除の違い

あとがき

正直冒頭のアレがやりたかっただけ……。
インスタンスの起動→停止と再起動の違いを知れてよかったです。

返信を残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

CAPTCHA