Economical mode for pay-as-you-go instances (including spot instances)

更新时间:
复制 MD 格式

For pay-as-you-go ECS instances that are not in continuous use, economical mode minimizes costs by releasing resources such as vCPUs, memory, and system-assigned public IP addresses, while retaining your cloud disks and instance configuration.

When you stop an instance in economical mode, the following actions occur:

  • Released resources: The instance's vCPUs, memory, GPUs, FPGAs, and system-assigned public IP address are released. Billing for these resources and the image license stops.

  • Retained resources: The instance's cloud disks (system disk and data disks), snapshots associated with the cloud disks, and private IP address are retained.

For more information, see Differences between economical mode and standard stop mode.

Impact and risks

The cost savings of economical mode stem from its resource-release mechanism, which also introduces risks. Carefully evaluate whether these risks are acceptable for your workload:

  • Uncertain startup (not 100% guaranteed)

    Because economical mode releases compute resources, restarting an instance is equivalent to requesting new resources. If the availability zone has insufficient resource inventory, the instance cannot start. This risk is higher in popular regions and during peak hours. Use this mode with caution for production environments that require high availability.

  • System-assigned public IP changes

    If your service depends on the instance's system-assigned public IP address (not an elastic IP address), the address is released when the instance is stopped. When the instance restarts, the system assigns a new system-assigned public IP address. To retain the public IP address, convert the system-assigned public IP address to an elastic IP address (EIP) before you enable economical mode.

  • CPU credits for burstable instances are cleared

    For burstable instances, such as those in the t5 and t6 instance families, all accumulated CPU credits are cleared when the instance enters economical mode. This affects the instance's burst performance.

Requirements

To use economical mode, an ECS instance must meet all of the following conditions:

  • Billing method: pay-as-you-go (including spot instances).

  • Network type: Only instances in a Virtual Private Cloud (VPC) are supported. Instances in the classic network are not supported.

  • Instance specification:

    • Must not have local disks. For example, Big Data (d-series) and Local SSD (i-series) instance families are not supported. You can check the Local Storage column in Instance families to see if an instance family includes local disks.

    • Must not have persistent memory. For example, re6p and re6p-redis instance families are not supported. You can check the Persistent Memory column in Instance families to see if an instance family includes persistent memory.

Stop an instance in economical mode

Important

Shutting down an instance from within its operating system by using commands such as shutdown, poweroff, or halt does not trigger economical mode. You must stop the instance from the console or by using the API or CLI.

Console

  1. Go to the ECS console - Instances page. Select a region and a resource group.

  2. Find the instance that you want to stop and, in the Operation column, click Stop.

  3. In the dialog box that appears, set Stop Mode to Economical Mode and then click OK.

Expected result

The instance first enters the Stopping state. After the instance is stopped, the Status column displays the Stopped state and the Economical Mode tag.

CLI

Call the StopInstance operation and set the StoppedMode parameter to StopCharging.

Example: Stop an instance with the ID i-t4n5xxxxxxxxxxx in the China (Hangzhou) region by using economical mode.

aliyun ecs StopInstance \
--RegionId cn-hangzhou \
--InstanceId i-t4n5xxxxxxxxxxx \
--StoppedMode StopCharging \
--ForceStop false \
--DryRun false

API

  • When you call StopInstance to stop a pay-as-you-go ECS instance (including a spot instance), set the StoppedMode parameter to StopCharging to place the instance in economical mode.

    Important

    If you call this operation with StoppedMode=StopCharging for an instance that does not meet the conditions for economical mode, no error is reported. The instance stops in standard stop mode. To confirm whether the instance successfully entered economical mode, call the DescribeInstances operation to query the instance status.

  • When you call RunInstances or CreateInstance to create a spot instance, set the SpotInterruptionBehavior parameter to Stop. The instance enters economical mode when it is interrupted.

Set economical mode as the default

By default, Standard Mode is selected when you stop an instance in the console. You can change this setting to make Economical Mode the default choice.

This setting changes only the default option in the console. When you stop an instance, you can still choose to stop the instance by using Standard Mode.
  1. Go to the ECS console - Overview page.

    To configure this setting, switch the ECS console to the standard version.
  2. On the right side of the page in the Common Features section, click Custom Settings.

  3. Turn on the Economical Mode switch.

  4. Read the notification and, after confirming the details, click Enable Economical Mode at the bottom of the page.

Usage in production environments

For large or periodically used clusters, use Operation Orchestration Service (OOS) to schedule instances to automatically stop in economical mode. This approach automates cost optimization without manual intervention.

  • Use case: A batch of ECS instances is used as a development and test environment. These instances are typically used only during business hours on weekdays (for example, 09:00 to 18:00). At night and on weekends, these instances are idle but continue to incur charges.

  • Solution: Use Alibaba Cloud's Operation Orchestration Service (OOS) to create a scheduled start and stop task. This task automatically places instances in the most cost-effective state when not in use, which helps save costs. The key configurations are as follows:

    • Execution schedule: Monday to Friday

    • Start time: 09:00

    • Stop time: 18:00

    • Stop mode: economical mode

Economical mode vs. standard mode

The main differences between economical mode and standard stop mode are as follows:

Feature

Economical mode

Standard stop mode

Resource retention

Retains only cloud disks and instance metadata. Releases resources such as vCPUs, memory, GPUs, FPGAs, and system-assigned public IP addresses.

Retains all resources.

Billing impact

Billing stops for resources such as vCPUs, memory, GPUs, FPGAs, and system-assigned public IP addresses. Billing continues for resources such as image licenses, cloud disks, elastic IP addresses (EIPs), and snapshots.

Billing continues for all resources.

Restart speed

Slower, because compute resources must be requested and allocated again.

Faster, because compute resources are not released.

Restart reliability

Not guaranteed. Start operations can fail in regions with high resource demand due to insufficient inventory.

Start operations do not fail due to insufficient resource inventory.

System-assigned public IP address

The system-assigned public IP address is released. Upon restart, a new public IP address is assigned.

The system-assigned public IP address is retained.

FAQ

  • Can I use standard stop mode if economical mode is the default?

    Yes. Even if economical mode is the default, you are still prompted to select a stop mode each time you stop an instance. If you stop an ECS instance by using standard stop mode, its compute and network resources are not released.

    If you need to restart an instance shortly after you stop it, we recommend that you set the StoppedMode parameter to KeepCharging when you call the StopInstance operation. Alternatively, select Standard Mode when you stop the ECS instance in the console.

  • Can I trigger economical mode from within the OS?

    No.

    Shutting down an instance from within its OS by using commands such as shutdown, poweroff, or halt, or by any other manual method, does not trigger economical mode. An instance enters economical mode only if it is stopped in one of the following ways:

    • Stopped from the ECS console.

    • Stopped by an API request sent from the Alibaba Cloud CLI or an SDK.

    • Stopped automatically due to an overdue payment on your account.

  • Do instances with local disks support economical mode?

    No, instances with local disks do not support economical mode.

  • Why did my instance fail to start from economical mode?

    Possible reasons include:

    • Insufficient resource inventory: The instance might fail to start due to insufficient resources. You can try to start the instance again later or change the instance specification.

    • Overdue payment on your account.

    • Spot instance price exceeds the maximum price: If you set a maximum price when you created the spot instance, the instance may fail to restart if the current market price exceeds your specified maximum price.

  • Why does starting an instance return a OperationDenied.NoStock error?

    Economical mode releases the compute resources of an instance. When you restart the instance, the system must request the resources again. If the resource pool has insufficient inventory at that moment, the start operation fails and returns the OperationDenied.NoStock error. We recommend that you try again later or change the instance specification.

  • How to retain a public IP address?

    When an ECS instance is stopped in economical mode, its system-assigned public IP address is released. When the instance restarts, a new system-assigned public IP address is automatically assigned. As a result, the address changes.

    To retain the public IP address, you can convert the instance's system-assigned public IP address to an elastic IP address (EIP). EIPs are not released when an instance is stopped in economical mode. For more information, see Convert a system-assigned public IP address to an EIP and ConvertNatPublicIpToEip.

    Important

    After you convert a system-assigned public IP address to an EIP, you are charged for outbound data transfer. EIP configuration and association fees also apply, although they are waived under certain conditions. For detailed billing information, see EIP billing.

  • Why did my instance not enter economical mode with StoppedMode=StopCharging?

    For instances that do not meet the conditions for economical mode, when you call the StopInstance API and set StoppedMode=StopCharging, the system does not block the operation and prioritizes stopping the instance. To confirm whether the instance has successfully entered economical mode, check the instance status by calling the DescribeInstances API.

  • How to switch from standard to economical mode?

    You cannot switch the modes directly while the instance is stopped. You must first start the instance until it enters the Running state, and then stop it again in economical mode.