All Products
Search
Document Center

Elastic Compute Service:Update a custom image

Last Updated:Jun 04, 2025

If you want a custom image to include the latest software and configurations, you can use CloudOps Orchestration Service (OOS) to update the image.

Background information

OOS provides the ACS-ECS-UpdateImage public template, which can be executed to update custom images. You only need to specify a source image, an instance type, and a Cloud Assistant script in the template. Then, an execution is automatically created for the template and runs to update the specified image and generate a new image.

Important

The custom image update process involves the automatic creation of a temporary pay-as-you-go ECS instance. Make sure that you have sufficient account balance to pay for temporary resources.

The ACS-ECS-UpdateImage public template performs the following tasks in sequence to update the specified image:

  1. Check the image name. Check whether the name of the new custom image is unique and complies with the naming conventions.

  2. Prepare resources. Use parameters, such as the instance type and security groups, to create a temporary ECS instance from the image that you want to update, and then install Cloud Assistant Agent on the instance.

  3. Update the environment. Call a Cloud Assistant-related API operation to run a custom shell, batch, or PowerShell script to update the application environment of the temporary ECS instance.

  4. Create a custom image. Stop the temporary ECS instance and create a custom image from it.

  5. Release resources. Release the temporary ECS instance to prevent unnecessary costs.

Procedure

  1. Go to ECS console - Images.

  2. In the top navigation bar, select the region and resource group of the resource that you want to manage. 地域

  3. On the Images page, click the Custom Images tab.

  4. Find the custom image that you want to update. In the Actions column, choose 更多操作 > Update Image.

  5. You are redirected to the OOS console. On the Create Task Create or Update Images page, perform the following steps:

    1. Complete the settings in the General Settings section.

      Parameter

      Description

      Example

      New Image Name

      The name of the new custom image. The name must be unique.

      image-20230713133609

      Permissions

      • Use Existing Permissions of Current Account: the default value. You have all the permissions that are granted to your account. Make sure that you have the permissions to call the ECS API operations that are used to create custom images.

      • Specify RAM Role and Use Permissions Granted to This Role: If you specify a Resource Access Management (RAM) role, OOS assumes the role to performs O&M tasks.

      Use Existing Permissions of Current Account

    2. In the Select Image section, select an image.

      By default, the source image is automatically selected. Make sure that the selected image is the custom image that you want to update.

    3. In the Configure Immediate Instance section, configure a temporary ECS instance.

      Configure the parameters, such as VPC, vSwitch, Security Group, and Instance Type, to create a temporary ECS instance.

      Parameter

      Description

      Example

      VPC

      The ID of the virtual private cloud (VPC) in which to deploy the temporary ECS instance.

      vpc-bp1pfyqnwdnvj7b******

      vSwitch

      The ID of the vSwitch to which to connect the temporary ECS instance. The vSwitch and the security group must reside in the same VPC.

      vsw-bp1s5fnvk4gn2tw******

      Security Group

      The ID of the security group to which to assign the temporary ECS instance.

      sg-bp1azkttqpldxg******

      Instance Type

      The instance type of the temporary ECS instance. For more information, see Overview of instance families.

      ecs.g6.xlarge

      System Disk Type

      The category of the system disk of the temporary ECS instance.

      cloud_essd

      Public Bandwidth

      The public bandwidth of the temporary ECS instance.

      0

    4. (Optional) Configure parameters in the Send Remote Commands section.

      You can select a command type and enter command content. The command is run on the intermediate ECS instance.

    5. (Optional) Configure parameters in the Image Distribution section.

      You can optionally copy or share the new image. If you want to copy the image, enter destination regions. If you want to share the image, enter the IDs of Alibaba Cloud accounts with which you want to share the image.

    6. (Optional) Configure parameters in the Scaling Group Configuration section.

    7. (Optional) Configure parameters in the Execution Settings(Optional) section.

      You can configure the Description, Tags for Execution, or Save as Template parameter based on your business requirements.

  6. Click Create. In the Parameter Confirmation message, confirm the parameter settings and click OK.

    If the execution is created and is in the Running state, the selected image is being updated. When Execution Status changes to Success, the image is updated.

    Note

    To view details and real-time progress of the image update process, click Details in the Actions column corresponding to the execution and click the Log tab.

  7. (Optional) View information about the new image.

    1. In the output section of the execution details page, view the ID of the new image.

      image.png

    2. On the Custom Images tab of the Images page in the ECS console, find the new image based on the ID.