You may need to restart Elastic Compute Service (ECS) instances, usually for maintenance purposes, such as to apply system updates or to save and apply configurations. This topic describes how to restart an instance in the ECS console or by calling an API operation.
Warning
The restart operation stops the instance for a short period of time and may interrupt services that are running on the instance. We recommend that you restart the instance during off-peak hours.
Prerequisites
The instances that you want to restart are in the Running state.
Note
We recommend that you restart an instance in the ECS console or calling an API operation instead of running the reboot command in the operating system of the instance. In specific scenarios, such as offline resizing, hostname modification, and reporting of system O&M events, the reboot command is invalid when you run this command to restart an ECS instance.
Restart an instance in the ECS console
Go to ECS console - Instance.
In the top navigation bar, select the region and resource group of the resource that you want to manage.
Click the ID of the ECS instance that you want to restart to go to the instance details page. In the upper-right corner of the page, click All Actions. In the pane that appears, search for and click Restart.
In the Restart Instance dialog box, select or unselect Force Restart, and then click Confirm.
If you select Force Restart, the instances are forcefully restarted. This may result in the loss of unsaved data.
If you do not select Force Restart, the instances are normally restarted.
Note
During instance restart, the operating system of the instance releases resources, such as processes, CPUs, and memory, and the virtualization layer also releases related resources. The entire process requires 3 to 5 minutes, and does not exceed 20 minutes.
Restart an instance by calling an API operation
You can restart one or more ECS instances by calling the following API operations. For information about API operations, see Integration overview.
To restart a single ECS instance that is in the Running state, call the RebootInstance operation.
To restart one or more ECS instances that are in the Running state, call the RebootInstances operation.
To reactivate a pay-as-you-go ECS instance that has expired or has been recycled due to overdue payments, see ReActivateInstances.
Note
During instance restart, the operating system of the instance releases resources, such as processes, CPUs, and memory, and the virtualization layer also releases related resources. The entire process requires 3 to 5 minutes, and does not exceed 20 minutes.