Skip to main content

MODULE 3 - EC2 Troubleshooting

Overview​

This module is dedicated to troubleshooting EC2 instances. You will learn to diagnose and resolve common issues related to the creation and operation of instances.

Learning Objectives​

By the end of this module, you will be able to:

  • Identify common instance creation errors
  • Apply the diagnostic method: symptom → hypotheses → tests → fix
  • Read and interpret EC2 states and events
  • Resolve connectivity issues (SSH, HTTP)
  • Analyze basic logs and metrics

Week Content​

1. Instance Creation Errors​

  • InsufficientInstanceCapacity
  • InstanceLimitExceeded
  • Security Group Errors
  • Subnet and VPC Issues

2. Diagnostic Method​

┌─────────────────────────────────────────────────────────────┐
│ DIAGNOSTIC METHOD │
├─────────────────────────────────────────────────────────────┤
│ │
│ 1. SYMPTOM │
│ └── What exactly is not working? │
│ │
│ 2. HYPOTHESES │
│ └── What are the possible causes? │
│ (Network? Security? Instance? Application?) │
│ │
│ 3. TESTS │
│ └── How to verify each hypothesis? │
│ (ping, curl, logs, metrics) │
│ │
│ 4. FIX │
│ └── What action resolves the issue? │
│ │
│ 5. DOCUMENTATION │
│ └── Note the solution for future reference │
│ │
└─────────────────────────────────────────────────────────────┘

3. Common Issues and Solutions​

ProblemProbable CauseSolution
Cannot SSHSecurity Group port 22Add SSH rule
Instance "pending" long timeRegion capacityChange AZ or type
Instance stops immediatelyAMI/EBS issueCheck system logs
No public IPSubnet without auto-assignEnable or use EIP
HTTP not respondingService not startedCheck application

4. Reading EC2 States​

States and their meaning:

pending → Starting up (normal < 2 min)
running → Instance operational
stopping → Stopping in progress
stopped → Stopped (no compute billing)
terminated → Permanently deleted

System status codes (Status Checks):
- System Status: AWS issue (network, hardware)
- Instance Status: Your config issue (OS, instance network)

Troubleshooting Exercises​

Exercise 1: Cannot SSH​

Scenario:
You launched an EC2 instance but cannot connect via SSH.
The command `ssh -i key.pem ec2-user@IP` times out.

Questions:
1. What are your top 3 hypotheses?
2. How do you verify them?
3. What is the most probable cause?

Exercise 2: Website Inaccessible​

Scenario:
Your Apache web server is installed on EC2.
You can SSH but http://IP does not respond.

Questions:
1. Is the issue network or application related?
2. What commands do you use to diagnose?
3. Propose 3 possible solutions.

Deliverables​

Mini-Troubleshooting Report​

For 2 failure scenarios (given in class), document:

  • The observed symptom
  • The formulated hypotheses
  • The tests performed
  • The applied fix
  • The lessons learned

Evaluation​

Type: Formative (0%)

  • Guided troubleshooting exercise in class
  • Scenario analysis
  1. Common Errors - Creation issues
  2. Diagnostic Method - Structured approach
  3. Validation Quiz - 30 questions to validate your knowledge
  4. Lab: Failure Scenarios - Practical exercises

Next week: MODULE 4 - EBS Storage