• Elastic Cloud Server

ecs
  1. Help Center
  2. Elastic Cloud Server
  3. API Reference
  4. Extension ECS APIs
  5. Flavor Management
  6. Modifying the Specifications of an ECS

Modifying the Specifications of an ECS

Function Description

ECS specifications can be modified, for example, upgrading the vCPUs and memory, to meet service requirements. This interface is used to modify ECS specifications.

An ECS flavor cannot be changed to certain flavors. To obtain the target flavors to which an ECS flavor can be changed, use the interface "/v2.1/{project_id}/resize_flavors?{instance_uuid,source_flavor_id,source_flavor_name}". For details, see section Querying the Target ECS Flavors to Which a Flavor Can Be Changed.

Constraints

  • You can modify the ECS specifications only when the ECS is stopped.
  • Before changing a general-purpose (S1, C1, C2, or M1) ECS to an H1 ECS, manually install the desired driver on the ECS. Otherwise, the specifications modification will fail. For instructions about how to install a driver, see section "Modifying ECS vCPU and Memory Specifications > Changing a General-Purpose ECS to an H1 ECS" in Elastic Cloud Server User Guide.
  • A XEN ECS can be changed to a KVM ECS, but a KVM ECS cannot be changed to a XEN ECS.
  • Before changing a XEN ECS to a KVM instance, manually install the desired driver on the ECS. Otherwise, the specifications modification will fail. For instructions about how to install a driver, see section "Modifying ECS vCPU and Memory Specifications > Changing a XEN ECS to a KVM ECS (Windows) or Changing a XEN ECS to a KVM ECS (Linux) in Elastic Cloud Server User Guide.
  • A XEN ECS with more than 24 VBD disks attached cannot be changed to a KVM ECS.

URI

POST /v1/{project_id}/cloudservers/{server_id}/resize

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

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

server_id

Yes

Specifies the ECS ID.

Request

Request parameters

Table 2 describes the request parameters.
Table 2 Request parameters

Parameter

Mandatory

Type

Description

resize

Yes

Dictionary data structure

Specifies the operation to modify ECS specifications. For details, see Table 3.

Table 3 resize field description

Parameter

Mandatory

Type

Description

flavorRef

Yes

String

Specifies the specifications ID of the ECS after the modification.

dedicated_host_id

No

String

Specifies the new DeH ID, which is applicable only to the ECSs on DeHs.

Response

See Responses (Task).

Examples

  • Example request
    {
    "resize": {
            "flavorRef": "c3.15xlarge.2",
            "dedicated_host_id": "459a2b9d-804a-4745-ab19-a113bb1b4ddc"
        }
    }

Returned Values

See General Request Returned Values.

Error Code

See Error Code Description.