All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::ECS::CustomImage

Last Updated:Jun 10, 2026

Creates a custom image.

Syntax

{
  "Type": "ALIYUN::ECS::CustomImage",
  "Properties": {
    "Description": String,
    "InstanceId": String,
    "ImageName": String,
    "SnapshotId": String,
    "Tag": List,
    "ResourceGroupId": String,
    "Platform": String,
    "DiskDeviceMapping": List,
    "Architecture": String,
    "ImageFamily": String,
    "Features": Map,
    "SourceRegionId": String,
    "DetectionStrategy": String,
    "ImageVersion": String,
    "BootMode": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

Description

String

No

No

The image description.

The description must be 2 to 256 characters in length. It cannot start with http:// or https://.

InstanceId

String

No

No

The instance ID.

Uses an ECS instance to create the image. For more information, see Create a custom image from an instance.

ImageName

String

No

No

The image name.

The name must be 2 to 128 characters in length, and can contain letters, digits, underscores (_), and hyphens (-). It must start with a letter and cannot start with http:// or https://.

SnapshotId

String

No

No

The snapshot ID.

Uses a snapshot to create the image. For more information, see Create a custom image from a snapshot.

Tag

List

No

No

The tags.

For more information, see Tag properties.

ResourceGroupId

String

No

Yes

The resource group ID.

None.

Platform

String

No

No

The OS distribution for the system disk. Required when creating a system disk from a data disk snapshot.

Valid values:

  • CentOS

  • Ubuntu

  • SUSE

  • OpenSUSE

  • RedHat

  • Debian

  • CoreOS

  • Aliyun

  • Windows Server 2012

  • Windows 7

  • Customized Linux

  • Others Linux (default)

Features

Map

No

No

The image feature attributes.

Features property.

DiskDeviceMapping

List

No

No

The disk-to-snapshot mappings.

For more information, see DiskDeviceMapping properties.

Architecture

String

No

No

The system architecture. Required when creating a system disk from a data disk snapshot.

Valid values:

  • i386

  • x86_64 (default)

ImageFamily

String

No

No

The image family name.

The name must be 2 to 128 characters in length, and can contain letters, digits, colons(:), underscores (_), and hyphens (-). It must start with a letter and cannot start with aliyun or acs:. It cannot contain http:// or https://.

SourceRegionId

String

No

No

The region ID of the source instance or snapshot.

By default, the ID of the current region is used.

DetectionStrategy

String

No

No

The image check mode.

If not specified, no check is performed. Only standard check mode is supported.

Note

Most Linux and Windows distributions are supported. For more information about the check items and the OS limits for image checks, see Scan and fix custom images and Operating system limits for image check.

ImageVersion

String

No

No

The image version.

If InstanceId references an instance whose image is from Alibaba Cloud Marketplace or derived from one, leave this empty or set it to the instance image version.

BootMode

String

No

No

The image boot mode.

Valid values:

  • BIOS: Basic Input/Output System (BIOS) boot mode

  • UEFI: Unified Extensible Firmware Interface (UEFI) boot mode

Note

Ensure the specified boot mode is supported by the image. An unsupported boot mode prevents instances from starting.

Features syntax

"Features": 
  {
    "ImdsSupport": String
  }

Features property

Property

Type

Required

Editable

Description

Constraint

ImdsSupport

String

No

No

The image metadata access mode.

Valid values:

  • v1: Security hardening mode unavailable for instances created from this image.

  • v2: Security hardening mode available for instances created from this image.

Tag syntax

"Tag": [
  {
    "Key": String,
    "Value": String
  }
]

Tag properties

Property

Type

Required

Editable

Description

Constraint

Key

String

No

No

The tag key.

The tag key must be 1 to 128 characters in length, and cannot contain http:// or https://. It cannot start with aliyun or acs:.

Value

String

No

No

The tag value.

The tag value can be up to 128 characters in length, and cannot contain http:// or https://. It cannot start with aliyun or acs:.

DiskDeviceMapping syntax

"DiskDeviceMapping": [
  {
    "Device": String,
    "SnapshotId": String,
    "Size": Integer,
    "DiskType": String
  }
]

DiskDeviceMapping properties

Property

Type

Required

Editable

Description

Constraint

Device

String

No

No

The disk device name.

Valid values:

  • For basic disks, the valid values range from /dev/xvda to /dev/xvdz in alphabetical order.

  • For disk categories other than basic disks, the valid values range from /dev/vda to /dev/vdz in alphabetical order.

SnapshotId

String

No

No

The snapshot ID.

None.

Size

Integer

No

No

The disk size.

  • If you leave SnapshotId empty, the following valid values are supported for Size:

    • Valid values for basic disks: 5 to 2000.

      Default value: 5.

    • Valid values for disk categories other than basic disks: 20 to 32768.

      Default value: 20.

  • If SnapshotId is specified, Size must be greater than or equal to the snapshot size. Default: the snapshot size.

Unit: GiB.

DiskType

String

No

No

The disk type.

Creates a system disk from a data disk snapshot. If not specified, uses the snapshot disk type.

Valid values:

  • system: system disk

  • data: data disk

Return values

Fn::GetAtt

ImageId: the ID of the custom image.

SourceRegionId: the ID of the region to which the instance or snapshot belongs.

Examples

ROSTemplateFormatVersion: '2015-09-01'
Description:
  en: Create ECS Custom Image
Parameters:
  InstanceId:
    Type: String
    AssociationProperty: ALIYUN::ECS::Instance::InstanceId
Resources:
  CustomImage:
    Type: ALIYUN::ECS::CustomImage
    Properties:
      InstanceId:
        Ref: InstanceId
      ImageName: myImageName
Outputs:
  ImageId:
    Value:
      Fn::GetAtt:
        - CustomImage
        - ImageId
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Description": {
    "en": "Create ECS Custom Image"
  },
  "Parameters": {
    "InstanceId": {
      "Type": "String",
      "AssociationProperty": "ALIYUN::ECS::Instance::InstanceId"
    }
  },
  "Resources": {
    "CustomImage": {
      "Type": "ALIYUN::ECS::CustomImage",
      "Properties": {
        "InstanceId": {
          "Ref": "InstanceId"
        },
        "ImageName": "myImageName"
      }
    }
  },
  "Outputs": {
    "ImageId": {
      "Value": {
        "Fn::GetAtt": [
          "CustomImage",
          "ImageId"
        ]
      }
    }
  }
}          

More examples: custom-image.yml. These examples use ALIYUN::ECS::CustomImage and ALIYUN::ECS::CopyImage.