The image update feature applies to scenarios where applications are frequently published. You can create an image update task in the Auto Scaling console. When the task is executed, Auto Scaling automatically creates a custom image from the source instance and replaces images in the scaling configurations of the scaling group with the created custom image.

Prerequisites

Image update tasks are executed by using Operation Orchestration Service (OOS). You must authorize OOS to perform operations on related resources. Make sure that at least one of the following requirements is met:
  • The current account has permissions to perform operations on resources of ECS and Auto Scaling.
  • A RAM role is created for OOS and is granted permissions to perform operations on resources of ECS and Auto Scaling. For more information, see Configure RAM permissions for OOS.
Note We recommend that you attach the AliyunECSFullAccess and AliyunESSFullAccess policies to grant permissions to the RAM role.

Background information

When an image update task is executed, Auto Scaling automatically creates a custom image from the source instance. You are charged based on the size of snapshots created from the image. For more information, see Snapshot.

Procedure

  1. Log on to the Auto Scaling console.
  2. In the left-side navigation pane, click Scaling Groups.
  3. In the top navigation bar, select a region.
  4. Find the scaling group and use one of the following methods to open the details page of the scaling group:
    • Click the ID of the scaling group in the Scaling Group Name/ID column.
    • Click Details in the Actions column.
  5. In the upper part of the page, click the Configuration Source tab.
  6. Click the Update Image Tasks tab.
  7. Click Update Image in Scaling Configuration.
  8. Configure the parameters for the image update task.
    The following table describes the parameters.
    Parameter Description
    Instance Select an ECS instance. Auto Scaling creates a custom image from the instance. The custom image is used to replace the images in scaling configurations. The custom image is created only from the system disk of the instance.
    Scaling Configuration ID Select one or more scaling configurations for which you want to update images.
    Executed At Specify the time when to execute the task.
    • Now: The task is executed immediately after it is created.
    • Scheduled: The task is to be executed at the specified time. You must specify the execution time, in minutes.
    • Periodic: Specify the recurrence period, expiration time, and start time of the image update task. Assume that you configure the following settings for an image update task on August 17, 2020:
      • Recurrence: Monthly
      • Execute from Day 21 to Day 25 of Each Month
      • Start Time: 02:00
      • Expired At: 00:00 on August 26, 2020

      The image update task is executed once at 02:00 every day from August 21, 2020 to August 25, 2020.

    Permission Source Select the permission source for OOS to perform operations on related resources.
    • Use Existing Permissions of Current Account: The permissions of the current account are used.
    • Specify RAM Role and Use Permissions Granted to This Role: You must select a RAM role to be assumed by OOS and use the permissions granted to this role.
    Note If you set Executed At to Scheduled or Period, you can only specify a RAM role to grant permissions to OOS.
  9. Click OK.
    The image update task is automatically executed at the specified time. You can view the execution status and source instance of this task in the task list.Image update task

Result

After the task is executed, you can view the execution result on the Scaling Configurations tab. If the image names in the scaling configurations are in the UpdateImage_from_<source ECS instance ID>_on_<image update task ID> format, the images in the scaling configurations are updated.Image update result