ECS image association

更新时间:
复制 MD 格式

If your private service uses a custom or Alibaba Cloud Marketplace image and needs to support deployment across multiple regions, you must map images to regions in a template. For custom images, you must also copy the image to each supported region and grant customers permission to use it. Compute Nest simplifies these operations with its image distribution feature. This topic describes how to automate this process by using image association.

Background

Service providers must specify the image ID property for resources such as ECS instances, ECS instance groups, scaling groups, or E-HPC clusters in their templates. Compute Nest parses all image IDs from the template. The service provider then associates the source image with a selected deployment package. When a customer creates a service instance, Compute Nest dynamically replaces the source image ID in the template with the corresponding image ID from the deployment package for the selected region.

Prerequisites

Before you begin, you must create an ECS image deployment package. For more information, see Create a deployment package.

Procedure

  1. When you create a private service, select ROS or Terraform as the deployment method. For example, in the JSON code of a ROS template, set the value of ImageId to a specific image ID string, such as "centos_7".

    • If you select ROS, the template must include the ImageId property.

      1. Supported cloud resource types:

      2. The resource property is ImageId.

      3. The property value must be a literal image ID string. You cannot use a template input parameter or a template function.

    • If you select Terraform, the template must include the image_id argument.

      1. Supported cloud resource types:

      2. The resource argument is image_id.

      3. The argument value must be a literal image ID string. You cannot use a template input parameter or a function.

  2. Select the deployment regions.

  3. In the deployment package association section, under Set Image Association, click Select Deployment Package.

    Important

    After you select a deployment package, you must also select its version.

    • If you select a draft version, the ECS image in that version has not been distributed. The image is available only in the region where it was created.

    • If you select a formal version, the ECS image in that version has been distributed. The image is available in its creation region and in all distributed regions.

    The Select Deployment Package (Image Association) dialog box appears. It shows the Image to be Replaced (for example, springboot) and its Associated Resource (for example, InstanceGroup). From the Select Deployment Package drop-down list, choose a deployment package (for example, EcsImage), select a version, and then click OK.

  4. After you save the service and it passes all tests, check it against the review criteria and submit it for review.

  5. After the service is approved, publish the service. For detailed steps, see Publish a service.

Next steps

After the service is live, when a customer creates a service instance, the system dynamically determines which image to use. The system uses the customer's selected region and the service's deployment package to automatically select the correct, region-specific image for the deployment.