All Products
Search
Document Center

Auto Scaling:Instance refresh

Last Updated:Dec 01, 2025

If you modify the scaling configuration or image in a scaling group, you can use the instance refresh feature to apply the changes. Auto Scaling creates new instances from the new scaling configuration or image to gradually replace the old instances. This process performs a rolling update on the running instances in the scaling group to ensure a smooth service upgrade.

Feature overview

To perform a rolling update on the instance configurations or images in your scaling group, you can use the instance refresh feature. After you start an instance refresh task, Auto Scaling automatically creates new instances based on the specified expected configuration to gradually replace old instances. This ensures a smooth version iteration. This feature has the following characteristics:

  • Rolling update: This feature performs a rolling update by creating new instances and releasing old instances.

    Difference from the rolling upgrade feature: When you use the rolling upgrade feature to update instance images, instances are not released. Instead, the images of the instances are replaced in batches.
  • Allows the number of instances to temporarily differ from the expected number: During an instance refresh task, Auto Scaling allows the number of instances in the group to temporarily exceed or fall below the expected number of instances. You can control the percentage by which the number of instances can exceed or fall below this limit.

  • Does not affect scaling activities: During an instance refresh task, scaling activities can continue as normal. If a scale-out is triggered, Auto Scaling creates instances using the scaling configuration or image specified in the instance refresh task. This ensures that all instances in the scaling group are consistent.

    Difference from rolling upgrades: During a rolling upgrade task, Auto Scaling pauses the scale-out and scale-in processes.
  • Does not affect instances that are in service: During an instance refresh, instances are not put into the standby state. Instead, new instances are created and old instances are released. This ensures a smooth transition.

  • Automatically modifies the scaling configuration: After an instance refresh task is complete, Auto Scaling automatically sets the expected configuration as the active scaling configuration for the scaling group or directly modifies the image in the active configuration.

Limits

  • The instance refresh feature is supported only for scaling groups of the ECS type.

  • The feature is not supported for scaling groups with an instance reclaim mode of Economical Mode or Forcibly Recycle.

  • The instance refresh feature is not supported if the Measure Scaling Group Capacity By Using vCPUs option is enabled in the active scaling configuration of the scaling group. In addition, you cannot enable the Measure Scaling Group Capacity By Using vCPUs option for the expected configuration.

Usage process

Scenario 1: Update only the image of instances in the scaling group

Follow this process if you only need to update your business application or the internal configurations of your instances.

  1. Prepare a new instance image.

    First, prepare an image that includes the modified instance. This image is used to create new instances during the instance refresh. For more information about how to create a custom image, see Create a custom image from an instance.

  2. Start an instance refresh task.

    When you start the instance refresh task, specify the expected image and the method for the rolling update of instances in the scaling group. For more information about the procedure and configuration descriptions, see Start an instance refresh task.

  3. Monitor the instance refresh task.

    During task execution, you can monitor its status. If necessary, you can pause, cancel, or roll back the task. For more information, see Instance refresh operations.

Scenario 2: Update the scaling configuration used by instances in the scaling group

Follow this process to update options in the scaling configuration and apply them to the instances in the scaling group.

  1. Create a new scaling configuration.

    First, prepare a new scaling configuration. During the instance refresh task, this configuration is used to create new instances. For more information about how to create a scaling configuration, see Create a scaling configuration for ECS instances.

    Why create a new scaling configuration: When you create an instance refresh task, Auto Scaling filters and refreshes the instances that do not use the target scaling configuration. If you first modify the scaling configuration and then perform a refresh, the refresh may fail. If an unexpected issue occurs after the refresh, a distinct configuration version helps you quickly find the last working configuration and restore it.
  2. Start an instance refresh task.

    When you start the instance refresh task, specify the expected scaling configuration and the method for the rolling update of instances in the scaling group. For more information about the procedure and configuration descriptions, see Start an instance refresh task.

  3. Monitor the instance refresh task.

    During task execution, you can monitor its status. If necessary, you can pause, cancel, or roll back the task. For more information, see Instance refresh operations.

Scenario 3: Update the launch template for instances in the scaling group

If the instance configuration source for your scaling group is a launch template, follow this process to update the launch template and apply the changes to the instances in the scaling group:

  1. Create a new launch template or a new version of an existing one.

    First, create a new version of the current launch template, or create an entirely new launch template. In the new version or template, update the desired configuration items. For more information, see Create a new version of a launch template and Create a launch template.

  2. Start an instance refresh task.

    When you start the instance refresh task, specify the expected scaling configuration and the method for the rolling update of instances in the scaling group. For more information about the procedure and configuration descriptions, see Start an instance refresh task.

  3. Monitor the instance refresh task.

    During task execution, you can monitor its status. If necessary, you can pause, cancel, or roll back the task. For more information, see Instance refresh operations.

Instance refresh operations

Entry point: Go to the Instance Refresh page

The instance refresh features are available on the Instance Refresh page of a scaling group. Follow these steps to navigate to the page.

Go to the Instance Refresh page

  1. Log on to the Auto Scaling console.

  2. In the navigation pane on the left, click Scaling Groups.

  3. In the top navigation bar, select a region.

  4. On the Scaling Groups page, find the scaling group that you want to manage and click the name of the scaling group to go to the details page.

  5. Click the Instance Refresh tab to go to the Instance Refresh page.

    image

Start an instance refresh task

Important
  • Only one instance refresh task can run in a scaling group at a time.

  • You cannot modify the active scaling configuration of the scaling group while an instance refresh task is in progress.

  1. On the Instance Refresh page, click the Instance Refresh button to open the instance refresh configuration page.

  2. On the instance refresh configuration page, complete the Configure Capacity Policy and Expected Configuration sections as prompted.

    How to configure the Configure Capacity Policy section

    This policy has two main configuration items:

    • Uptime Percentage > Min: The minimum percentage of the scaling group's capacity that must be maintained by instances in the In Service state during an instance refresh.

    • Uptime Percentage > Max: The maximum percentage by which the number of instances in a scaling group can exceed its capacity during an instance refresh.

    Configure these items based on your needs and the following scenarios.

    • Prioritize availability

      Select Create Before Release. With this option, the instance refresh task first starts new instances and releases the old instances only after the new instances are ready. You can set the Max value to control the instance creation rate, batch size, and extra costs.

      For example, to update instances in two batches, with each batch updating half of the instances, you can set the Max value to 150. This means that new instances are created, allowing the total number of instances to exceed the expected capacity by up to 50%. After this batch of instances is ready, old instances are released until the number of running instances in the scaling group returns to the expected number. You can preview the temporary minimum and maximum number of healthy instances in the Estimated Capacity Of Current Scaling Group section.
    • Prioritize cost

      Select Create and Release At One Time. With this option, the instance refresh task releases old instances and creates new instances simultaneously. You can set the Min value to control the minimum number of available instances.

    • Balance availability and cost

      Select Custom Policy to specify both the Min and Max values. This lets you balance cost and availability based on your requirements.

  3. After you check the configuration, click the Start Refresh button. The instance refresh task starts.

Pause or resume an instance refresh task

If you encounter a problem during an instance refresh task, you can pause the task to investigate. You can then decide whether to resume the task. The following figures show where to find the pause and resume operations.

Important

If a new instance starts initialization or is being added to the scaling group before you pause the task, these processes continue until they are complete, even after the task is paused.

Pause an instance refresh task

image

Resume an instance refresh task

image

Roll back an instance refresh task

If you encounter a problem during the instance refresh task, you can roll back to the previous scaling configuration or image. The following figure shows where to find the rollback operation.

image

Cancel an instance refresh task

In addition to rolling back, you can cancel an instance refresh task that is in progress. The following figure shows where to find the cancel operation.

Important

Unlike a rollback, a cancellation retains the new instances that have already been replaced or added.

image