This topic describes how to troubleshoot the issue that an Elastic Compute Service (ECS) instance remains in the Stopping state when you stop or restart the instance in the ECS console.
Background information
When you stop or restart an ECS instance in the ECS console, the internal operating system of the instance must release resources, such as processes, CPUs, and memory, and the virtualization layer must also release related resources. The time required for the stop or restart operation is approximately up to 20 minutes and varies based on various factors, such as the number of services running on the instance. For example, after an instance restart operation is triggered, the instance enters the Stopping (Stopping) state, the Starting (Starting) state, and then the Running (Running) state.
Workflow
If the ECS instance remains in the Stopping state for an extended period of time, for example, more than 10 to 20 minutes, you can troubleshoot and handle the issue by using the following workflow.
The following section describes the common causes of and solutions to instances that remain in the Stopping state for an extended period of time.
Causes
When an ECS instance runs an excessive number of service processes, the operating system must release the related resources after the stop operation is triggered. As a result, the instance remains in the Stopping state for an extended period of time.
The system becomes unresponsive for unknown reasons during the stop process.
Solutions
After the instance stop operation is triggered, the instance starts to perform stop-related operations. During this period, the instance status cannot be changed. Wait until the instance is restarted or stopped before you proceed.
If you want to obtain more information, such as the status of an instance, you can connect to the instance by using Virtual Network Computing (VNC). Identify and handle the issue based on the information on the VNC terminal.
After the instance is restarted, analyze system logs to identify the cause of the issue.
References
For information about how to use VNC to connect to an instance, see Connect to an instance by using VNC.
For information about instance status changes, see Instance lifecycle.
For information about instance health status, see the Instance health status section of the "View the health status of ECS instances" topic.
For information about how to create a snapshot, see Create a snapshot.
For information about how to re-initialize a system disk, see Re-initialize a system disk.
For information about how to use a snapshot to roll back a cloud disk, see Roll back a disk by using a snapshot.
For information about how to use SSH to connect to a Linux instance, see Use Workbench to connect to a Linux instance over SSH.
For information about how to handle system startup exceptions caused by configuration errors in the /etc/fstab file of a Linux instance, see What do I do if system startup exceptions occur due to configuration errors in the /etc/fstab file on a Linux instance?