ModifyDedicatedHostAttribute

更新时间:
复制 MD 格式

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

Operation description

Usage notes

  • All 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.

  • Changes to the CPU overcommit ratio of a dedicated host do not affect the running status of the dedicated host. After the CPU overcommit ratio is changed, 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.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ecs:ModifyDedicatedHostAttribute

update

*DedicatedHost

acs:ecs:{#regionId}:{#accountId}:ddh/{#ddhId}

DedicatedHostCluster

acs:ecs:{#regionId}:{#accountId}:ddhcluster/{#ddhclusterId}

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

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

cn-hangzhou

DedicatedHostId

string

Yes

The ID of the dedicated host.

dh-bp165p6xk2tlw61e****

DedicatedHostName

string

No

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 (-).

testDedicatedHostName

Description

string

No

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

testDescription

ActionOnMaintenance

string

No

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.

Migrate

NetworkAttributes.SlbUdpTimeout

integer

No

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.

60

NetworkAttributes.UdpTimeout

integer

No

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.

60

AutoPlacement

string

No

Specifies whether to add the dedicated host to the resource pool for automatic deployment. If you do not specify DedicatedHostId 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 Functions and features.

on

DedicatedHostClusterId

string

No

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

dc-bp165p6xk2tlw61e****

CpuOverCommitRatio

number

No

The CPU overcommit ratio. You can configure CPU overcommit ratios only for the following dedicated host types: 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 allows you to deploy more ECS instances of the same specifications on the dedicated host and reduce the unit deployment cost.

1

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

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

Examples

Success response

JSON format

{
  "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.
400 InvalidDescription.Malformed The specified parameter Description is not valid. The resource description is invalid. 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. The specified SlbUdpTimeout parameter is invalid.
400 InvalidParameter.UdpTimeout The specified value is invalid. The specified UdpTimeout parameter is invalid.
400 InvalidDedicatedHostType.CpuOverCommitRatioNotSupported %s
400 InvalidCpuOverCommitRatio.ValueNotSupported %s
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.
404 InvalidDedicatedHostClusterId.NotFound The specified DedicatedHostClusterId does not exist.
404 InvalidDedicatedHostClusterId.ExceedMaxSize The specified Dedicated Host Cluster exceeded max capacity.
404 InvalidDedicatedHostClusterId.NotMatch The specified DedicatedHostCluster does not match request.
404 InvalidParameter.ActionOnMaintenance The specified ActionOnMaintenance does not exist.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.