All Products
Search
Document Center

Elastic Compute Service:DescribeDedicatedHosts

更新時間:Dec 25, 2024

Queries the information about dedicated hosts, including the physical performance specifications, machine codes, and status of the dedicated hosts, and Elastic Compute Service (ECS) instances that are created on the dedicated hosts.

Operation description

Usage notes

You can use one of the following methods to query the information about dedicated hosts:

  • Specify DedicatedHostIds to query the details of specified dedicated hosts.
  • Specify DedicatedHostClusterId to query the details of dedicated hosts in a dedicated host cluster.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
ecs:DescribeDedicatedHostsget
*DedicatedHost
acs:ecs:{#regionId}:{#accountId}:ddh/*
*DedicatedHost
acs:ecs:{#regionId}:{#accountId}:ddh/{#ddhId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the dedicated host. You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou
ZoneIdstringNo

The zone ID of the dedicated host. You can call the DescribeZones operation to query the most recent zone list.

cn-hangzhou-g
DedicatedHostIdsstringNo

The IDs of dedicated hosts. You can specify up to 100 dedicated host IDs in a single request. Separate the IDs with commas (,).

["dh-bp165p6xk2tlw61e****", "dh-bp1f9vxmno7emy96****"]
DedicatedHostNamestringNo

The name of the dedicated host.

MyDDHTestName
StatusstringNo

The service state of the dedicated host. Valid values:

  • Available: The dedicated host is running normally.
  • UnderAssessment: The dedicated host is available but has potential risks that may cause the ECS instances on the dedicated host to fail.
  • PermanentFailure: The dedicated host encounters permanent failures and is unavailable.
  • TempUnavailable: The dedicated host is temporarily unavailable.
  • Redeploying: The dedicated host is being restored.

Default value: Available.

Available
DedicatedHostTypestringNo

The dedicated host type. You can call the DescribeDedicatedHostTypes operation to query the most recent list of dedicated host types.

ddh.g5
LockReasonstringNo

The reason why the dedicated host is locked. Valid values:

  • financial: The dedicated host is locked due to overdue payments.
  • security: The dedicated host is locked due to security reasons.
financial
PageNumberintegerNo

The number of entries per page.

Default value: 1.

1
PageSizeintegerNo

The number of entries per page.

Valid values: 1 to 100.

Default value: 10.

10
ResourceGroupIdstringNo

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.
rg-aek3b6jzp66****
Tagarray<object>No

The tags of the dedicated host.

objectNo
KeystringNo

The key of tag N of the dedicated host. Valid values of N: 1 to 20. The tag key cannot be an empty string. The tag key can be up to 128 characters in length and cannot contain http:// or https://. The tag key cannot start with acs: or aliyun.

TestKey
ValuestringNo

The value of tag N of the dedicated host. Valid values of N: 1 to 20. The tag value can be an empty string. The tag value can be up to 128 characters in length and cannot contain http:// or https://.

TestValue
DedicatedHostClusterIdstringNo

The ID of the dedicated host cluster.

dc-bp12wlf6am0vz9v2****
SocketDetailsstringNo

Specifies whether to display socket information. Valid values:

  • true
  • false
true
NextTokenstringNo

The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request. You must specify the token that is obtained from the previous query as the value of NextToken.

e71d8a535bd9cc11
MaxResultsintegerNo

The maximum number of entries per page. If you specify this parameter, both MaxResults and NextToken are used for a paged query.

Valid values: 1 to 100.

Default value: 10.

10

Response parameters

ParameterTypeDescriptionExample
object
PageSizeinteger

The number of entries per page.

1
RequestIdstring

The ID of the request.

7654525A-9964-4ABB-8BCD-98F8835E809A
PageNumberinteger

The page number.

5
TotalCountinteger

The total number of dedicated hosts.

3
NextTokenstring

A pagination token. It can be used in the next request to retrieve a new page of results. If NextToken is empty, no next page exists. If the return value of this parameter is empty when you specify MaxResults and NextToken for a paged query, no more results are to be returned.

e71d8a535bd9cc11
DedicatedHostsarray<object>

Details about the dedicated hosts.

DedicatedHostobject

The ID of the managed private space to which the dedicated host belongs.

CreationTimestring

The time when the dedicated host was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The time is displayed in UTC.

2018-01-01T12:00Z
SchedulerOptions.ManagedPrivateSpaceIdstring

The ID of the managed private space to which the dedicated host belongs.

mps-iq81z6pkbqjx61php46e
Statusstring

The status of the dedicated host. Valid values:

  • Available: The dedicated host is running as expected.
  • UnderAssessment: The dedicated host is available but has potential risks that may cause the ECS instances on the dedicated host to fail.
  • PermanentFailure: The dedicated host has permanent failures and is unavailable.
Available
Coresinteger

The number of physical cores per CPU.

3
AutoPlacementstring

Indicates whether the dedicated host is added to the resource pool for automatic deployment. Valid values:

  • on: The dedicated host is added to the resource pool for automatic deployment.
  • off: The dedicated host is not added to the resource pool for automatic deployment.

For information about automatic deployment, see the "Automatic deployment" section in Functions and features.

on
GPUSpecstring

The GPU model.

gpu
AutoReleaseTimestring

The automatic release time of the dedicated host. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The time is displayed in UTC.

2017-01-01T12:00Z
ChargeTypestring

The billing method of the dedicated host.

Prepaid
CpuOverCommitRatiofloat

The CPU overcommit ratio.Valid values: 1 to 5.

1
ActionOnMaintenancestring

The policy used to migrate the ECS instances deployed on the dedicated host when the dedicated host fails. Valid values:

  • Migrate: The instances are migrated to another physical machine. Instances that are not in the Stopped state when the dedicated host fails are restarted.
  • Stop: The instances are stopped. If the dedicated host cannot be repaired, the instances are migrated to another physical machine and then restarted.

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.

Migrate
SaleCyclestring

The unit of the subscription duration. Valid values:

  • Month
  • Year
Month
PhysicalGpusinteger

The number of physical GPUs.

10
RegionIdstring

The region ID of the dedicated host.

cn-hangzhou
DedicatedHostNamestring

The name of the dedicated host.

MyDDHTestName
Descriptionstring

The description of the dedicated host.

this-is-my-DDH
DedicatedHostClusterIdstring

The ID of the dedicated host cluster to which the dedicated host belongs.

dc-bp12wlf6am0vz9v2****
ExpiredTimestring

The expiration time of the subscription dedicated host. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The time is displayed in UTC.

2019-01-01T12:00Z
DedicatedHostTypestring

The type of the dedicated host.

ddh.g5
ResourceGroupIdstring

The ID of the resource group to which the dedicated host belongs.

rg-aek3b6jzp66****
ZoneIdstring

The zone ID of the dedicated host.

cn-hangzhou-g
DedicatedHostIdstring

The ID of the dedicated host.

dh-bp165p6xk2tlw61e****
Socketsinteger

The number of physical CPUs.

5
MachineIdstring

The machine code of the dedicated host.

12aaa123456ff19dec12345d3026e****
Instancesarray<object>

The ECS instances that were created on the dedicated host.

Instanceobject
InstanceTypestring

The instance type of the ECS instance that was created on the dedicated host.

ecs.g5.large
InstanceIdstring

The ID of the ECS instance.

i-bp14ot0ykf8w13a1****
SocketIdstring

The ID of the socket to which the ECS instance belongs.

0,1
InstanceOwnerIdlong

The ID of the ECS instance owner.

128************0
OperationLocksarray<object>

The reasons why the resources of the dedicated host were locked.

OperationLockobject
LockReasonstring

The reason why the dedicated host was locked. Valid values:

  • financial: The dedicated host was locked due to overdue payments.
  • security: The dedicated host was locked due to security reasons.
financial
Tagsarray<object>

The tags of the dedicated host.

Tagobject
TagValuestring

The tag value of the dedicated host.

TestValue
TagKeystring

The tag key of the dedicated host.

TestKey
SupportedInstanceTypeFamiliesarray

The ECS instance families that are supported by the dedicated host.

SupportedInstanceTypeFamilystring

The ECS instance family that is supported by the dedicated host.

ecs.g5
SupportedCustomInstanceTypeFamiliesarray

The custom ECS instance families that are supported by the dedicated host.

SupportedCustomInstanceTypeFamilystring

The custom ECS instance family that is supported by the dedicated host.

ecs.ddh6s.custom
SupportedInstanceTypesListarray

The ECS instance types that are supported by the dedicated host.

SupportedInstanceTypesListstring

The ECS instance type that is supported by the dedicated host.

ecs.g5.large
Capacityobject

The performance specifications of the dedicated host.

AvailableMemoryfloat

The amount of available memory. Unit: GiB.

25
LocalStorageCategorystring

The category of local disks.

i2
TotalMemoryfloat

The total amount of memory. Unit: GiB.

1024
TotalLocalStorageinteger

The total capacity of local disks. Unit: GiB.

512
TotalVcpusinteger

The total number of vCPUs.

56
TotalVgpusinteger

The total number of vGPUs.

10
AvailableLocalStorageinteger

The amount of available space on the local disks. Unit: GiB

65
AvailableVcpusinteger

The number of available vCPUs.

5
AvailableVgpusinteger

The number of available vGPUs.

2
SocketCapacitiesarray<object>

The socket capacities.

SocketCapacityobject
SocketIdinteger

The socket ID.

1
AvailableMemoryfloat

The amount of available memory. Unit: GiB.

65
TotalMemoryfloat

The total amount of memory. Unit: GiB.

128
AvailableVcpuinteger

The number of available vCPUs.

64
TotalVcpuinteger

The total number of vCPUs.

128
NetworkAttributesobject

The network attributes of the dedicated host.

UdpTimeoutinteger

The timeout period of the UDP session that is established between a user and an Alibaba Cloud service on the dedicated host. Unit: seconds. Only 60 is returned.

60
SlbUdpTimeoutinteger

The timeout period of the UDP session that is established between Server Load Balancer (SLB) and the dedicated host. Unit: seconds. Only 60 is returned.

60
HostDetailInfoobject

This parameter will be removed in the future. We recommend that you use other parameters to ensure future compatibility.

SerialNumberstring

This parameter will be removed in the future. We recommend that you use other parameters to ensure future compatibility.

null
DedicatedHostOwnerIdlong

The ID of the dedicated host owner.

100************7

Examples

Sample success responses

JSONformat

{
  "PageSize": 1,
  "RequestId": "7654525A-9964-4ABB-8BCD-98F8835E809A",
  "PageNumber": 5,
  "TotalCount": 3,
  "NextToken": "e71d8a535bd9cc11",
  "DedicatedHosts": {
    "DedicatedHost": [
      {
        "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": {
          "Instance": [
            {
              "InstanceType": "ecs.g5.large",
              "InstanceId": "i-bp14ot0ykf8w13a1****",
              "SocketId": "0,1",
              "InstanceOwnerId": 0
            }
          ]
        },
        "OperationLocks": {
          "OperationLock": [
            {
              "LockReason": "financial"
            }
          ]
        },
        "Tags": {
          "Tag": [
            {
              "TagValue": "TestValue",
              "TagKey": "TestKey"
            }
          ]
        },
        "SupportedInstanceTypeFamilies": {
          "SupportedInstanceTypeFamily": [
            "ecs.g5"
          ]
        },
        "SupportedCustomInstanceTypeFamilies": {
          "SupportedCustomInstanceTypeFamily": [
            "ecs.ddh6s.custom"
          ]
        },
        "SupportedInstanceTypesList": {
          "SupportedInstanceTypesList": [
            "ecs.g5.large"
          ]
        },
        "Capacity": {
          "AvailableMemory": 25,
          "LocalStorageCategory": "i2",
          "TotalMemory": 1024,
          "TotalLocalStorage": 512,
          "TotalVcpus": 56,
          "TotalVgpus": 10,
          "AvailableLocalStorage": 65,
          "AvailableVcpus": 5,
          "AvailableVgpus": 2,
          "SocketCapacities": {
            "SocketCapacity": [
              {
                "SocketId": 1,
                "AvailableMemory": 65,
                "TotalMemory": 128,
                "AvailableVcpu": 64,
                "TotalVcpu": 128
              }
            ]
          }
        },
        "NetworkAttributes": {
          "UdpTimeout": 60,
          "SlbUdpTimeout": 60
        },
        "HostDetailInfo": {
          "SerialNumber": "null"
        },
        "DedicatedHostOwnerId": 0
      }
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidStatus.ValueNotSupportedThe pecified dedicated host status is not supported.The host is in a state that does not support the current operation.
400MissingParamter.RegionIdThe regionId should not be null.The RegionId parameter is required.
400InvalidParameter.DedicatedHostIdsThe specified parameter dedicatedHostIds is not valid.The specified DedicatedHostIds parameter is invalid.
400InvalidRegion.NotFoundThe specified parameter RegionId is not valid.The specified RegionId parameter is invalid.
400InvalidZone.NotFoundThe specified parameter ZoneId is not valid.The specified ZoneId parameter is invalid.
403InvalidDedicatedHostIds.MalformedThe amount of specified dedicatedHostIds exceeds the limit.More than 100 dedicated host IDs are specified in the DedicatedHostIds value.
404InvalidLockReason.NotFoundThe specified LockReason is not found.The specified lockout reason does not exist.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-04-11The Error code has changed. The request parameters of the API has changed. The response structure of the API has changedView Change Details
2023-03-16The Error code has changed. The response structure of the API has changedView Change Details