Queries the details of dedicated hosts, including the physical performance specifications, machine codes, and service states of the dedicated hosts, and Elastic Compute Service (ECS) instances that are created on the dedicated hosts.
Usage notes
You can use one of the following methods to query the details of dedicated hosts:
- Specify
DedicatedHostIds
to query the details of dedicated hosts. - Specify
DedicatedHostClusterId
to query the details of the dedicated hosts in a dedicated host cluster.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | DescribeDedicatedHosts | The operation that you want to perform. Set the value to DescribeDedicatedHosts. |
RegionId | String | Yes | cn-hangzhou | The region ID of the dedicated host. You can call the DescribeRegions operation to query the most recent region list. |
ZoneId | String | No | cn-hangzhou-g | The zone ID of the dedicated host. You can call the DescribeZones operation to query the most recent zone list. |
DedicatedHostIds | String | No | ["dh-bp165p6xk2tlw61e****", "dh-bp1f9vxmno7emy96****"] | The IDs of dedicated hosts. You can specify up to 100 dedicated host IDs in a single request. Separate the IDs with commas (,). |
DedicatedHostName | String | No | MyDDHTestName | The name of the dedicated host. |
Status | String | No | Available | The service state of the dedicated host. Valid values:
Default value: Available. |
DedicatedHostType | String | No | ddh.g5 | The dedicated host type. You can call the DescribeDedicatedHostTypes operation to obtain the most recent list of dedicated host types. |
LockReason | String | No | financial | The reason why the dedicated host is locked. Valid values:
|
PageNumber | Integer | No | 1 | The number of entries per page. Default value: 1. |
PageSize | Integer | No | 10 | The page number. Valid values: 1 to 100. Default value: 10. |
ResourceGroupId | String | No | rg-aek3b6jzp66**** | The ID of the resource group to which the dedicated host belongs. When this parameter is specified to query resources, up to 1,000 resources that belong to the specified resource group can be displayed in the response. Note Resources in the default resource group are displayed in the response regardless of how this parameter is set. |
Tag.N.Key | String | No | TestKey | The key of tag N of the dedicated host. Valid values of N: 1 to 20. The tag key cannot be an empty string. It can be up to 128 characters in length and cannot start with |
Tag.N.Value | String | No | TestValue | The value of tag N of the dedicated host. Valid values of N: 1 to 20. The tag value can be an empty string. It can be up to 128 characters in length and cannot start with |
DedicatedHostClusterId | String | No | dc-bp12wlf6am0vz9v2**** | The ID of the dedicated host cluster to which the dedicated host belongs. |
SocketDetails | String | No | true | Specifies whether to display socket information. Valid values:
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
PageSize | Integer | 1 | The number of entries per page. |
RequestId | String | 7654525A-9964-4ABB-8BCD-98F8835E809A | The request ID. |
PageNumber | Integer | 5 | The page number. |
TotalCount | Integer | 3 | The total number of dedicated hosts. |
DedicatedHosts | Array of DedicatedHost | The queried dedicated hosts. | |
DedicatedHost | |||
CreationTime | String | 2018-01-01T12:00Z | The time when the dedicated host was created. The time follows the ISO 8601 standard in the |
SchedulerOptions.ManagedPrivateSpaceId | String | mps-iq81z6pkbqjx61php46e | The ID of the managed private space to which the dedicated host belongs. |
Status | String | Available | The service state of the dedicated host. Valid values:
|
Cores | Integer | 3 | The number of physical cores per CPU. |
AutoPlacement | String | on | Indicates whether the dedicated host was added to the resource pool for automatic deployment. Valid values:
For more information about automatic deployment, see the "Automatic deployment" section in the Functions and features topic. |
GPUSpec | String | gpu | The GPU model. |
AutoReleaseTime | String | 2017-01-01T12:00Z | The automatic release time of the dedicated host. The time follows the ISO 8601 standard in the |
ChargeType | String | Prepaid | The billing method of the dedicated host. |
CpuOverCommitRatio | Float | 1 | The CPU overcommit ratio. |
ActionOnMaintenance | String | Migrate | The policy used to migrate the instances deployed on the dedicated host when the dedicated host fails. Valid values:
If the dedicated host has cloud disks attached, the default value is Migrate. If the dedicated host has local disks attached, the default value is Stop. |
SaleCycle | String | Month | The unit of the subscription period. Valid values:
|
PhysicalGpus | Integer | 10 | The number of physical GPUs. |
RegionId | String | cn-hangzhou | The region ID of the dedicated host. |
DedicatedHostName | String | MyDDHTestName | The name of the dedicated host. |
Description | String | this-is-my-DDH | The description of the dedicated host. |
DedicatedHostClusterId | String | dc-bp12wlf6am0vz9v2**** | The ID of the dedicated host cluster to which the dedicated host belongs. |
ExpiredTime | String | 2019-01-01T12:00Z | The expiration time of the subscription dedicated host. The time follows the ISO 8601 standard in the |
DedicatedHostType | String | ddh.g5 | The type of the dedicated host. |
ResourceGroupId | String | rg-aek3b6jzp66**** | The ID of the resource group to which the dedicated host belongs. |
ZoneId | String | cn-hangzhou-g | The zone ID of the dedicated host. |
DedicatedHostId | String | dh-bp165p6xk2tlw61e**** | The ID of the dedicated host. |
Sockets | Integer | 5 | The number of physical CPUs. |
MachineId | String | 12aaa123456ff19dec12345d3026e**** | The machine code of the dedicated host. |
Instances | Array of Instance | The ECS instances that were created on the dedicated host. | |
Instance | |||
InstanceType | String | ecs.g5.large | The instance type of the ECS instance. |
InstanceId | String | i-bp14ot0ykf8w13a1**** | The ID of the ECS instance. |
SocketId | String | 0,1 | The ID of the socket to which the ECS instance belongs. |
InstanceOwnerId | Long | 128************0 | The ID of the ECS instance owner. |
OperationLocks | Array of OperationLock | The reasons why the resources of the dedicated host were locked. | |
OperationLock | |||
LockReason | String | financial | The reason why the dedicated host was locked. Valid values:
|
Tags | Array of Tag | The tags of the dedicated host. | |
Tag | |||
TagValue | String | TestValue | The tag value of the dedicated host. |
TagKey | String | TestKey | The tag key of the dedicated host. |
SupportedInstanceTypeFamilies | Array of String | ecs.g5 | The ECS instance families supported by the dedicated host. |
SupportedCustomInstanceTypeFamilies | Array of String | ecs.ddh6s.custom | The custom ECS instance families supported by the dedicated host. |
SupportedInstanceTypesList | Array of String | ecs.g5.large | The ECS instance types supported by the dedicated host. |
Capacity | Object | The performance specifications of the dedicated host. | |
AvailableMemory | Float | 25 | The amount of available memory. Unit: GiB. |
LocalStorageCategory | String | i2 | The instance family that uses local disks. |
TotalMemory | Float | 1024 | The total capacity of the memory. Unit: GiB. |
TotalLocalStorage | Integer | 512 | The total capacity of local disks. Unit: GiB. |
TotalVcpus | Integer | 56 | The total number of vCPUs. |
TotalVgpus | Integer | 10 | The total number of vGPUs. |
AvailableLocalStorage | Integer | 65 | The amount of available capacity on the local disks. Unit: GiB. |
AvailableVcpus | Integer | 5 | The number of available vCPUs. |
AvailableVgpus | Integer | 2 | The number of available vGPUs. |
SocketCapacities | Array of SocketCapacity | The socket capacities. | |
SocketCapacity | |||
SocketId | Integer | 1 | The socket ID. |
AvailableMemory | Float | 65 | The remaining capacity of the memory. Unit: GiB. |
TotalMemory | Float | 128 | The total capacity of the memory. Unit: GiB. |
AvailableVcpu | Integer | 64 | The total number of vCPUs. |
TotalVcpu | Integer | 128 | The number of available vCPUs. |
NetworkAttributes | Object | The network attributes of the dedicated host. | |
UdpTimeout | Integer | 60 | The timeout period of the UDP session that is established between a user and an Alibaba Cloud service on the dedicated host. Unit: seconds. Valid value: 60. |
SlbUdpTimeout | Integer | 60 | The timeout period of the UDP session that was established between Server Load Balancer (SLB) and the dedicated host. Unit: seconds. Valid value: 60. |
HostDetailInfo | Object | This parameter will be removed in the future. We recommend that you use other parameters to ensure future compatibility. | |
SerialNumber | String | null | This parameter will be removed in the future. We recommend that you use other parameters to ensure future compatibility. |
DedicatedHostOwnerId | Long | 100************7 | The ID of the dedicated host owner. |
Examples
Sample requests
http(s)://ecs.aliyuncs.com/?Action=DescribeDedicatedHosts
&RegionId=cn-hangzhou
&ZoneId=cn-hangzhou-g
&DedicatedHostIds=["dh-bp165p6xk2tlw61e****", "dh-bp1f9vxmno7emy96****"]
&DedicatedHostName=MyDDHTestName
&Status=Available
&DedicatedHostType=ddh.g5
&LockReason=financial
&PageNumber=1
&PageSize=10
&ResourceGroupId=rg-aek3b6jzp66****
&Tag=[{"Key":"TestKey","Value":"TestValue"}]
&DedicatedHostClusterId=dc-bp12wlf6am0vz9v2****
&SocketDetails=true
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<DescribeDedicatedHostsResponse>
<PageSize>1</PageSize>
<RequestId>7654525A-9964-4ABB-8BCD-98F8835E809A</RequestId>
<PageNumber>5</PageNumber>
<TotalCount>3</TotalCount>
<DedicatedHosts>
<CreationTime>2018-01-01T12:00Z</CreationTime>
<SchedulerOptions.ManagedPrivateSpaceId>mps-iq81z6pkbqjx61php46e</SchedulerOptions.ManagedPrivateSpaceId>
<Status>Available</Status>
<Cores>3</Cores>
<AutoPlacement>on</AutoPlacement>
<GPUSpec>gpu</GPUSpec>
<AutoReleaseTime>2017-01-01T12:00Z</AutoReleaseTime>
<ChargeType>Prepaid</ChargeType>
<CpuOverCommitRatio>1</CpuOverCommitRatio>
<ActionOnMaintenance>Migrate</ActionOnMaintenance>
<SaleCycle>Month</SaleCycle>
<PhysicalGpus>10</PhysicalGpus>
<RegionId>cn-hangzhou</RegionId>
<DedicatedHostName>MyDDHTestName</DedicatedHostName>
<Description>this-is-my-DDH</Description>
<DedicatedHostClusterId>dc-bp12wlf6am0vz9v2****</DedicatedHostClusterId>
<ExpiredTime>2019-01-01T12:00Z</ExpiredTime>
<DedicatedHostType>ddh.g5</DedicatedHostType>
<ResourceGroupId>rg-aek3b6jzp66****</ResourceGroupId>
<ZoneId>cn-hangzhou-g</ZoneId>
<DedicatedHostId>dh-bp165p6xk2tlw61e****</DedicatedHostId>
<Sockets>5</Sockets>
<MachineId>12aaa123456ff19dec12345d3026e****</MachineId>
<Instances>
<InstanceType>ecs.g5.large</InstanceType>
<InstanceId>i-bp14ot0ykf8w13a1****</InstanceId>
<SocketId>0,1</SocketId>
</Instances>
<OperationLocks>
<LockReason>financial</LockReason>
</OperationLocks>
<Tags>
<TagValue>TestValue</TagValue>
<TagKey>TestKey</TagKey>
</Tags>
<SupportedInstanceTypeFamilies>ecs.g5</SupportedInstanceTypeFamilies>
<SupportedCustomInstanceTypeFamilies>ecs.ddh6s.custom</SupportedCustomInstanceTypeFamilies>
<SupportedInstanceTypesList>ecs.g5.large</SupportedInstanceTypesList>
<Capacity>
<AvailableMemory>25</AvailableMemory>
<LocalStorageCategory>i2</LocalStorageCategory>
<TotalMemory>1024</TotalMemory>
<TotalLocalStorage>512</TotalLocalStorage>
<TotalVcpus>56</TotalVcpus>
<TotalVgpus>10</TotalVgpus>
<AvailableLocalStorage>65</AvailableLocalStorage>
<AvailableVcpus>5</AvailableVcpus>
<AvailableVgpus>2</AvailableVgpus>
<SocketCapacities>
<SocketId>1</SocketId>
<AvailableMemory>65</AvailableMemory>
<TotalMemory>128</TotalMemory>
<AvailableVcpu>64</AvailableVcpu>
<TotalVcpu>128</TotalVcpu>
</SocketCapacities>
</Capacity>
<NetworkAttributes>
<UdpTimeout>60</UdpTimeout>
<SlbUdpTimeout>60</SlbUdpTimeout>
</NetworkAttributes>
<HostDetailInfo>
<SerialNumber>null</SerialNumber>
</HostDetailInfo>
</DedicatedHosts>
</DescribeDedicatedHostsResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"PageSize" : 1,
"RequestId" : "7654525A-9964-4ABB-8BCD-98F8835E809A",
"PageNumber" : 5,
"TotalCount" : 3,
"DedicatedHosts" : [ {
"CreationTime" : "2018-01-01T12:00Z",
"SchedulerOptions.ManagedPrivateSpaceId" : "mps-iq81z6pkbqjx61php46e",
"Status" : "Available",
"Cores" : 3,
"AutoPlacement" : "on",
"GPUSpec" : "gpu",
"AutoReleaseTime" : "2017-01-01T12:00Z",
"ChargeType" : "Prepaid",
"CpuOverCommitRatio" : 1,
"ActionOnMaintenance" : "Migrate",
"SaleCycle" : "Month",
"PhysicalGpus" : 10,
"RegionId" : "cn-hangzhou",
"DedicatedHostName" : "MyDDHTestName",
"Description" : "this-is-my-DDH",
"DedicatedHostClusterId" : "dc-bp12wlf6am0vz9v2****",
"ExpiredTime" : "2019-01-01T12:00Z",
"DedicatedHostType" : "ddh.g5",
"ResourceGroupId" : "rg-aek3b6jzp66****",
"ZoneId" : "cn-hangzhou-g",
"DedicatedHostId" : "dh-bp165p6xk2tlw61e****",
"Sockets" : 5,
"MachineId" : "12aaa123456ff19dec12345d3026e****",
"Instances" : [ {
"InstanceType" : "ecs.g5.large",
"InstanceId" : "i-bp14ot0ykf8w13a1****",
"SocketId" : "0,1"
} ],
"OperationLocks" : [ {
"LockReason" : "financial"
} ],
"Tags" : [ {
"TagValue" : "TestValue",
"TagKey" : "TestKey"
} ],
"SupportedInstanceTypeFamilies" : [ "ecs.g5" ],
"SupportedCustomInstanceTypeFamilies" : [ "ecs.ddh6s.custom" ],
"SupportedInstanceTypesList" : [ "ecs.g5.large" ],
"Capacity" : {
"AvailableMemory" : 25,
"LocalStorageCategory" : "i2",
"TotalMemory" : 1024,
"TotalLocalStorage" : 512,
"TotalVcpus" : 56,
"TotalVgpus" : 10,
"AvailableLocalStorage" : 65,
"AvailableVcpus" : 5,
"AvailableVgpus" : 2,
"SocketCapacities" : [ {
"SocketId" : 1,
"AvailableMemory" : 65,
"TotalMemory" : 128,
"AvailableVcpu" : 64,
"TotalVcpu" : 128
} ]
},
"NetworkAttributes" : {
"UdpTimeout" : 60,
"SlbUdpTimeout" : 60
},
"HostDetailInfo" : {
"SerialNumber" : "null"
}
} ]
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidStatus.ValueNotSupported | The pecified dedicated host status is not supported. | This operation cannot be performed on the dedicated host in the current state. |
400 | MissingParamter.RegionId | The regionId should not be null. | RegionId is required. |
400 | InvalidParameter.DedicatedHostIds | The specified parameter dedicatedHostIds is not valid. | Invalid DedicatedHostIds value. |
400 | InvalidRegion.NotFound | The specified parameter RegionId is not valid. | Invalid RegionId value. |
400 | InvalidZone.NotFound | The specified parameter ZoneId is not valid. | Invalid ZoneId value. |
403 | InvalidDedicatedHostIds.Malformed | The amount of specified dedicatedHostIds exceeds the limit. | More than 100 dedicated host IDs are specified in the DedicatedHostIds value. |
404 | InvalidLockReason.NotFound | The specified LockReason is not found. | The specified LockReason value is not found. |
For a list of error codes, see Service error codes.