All Products
Search
Document Center

:ModifyDedicatedHostAttribute

更新時間:Dec 01, 2023

Modifies some properties of a dedicated host, such as the name, description, and instance migration policy that is applied when the dedicated host fails.

Usage notes

  • All the Elastic Compute Service (ECS) instances that are hosted on a dedicated host must be in the Stopped (Stopped) state before you can modify the CPU overcommit ratio of the dedicated host.
  • Modifications to the CPU overcommit ratio of a dedicated host do not affect the operation of the dedicated host. After the CPU overcommit ratio is modified, the number of allocated vCPUs on the dedicated host cannot exceed the new total number of vCPUs. Otherwise, ECS instances that use the excess vCPUs cannot start.

Request parameters

Parameter

Type

Required

Example

Description

Action String Yes ModifyDedicatedHostAttribute

The operation that you want to perform. Set the value to ModifyDedicatedHostAttribute.

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.

DedicatedHostId String Yes dh-bp165p6xk2tlw61e****

The ID of the dedicated host.

DedicatedHostName String No testDedicatedHostName

The name of the dedicated host. The name must be 2 to 128 characters in length. The name must start with a letter and cannot start with http:// or https://. The name can contain letters, digits, colons (:), underscores (_), and hyphens (-).

Description String No testDescription

The description of the dedicated host. The description must be 2 to 256 characters in length and cannot start with http:// or https://.

ActionOnMaintenance String No Migrate

The policy for migrating the instances deployed on the dedicated host when the dedicated host fails or needs to be repaired online. Valid values:

  • Migrate: The instances are migrated to another physical machine and then 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.

NetworkAttributes.SlbUdpTimeout Integer No 60

The timeout period for a UDP session between a Server Load Balancer (SLB) instance and the dedicated host. Unit: seconds. Valid values: 15 to 310.

NetworkAttributes.UdpTimeout Integer No 60

The timeout period for a UDP session between a user and an Alibaba Cloud service on the dedicated host. Unit: seconds. Valid values: 15 to 310.

AutoPlacement String No on

Specifies whether to add the dedicated host to the resource pool for automatic deployment. If you do not specify the DedicatedHostId parameter when you create an instance on a dedicated host, Alibaba Cloud automatically selects a dedicated host from the resource pool to host the instance. Valid values:

  • on: adds the dedicated host to the resource pool for automatic deployment.
  • off: does not add the dedicated host to the resource pool for automatic deployment.

For information about automatic deployment, see Features.

DedicatedHostClusterId String No dc-bp165p6xk2tlw61e****

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

CpuOverCommitRatio Float No 1

The CPU overcommit ratio. You can set CPU overcommit ratios only for the following types of dedicated hosts: g6s, c6s, and r6s. Valid values: 1 to 5.

The CPU overcommit ratio affects the number of available vCPUs on a dedicated host. You can use the following formula to calculate the number of available vCPUs on a dedicated host: Number of available vCPUs = Number of physical CPU cores × 2 × CPU overcommit ratio. For example, the number of physical CPU cores on each g6s dedicated host is 52. If you change the CPU overcommit ratio of a g6s dedicated host to 4, the number of available vCPUs on the dedicated host is 416. For scenarios that have minimal requirements for CPU stability or where CPU load is not heavy, such as development and test environments, you can increase the number of available vCPUs on a dedicated host by increasing the CPU overcommit ratio. This way, you can deploy more ECS instances of the same specifications on the dedicated host and reduce the unit deployment cost.

Response parameters

Parameter

Type

Example

Description

RequestId String 2A4EA075-CB5B-41B7-B0EB-70D339F6****

The ID of the request.

Examples

Sample requests

http(s)://ecs.aliyuncs.com/?Action=ModifyDedicatedHostAttribute
&DedicatedHostId=dh-bp165p6xk2tlw61e****
&RegionId=cn-hangzhou
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ModifyDedicatedHostAttributeResponse>
    <RequestId>2A4EA075-CB5B-41B7-B0EB-70D339F6****</RequestId>
</ModifyDedicatedHostAttributeResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "2A4EA075-CB5B-41B7-B0EB-70D339F6****"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidDedicatedHostName.Malformed The specified parameter DedicatedHostName is not valid. Invalid DedicatedHostName value.
400 InvalidDescription.Malformed The specified parameter Description is not valid. Invalid Description format. The description must be 2 to 256 characters in length and cannot start with http:// or https://.
400 InvalidParameter.SlbUdpTimeout The specified value is invalid. Invalid NetworkAttributes.SlbUdpTimeout value.
400 InvalidParameter.UdpTimeout The specified value is invalid. Invalid NetworkAttributes.UdpTimeout value.
403 InvalidUser.Unauthorized The user is not authorized You are not authorized to perform this operation.
404 InvalidDedicatedHostId.NotFound The specified DedicatedHostId does not exist. The DedicatedHostId value is not found.
404 InvalidParameter.ActionOnMaintenance The specified ActionOnMaintenance does not exist. The ActionOnMaintenance value is not found.

For a list of error codes, see Service error codes.