Data Structure for Creating ECSs
Notes
ECS APIs can be of V1 or V1.1. V1 APIs can only be used to create pay-per-use ECSs, while V1.1 APIs can be used to create both pay-per-use and yearly/monthly ECSs.
For the fields described in this section, use V1.1 APIs for yearly/monthly ECSs.
Contents
- publicip Field Description
- security_groups Field Description
- eip Field Description
- bandwidth Field Description
- ipv6_bandwidth Field Description
- extendparam Field Description for Assigning EIPs
- extendparam Field Description for Creating Disks
- extendparam Field Description for Creating ECSs
- metadata Field Description for Creating Disks
- metadata Field Description for Creating ECSs
- os:scheduler_hints Field Description
- server_tags Field Description
publicip Field Description
- Creating ECSs /v1/{project_id}/cloudservers
- Creating ECSs: /v1.1/{project_id}/cloudservers
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
id |
No |
String |
Definition Specifies the ID of the existing EIP assigned to the ECS to be created. The value is in UUID format. Constraints Only EIPs in DOWN state can be assigned. Range N/A Default Value N/A |
eip |
No |
Object |
Definition Specifies an EIP that will be automatically assigned to an ECS. For details, see Table 3. Constraints N/A Range N/A Default Value N/A |
delete_on_termination |
No |
Boolean |
Definition Specifies whether the EIP is released when the ECS where the EIP is bound is deleted. Constraints This parameter is available only for pay-per-use EIPs. Range
Default Value false |

Either id or eip in the publicip field can be configured.
security_groups Field Description
This field is used by the following APIs:
- Creating ECSs /v1/{project_id}/cloudservers
- Creating ECSs: /v1.1/{project_id}/cloudservers
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
id |
No |
String |
Definition Specifies the ID of the security group to which an ECS is to be added. The configuration will take effect on the NICs of the ECS. You need to specify the ID of an existing security group in UUID format. Otherwise, the default security group will be used at the underlying layer. Constraints N/A Range N/A Default Value N/A |
eip Field Description
- Creating ECSs /v1/{project_id}/cloudservers
- Creating ECSs: /v1.1/{project_id}/cloudservers
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
iptype |
Yes |
String |
Definition Specifies the EIP type. For details, see the publicip field description in Assigning an EIP. Constraints N/A Range N/A Default Value N/A |
bandwidth |
Yes |
Object |
Definition Specifies the bandwidth of an EIP. For details, see bandwidth Field Description. Constraints N/A Range N/A Default Value N/A |
extendparam |
No |
Object |
Definition Provides additional EIP information. For details, see Table 6. Constraints If chargingMode in the extendparam parameter of the created ECS is set to prePaid, the ECS is billed in yearly/monthly payments. This parameter is mandatory if a pay-per-use EIP is required. In such a case, chargingMode must be set to postPaid, indicating pay-per-use payments. Range N/A Default Value N/A |
bandwidth Field Description
- Creating ECSs /v1/{project_id}/cloudservers
- Creating ECSs: /v1.1/{project_id}/cloudservers
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
size |
No |
Integer |
Definition Specifies the bandwidth size. Constraints
Range Specifies the bandwidth (Mbit/s). The value ranges from 1 to 300. The specific range may vary depending on the configuration in each region. You can see the bandwidth range of each region on the management console. Default Value N/A |
sharetype |
Yes |
String |
Definition Specifies the bandwidth sharing type. Constraints N/A Range Enumerated values: PER (indicates exclusive bandwidth) and WHOLE (indicates shared bandwidth) Default Value N/A |
chargemode |
No |
String |
Definition Specifies the bandwidth billing mode. Constraints
Range N/A Default Value N/A |
id |
No |
String |
Definition Specifies the bandwidth ID. You can use an existing shared bandwidth when applying for an EIP for the bandwidth of type WHOLE. Constraints This parameter is mandatory when sharetype is set to WHOLE. Range The value must be the ID of bandwidth whose share_type is WHOLE. Default Value N/A |
ipv6_bandwidth Field Description
- Creating ECSs /v1/{project_id}/cloudservers
- Creating ECSs: /v1.1/{project_id}/cloudservers
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
id |
No |
String |
Definition Specifies the ID of an IPv6 bandwidth. Constraints N/A Range N/A Default Value N/A |
extendparam Field Description for Assigning EIPs
This field is used by the following API:
Creating ECSs /v1.1/{project_id}/cloudservers
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
chargingMode |
No |
String |
Definition Specifies the billing mode of an EIP. Constraints If sharetype in the bandwidth parameter with an ID specified is set to WHOLE, only pay-per-use EIPs are allowed and parameter prePaid is unavailable. Range
Default Value N/A |
extendparam Field Description for Creating Disks
This field is used by the following APIs:
- Creating ECSs /v1/{project_id}/cloudservers
- Creating ECSs: /v1.1/{project_id}/cloudservers
extendparam Field Description for Creating ECSs
- Creating ECSs /v1/{project_id}/cloudservers
- Creating ECSs: /v1.1/{project_id}/cloudservers
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
chargingMode |
No |
Integer |
Definition Specifies the billing mode. Constraints N/A Range 0: indicates the pay-per-use billing mode. Default Value 0 |
regionID |
No |
String |
Definition Specifies the ID of the region where the ECS resides. Constraints N/A Range N/A Default Value N/A |
support_auto_recovery |
No |
Boolean |
Definition Specifies whether automatic recovery is enabled on the ECS. Constraints This parameter is of boolean type. If a non-boolean character is imported, the parameter value is set to false.
You can query whether "cond:compute": autorecovery is available in the flavor by referring to Querying Details About Flavors and Extended Flavor Information. Range
Default Value N/A |
enterprise_project_id |
No |
String |
Definition Specifies the enterprise project ID.
NOTE:
For more information about enterprise projects and how to obtain enterprise project IDs, see Enterprise Management User Guide. Constraints If this parameter is not specified or is set to 0, resources will be bound to the default enterprise project. Range N/A Default Value N/A |
marketType |
No |
String |
Definition Specifies a spot ECS. When creating a spot ECS, set the parameter value to spot. Constraints This parameter takes effect only when chargingMode is set to 0 and marketType is set to spot. Range N/A Default Value N/A |
spotPrice |
No |
String |
Definition Specifies the highest price per hour you accept for a spot ECS. Constraints
Range N/A Default Value N/A |
diskPrior |
No |
String |
Definition Specifies whether to support the function of creating a disk and then ECS. Constraints N/A Range
Default Value N/A |
spot_duration_hours |
No |
Integer |
Definition Specifies the predefined duration of the spot ECS. Constraints
Range N/A Default Value N/A |
spot_duration_count |
No |
Integer |
Definition Specifies the number of durations. Constraints
Range N/A Default Value N/A |
interruption_policy |
No |
String |
Definition Specifies the spot ECS interruption policy. The parameter can only be set to immediate currently, meaning that the spot ECSs are released immediately. Constraints This parameter must be set to immediate for spot block ECSs. Range N/A Default Value N/A |
CB_CSBS_BACKUP |
No |
String |
Definition Specifies a CSBS policy ID and CSBS vault ID. For example, a CSBS policy ID obtained on the console is fdcaa27d-5be4-4f61-afe3-09ff79162c04. A CSBS vault ID is 332a9408-463f-436a-9e92-78dad95d1ac4. The CB_CSBS_BACKUP value is "{\"policy_id\":\"fdcaa27d-5be4-4f61-afe3-09ff79162c04\",\"vault_id\":\"332a9408-463f-436a-9e92-78dad95d1ac4\"}". Constraints N/A Range N/A Default Value N/A |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
chargingMode |
No |
String |
Definition Specifies the billing mode. Constraints When chargingMode is set to prePaid (indicating that the created ECS is billed in yearly/monthly payments) and the ECS is logged in using an SSH key, op_svc_userid in metadata is mandatory. For details about the value of op_svc_userid in metadata, see Table 11. Range
Default Value postPaid |
regionID |
No |
String |
Definition Specifies the ID of the region where the ECS resides. Constraints N/A Range N/A Default Value N/A |
periodType |
No |
String |
Definition Specifies the subscription period. Constraints This parameter is valid and mandatory if chargingMode is set to prePaid. Range
Default Value N/A |
periodNum |
No |
Integer |
Definition Specifies the number of subscription periods. Constraints
Range
Default Value N/A |
isAutoRenew |
No |
String |
Definition Specifies whether auto renew is enabled. Constraints This parameter is valid when chargingMode is set to prePaid. If this parameter is not specified, auto renew is disabled by default. Range
Constraints N/A |
isAutoPay |
No |
String |
Definition Specifies whether the order is automatically or manually paid. Constraints This parameter is valid when chargingMode is set to prePaid. If this parameter is not specified, the order must be manually paid by default. Range
Default Value N/A |
enterprise_project_id |
No |
String |
Definition Specifies the enterprise project ID. For more information about enterprise projects and how to obtain enterprise project IDs, see Enterprise Management User Guide. Constraints If this parameter is not specified or is set to 0, resources will be bound to the default enterprise project. Range N/A Default Value N/A |
support_auto_recovery |
No |
Boolean |
Definition Specifies whether to enable automatic ECS recovery. Constraints This parameter is of boolean type. If a non-boolean character is imported, the parameter value is set to false. Range
Default Value N/A |
marketType |
No |
String |
Definition Specifies a spot ECS. When creating a spot ECS, set the parameter value to spot. Constraints This parameter takes effect only when chargingMode is set to postPaid and marketType is set to spot. Range N/A Default Value N/A |
spotPrice |
No |
String |
Definition Specifies the highest price per hour you are willing to pay for a spot ECS. Constraints
Range N/A Default Value N/A |
diskPrior |
No |
String |
Definition Specifies whether to support the function of creating a disk and then ECS. Constraints N/A Range
Default Value N/A |
spot_duration_hours |
No |
Integer |
Definition Specifies the predefined duration of the spot ECS. Constraints
Range N/A Default Value N/A |
spot_duration_count |
No |
Integer |
Definition Specifies the number of durations. Constraints
NOTE:
The maximum value of spot_duration_count is automatically set by the system and can be obtained from the cond:spot_block:operation:longest_duration_count field of flavor parameter extra_specs. Range N/A Default Value N/A |
interruption_policy |
No |
String |
Definition Specifies the spot ECS interruption policy. The parameter can only be set to immediate currently, meaning that the spot ECSs are released immediately. Constraints This parameter must be set to immediate for spot block ECSs. Range N/A Default Value N/A |
CB_CSBS_BACKUP |
No |
String |
Definition Specifies a CSBS policy ID and CSBS vault ID. For example, a CSBS policy ID obtained on the console is fdcaa27d-5be4-4f61-afe3-09ff79162c04. A CSBS vault ID is 332a9408-463f-436a-9e92-78dad95d1ac4. The CB_CSBS_BACKUP value is "{\"policy_id\":\"fdcaa27d-5be4-4f61-afe3-09ff79162c04\",\"vault_id\":\"332a9408-463f-436a-9e92-78dad95d1ac4\"}". Constraints N/A Range N/A Default Value N/A |
metadata Field Description for Creating Disks
This field is used by the following APIs:
- Creating ECSs /v1/{project_id}/cloudservers
- Creating ECSs: /v1.1/{project_id}/cloudservers

- When you create an ECS, both root_volume and data_volume contain the metadata field.
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
__system__encrypted |
No |
String |
Definition Specifies the encryption parameter in metadata. Constraints If this parameter does not exist, the disk will not be encrypted by default. Range
Default Value N/A |
__system__cmkid |
No |
String |
Definition Specifies the CMK ID, which indicates encryption in metadata. For details about how to obtain the CMK ID through HTTPS requests, see Querying the Key List. Constraints This parameter must be used with __system__encrypted. Range N/A Default Value N/A |
metadata Field Description for Creating ECSs
This field is used by the following APIs:
- Creating ECSs /v1/{project_id}/cloudservers
- Creating ECSs: /v1.1/{project_id}/cloudservers
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
op_svc_userid |
No |
String |
Definition Specifies the user ID. You can obtain the value of this parameter from IAM User ID on the My Credentials > API Credentials page. For details, see API Credentials.
NOTE:
The value of this parameter is that of IAM User ID of the current login account. If you log in as an IAM user, obtain the IAM user ID of that IAM user. Constraints N/A Range N/A Default Value N/A |
agency_name |
No |
String |
Definition Specifies the IAM agency name. An agency is created by a tenant administrator on Identity and Access Management (IAM) to provide temporary credentials for ECSs to access cloud services. Constraints N/A Range N/A Default Value N/A |
BYOL |
No |
String |
Definition If you have an OS or a software license (a license certified based on the number of physical servers and cores), you can migrate your services to the cloud platform using bring your own license (BYOL) model to continue using your existing licenses. Constraints N/A
Range
Default Value N/A |
os:scheduler_hints Field Description
- Creating ECSs: /v1/{project_id}/cloudservers
- Creating ECSs: /v1.1/{project_id}/cloudservers
- Creating ECSs (native): /v2.1/{project_id}/servers
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
group |
No |
String |
Definition Specifies the ECS group ID in UUID format. Obtain the parameter value from the console or by referring to Querying ECS Groups. Constraints Ensure that the ECS group uses the anti-affinity policy. The anti-affinity policy is not supported for ECSs created on a specified DeH. Range N/A Default Value N/A |
tenancy |
No |
String |
Definition Creates ECSs on a dedicated or shared host. The value of this parameter can be dedicated or shared. Constraints N/A Range The value of this parameter can be dedicated or shared. Default Value N/A |
dedicated_host_id |
No |
String |
Definition Specifies the dedicated host ID. Constraints A DeH ID takes effect only when tenancy is set to dedicated. Range N/A Default Value N/A |
Parameter |
Type |
Description |
---|---|---|
group |
Array of strings |
Definition Specifies the ECS group ID in UUID format. Obtain the parameter value from the console or by referring to Querying ECS Groups Constraints N/A Range N/A Default Value N/A |
tenancy |
Array of strings |
Definition Creates ECSs on a dedicated or shared host. Constraints N/A Range share or dedicate Default Value N/A |
dedicated_host_id |
Array of strings |
Definition Specifies the dedicated host ID. Constraints A DeH ID takes effect only when tenancy is set to dedicated. Range N/A Default Value N/A |
server_tags Field Description
- Creating ECSs: /v1/{project_id}/cloudservers
- Creating ECSs: /v1.1/{project_id}/cloudservers
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
key |
Yes |
String |
Definition Specifies the tag key. Constraints
Range N/A Default Value N/A |
value |
Yes |
String |
Definition Specifies the tag value. Constraints
Range N/A Default Value N/A |
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