Troubleshoot an unreachable instance
You can use the following methods to troubleshoot an unreachable Linux instance. For information about troubleshooting an unreachable Windows instance, see Troubleshoot an unreachable instance.
Contents
Instance reboot
The ability to reboot instances that are otherwise unreachable is valuable for both troubleshooting and general instance management.
Just as you can reset a computer by pressing the reset button, you can reset EC2 instances using the Amazon EC2 console, CLI, or API. For more information, see Reboot your instance
Instance console output
Console output is a valuable tool for problem diagnosis. It is especially useful for troubleshooting kernel problems and service configuration issues that could cause an instance to terminate or become unreachable before its SSH daemon can be started.
For Linux/Unix, the instance console output displays the exact console output that would normally be displayed on a physical monitor attached to a computer. The console output returns buffered information that was posted shortly after an instance transition state (start, stop, reboot, and terminate). The posted output is not continuously updated; only when it is likely to be of the most value.
For Windows instances, the instance console output includes the last three system event log errors.
You can optionally retrieve the latest serial console output at any time during the instance lifecycle. This option is only supported on Instances built on the Nitro System. It is not supported through the Amazon EC2 console.
Note
Only the most recent 64 KB of posted output is stored, which is available for at least 1 hour after the last posting.
Only the instance owner can access the console output. You can retrieve the console output for your instances using the console or the command line.
Use one of the following methods to get console output.
For more information about common system log errors, see Troubleshoot system log errors for Linux-based instances.
Capture a screenshot of an unreachable instance
If you are unable to reach your instance via SSH or RDP, you can capture a screenshot of
your instance and view it as an image. The image can provide visibility as to the status of the
instance, and allows for quicker troubleshooting. You can generate screenshots while the
instance is running or after it has crashed. There is no data transfer cost for this screenshot.
The image is generated in JPG format and is no larger than 100 kb. This feature is not supported
when the instance is using an NVIDIA GRID driver, is on bare metal instances (instances of type
*.metal
), or is powered by Arm-based Graviton or Graviton 2 processors.
This feature is available in the following Regions:
-
US East (N. Virginia) Region
-
US East (Ohio) Region
-
US West (Oregon) Region
-
US West (N. California) Region
-
Africa (Cape Town) Region
-
Asia Pacific (Hong Kong) Region
-
Asia Pacific (Hyderabad) Region
-
Asia Pacific (Mumbai) Region
-
Asia Pacific (Seoul) Region
-
Asia Pacific (Singapore) Region
-
Asia Pacific (Sydney) Region
-
Asia Pacific (Tokyo) Region
-
Canada (Central) Region
-
China (Beijing) Region
-
China (Ningxia) Region
-
Europe (Frankfurt) Region
-
Europe (Ireland) Region
-
Europe (London) Region
-
Europe (Milan) Region
-
Europe (Paris) Region
-
Europe (Stockholm) Region
-
South America (São Paulo) Region
-
Middle East (Bahrain) Region
To access the instance console
Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/
. -
In the left navigation pane, choose Instances.
-
Select the instance to capture.
-
Choose Actions, Monitor and troubleshoot.
-
Choose Get instance screenshot.
Right-click the image to download and save it.
To capture a screenshot using the command line
You can use one of the following commands. The returned content is base64-encoded. For more information about these command line interfaces, see Access Amazon EC2.
-
get-console-screenshot (AWS CLI)
-
GetConsoleScreenshot (Amazon EC2 Query API)
Instance recovery when a host computer fails
If there is an unrecoverable issue with the hardware of an underlying host computer, AWS may schedule an instance stop event. You are notified of such an event ahead of time by email.
To recover an Amazon EBS-backed instance running on a host computer that failed
-
Back up any important data on your instance store volumes to Amazon EBS or Amazon S3.
-
Stop the instance.
-
Start the instance.
-
Restore any important data.
For more information, see Stop and start your instance.
To recover an instance store-backed instance running on a host computer that failed
-
Create an AMI from the instance.
-
Upload the image to Amazon S3.
-
Back up important data to Amazon EBS or Amazon S3.
-
Terminate the instance.
-
Launch a new instance from the AMI.
-
Restore any important data to the new instance.
For more information, see Create an instance store-backed Linux AMI.