All Products
Search
Document Center

Elastic Compute Service:Update a custom image

Last Updated:Aug 26, 2024

If you want to update the software and configurations of an Elastic Compute Service (ECS) instance that uses a custom image, you can use CloudOps Orchestration Service (OOS) to update the custom image.

Background information

CloudOps Orchestration Service provides public templates that can be used to update images. To execute a public template to update a custom image, you only need to select the image and specify the parameters that are required in the Cloud Assistant script used in the template. An execution is created for the public template and runs immediately to update the selected image. For more information, see What is OOS?

During the custom image update process, the ACS-ECS-UpdateImage public template of CloudOps Orchestration Service performs the following tasks in sequence to update the selected image to generate a new custom image:

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

  2. Create and run a temporary ECS instance based on parameters that you configure, such as the instance type, source image ID, and security group ID.

  3. Check whether Cloud Assistant is installed on the temporary ECS instance. If not, install Cloud Assistant on the temporary ECS instance.

  4. Run scripts by using Cloud Assistant to update the system environment of the temporary ECS instance.

    Note

    CloudOps Orchestration Service calls API operations that are related to Cloud Assistant to run shell, batch, or PowerShell scripts to update the system environments of ECS instances. For more information, see Overview of Cloud Assistant.

  5. Stop the temporary ECS instance.

  6. Create the custom image based on the temporary ECS instance.

  7. Release the temporary ECS instance.

    Important

    When you update a custom image, a temporary ECS instance is automatically created. You are charged for the temporary ECS instance on a pay-as-you-go basis. Before you update a custom image, make sure that your account balance is sufficient.

Procedure

  1. Log on to the ECS console.

  2. In the left-side navigation pane, choose Instances & Images > Images.

  3. In the top navigation bar, select the region and resource group to which the resource belongs. 地域

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

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

  6. 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 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 Template parameter based on your business requirements.

  7. 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.

  8. (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.