Modifying the Specifications of an ECS (Pay-per-Use)
Function
ECS specifications can be modified, for example, upgrading the vCPUs and memory, to meet service requirements. This API is used to modify ECS specifications.
This API is an asynchronous API. After the specifications modification request is successfully delivered, a job ID is returned. This does not mean the modification is complete. You need to call the API by referring to Querying Task 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 the ECS specifications only when the ECS is stopped.
- This API cannot be used to modify the specifications of a yearly/monthly ECS. For details about how to modify the specifications of a yearly/monthly ECS, see Modifying the Specifications of an ECS.
- Spot ECSs do not support specifications modification.
URI
POST /v1/{project_id}/cloudservers/{server_id}/resize
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
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
resize |
Yes |
Object |
Specifies the operation to modify ECS specifications. For details, see Table 3. |
dry_run |
No |
Boolean |
Specifies whether to only check the request and not modify the ECS specifications. true: The request is sent and the ECS specifications are not modified. Check items include mandatory parameters and request format.
false: The request is sent and the ECS specifications will be modified after the check is passed. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
flavorRef |
Yes |
String |
Specifies the flavor ID of the ECS after the modification. You can view Querying the Target ECS Flavors to Which a Flavor Can Be Changed to query the target flavors to which a specified ECS flavor can be changed. |
cpu_options |
No |
Object |
Specifies the CPU options. For details, see Table 4. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
hw:cpu_threads |
No |
integer |
Specifies whether to enable CPU hyper-threading. Values: 1 and 2
This parameter can be set to 1 (disabling hyper-threading) only when all of the following conditions are met:
|
Response
See Responses (Task).
Example Request
Change the ECS flavor to c3.15xlarge.2.
POST https://{endpoint}/v1/{project_id}/cloudservers/{server_id}/resize { "resize": { "flavorRef": "c3.15xlarge.2" } }
Example Response
{ "job_id": "ff80808288d41e1b018990260955686a" }
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