You can call this operation to modify some attributes of a dedicated host, such as the name, description, and instance migration policy that is applied when the dedicated host fails.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description 
DedicatedHostId String Yes ddh-xxxxxxxxxxxxxxxxxxx

The ID of the dedicated host.

RegionId String Yes cn-hangzhou

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

Action String No ModifyDedicatedHostAttribute

The operation that you want to perform. Set this parameter to ModifyDedicatedHostAttribute.

ActionOnMaintenance String No Migrate

The policy used to migrate the instances from the dedicated host when the dedicated host fails or needs to be repaired online. Valid values:

  • Migrate: Instances are migrated to another physical server and restarted.
  • Stop: Instances on the dedicated host are stopped. If the dedicated host cannot be repaired, the instances are migrated to another physical server and restarted.

If the dedicated host is attached with disks that are not local disks, the default value is Migrate.

If the dedicated host is attached with local disks, the default value is Stop.

AutoPlacement String No on

Specifies whether the dedicated host is added 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: 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 more information, see Features.

DedicatedHostName String No myDDH

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

Description String No this-is-my-ddh

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

NetworkAttributes.SlbUdpTimeout Integer No 60

The duration of UDP timeout for sessions between Server Load Balancer (SLB) and the dedicated host. Unit: seconds. Valid values: 15 to 310.

NetworkAttributes.UdpTimeout Integer No 60

The duration of UDP timeout for sessions between users and instances on the dedicated host. Unit: seconds. Valid values: 15 to 310.

Response parameters

Parameter Type Example Description
RequestId String 2A4EA075-CB5B-41B7-B0EB-70D339F64DE7

The ID of the request.

Examples

Sample requests


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

Sample success responses

XML format

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

JSON format

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

Error codes

HTTP status code Error code Error message Description 
404 InvalidDedicatedHostId.NotFound The specified DedicatedHostId does not exist. The error message returned because the specified dedicated host ID does not exist.
400 InvalidDedicatedHostName.Malformed The specified parameter DedicatedHostName is not valid. The error message returned because the specified DedicatedHostName is invalid.
400 InvalidDescription.Malformed The specified parameter Description is not valid. The error message returned because the value of the Description parameter is invalid. The description must be 2 to 256 characters in length and cannot start with http:// or https://.
403 InvalidUser.Unauthorized The user is not authorized The error message returned because you are not authorized to perform this operation.
400 InvalidParameter.SlbUdpTimeout The specified parameter is invalid. The error message returned because the SlbUdpTimeout parameter is invalid.
400 InvalidParameter.UdpTimeout The specified parameter is invalid. The error message returned because the UdpTimeout parameter is invalid.

For more information about error codes, see API Error Center.