Create a cluster instance

Last Updated: Jul 18, 2017


Creates a cluster instance with the specified quantity of nodes.

Request information

Request line (RequestLine)

  1. POST /clusters HTTP/1.1

Request line parameter (URI Param)


Special request header (RequestHead)

None. Refer to Public request headers.

Request body (RequestBody)

  1. ClusterCreation {
  2. "name": "string",
  3. "size": "number",
  4. "network_mode": "string",
  5. "subnet_cidr": "string",
  6. "instance_type": "string",
  7. "vpc_id": "string",
  8. "vswitch_id": "string",
  9. "password": "string",
  10. "data_disk_size": "number",
  11. "data_disk_category": "number"
  12. "ecs_image_id": "string",
  13. "io_optimized": "string",
  14. }

Explanation on the request body

Name Type Required? Description
name String Yes Name of a cluster, which can contain uppercase and lowercase letters, Chinese characters, numbers, and dashes.
size int Yes Quantity of ECS nodes in the cluster.
instance_type string Yes Code indicating the ECS instance type. For more details, refer to Instance type table.
network_mode String Yes Network mode of the cluster (options: classic, indicating a classic network, and vpc, indicating a VPC network.
subnet_cidr String Yes Network address block that can be used by the cluster, for example, This field needs to be set only when the network mode is VPC.
vpc_id string Yes ID of a VPC network. This field needs to be set only when the network mode is VPC. For more information on VPC network, refer to VPC network overview.
vswitch_id string Yes Switch ID of the VPC network. This field needs to be set only when the network mode is VPC.
password string Yes Logon password of the root account.
data_disk_category string Yes Disk category used by ECS. For more details, refer to Disk category table.
data_disk_size number Yes Node-shared disk size.
ecs_image_id string No ID of the system image used by ECS.
io_optimized string No Depends the ECS instance type. Its value can be none or optimized.

ecs_image_id list

Region System ecs_image_id
Beijing 64-bit Ubuntu 14.04 m-25i16eaw8
Beijing 64-bit CentOS 7.0 m-25ksqahve
Hangzhou 64-bit Ubuntu 14.04 m-2313ixw4g
Hangzhou 64-bit CentOS 7.0 m-23i32bks6

If you need to define the ECS image ID of the cluster, make sure the ECS image meets the following requirements:

  • OS: Ubuntu or CentOS.
  • Linux Kernel version ≥ 3.18, used to support overlayfs and overlay network.
  • The /etc/docker/key.json file is deleted from the image.

Response information

Response line (ResponseLine)

  1. HTTP/1.1 202 Accepted

Special response header (ResponseHead)

None. Refer to Public return headers.

Response body (ResponseBody)

  1. {
  2. "cluster_id":"string",
  3. "request_id":"string"
  4. }


Request example

  1. POST /clusters HTTP/1.1
  2. <Public request headers>
  3. {
  4. "password": "Just$test",
  5. "instance_type": "ecs.s2.small",
  6. "name": "my-cluster-001",
  7. "size": 2,
  8. "network_mode": "classic",
  9. "data_disk_category": "cloud",
  10. "data_disk_size": 20,
  11. "charge_type": "PayByTraffic",
  12. "ecs_image_id":"m-xx251ll"
  13. }

Return example

  1. HTTP/1.1 202 Accepted
  2. <Public response header>
  3. {
  4. "cluster_id":"c01994faf5f364cc79b6ffb604061fa4a",
  5. "request_id":"b44afc3c-46a4-4087-a215-c333a1218316"
  6. }
Thank you! We've received your feedback.