You can delete abnormal image templates or components and then create normal image templates or components based on your business requirements. If you no longer require an image template or component, you can delete the image template or component to save resources.
Prerequisites
The first time you create image components or image templates, the system creates a service-linked role named AliyunServiceRoleForECSImageBuilder for Image Builder. This service-linked role grants Image Builder access to the required Alibaba Cloud resources. If you use a Resource Access Management (RAM) user, grant the RAM user permissions to use Image Builder so that you can manage the service-linked role for Image Builder. If you use an Alibaba Cloud account, the account is automatically granted permissions to use Image Builder. For more information, see Manage the service-linked role for Image Builder.
Delete an image template
Considerations
Before you delete an image template, take note of the following items:
Make sure that no ongoing image building tasks associated with the template exist. If the image template is associated with an ongoing image building task, you cannot delete the image template. Wait until the image building task is completed before you delete the image template.
Deletion of the image template does not affect the status of the images that are already built based on the template.
Procedure
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 Image Templates tab of the Image Builder page, find the image template that you want to delete and click Delete in the Actions column.
Confirm the information about the image template and click OK.
Delete an image component
Limits
You can delete only custom image components that you created. You cannot delete system image components.
If an image component is referenced by an image template, you must delete the image template before you can delete the image component.
Procedure
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 Image Builder page, click the Image Components tab.
Click Custom Components, find the custom image component that you want to delete, and then click Delete in the Actions column.
Confirm the information about the image component and click OK.
References
You can call the following API operations to delete an image template and an image component:
DeleteImageComponent: deletes an image component.
DeleteImagePipeline: deletes an image template.