A rolling update lets you update the configurations of multiple Elastic Compute Service (ECS) instances or Elastic Container Instances (ECI) in batches as a single task. With the Rolling Update feature in Auto Scaling, you can update images, run scripts, or install CloudOps Orchestration Service (OOS) packages in batches on ECS or ECI instances that are in the In Service state within a scaling group
Prerequisites
To update the image for instances in a scaling group, prepare the required image.
To run a script on instances, prepare the script.
To install a OOS package, create the package in OOS. For more information, see Manage custom extensions in batches.
Supported task types for a rolling update
Task type | Description |
Image update | Use this task to uniformly update the operating system of ECS or ECI instances that are in the When you update an image, the source of instance configurations is affected as follows:
Note Depending on your scenario, you can choose to update images by using a rolling update or by automatically updating the image in the scaling configuration. For more information, see Differences from automatically updating images in a scaling configuration. |
Script execution | Suitable for running one or more O&M tasks. For example:
|
OOS package installation | Suitable for installing and uninstalling software in batches. |
Differences from automatically updating images in a scaling configuration
Automatically updating images in a scaling configuration: This method is suitable for scenarios with frequent application releases and only applies to scaling groups of the ECS type. You only need to create an update task in the Auto Scaling console. When the task runs, the system automatically creates a custom image from an original ECS instance. This ensures that all new ECS instances created in the scaling group use the new image version. For more information, see Automatically update the image in a scaling configuration.
Rolling update: This method is suitable for updating the configurations of ECS or ECI instances in batches. It only applies to scaling groups in regions where CloudOps Orchestration Service (OOS) is available. This feature lets you progressively upgrade the images of existing In Service ECS or ECI instances to a new version.
Create and run a rolling update task
Before you create and run a rolling update task, note the following:
This feature is available only for scaling groups in regions that support CloudOps Orchestration Service (OOS).
The scaling group cannot have any ongoing scaling activities.
Only one rolling update task can run at a time in a scaling group.
Log on to the Auto Scaling console.
In the navigation pane on the left, click Scaling Groups.
In the top navigation bar, select a region.
Find the scaling group that you want to manage and open its details page in one of the following ways:
In the Scaling Group Name/ID column, click the ID of the scaling group.
In the Actions column, click Details.
At the top of the page, click the tab, and find the list.
Click Create Execution Task.
In the Create Execution Task dialog box, configure the rolling update task and then click Create Task.
The following table describes the parameters.
Parameter
Description
Task Description
A description for the task to aid future tracking.
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. This process restarts the ECS or ECI instance. You must also specify the following information:
Image for Update: The image to use for the update task.
Image for Rollback: The default image to use when a rollback task runs.
NoteThis image is selected by default when you create a rollback task, but you can select a different image.
Script Execution: Runs a script using Cloud Assistant. This process does not stop the ECS or ECI instance. You must also specify the following information:
Script Type. The following three script types are supported:
Linux Shell: For example, the
hostnamecommand to display the hostname or theecho hellocommand.Windows Bat: For example, the
dir c:\command to list directory files.Windows PowerShell: For example, the
Get-Servicescommand to display services.
Script for Execution: The script to use when the update task runs.
Script for Rollback: The default script to use when a rollback task runs.
NoteThis script is automatically filled in when you create a rollback task, but you can edit it.
Install OOS Package: Select the OOS package name and version.
Execution Batch
The number of batches for the task. When the scaling group runs the task, it divides the ECS or ECI instances into batches. Each batch must contain at least one instance. For example, for a scaling group with 10 In Service instances, setting this to 2 divides them into two batches of five.
Suspension Policy
Without Suspension: The task runs to completion without any pauses.
Suspend First Batch: The task pauses after the first batch completes. You must then manually resume it. Subsequent batches do not pause.
Suspend Each Batch: After each batch is completed, the scaling group pauses the task. You must manually continue the task after each pause.
Advanced
Optional. If you set Task Type to Update Image, you can set the maximum number of errors allowed before the rolling update task stops. The default value is 0, which means the entire rolling update task fails if a single error occurs.
Read the description of the impacts of the rolling update task, and then click OK.
The rolling update task starts automatically. After it starts, the scaling group and its instances are affected as follows:
The scaling group suspends scaling processes, such as scale-outs and scale-ins, and ignores all scaling activities during the update. After the update is complete, the suspended processes resume. If scaling processes were manually suspended before the update, they remain suspended to preserve their state.
Instances are moved to the Standby state in batches. After the task is complete, they are returned to the In Service state.
ImportantIf the scaling group is associated with a Server Load Balancer (SLB) instance, the load balancing weight of an instance in the Standby state is set to zero, and it no longer receives service traffic.
Manage the rolling update task based on its execution status.
Task
Description
Procedure
Continue the rolling update task
If the suspension policy is Suspend First Batch or Suspend Each Batch, the task enters the Pending (Batch Suspension) 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 update task
If a rolling update task fails, it enters the Pending (Failure Suspension) state. If you need to complete the task, select an appropriate action.
In the Actions column, click Details.
Find the ECS or ECI instance that failed to be updated, and 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 move the skipped ECS or ECI instance out of the Standby state.
Click Cancel to proceed with the rolling update on the next instance. The status of the current instance remains Failed.
Cancel the rolling update task
If the rolling update task does not meet your business requirements, you can cancel it.
In the Actions column, choose .
ImportantAfter you cancel a task, you must manually resume the suspended scaling processes and move any instances from the current batch that are in progress or have failed out of the Standby state.
Roll back the rolling update task
To revert a rolling update, you can roll back a task that is pending (due to a batch suspension or failure suspension) or the most recently executed task.
For more information, see Roll back a completed rolling update task.
Roll back a completed rolling update task
You can roll back a pending task (due to a batch suspension or failure suspension) or the most recently executed one to restore the original configuration of your ECS or ECI instances. If a rolling update task is in the Waiting state, it is automatically canceled before the rollback task begins. Then, the instances that were already updated are rolled back.
You can only roll back a rolling update task. You cannot roll back a rollback task.
On the task execution list page, find the task that you want to manage and click Roll Back in the Actions column.
In the Create Rollback Task dialog box, configure the rollback task.
The following table describes the parameters.
Parameter
Description
Task Description
A description for the rollback task to aid future tracking.
Task Type
This is the same as the original task type and cannot be edited.
If the task type is Image Update, the rollback image that you specified when creating the rolling update task is automatically selected. You can select a different image.
If the task type is Script Execution, the rollback script that you specified when creating the rolling update task is automatically entered. You can edit this script.
If the task type is Install OOS Package, the OOS package version that you specified when creating the rolling update task is automatically selected. You can select a different version but cannot select a different package.
Execution Batch
The number of batches for the task. When the scaling group runs the task, it divides the ECS or ECI instances into batches. Each batch must contain at least one instance. For example, if a scaling group has 10 instances in the
In Servicestate and the number of execution batches is 2, the instances are divided into 2 batches of 5 instances each.Suspension Policy
Without Suspension: The task runs to completion without any pauses.
Suspend First Batch: After the first batch is completed, the scaling group pauses the task. You must manually continue the task.
Suspend Each Batch: After each batch is completed, the scaling group pauses the task. You must manually continue the task after each pause.
Advanced
Optional. If you set Task Type to Update Image, you can set the maximum number of errors allowed before the rolling update task stops.
Click Create Task.
Read the description of the impacts of the rollback task, and then click OK.
The rollback task starts automatically.
View the details of a rolling update task
You can view the information about a rolling update task and perform actions such as Retry or Skip on individual ECS or ECI instances.
On the task execution list page, find the task that you want to manage and click Details in the Actions column.
View the basic information of the task.
This includes the task status and task type. If the task type is Script Execution, click Script Details to view the content of the script.
View the list of executed instances.
This list shows the instances in various execution states.
If an ECS or ECI instance has not been updated, you can skip or cancel the update for that 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 Result 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 move the skipped ECS or ECI instance out of 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 updates
You can configure independent monitoring and alerts for rolling update tasks based on the needs of different scaling groups. This allows you to view alert details and promptly resolve issues with rolling updates.
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 Searches to query for rolling update failure events for a specified scaling group.
For example, select Critical for the event level 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 the ID of your scaling group, for example,asg-bp180y8dj5eku2j4****.
Click Save as Alert.
In the Create/Modify Event-triggered Alert Rule panel, configure the parameters and click OK.

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