Batch Modifying ECS Specifications
Function
This API is used to batch modify ECS specifications.
This API is an asynchronous API. After the batch specification modification request is successfully submitted, a job ID is returned. This does not mean the modification is complete. You need to call the API by referring to Querying Job Execution Status to query the job status. The SUCCESS status indicates that the modification is successful.

Huawei Cloud no longer provides Windows images. This API cannot be used to modify the specifications of Windows ECSs.
Constraints
- You can modify specifications for a maximum of 50 ECSs in a batch.
- The billing modes of ECSs whose specifications are to be modified in the same batch must be the same.
- The specifications of yearly/monthly ECSs can be batch upgraded or downgraded.
- The ECSs whose specifications are to be modified in the same batch must be located in the same AZ.
- The current and new specifications of the ECSs whose specifications are to be modified in the same batch must be the same.
- The specifications of ECSs on DeHs cannot be batch modified.
- The specifications of spot instances cannot be batch modified.
- Auto-payment is not supported for batch upgrade of specifications for yearly/monthly ECSs. You can manually pay for the generated order on the console or refer to Paying Yearly/Monthly Product Orders to pay for the order.
- The specifications of yearly/monthly ECSs created using paid public images cannot be batch modified. For details about paid public images, see Image Billing.
Debugging
You can debug this API in API Explorer.
Authorization
- If you are using role/policy-based authorization, see the required permissions in Permissions and Supported Actions.
- If you are using identity policy-based authorization, the permissions listed below are required.
Action | Access Level | Resource Type (*: required) | Condition Key | Alias | Dependencies |
|---|---|---|---|---|---|
ecs:cloudServers:resize | write | instance * |
| - | - |
URI
POST /v1/{project_id}/cloudservers/batch-resize
Parameter | Mandatory | Description |
|---|---|---|
project_id | Yes | Definition Specifies the project ID. For details about how to obtain the ID, see Obtaining a Project ID. Constraints N/A Range N/A Default Value N/A |
Request
Parameter | Mandatory | Type | Description |
|---|---|---|---|
resize | Yes | Object | Definition Specifies the operation to modify ECS specifications. For details, see Table 3. Constraints N/A Range N/A Default Value N/A |
Parameter | Mandatory | Type | Description |
|---|---|---|---|
flavorRef | Yes | String | Definition Specifies the flavor ID of the ECS after the modification. Constraints N/A Range N/A Default Value N/A |
servers | Yes | Array of objects | Definition Specifies the ECS ID list. For details, see Table 4. Constraints N/A Range N/A Default Value N/A |
mode | No | String | Definition The specification modification request can be submitted at ECS runtime. Constraints N/A Range When mode is set to withStopServer, the system will stop the running ECS first before modifying specifications and then start the ECS after the modification is complete. Default Value N/A |
cpu_options | No | Object | Definition Specifies the CPU options. For details, see Table 5. Constraints N/A Range N/A Default Value N/A |
promotion | No | Object | Definition Specifies the discount. For details, see Table 6. Constraints N/A Range N/A Default Value N/A |
Parameter | Mandatory | Type | Description |
|---|---|---|---|
id | Yes | String | Definition Specifies the ECS ID. Constraints N/A Range N/A Default Value N/A |
Parameter | Mandatory | Type | Description |
|---|---|---|---|
hw:cpu_threads | No | Integer | Definition Specifies whether to enable CPU hyper-threading. Constraints This parameter can be set to 1 (disabling hyper-threading) only when all of the following conditions are met:
Range
Default Value N/A |
Response
Table 7 describes the response parameters.
Example Request
Batch modify the specifications of two ECSs to s3.small.1.
POST https://{endpoint}/v1/{project_id}/cloudservers/batch-resize
{
"resize": {
"flavorRef": "s3.small.1",
"servers": [
{
"id": "98ce4563-3e06-414f-899b-6ba6eaa41c1d"
},
{
"id": "aacc5bf0-49c4-4720-a406-1751d8010e7f"
}
]
}
} Example Response
{
"job_id": "ff80808288d415d80189901d8eb81cbb",
"order_id": "CS18020810083A4GP"
} Returned Values
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot
