You can call this operation to create a cluster template, which can be used to initialize new clusters during data development.

Debugging

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

The type of the cluster.

TemplateName String Yes templateName2

The name of the template.

EmrVer String Yes EMR-3.15.0

The version of the cluster.

RegionId String Yes cn-hangzhou

The ID of the region where your cluster resides.

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

Specifies whether to use a high-security cluster.

HighAvailabilityEnable Boolean No true

Specifies whether to use a high-availability cluster.

InitCustomHiveMetaDb Boolean No true

A value of true indicates that the value of the init.meta.db configuration item in the hive-site.xml file is set to true.

InstanceGeneration String No ecs-3

The generation of ECS instances in the cluster.

IoOptimized Boolean No true

Specifies whether ECS instances are I/O optimized.

IsOpenPublicIp Boolean No true

Specifies whether a public IP address is assigned.

LogPath String No oss://bucket/path

The path of logs that are stored in OSS buckets.

MachineType String No ECS

The type of hosts. The default and only valid value is ECS.

MasterPwd String No pwd

The password for the master node.

NetType String No vpc

The type of the 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 to be created.

SshEnable Boolean No true

Specifies whether to enable the SSH authentication for hosts in the cluster.

UseCustomHiveMetaDb Boolean No false

Specifies whether to use Hive Metastore.

UseLocalMetaDb Boolean No false

Specifies whether to use the local Hive metadatabase.

UserDefinedEmrEcsRole String No AliyunEmrEcsDefaultRole

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

VpcId String No vpc-bp1l4urd87xlh7i4bju4h

The ID of the VPC to which the cluster belongs.

VSwitchId String No vsw-bp10tvjyc77psy0z5h0ni

The ID of the VSwitch.

ZoneId String No cn-hangzhou-b

The ID of the region.

BootstrapAction.N.Arg String No --a

The argument that you pass into the bootstrap action.

BootstrapAction.N.Name String No action_name

The name of the bootstrap action.

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

The path of the bootstrap action script.

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

The key of the custom configuration item.

Config.N.ConfigValue String No 60

The value of the custom configuration item.

Config.N.Encrypt String No 0

A reserved parameter that you do not need to specify.

Config.N.FileName String No yarn-site

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

Config.N.Replace String No 0

A reserved parameter that you do not need to specify.

Config.N.ServiceName String No YARN

The name of the service that is configured by using the custom configuration items. The name must be capitalized.

HostGroup.N.AutoRenew Boolean No false

Specifies whether to enable auto scaling for the cluster.

HostGroup.N.ChargeType String No PostPaid

The biling method of the node group.

HostGroup.N.ClusterId String No 0

A reserved parameter that you do not need to specify.

HostGroup.N.Comment String No header

The description of the host group.

HostGroup.N.CreateType String No ON-DEMAND

The method in which the host group is created.

HostGroup.N.DiskCapacity Integer No 80

The data disk capacity of the host group.

HostGroup.N.DiskCount Integer Optional 1

The number of data disks of the host group.

HostGroup.N.DiskType String No CLOUD_EFFICIENCY

The data disk type of the host group.

HostGroup.N.HostGroupId String No 0

A reserved parameter that you do not need to specify.

HostGroup.N.HostGroupName String No Master instance group

The name of the host group.

HostGroup.N.HostGroupType String No MASTER

The type of the host group.

HostGroup.N.InstanceType String No ecs.g5.xlarge

The instance type of the host group.

HostGroup.N.MultiInstanceTypes String No ecs.sn1.xlarge,ecs.sn2.xlarge

The multiple instance types, separated with commas (,).

HostGroup.N.NodeCount Integer No 2

The number of nodes in the host group.

HostGroup.N.Period Integer No 30

The validity period of the host group.

HostGroup.N.SysDiskCapacity Integer No 80

The system disk capacity of the host group.

HostGroup.N.SysDiskType String No CLOUD_SSD

The system disk type of the host group.

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

The ID of the VSwitch.

AccessKeyId String No LTAI8ljWyu7y****

The AccessKey ID provided to you by Alibaba Cloud, which specifies the ID of the user.

AutoRenew Boolean No false

Specifies whether to automatically renew the subscription.

DepositType String No HALF_MANAGED

The hosting type of the cluster.

Response parameters

Parameter Type Example Description 
ClusterTemplateId String CT-35498C56B3F12002

The ID of the cluster template.

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

The ID of the request.

Examples

Sample requests


http(s)://[Endpoint]/? Action=CreateClusterTemplate
&ClusterType=HADOOP
&TemplateName=templateName2
&BootstrapAction.1.1ame=action_name
&BootstrapAction.1.Path=oss://bucket/path
&Config.1.ConfigKey=fs.trash.interval
&Config.1.ConfigValue=60
&Config.1.FileName=yarn-site
&Config.1.ServiceName=YARN
&HostGroup.1.HostGroupType=MASTER
&HostGroup.1.InstanceType=ecs.g5.xlarge
&HostGroup.1.1odeCount=2
&EmrVer=EMR-3.15.0
&RegionId=cn-hangzhou
&<Common request parameters>

Sample success responses

XML format

<CreateClusterTemplateResponse>
	  <code>200</code>
	  <data>
		    <RequestId>8CA40D40-2092-4A09-9F07-2F9C1399FB11</RequestId>
		    <ClusterTemplateId>CT-35498C56B3F1****</ClusterTemplateId>
	  </data>
	  <requestId>8CA40D40-2092-4A09-9F07-2F9C1399FB11</requestId>
	  <successResponse>true</successResponse>
</CreateClusterTemplateResponse>

JSON format

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

Error codes

HTTP status code Error code Error message Description
403 Forbidden User not authorized to operate on the specified resource. The error message returned because you are not authorized to manage the specified resource. Contact the Alibaba Cloud account user for authorization.
400 ECSInfo.DiskSize.TooSmall disk size per ecs should be >= 80GB. The error message returned because the disk capacity cannot meet the current requirements. Extend the disk capacity.
403 User.OtherUserResource.NotAllow It is not allowed to operate other user's resource The error message returned because you are not allowed to manage resources of other users.
403 User.Account.Abnormal The User Account maybe is out of service! The error message returned because the Alibaba Cloud account is invalid.
403 Master.Pwd.Cannot.Blank Master password can not be blank when enable password! The error message returned because you have not entered the password for the master node. Enter a valid password.
403 LogPath.Cannot.Blank Log path can not be blank when enablbe log! The error message returned because you have not specified the log path. Specify a valid log path.
403 EMR.Version.Not.Exist Specified emr version [%s] does not exist in region [%s]! The error message returned because the specified EMR version does not exist. Specify a valid EMR version.
400 HighAvailability.Master.NodeCount.Not.Match HighAvailability parameter does not match the master's node count The error message returned because the value of the HighAvailability parameter does not match the number of master nodes. A high-availability (HA) cluster requires two master nodes.
400 HighAvailability.is.not.permitted.in.this.emr.version HighAvailability parameter is not permitted in this emr version The error message returned because the EMR version does not support HA clusters. Specify a valid EMR version.
400 InvalidParameter.Period Invalid parameter 'period'. The error message returned because the period parameter for the subscription cluster is invalid.
400 Balance.Not.Enough Account balance is not enough! The error message returned because the Alibaba Cloud account does not have sufficient balance. An account must have a balance of at least CNY 100.
403 VSwitch.NotBelongTo.Zone VSwitchid should belong to the ZoneId! The error message returned because the specified VSwitch does not belong to the zone.
400 InsufficientBalance Your account does not have enough balance The error message returned because the Alibaba Cloud account does not have sufficient balance. An account must have a balance of at least CNY 100.
400 Create.PrePaid.Cluster.Failed Create prepaid cluster order failed:[%s] The error message returned because an error occurred when you created the subscription cluster.
400 ECSInfo.ECSOrder.INVALID invalid parameter format(ecsorderinfo) The error message returned because one or more parameters were invalid when you created ECS instances.
400 Ecs.InstanceType.NotSupported Unsupported ecs instance type [%s] at zone [%s] with IO-optimized [%s] and network type [%s]. The error message returned because the specified instance type is not supported. Select a valid instance type.
400 DiskType.Invalid Unsupported disk type [%s] at zone [%s] with IO-optimized [%s] and network type [%s]. The error message returned because the disk type is not supported. Select a supported disk type.
400 Unsupported.DiskType Ecs instance type [%s] does not support disk type [%] The error message returned because the ECS instance does not support the disk type.
400 Unsupported.ZoneId Zone [%s] is invalid or not supported in emr The error message returned because EMR cannot be deployed in the specified zone. Switch to a valid zone.
400 ECSInfo.DiskSize.TooBig Disk size exceeded max value limit. The error message returned because the disk size exceeds the limit. Reduce the disk size.
400 ECSInfo.DiskCount.ExceedLimit Disk count exceeded max value limit. The error message returned because the number of disk blocks exceeds the limit. Reduce the number of disk blocks.
400 ECSInfo.NodeType.Unsupported the specify node type is unsupport. The error message returned because the specified node type is not supported. Select a supported node type.
400 Must.Specify.MasterNode master node is mandatory. The error message returned because you have not specified the master node.
400 Only.Support.One.Master Only one master node is supported in emr cluster The error message returned because only one master node is supported in the EMR cluster.
400 Have.Orders.Wait.For.Pay Have other orders wait for pay The error message returned because you need to pay for other orders.
400 Unsupported.IoOptimization.Option IO-optimization option [%s] is not supported at zone [%s] and network type [%s]. The error message returned because the network type in the zone does not support I/O optimized instances.
400 Unsupported.EcsInstanceGeneration Unsupported ecs instance generation [%s] at zone [%s] with IO-optimized [%s] and network type [%s]. The error message returned because the network type in the zone does not support I/O optimized instances.
400 AuthRealNameNotPass User real name authenticate failed! The error message returned because the Alibaba Cloud account has not passed real-name verification.
403 EMR.Version.OptionSoftWare.UnSupported only emr version >= 2.0.0 support optionsoftware. The error message returned because you cannot configure any optional software. Only EMR 2.0.0 or later versions support the configuration of optional software.
403 Check.Account.Failed Verify account's registration info failed:[%s]. The error message returned because the information about the Alibaba Cloud account is incomplete and an error occurred when you verified the account. Complete the information about the account.
500 InternalError The request processing has failed due to some unknown error. The error message returned because an internal error has occurred. Submit a ticket.

For a list of error codes, visit the API Error Center.