Updated on 2025-08-20 GMT+08:00

Modifying the Specifications of an ECS (Discarded)

Function

This API is used to modify the specifications of an ECS.

For a running ECS, the system will automatically stop the ECS, copy the ECS data to the target node, which can be the source node, and then restart the ECS.

This API supports automatic rollback if the underlying resources are insufficient.

This API cannot be used independently. The VM status needs to be queried in polling mode. When status is VERIFY_RESIZE, OS-EXT-STS:task_state is "", and OS-EXT-STS:vm_state is RESIZED, this API must be used together with Confirming the Specifications Modification of an ECS (Discarded) (POST /v2.1/{project_id}/servers/{server_id}/action) or Rolling Back ECS Specifications Modification (Discarded) (POST /v2.1/{project_id}/servers/{server_id}/action).

This API has been discarded. Use the API described in Modifying the Specifications of an ECS (Pay-per-Use).

Huawei Cloud no longer provides Windows images. This API cannot be used to modify the specifications of Windows ECSs.

URI

POST /v2.1/{project_id}/servers/{server_id}/action

Table 1 describes the parameters in the URI.
Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

For details about how to obtain the ID, see Obtaining a Project ID.

server_id

Yes

Specifies the ECS ID.

Request

Table 2 describes the request parameters.
Table 2 Request parameters

Parameter

Mandatory

Type

Description

resize

Yes

Object

For details about how to modify specifications, see Table 3.

Table 3 resize field description

Parameter

Mandatory

Type

Description

flavorRef

Yes

String

Specifies the new flavor ID or URI.

Response

None

Example Request

Change the flavor of a specified ECS to s3.medium.2.

POST https://{endpoint}/v2.1/{project_id}/servers/{server_id}/action

{
    "resize" : {
        "flavorRef" : "s3.medium.2"
    }
}

Example Response

None