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.
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:
Check whether the name of the new custom image is unique and make sure that the name complies with the naming conventions.
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.
Check whether Cloud Assistant is installed on the temporary ECS instance. If not, install Cloud Assistant on the temporary ECS instance.
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.
Stop the temporary ECS instance.
Create the custom image based on the temporary ECS instance.
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.
Log on to the ECS console.
In the left-side navigation pane, choose .
In the top navigation bar, select the region and resource group to which the resource belongs.
On the Images page, click the Custom Images tab.
Find the custom image that you want to update and choose. In the Actions column, choose > Update Image.
You are redirected to the OOS console. On the Create Task Create or Update Images page, perform the following steps:
Complete the settings in the General Settings section.
New Image Name
The name of the new custom image. The name must be unique.
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
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.
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.
The ID of the virtual private cloud (VPC) in which to deploy the temporary ECS instance.
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.
The ID of the security group to which to assign the temporary ECS instance.
The instance type of the temporary ECS instance. For more information, see Overview of instance families.
System Disk Type
The category of the system disk of the temporary ECS instance.
The public bandwidth of the temporary ECS instance.
(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.
(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.
(Optional) Configure parameters in the Scaling Group Configuration section.
(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.
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.
(Optional) View information about the new image.
In the output section of the execution details page, view the ID of the new image.
On the Custom Images tab of the Images page in the ECS console, find the new image based on the ID.