インスタンスが起動できない。容量不足のエラーについて

2017.02.19

この記事は公開されてから1年以上経過しています。情報が古い可能性がありますので、ご注意ください。

はじめに

オペレーションチームでは運用作業やお問い合わせで様々なエラーに遭遇します。
ごく稀にキャパシティの不足が原因でインスタンスを起動できない場合がありますが、
あまり見慣れないエラーだと思いますのでエラーや回避策についてご紹介します。

エラー内容

全てのログを取れていないのですが以下のようなログがあります。

EC2

A server error (InsufficientInstanceCapacity) occurred when calling
the StartInstances operation: We currently do not have sufficient
t2.small capacity in the Availability Zone you requested (ap-northeast-1c). 
Our system will be working on provisioning additional capacity.
You can currently get t2.small capacity by not specifying an Availability Zone
in your request or choosing ap-northeast-1a.

Auto Scaling

Launching a new EC2 instance. Status Reason: Your quota allows for 0
more running instance(s). You requested at least 1. Launching EC2 instance failed.

CloudFormation、EC2

Your quota allows for 0 more running instance(s). You requested at least 1

OpsWorks

An error occurred while starting the instance measure30
Your quota allows for 0 more running instance(s). 
You requested at least 1 - You can request an increase of the instance limit here:
http://aws.amazon.com/contact-us/ec2-request/

RDS

Cannot modify the instance class because there are not enough
availability zones that have the requested instance class. Please try
your request again at a later time. (Service: AmazonRDS; Status Code:
400; Error Code: InsufficientDBInstanceCapacity; Request ID:
********-****-****-****-************)

エラーの意味

2パターンありますのでそれぞれ説明します。

パターン1 キャパシティ不足

  • InsufficientInstanceCapacity
  • InsufficientDBInstanceCapacity

こちらの内容が記載されている場合は
AWS側でリクエストした対象インスタンスのキャパシティが一時的に不足している場合に発生します。

パターン2 制限に達している

  • Your quota allows for 0 more running instance(s)...

こちらは同時実行できるインスタンスの上限に達している際にエラーが発生します。

対応について

パターン1 キャパシティ不足

  • 別のAZで起動する
  • しばらく時間をおいてから起動を試す(容量は頻繁に変化するため)
  • 別のインスタンスタイプを選択する
  • 起動数を減らして試してみる

こちらは対象インスタンスを起動するためキャパシティが一時的に不足していますので上記の方法で起動を試します。

またエラーが許容できない場合は リザーブドインスタンスの購入を行いキャパシティを確保する必要があります。

注意

キャパシティの確保ができるのはEC2でアビリティゾーンの指定を行ったもののみです。
RDS、Redshift, ElastiCacheではキャパシティの確保はできません。

パターン2 制限に達している

  • 上限緩和申請を行う

AWSアカウントでインスタンスを実行できる上限に達していますので上限緩和申請を行います。

まとめ

今回はインスタンスの容量不足によるエラーについてご紹介しました。 対応方法もご紹介していますので実際にエラーに遭遇しましたら
こちらのブログをご参照していただければ幸いです。

参考URL