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.
An ECS flavor cannot be changed to certain flavors. For details, see Querying the Target ECS Flavors to Which a Flavor Can Be Changed.
Constraints
- Before changing a Xen ECS to a KVM ECS, manually install the desired driver on the ECS. Otherwise, the specifications modification will fail. For instructions about how to install a driver, see Changing a Xen ECS to a KVM ECS (Windows), Automatically Changing a Xen ECS to a KVM ECS (Linux), or Manually Changing a Xen ECS to a KVM ECS (Linux) in Elastic Cloud Server User Guide.
- 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. |
|
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. |
|
mode |
No |
String |
If the parameter value is withStopServer, the specifications of a running ECS can be modified. If the parameter value is withStopServer, the modification process is as follows: The system automatically stops the ECS, modifies ECS specifications, and starts the ECS after the modification is complete. |
Response
See Responses (Task).
Example Request
POST https://{endpoint}/v1/{project_id}/cloudservers/{server_id}/resize
{
"resize": {
"flavorRef": "c3.15xlarge.2"
}
}
Example Response
None
Returned Values
Error Codes
Last Article: Modifying the Specifications of an ECS
Next Article: Adding an ECS to the Monitoring List
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.