The Update Image in Scaling Configuration feature applies to scenarios where applications are frequently published. You can create an update image 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 with ease.

Prerequisites

Update image tasks are executed through 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 Grant RAM permission for OOS.
Note We recommend that you attach the AliyunECSFullAccess and AliyunESSFullAccess policies to grant permissions to the RAM role.

Background information

When an update image 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 billing.

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 target 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 Manage in the Actions column.
  5. In the left-side navigation pane, click Instance Configuration Source.
  6. In the upper-right corner of the page, click the Update Image Tasks tab.
  7. In the upper-right corner of the tab, click Update Image in Scaling Configuration.
  8. Configure the parameters for the update image task.
    The following table lists 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 from only the system disk.
    Scaling Configuration ID Select scaling configurations for which you want to update images. You can select multiple scaling configurations.
    Executed At Specify the time when the task is executed.
    • Now: immediately
    • Scheduled: at the specified time. You must specify the execution time, in minutes.
    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.
  9. Click OK.
    If you set Executed At to Now, the update image task is immediately executed. If you set Executed At to Scheduled, the update image task will be executed at the specified time. You can view the execution status and source instance in the task list.Update image task

Result

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