Operation Orchestration Service (OOS) provides a public template named ACS-ECS-CreateAndCopyImage to help you perform a set of operations. For example, you can use this template to send remote commands and create and copy custom images.

Background information

You can view information such as the default process of executing this public template in the OOS console. For more information, see View the information of a public template.

Procedure

  1. Go to the page for configuring a custom image creation task in the OOS console.
    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 a region.
    4. In the Create Image section, click Use OOS to Create.
  2. On the Create or Update Images page, configure parameters.
    1. Keep Create Image from Existing Instance selected.
    2. Complete the settings in the General Settings section.
      Enter a name and description for the custom image and set the Permissions parameter.
    3. Complete settings in the Image Distribution section.
      Parameter Description
      Copy to Other Region After a custom image is created in the current region, the image is automatically copied to one or more regions.
      Shared Account ID After a custom image is created, it is automatically shared to one or more Alibaba Cloud accounts.
    4. Select an instance.
      OOS will create a custom image from the selected instance. When OOS creates a custom image, OOS generates snapshots for the disks attached to the instance. You are charged for the snapshots contained in the created custom image.
    5. Enter a remote command.
      The remote command that you entered is sent to the selected instance before OOS creates the custom image. You can enter a remote command to perform a specific operation on the instance, such as installing software or recording the execution time of O&M tasks.
    6. Configure advanced options.
      Parameter Description
      Scaling Group Configuration ID After a custom image is created, it is used to automatically update image parameters in the scaling configuration of the specified scaling group.
      Tag Add tags to the task for easy search.
      Save Template Save the settings of this task as a custom template for future reuse.
    7. Click Execute Now.

Result

When the task state changes to Running, you can click the execution ID to view the execution details such as output parameters and execution logs. When the task state changes to Success, the custom image is created and operations such as copying the image to other regions are performed as configured in the task.