LoginSignup
38
32

More than 5 years have passed since last update.

AWSのEC2インスタンスリタイア通知が届いた時の対応

Posted at

概要

個人的メモ。
「EC2が利用しているハードウェアが故障したので他のハードウェアに移ってほしい」というお願いメールが、たまにAWSから届きます。
何も対処しないと指定日時にインスタンスが停止するため、継続利用するためには作業が必要です。

※通知メールの題名と本文は英文で見逃しやすいですが、対応期限があるため要注意です。

EC2 インスタンスのリタイアとは

「EC2インスタンスが利用しているハードウェアが劣化・故障したから、近いうちにハードウェアを停止させるね(EC2も停止する)。継続利用したいならちゃんと対応してね」というものなのですが、知らない人が見たら驚きますよね。

継続利用する場合はハードウェアが停止する前に、メールの内容に従ってEC2インスタンスが利用するハードウェアを変更する必要があります。

※ハードウェアが停止する日時はメール本文に記載されていますが、予定日時より早くにEIPがデタッチされることがあったりするようなので、可能なら早めに対応しておきたいですね。

リタイア通知メール

メール題名

Amazon EC2 Instance Retirement [AWS Account ID: xxxxxxxx]

メール本文(一部抜粋)

Hello,
EC2 has detected degradation of the underlying hardware hosting your Amazon >EC2 instance (instance-ID: xxxxxxxx) associated with your AWS account (AWS >Account ID: xxxxxxxx) in the xxxxxxxx region. Due to this degradation your >instance could already be unreachable. We will stop your instance after >20xx-01-01 00:00 UTC.

You can find more information about maintenance events scheduled for your >EC2 instances in the AWS Management Console (https://console.aws.amazon.com/ec2/v2/home?region=xxxxxxxx#Events)

  • 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.

※通知メール本文の和訳は以下の記事に記載されています。詳細が気になる方はどうぞ。
[Retirement Notification] Amazon EC2 Instance scheduled for retirement.

対応手順

リタイア日時を確認する

リタイア日時はメール本文に記載されていますが念のため「EC2ダッシュボード」-「イベント」からも確認しておきましょう。
image.png

EC2インスタンスのルートデバイスタイプを確認する

リタイヤ対象のEC2インスタンスの説明欄内にある「ルートデバイスタイプ」を確認します。この値がebsinstant storeかで作業内容が変わります。
スクリーンショット 2019-03-16 13.07.24.png

ルートデバイスタイプがebsの場合

リタイヤ対象のインスタンスを一度「停止」させてから「起動」するだけでOKです。
※「停止」させてから「起動」すると、物理的に実行されるハードウェアが自動的に変更されます。「再起動」のみだとハードウェアは変わらないため注意が必要です。

ルートデバイスタイプがinstant storeの場合

  1. EC2インスタンスからイメージを作成する。
  2. ↑で作成したイメージを利用し、別のEC2インスタンスを立ち上げる。
  3. 元のEC2インスタンスは削除する、

完了確認

念のため、「EC2ダッシュボード」-「イベント」から、リタイヤイベントが消えていることを確認しておきましょう。
スクリーンショット 2019-03-09 4.24.43.png

参考

AWS特有の運用イベントまとめ(非障害系)

38
32
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
38
32