When you deploy services in multiple regions by using Elastic Compute Service (ECS) images, you need to perform complicated operations such as manually replicating and mapping ECS images and managing permissions. To simplify the deployment process, Compute Nest provides ECS image deployment packages. This topic describes how ECS image deployment packages work. This topic also describes how to create and use an ECS image deployment package.
Background information
Purpose
During service deployment, ECS images are often used for multi-region deployment. However, ECS images are region-specific. To implement multi-region deployment, you need to replicate ECS images to each region and specify an ECS image for the corresponding region in a template. The operations include manually replicating and mapping ECS images and managing permissions. Each time a new image version is released, you need to repeat the operations. This complicates the multi-region deployment process.
Benefits
As a service provider, you need to only create the source ECS image, configure the ECS image deployment package in the Compute Nest console, and then associate the ECS image deployment package with the source ECS image. The subsequent operations such as image replication, image mapping, and permission management are performed by Compute Nest.
Image replication: Compute Nest replicates the source ECS image that you created to the general account of Compute Nest that is used to replicate the image to multiple regions.
Image mapping: Compute Nest checks whether the
ImageIdparameter is specified in a template. If the parameter is specified, the image ID can be associated with an ECS image deployment package in the service details. When a customer deploys the service, Compute Nest checks the region in which the service is deployed and automatically uses the image ID corresponding to the region instead of the image ID specified in the template. This way, the image ID and region are dynamically mapped.Permission management: The permissions of an ECS image deployment package are related to the associated service. If no service is associated with an ECS image deployment package, the ECS image deployment package is private and only the corresponding service provider can use the ECS image deployment package. If at least one public service is associated with an ECS image deployment package, the ECS image deployment package is public. If all services associated with an ECS image deployment package are private, the ECS image deployment package is private. If a whitelist is configured for an associated service, the whitelist also applies to the ECS image deployment package.
Limits
You can modify the cloud resources of an ECS image deployment package in a template.
ROS
If you use Resource Orchestration Service (ROS) for service deployment, you must specify the ImageId parameter in the Resource section of the ROS template.
You can specify an image ID of the following cloud resources:
ECS instance (ALIYUN::ECS::Instance)
ECS instance group (ALIYUN::ECS::InstanceGroup)
Scaling group (ALIYUN::ESS::ScalingGroup)
Elastic High Performance Computing (E-HPC) cluster (ALIYUN::EHPC::Cluster)
You can specify an image ID by using the
ImageIdparameter.The value of the ImageId parameter must be a string. You cannot obtain the value from an input parameter or a built-in function in the template.
Terraform
If you use Terraform for service deployment, you must specify the image_id parameter in the template.
You can specify an image ID of the following cloud resources:
ECS instance (alicloud_instance)
Scaling group (ALIYUN::ESS::ScalingGroup)
You can specify an image ID by using the
image_idparameter.The value of the image_id parameter must be a string. You cannot obtain the value from an input parameter or a built-in function in the template.
Create and use an ECS image deployment package
Prerequisites
An ECS image is created. Compute Nest supports custom images and Alibaba Cloud Marketplace images. You can select an image type based on your business requirements.
Custom image: the custom ECS images within your Alibaba Cloud account.
If you do not have a custom image, you can create one. For more information, see Create a custom image from an instance.
Alibaba Cloud Marketplace image: the images on sale in Alibaba Cloud Marketplace.
You can search for images in Alibaba Cloud Marketplace based on your business requirements.
Create an ECS image deployment package
Configure the basic information about the deployment package.
Log on to the Compute Nest console. In the left-side navigation pane, click Service Deployment Package. In the Deployment Package section of the Service Deployment Package page, click Create Deployment Package.
In the Deployment Package Information section, configure the parameters described in the following table.
Parameter
Description
Deployment Package Name
The name of the deployment package. The name must be 3 to 128 characters in length, and can contain letters, digits, and underscores (_). The name cannot be changed after the deployment package is created.
Version Name
The name of the deployment package version. The name must be 3 to 50 characters in length, and can contain letters, digits, and underscores (_).
Description
The description of the deployment package. The description must be 10 to 500 characters in length.
Resource Group
The name of the resource group to which the deployment package belongs.
Resource groups are used to group your resources by usage, permission, and region. You can use resource groups to organize your resources in a hierarchical manner and group resources based on users and projects. For more information, see Manage resource groups.
Tag Settings
The tags that you want to add to the deployment package. Select or enter complete tag keys and tag values. You can add up to 20 tags to a deployment package. If no tag key or tag value are available, you can create a custom tag. For more information, see Add a custom tag.
Configure the ECS image deployment package.

In the Deployment Package Content section, select ECS Image for the Deployment Package Type parameter. Configure the Image Type and Select Product parameters based on the ECS image that you prepared.
In the Distribution Settings section, select the regions to which you want to distribute the deployment package. In this example, All Regions is selected.
ImportantYou must select at least one region to distribute the deployment package.
Click Publish Deployment Package.
After a deployment package is published, you cannot modify the content of the published version. You can only create new versions or new deployment packages.
NoteIf you need to test the deployment package, click Save Deployment Package. After you complete the test, click Publish Deployment Package.
If the deployment package is not published, you cannot test the deployment package in the selected distribution regions. In this case, you can test the deployment package only in the region in which the ECS image resides.
View the deployment package.
Return to the Service Deployment Package page. Find the deployment package that you created and click its name to go to the Deployment Package Details page to view the deployment progress.
After the deployment package enters the Available state, find the version that you want to view on the Deployment Package Version tab and click View in the Actions column to view the distribution results of the deployment package.
NoteThe duration to distribute an image may vary from several minutes to several hours based on the region and image size.
Use an ECS image deployment package
In this example, a private service is created to describe how to use an ECS image deployment package.
Log on to the Compute Nest console.
In the left-side navigation pane, click My Services. On the Created Services tab of the My Services page, click Create Service.
On the Create Service page, set Select Service Creation Method to Custom Launch, Select Service Type to Private Service, and then click Next: Configure Settings.

On the Create Service page, specify basic information about the service as prompted. In the Template section, select a template or enter a template name. In this example, Scenario-based Template is selected.
If the template content contains the
ImageIdparameter, configure the Associate ECS Image parameter in the Deployment Package Association section.
Click Select Deployment Package. In the dialog box that appears, select the deployment package and version that you want to use and click OK. The source image specified in the template is replaced with the ECS image deployment package.
ImportantIf a deployment package of the draft version has not been distributed, the associated ECS image that is not distributed can be used only in the region in which the image is created.
If a deployment package of a formal version has been distributed, the associated ECS image that is already distributed can be used in the region in which the image is created and the regions to which the image is distributed.

Save and test the service. After the service passes the test, check whether the service meets the review criteria of Compute Nest and submit the service for review. For more information, see Review criteria.
After the service is approved, publish the service. For more information, see Publish a service.
When a customer creates a service instance in a region, the associated image that has been distributed to the region is used.
Image ID before replacement

Image ID after replacement

References
For more information about how to create a service in Compute Nest, see Create a service.
If you no longer need a deployment package or deployment package version, you can delete it. For more information, see Delete a deployment package.
If you need to modify a deployment package such as the distribution regions and content, you can create a new version. For more information, see Create a version.
For more information about how to configure the update settings of a deployment package, see Configure service update settings.