Restart instances

更新时间:
复制 MD 格式

GPU-accelerated instances are a type of Elastic Compute Service (ECS) instances and are managed in the same manner as common ECS instances. This topic describes how to restart instances in the Elastic Compute Service (ECS) console.

Impacts and risks

Service interruption: When you restart an instance, it stops and then starts again. This process interrupts your services.

Data loss (force restart): If you force restart an instance, cached data in memory that has not been written to a storage device is lost.

Procedure

Step 1: Pre-restart checks and preparations

  • Restart time: We recommend that you execute this operation during off-peak hours.

  • Stop applications: Manually stop application services within the operating system. Ensure all requests and data writes are complete.

    To quickly resume services after a restart, check if critical business applications are configured to start automatically on boot.
  • Back up data: To prevent data loss from unexpected issues during a restart, create a snapshot to back up your data before you restart the instance.

    Snapshots are a paid feature. For more information, see Snapshot billing.

Step 2: Restart the instance

Console

  1. Go to the ECS console - Instances page. In the upper-left corner, select the resource group and region of your instance.

  2. Click the ID of the target instance to go to its details page. In the upper-right corner, click Restart.

  3. In the dialog box that appears, select a restart mode.

    • Do not select Force Restart (Default): The operating system attempts to gracefully shut down all processes before restarting.

    • Select Force Restart: This is similar to a power-off operation. It risks data loss and file system corruption. Use this option only if the instance does not respond to a normal restart.

  4. Perform the restart operation:

    • Restart Now: Click OK.

    • Scheduled Restart: Select the scheduled execution option to specify a future time to restart the instance. Follow the on-screen instructions to configure the time and select a role. Then, click OK to create a scheduled restart task. After the task is created, you can go to the CloudOps Orchestration Service (OOS) console - Scheduled O&M page to modify the task configuration.

When you restart an instance, the operating system and the hypervisor must release resources such as processes, CPU, and memory. This operation may take a long time. The process typically takes 3 to 5 minutes but can take up to 20 minutes.

API

You can call the following API operations to restart one or more ECS instances.

  • Restart a single ECS instance that is in the Running state: RebootInstance.

  • Restart one or more ECS instances that are in the Running state: RebootInstances.

  • Restart an ECS instance that is expired or has been reclaimed due to an overdue payment: ReActivateInstances.

To schedule an instance restart, see the CloudOps Orchestration Service (OOS) - Common Task Template - Scheduled Restart Task for configuration instructions.

FAQ

Why do changes not take effect after I restart an instance using the reboot command?

You must restart your ECS instance from the console or using an API. This method loads the complete instance configuration and applies underlying changes that the operating system cannot detect. Therefore, if you modify instance resources, change the hostname, perform an offline disk scale-out, or need to restart the instance for a system maintenance event, you must restart the instance from the console or using an API for the changes to take effect. The reboot command within the operating system is not effective in these cases.

What do I do if an instance remains in the Stopping or Starting state for a long time after a restart?

For more information, see FAQ about instance startup and shutdown exceptions.

What permissions are required to restart an ECS instance as a RAM user?

If you are a Resource Access Management (RAM) user, you must have the ecs:DescribeInstances and ecs:RebootInstance permissions.

References