Lesson 3 of 4 Amazon EC2 Performance and Cost Optimization

Troubleshooting Status Checks and Launch Failures

This lesson explains how EC2 reports instance health through status checks, and how launches fail for capacity, quota or configuration reasons, with the fix for each.

Learning outcomes

After completing this lesson, you will be able to:

  • Distinguish system, instance and attached EBS status checks.
  • Resolve launch and start errors.
  • Recover an instance that fails its status check.

Status checks

EC2 runs automated checks every minute. A system status check (StatusCheckFailed_System) detects problems with the AWS infrastructure: loss of network connectivity or power, or hardware and software issues on the host. Fix it by stopping and starting the instance (moving it to another host) or with the recover action; AWS may also schedule a retirement. An instance status check (StatusCheckFailed_Instance) detects problems inside the instance: a failed boot, exhausted memory, a corrupted file system, incorrect network configuration or an incompatible kernel. Fix it by rebooting, examining the system log and screenshot (get-console-output, get-console-screenshot), or using the EC2 serial console or AWSSupport-ExecuteEC2Rescue. An attached EBS status check detects impaired attached volumes.

The following diagram compares the two checks and their fixes.

The two EC2 status checks. A system status check failure is a problem with AWS infrastructure, such as host hardware or power, fixed by stopping and starting the instance or the recover action. An instance status check failure is a problem inside the instance, such as a failed boot or exhausted memory, fixed by rebooting and examining the console output, screenshot or serial console.
The failing check tells you whose side the problem is on, and therefore which fix applies.
Sort into groups

System or instance check?

Exam skills 1.3.6 · 1.2.1

Decide which status check each problem fails, and so who fixes it.

Log in to try this activity Interactive activities are free with an account.

Launch and start errors

Instances can fail to launch or start for reasons that have nothing to do with the operating system: the account has reached a quota, the Availability Zone has no capacity of the requested type, the instance cannot decrypt its volumes, or the request is incompatible with the image. The API returns a specific error code in each case, and the correct fix depends on reading that code rather than retrying. Several error messages appear repeatedly in exam questions. The following table lists them with their causes and fixes.

ErrorCauseFix
InsufficientInstanceCapacityAWS has no capacity for that type in that AZ right nowTry another AZ or type, wait, or use Capacity Reservations
VcpuLimitExceeded / InstanceLimitExceededAccount On-Demand vCPU quota reachedRequest a Service Quotas increase
InsufficientFreeAddressesInSubnetNo free IP addresses in the subnetUse or add a larger subnet
Instance terminates immediatelyEBS volume limit, corrupt snapshot, or encrypted volume whose KMS key is unavailableCheck the state reason; fix the key policy or snapshot
UnauthorizedOperationMissing IAM permission (encoded message)Decode with sts decode-authorization-message
Spot instance interruptedCapacity reclaimed with 2-minute warningDiversify types and AZs; handle the interruption notice
Troubleshooting scenario

Launch failures

Exam skills 1.3.6 · 3.1.3

Choose the fix for each launch or start error.

Log in to try this activity Interactive activities are free with an account.
Worked example

An instance that fails its status check

After a kernel update, an instance shows 1/2 checks passed, with the instance status check failing. Rebooting does not help. The console screenshot shows a kernel panic at boot. The operator runs AWSSupport-ExecuteEC2Rescue, which stops the instance, attaches its root volume to a helper instance, repairs the boot configuration to use the previous kernel and restarts it. A system status check failure would have needed a stop and start instead, because the problem would have been the host rather than the operating system.

Check yourself

A launch fails with VcpuLimitExceeded. What is the fix?

Show answer

Request a higher vCPU quota. The error is your account's quota, not AWS capacity.

Exam Tips

Remember for the exam

  • System status check failure: AWS host problem; stop/start or recover.
  • Instance status check failure: OS problem; reboot, console output, EC2Rescue.
  • InsufficientInstanceCapacity is AWS capacity; VcpuLimitExceeded is your quota.
  • Instances terminating at launch with encrypted volumes: check the KMS key.