edit-icon download-icon

Three methods for specifying images for ECS instances

Last Updated: Apr 12, 2018

ROS uses the following four resource types to create ECS instances:

When creating an ECS instance, you must specify an image for it. ROS allows you to specify the ImageId in three ways:

Directly specify the specific image ID you require

If you know the image ID you want, specify this Image ID. You can view the available image IDs for each region in the ROS console.

Search for images

Use fuzzy match method to specify the image you require

If you do not require a specific image version, but only require it as a CentOS, Win, or Ubuntu series image, you can specify an image in a fuzzy way. ROS then selects the most suitable image ID based on the specified image value.

The matching rules are as follows:

  • If you only specify an image series, such as CentOS, Win, or Ubuntu, ROS uses the latest matching 64-bit image version.

  • If you specify a certain version family, such as CentOS_6, Ubuntu_14, or Win2008r2, ROS selects the latest 64-bit version of the selected version family (CentOS 6, Ubuntu 14, or Win2008r2).

  • If you use an asterisk (*) to replace a certain field in the image ID, such as centos_6_09_64_20G_alibase*.vhd, ROS uses the latest centos_6_09_64_20G_alibase public image version.

Select a currently available image using the image parameter attribute AssociationProperty

In the template Parameters field, if you define the ECS ImageId as a parameter, you can add the attribute AssociationProperty to specify an image. When parsing this parameter, ROS automatically displays a list of image IDs available in the current region for you to choose from.

AssociationProperty is defined as follows.

  1. "ImageId": {
  2. "AssociationProperty":"ALIYUN::ECS::Instance:ImageId",
  3. "Type" : "String",
  4. "Default": "centos_7_04_64_20G_alibase_201701016.vhd",
  5. "Description": "Automatically retrieves available image IDs"
  6. }

If you are required to enter an image ID when creating a stack in the console, all the image IDs for the current region are displayed as options.

In addition to the available images, it also displays the default image ID and whether the value defined in AllowedValues is available. Select the appropriate image ID to create ECS instances.

Thank you! We've received your feedback.