この記事は公開されてから1年以上経過しています。情報が古い可能性がありますので、ご注意ください。
スケジュールされたイベント
Amazon EC2には、ごくまれに運用管理系のイベントに関して通知メールが飛んできます。種類は3つありまして、システムリブート、インスタンスリブート、リタイヤです。それぞれの詳細については参考資料を確認してください。今回は、コマンドラインからAPIを呼び出してステータスを確認します。
Amazon EC2 API Toolsの更新
既にみなさんの環境にはAmazon EC2 API Toolsが入っていると思いますが、最新のバージョンに上げてください。Version 1.5.0.0から対応しています。
ec2-describe-instance-statusコマンド
コマンドラインからec2-describe-instance-statusコマンドを実行します。特にイベント予定はありませんね。
$ ec2-describe-instance-status --region ap-northeast-1
INSTANCE i-242f3225 ap-northeast-1a running 16
どのように表示されるか公式ドキュメントから引用します。どのインスタンスに対していつ何が起こるか分かりますね。
PROMPT> ec2-describe-instance-status
Type InstanceId AvailabilityZone InstanceStateName InstanceStateCode
INSTANCE i-6d9eaa0c us-east-1d running 16
Type EventCode NotBefore NotAfter EventDescription
EVENT instance-reboot 2011-12-05T13:00:00+0000 2011-12-06T13:00:00+0000 The instance is scheduled for a reboot
INSTANCE i-ee7e508e us-east-1c running 16
Type EventCode NotBefore NotAfter EventDescription
EVENT instance-reboot 2011-12-06T13:00:00+0000 2011-12-07T13:00:00+0000 The instance is scheduled for a reboot
INSTANCE i-1c654d7c us-east-1a running 16
Type EventCode NotBefore NotAfter EventDescription
EVENT instance-reboot 2011-12-07T13:00:00+0000 2011-12-08T13:00:00+0000 The instance is scheduled for a reboot
INSTANCE i-893eb0ea us-east-1d running 16
Type EventCode NotBefore NotAfter EventDescription
EVENT instance-reboot 2011-12-07T13:00:00+0000 2011-12-08T13:00:00+0000 The instance is scheduled for a reboot
まとめ
EC2インスタンスのイベントスケジュールについて、Management ConsoleやAPIコマンドから確認できる事が分かりました。これで運用管理系の業務がさらに楽になりますね!イベントの把握してAWS運用管理マエストロになりましょう!