Call the CreateClusterTemplate interface to create a E-MapReduce cluster template.


OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateClusterTemplate

The operation that you want to perform. Set the value to CreateClusterTemplate.

ClusterType String Yes HADOOP

Cluster type, with the following values:

TemplateName String Yes templateName2

The name of the template.

ZoneId String Yes cn-hangzhou-b

The region ID.

BootstrapAction.N.Name String Yes action_name

The name of bootstrap action N.

BootstrapAction.N.Path String Yes oss://bucket/path

The path where the script of bootstrap action N is stored.

Config.N.ConfigKey String Yes fs.trash.interval

The key of custom configuration item N.

Config.N.ConfigValue String Yes 60

The value of custom configuration item N.

Config.N.FileName String Yes yarn-site

The name of the file that contains custom configuration item N.

Config.N.ServiceName String Yes YARN

The name of the service for which custom configuration item N is configured. Specify the entire name in uppercase.

HostGroup.N.DiskCapacity Integer Yes 80

The data disk capacity of host group N.

HostGroup.N.DiskCount Integer Yes 1

The number of data disks in host group N.

HostGroup.N.DiskType String Yes CLOUD_EFFICIENCY

The system disk type, with the following values:

  • CLOUD: common cloud disk
  • CLOUD_EFFICIENCY: Efficient Cloud Disk
  • CLOUD_SSD:SSD cloud disk
HostGroup.N.HostGroupName String Yes master_group

The name of the host group you want to query.

HostGroup.N.HostGroupType String Yes MASTER

The type of machine group to be queried, with the following values:

  • MASTER: primary instance group
  • CORE: core instance group
  • TASK: compute instance group
HostGroup.N.InstanceType String Yes ecs.g5.xlarge

machine group of instance.

HostGroup.N.NodeCount Integer Yes 2

The number of nodes in host group N.

HostGroup.N.SysDiskCapacity Integer Yes 80

The system disk capacity of host group N.

HostGroup.N.SysDiskType String Yes CLOUD_SSD

The system disk type, with the following values:

  • CLOUD: common cloud disk
  • CLOUD_EFFICIENCY: Efficient Cloud Disk
  • CLOUD_SSD:SSD cloud disk
EmrVer String Yes EMR-3.15.0

The version of the cluster.

RegionId String Yes cn-hangzhou

The region ID.

KeyPairName String No test_pair

The key pair.

MetaStoreType String No LOCAL

The metadata type, with the following values:

  • LOCAL: cluster internal metadata
  • UNIED: unified metadata
  • USER_RDS: user-built RDS
MetaStoreConf String No None.

A JSON field that contains dbUrl, dbUserName, and dbPassword representing the connection string, username, and password of RDS. Bring the library name in dbUrl.

BootstrapAction.N.ExecutionTarget String No core_group

The script execution range, with the following values:

  • For the entire cluster, just pass in a null value.
  • Set the name of the machine group
BootstrapAction.N.ExecutionMoment String No BEFORE_INSTALL

When the script is executed, the value is as follows:

  • BEFORE_INSTALL: executed before service installation
  • AFTER_STARTED: Executed after service startup
BootstrapAction.N.ExecutionFailStrategy String No FAILED_BLOCKED

The script fails to execute the policy. The value is as follows:

  • FAILED_BLOCKED: Workflow to manual processing after failure
  • FAILED_CONTINUE: Continue execution after failure
Tag.N.Key String No DevDept

The tag key used when you find an EMR cluster precisely. Value range of tag keys: 1 to 128. Valid values of N: 1 to 20. Tag.N is used to accurately find the EMR cluster to which the specified tag is bound, and consists of a key-value pair.

  • When only Tag.N.Key is specified, all clusters associated with the tag key are returned.
  • If you specify only Tag.N.Value, the MissingParameter.TagKey error code is returned.
  • at the same time specify multiple tag key-value pairs, only while meeting all tag key-value pairs of EMR kubernetes cluster is to find.
Tag.N.Value String No DevNianmin

refine search EMR when the cluster is created using the value of the nth tag of the. Value range of tag values: 1 to 128. Valid values of N: 1 to 20.

ResourceGroupId String No rg-bp67acfmxazb4p****

The ID of the resource group to which the snapshot belongs.

Configurations String No [{"classification": "core-site","properties": {"fs.trash.interval": "61"}},{"classification": "hadoop-log4j","properties": {"hadoop.log.file": "hadoop1.log","hadoop.root.logger": "INFO","a.b.c": "ABC"}}]

The custom configuration items for software. You can use a JSON file to modify the software configurations before you start a cluster.

EasEnable Boolean No true

Whether it is a high-security cluster mode:

  • true: High-security clusters
  • true: non-high-security clusters
HighAvailabilityEnable Boolean No true

Whether to enable high availability:

  • true: enables high availability
  • false: High availability is not enabled
InitCustomHiveMetaDb Boolean No false

A reserved field.

InstanceGeneration String No ecs-3

The generation of ECS instances.

IoOptimized Boolean No true

Whether I/O is optimized:

  • true: optimized
  • false: not optimized
IsOpenPublicIp Boolean No true

Whether public network IP is open:

  • true: Open public IP
  • false: does not open public IP
LogPath String No oss://bucket/path

The path of logs that are stored in OSS buckets.

MachineType String No ECS

The instance type.

MasterPwd String No pwd

The password for the master node.

NetType String No VPC

The type of network.

OptionSoftWareList.N RepeatList No ["HBASE","FLINK"]

The list of optional services.

Period Integer No 36

The validity period of the subscription cluster.

SecurityGroupId String No sg-bp1id7ajv83kmqwq****

The ID of the security group.

SecurityGroupName String No sg-name

The name of the security group.

SshEnable Boolean No true

Whether to enable the SSH service of the cluster machine:

  • true: Enable the SSH service
  • false: does not enable the SSH service
UseCustomHiveMetaDb Boolean No false

Whether to use Hive unified metadata:

  • true: uses Hive unified metadata
  • false: Hive unified metadata is not used
UseLocalMetaDb Boolean No false

Whether to use the local Hive metadatabase:

  • true
  • false
UserDefinedEmrEcsRole String No AliyunEmrEcsDefaultRole

The RAM role that is assigned to EMR to access ECS resources.

VpcId String No vpc-bp1l4urd87xlh7i4b****

The ID of the VPC.

VSwitchId String No vsw-bp10tvjyc77psy0z5****

The ID of the vSwitch.

BootstrapAction.N.Arg String No --a

The argument that you pass into bootstrap action N.

Config.N.Encrypt String No 0

A reserved parameter. You do not need to specify this parameter.

Config.N.Replace String No 0

A reserved parameter. You do not need to specify this parameter.

HostGroup.N.AutoRenew Boolean No false

if automatically:

  • true: automatic expansion
  • false: does not automatically expand
HostGroup.N.ChargeType String No PostPaid

The billing method. Valid values:

  • PostPaid: pay-as-you-go clusters
  • PrePaid: subscription cluster
HostGroup.N.ClusterId String No 0

A reserved parameter. You do not need to specify this parameter.

HostGroup.N.Comment String No header

The comment for host group N.

HostGroup.N.CreateType String No ON-DEMAND

The machine group creation type has the following values:

  • ON-DEMAND: create on-demand
  • MANUAL: manually created
HostGroup.N.HostGroupId String No 0

A reserved parameter. You do not need to specify this parameter.

HostGroup.N.MultiInstanceTypes String No ["ecs.c5.xlarge","ecs.sn1ne.xlarge","ecs.hfc5.xlarge"]

A JSON field that consists of the supported instance types.

HostGroup.N.Period Integer No 30

The validity period of host group N.

HostGroup.N.VSwitchId String No vsw-bp10tvjyc77psy0z5****

The ID of the vSwitch.

AutoRenew Boolean No false

Specifies whether to automatically renew the subscription.

DepositType String No HALF_MANAGED

The hosting type of the cluster. The value is as follows:

  • HALF_MANAGED: semi-managed
  • MANAGED: fully managed

Response parameters

Parameter Type Example Description
ClusterTemplateId String CT-35498C56B3F1****

The ID of the cluster template.

RequestId String 8CA40D40-2092-4A09-9F07-2F9C1399FB11

The ID of the request.


Sample requests

&<common request parameters>

Sample responses

XML format


JSON Syntax

    "code": "200",
    "data": {
        "RequestId": "8CA40D40-2092-4A09-9F07-2F9C1399FB11",
        "ClusterTemplateId": "CT-35498C56B3F1****"
    "requestId": "8CA40D40-2092-4A09-9F07-2F9C1399FB11",
    "successResponse": true