A rolling upgrade is a task that updates the configurations of multiple ECS instances or Elastic Container Instances (ECI) in batches. You can use the rolling upgrade feature of Auto Scaling to update images, run scripts, or install CloudOps Orchestration Service (OOS) packages for ECS or ECI instances that are in the In Service state within a scaling group.
Prerequisites
To update images for ECS or ECI instances in a scaling group, you must prepare the required images.
To run scripts on ECS or ECI instances in a scaling group, you must prepare the required scripts.
To install OOS packages on ECS instances or ECI instances in a scaling group, you must have already created the packages in OOS. For more information, see Manage custom extensions in batches.
Task types supported by rolling upgrades
Task type | Description |
Image update | Suitable for uniformly updating the operating systems of ECS or ECI instances that are in the In Service state within a scaling group. When you update an image, the impact on the instance configuration source of the group is as follows:
Note Based on your scenario, you can choose to update images using a rolling upgrade or by automatically updating the image in the scaling configuration. For more information, see Differences between rolling upgrades and automatic image updates in scaling configurations. |
Script execution | Suitable for performing one or more O&M operations. For example:
|
Install OOS package | Suitable for installing and uninstalling software in batches. |
Differences from automatic image updates in scaling configurations
Automatic image updates in scaling configurations: This method is suitable for scenarios where applications are frequently released and applies only to scaling groups that contain ECS instances. You can create an update task in the Auto Scaling console. When the task is executed, the system automatically creates a custom image from an original ECS instance. This ensures that all new ECS instances created in the scaling group have the new image version. For more information, see Automatically update the image in a scaling configuration.
Rolling upgrades: This method is suitable for scenarios where you need to update the configurations of ECS or ECI instances in batches. It applies only to scaling groups in regions that support CloudOps Orchestration Service (OOS). You can use this feature to gradually upgrade the images of existing ECS or ECI instances that are in the In Service state to a new version within the scaling group.
Create and run a rolling upgrade task
Before you create and run a rolling upgrade task, note the following:
This feature is available only for scaling groups in regions that support CloudOps Orchestration Service (OOS).
The scaling group must not have any scaling activities in progress.
Only one rolling upgrade task can be run at a time.
Log on to the Auto Scaling console.
In the left-side navigation pane, click Scaling Groups.
In the top navigation bar, select a region.
Find the desired scaling group and use one of the following methods to open the scaling group details page.
Click the ID of the scaling group in the Scaling Group Name/ID column.
Click Details in the Actions column.
In the upper part of the details page, click the Rolling Update tab.
Click Create Execution Task.
In the Create Execution Task dialog box, configure the parameters for the rolling upgrade task and then click Create Task.
The following table describes the required configurations.
Configuration item
Description
Task Description
Enter a description for the task for future reference.
Task Type
Update Image: Replaces the current image of an ECS or ECI instance. You can select a public image, custom image, shared image, or marketplace image. The ECS or ECI instance is restarted during the replacement process. Specify the following information:
Image for Update: The image to use for the update task.
Image for Rollback: The default image to use for the rollback task.
NoteWhen you create a rollback task, this image is selected by default, but you can select other images.
Script Execution: Runs a script using Cloud Assistant. The ECS or ECI instance is not stopped during the process. Specify the following information:
Script Type. The following three script types are supported:
Linux Shell: For example, the hostname command to display the hostname or the echo hello command to print 'hello'.
Windows Bat: For example, the dir c:\ command to display directory files.
Windows PowerShell: For example, the Get-Services command to display services.
Script for Execution: The script to use for the update task.
Script for Rollback: The default script to use for the rollback task.
NoteWhen you create a rollback task, this script is entered by default, but you can edit the script.
Install OOS Package: Select the OOS package name and version.
Execution Batches
The number of batches for the task. When the scaling group executes the task, it divides the ECS or ECI instances into several batches. Each batch must include at least one ECS or ECI instance. For example, if a scaling group contains 10 ECS instances that are in the In Service state and you set this parameter to 2, the task is executed in two batches with five ECS instances per batch.
Suspension Policy
Without Suspension: The task is executed at once.
Suspend First Batch: After the first batch is complete, the scaling group pauses the task. You must manually resume the task. Subsequent batches are not paused.
Suspend Each Batch: After each batch is complete, the scaling group pauses the task. You must manually resume the task each time.
Advanced Options
Optional. If you set Task Type to Update Image, you can set the maximum number of errors allowed before the rolling upgrade task stops. If you leave this blank, the default value is 0. This means the entire rolling upgrade task fails if one error occurs.
Review the impacts of the rolling upgrade task, and then click OK.
After you click OK, the rolling upgrade task starts automatically and has the following impacts on the scaling group and its ECS or ECI instances:
The scaling group pauses processes, such as scaling activities, and does not respond to them during the rolling upgrade. After the upgrade is complete, the processes are resumed. If you manually paused the scaling processes before the upgrade, they remain paused to maintain the state of the scaling group.
The ECS or ECI instances are moved to the Standby state in batches. After the execution is complete, they are restored to the In Service state.
ImportantIf the scaling group is associated with an SLB instance, the weight of an ECS or ECI instance in the Standby state is set to 0. As a result, the instance stops receiving service traffic.
Manage the rolling upgrade task based on its execution status.
Task
Description
Procedure
Continue the rolling upgrade task
If the suspension policy is Suspend First Batch or Suspend Each Batch, the task enters the Pending (Batch Paused) state one or more times. If you confirm that the upgraded instances meet your expectations, you can continue the task.
In the Actions column, click Continue.
In the Continue Execution Task dialog box, click OK.
Complete the rolling upgrade task
If the rolling upgrade task fails, it enters the Pending (Failure Paused) state. You can then choose to retry, skip, or cancel the operation for the failed instance to complete the task.
In the Actions column, click Details.
Find the ECS or ECI instance whose execution status is Failed. In the Actions column, click Retry, Skip, or Cancel.
Click Retry to retry the rolling upgrade operation on the instance.
Click Skip to perform the rolling upgrade operation on the next instance. The execution status of the current instance is displayed as Success.
ImportantYou must manually remove the skipped ECS or ECI instance from the Standby state.
Click Cancel to perform the rolling upgrade operation on the next instance. The execution status of the current instance is displayed as Failed.
Cancel the rolling upgrade task
If the rolling upgrade task does not meet your business requirements, you can cancel it.
In the Actions column, choose .
ImportantAfter you cancel the task, you must manually resume the paused scaling group processes and remove the instances from the current batch that are being processed or have failed from the Standby state.
Roll back the rolling upgrade task
You can roll back a task that is pending (batch paused or failure paused) or the most recently completed task.
For more information, see Roll back a completed rolling upgrade task.
Roll back a completed rolling upgrade task
You can roll back a rolling upgrade task that is pending (batch paused or failure paused) or the most recently completed task to restore instance configurations if an issue occurs. If a rolling upgrade task is in the Pending state, the task is automatically canceled before the rollback task is executed. The instances that have already been updated are then rolled back.
You can only roll back a rolling upgrade task. You cannot roll back a rollback task.
On the execution task list page, find the task that you want to manage. In the Actions column, click Rollback.
In the Create Rollback Task dialog box, configure the parameters for the rollback task.
The following table describes the parameters.
Region
Description
Task Description
Enter a description for the rollback task for future reference.
Task Type
This is the same as the task type of the original task and cannot be edited.
If the task type is Image Update, the image you entered for rollback when you created the rolling upgrade task is automatically selected. You can select other images.
If the task type is Script Execution, the script you entered for rollback when you created the rolling upgrade task is automatically entered. You can edit the script.
If the task type is Install OOS Package, the OOS package version you selected when you created the rolling upgrade task is automatically selected. You can select another version, but you cannot select other packages.
Execution Batches
The number of batches for the task. When the scaling group executes the task, it divides the ECS or ECI instances into several batches. Each batch must include at least one ECS or ECI instance. For example, if a scaling group contains 10 instances in service and you set this parameter to 2, the task is executed in two batches with five instances per batch.
Suspension Policy
Without Suspension: The task is executed at once.
Suspend First Batch: After the first batch is complete, the scaling group pauses the task. You must manually resume the task.
Suspend Each Batch: After each batch is complete, the scaling group pauses the task. You must manually resume the task each time.
Advanced Options
Optional. If you set Task Type to Update Image, you can set the maximum number of errors allowed before the rolling upgrade task stops.
Click Create Task.
Review the impacts of the rollback task, and then click OK.
The rollback task starts automatically after you click OK.
View rolling upgrade task details
You can view the information about a rolling upgrade task and perform operations, such as retry and skip, on a specific ECS or ECI instance.
On the execution task list page, find the task that you want to view. In the Actions column, click Details.
View the basic information of the task.
The basic task information includes the task status and task type. If the task type is Script Execution, click Script Details to view the script content.
View the list of executed instances.
The list of executed instances shows instances in various execution states.
If an ECS or ECI instance has not completed execution, you can skip or cancel the operation for the instance.
If an ECS or ECI instance fails to execute, you can retry, skip, or cancel the operation in the Actions column.
If the task type is Script Execution, click View in the Output column to view the output of the script.
The differences between retry, skip, and cancel are as follows:
Click Retry to retry the rolling upgrade operation on the instance.
Click Skip to proceed to the next instance. The execution status of the current instance changes to Success.
ImportantYou must manually remove the skipped ECS or ECI instance from the Standby state.
Click Cancel to proceed to the next instance. The execution status of the current instance changes to Failed.
Configure monitoring and alerts for rolling upgrades
You can configure independent monitoring and alerts for rolling upgrade tasks based on the requirements of different scaling groups. This lets you promptly handle rolling upgrade issues by viewing alert details.
Log on to the CloudMonitor console.
In the navigation pane on the left, choose .
On the System Event page, set the filter conditions and click Search to query for rolling upgrade failure events for a specified scaling group.
For example, set the event level to Critical and enter the following keywords:
(ACS-ESS-RollingUpdateByConfigureOOSPackage or ACS-ESS-RollingUpdateByReplaceSystemDiskInScalingGroup or ACS-ESS-RollingUpdateByRunCommandInScalingGroup or ACS-ESS-RollingUpdateByUpdateContainerGroup) and ${your_scaling_group_id}NoteReplace
{your_scaling_group_id}with your actual scaling group ID, such as asg-bp180y8dj5eku2j4****.
Click Save as Alert Rule.
In the Create/Modify Event Alert panel, configure the following parameters and click OK.

In the navigation pane on the left, choose .
On the alert history page, you can view the specific alert details.

> Cancel