Creates a host in a dedicated cluster.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
Action | String | Yes | CreateDedicatedHost | The operation that you want to perform. Set the value to CreateDedicatedHost. |
RegionId | String | Yes | cn-hangzhou | The ID of the region where the cluster is deployed. To obtain the ID of the region, see Region IDs. |
DedicatedHostGroupId | String | Yes | dhg-6w7q18iwt5jo**** | The ID of the cluster that contains the host. To view the ID of the cluster, log on to the ApsaraDB MyBase console and view the ID of the cluster on the Dedicated Clusters page. Note The database engine of the host must be the same as the database engine of the cluster. |
ZoneId | String | Yes | cn-hangzhou-i | The ID of the zone where you want to deploy the host. To obtain the ID of the zone, see Dedicated Clusters. |
VSwitchId | String | Yes | vsw-bp133c8ifzxd3iv6q**** | The ID of the vSwitch to which you want to connect the host. You can view the ID of the vSwitch in the Virtual Private Cloud (VPC) console. |
HostClass | String | Yes | rds.g6.4xlarge | The specification of the host. For information about the host specifications supported by different types of databases, see Instance types of hosts. |
PayType | String | Yes | prepaid | The billing method. Set the value to prepaid. prepaid indicates the subscription billing method. |
Period | String | No | Month | The unit of the subscription duration. Valid values:
|
UsedTime | String | No | 1 | The subscription duration of the host. Valid values:
|
ClientToken | String | Yes | ETnLKlblzczshOTUbOCzSBZH8**** | The client token that is used to ensure the idempotence of the request. You can use the client to generate the value. You must make sure that the token is unique among different requests. The token can contain only ASCII characters and can be up to 64 characters in length. |
AutoRenew | String | No | false | Specifies whether to enable the auto-renewal feature. Valid values:
Note If you do not specify this parameter, the default value false is used. |
ImageCategory | String | No | AliLinux | The image that you want to use to create the host. Valid values:
Note When you create an SQL Server host, you must specify an image of the edition that corresponds to the edition of the host. |
OsPassword | String | No | Test123456 | The password that is used to log on to the host. You can create a password only if the host is contained in a private cluster. The password must meet the following requirements:
|
HostStorageType | String | No | cloud_essd0 | The type of disk that you want to use for the host. This parameter takes effect only for Tair hosts. Only the following two disk types are supported:
|
HostStorage | String | No | 512 | The disk capacity of the host. This parameter takes effect only for Tair hosts. Unit: GB. Valid values:
|
Response parameters
Parameter | Type | Example | Description |
OrderId | Long | 102565235 | The ID of the order. |
RequestId | String | C860658E-68A6-46C1-AF6E-3AE7C4D32375 | The ID of the request. |
DedicateHostList | Array of DedicateHostList | The information about the host that is created. | |
DedicateHostList | |||
DedicatedHostId | String | ch-bp108dki3wdl6**** | The ID of the host that is created. |
Examples
Sample requests
http(s)://cddc.aliyuncs.com/?Action=CreateDedicatedHost
&RegionId=cn-hangzhou
&DedicatedHostGroupId=dhg-6w7q18iwt5jo****
&ZoneId=cn-hangzhou-i
&VSwitchId=vsw-bp133c8ifzxd3iv6q****
&HostClass=rds.g6.4xlarge
&PayType=prepaid
&Period=Month
&UsedTime=1
&ClientToken=ETnLKlblzczshOTUbOCzSBZH8****
&AutoRenew=false
&ImageCategory=AliLinux
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<CreateDedicatedHostResponse>
<OrderId>102565235</OrderId>
<RequestId>C860658E-68A6-46C1-AF6E-3AE7C4D32375</RequestId>
<DedicateHostList>
<DedicatedHostId> ch-bp108dki3wdl6****</DedicatedHostId>
</DedicateHostList>
</CreateDedicatedHostResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"OrderId" : 102565235,
"RequestId" : "C860658E-68A6-46C1-AF6E-3AE7C4D32375",
"DedicateHostList" : [ {
"DedicatedHostId" : " ch-bp108dki3wdl6****"
} ]
}
Error codes
HttpCode | Error code | Error message | Description |
400 | InvalidParameter | The parameter is invalid. | The error message returned because a parameter is set to an invalid value. |
400 | InvalidAccountPassword.Format | The account password format is invalid. | The error message returned because the specified password is invalid. |
400 | InsufficientResourceCapacity | No host is available for the requested instance. | The error message returned because the system failed to create the host due to insufficient resources in the dedicated cluster. |
For a list of error codes, visit the API Error Center.