Create instance
Prerequisites
Creating an instance requires real-name certification. Users who have not completed real-name certification can proceed to the Personal Certification or Enterprise Certification sections under Security Certification in the Baidu AI Cloud’s console for certification.
BCC instances
-
Notes for billing:
- To create a postpaid instance, the account's cash balance combined with general coupons must exceed 100. For prepaid instances, the account's cash balance must at least match the cost of the instance.
- Specify the public IP bandwidth during creation, with charges based on the selected bandwidth.
-
Notes for instances:
- Specify the type of virtual machine (VM) to be created through the instanceType field. For the VM types currently supported by the creation API, refer to [InstanceType](BCC/API Reference/Appendix.md#InstanceType). Parameters
instanceType,cpuCountandmemoryCapacityInGBcan determine the required machine type and configuration. - A single instance cannot simultaneously include both GPU and FPGA cards. When purchasing an instance with GPU or FPGA cards, specify the number of these cards to be included via the cardCount field.
- When purchasing VMs with GPU or FPGA cards, depending on the count and type of GPU or FPGA cards, CPU core count (cpuCount), memory size (memoryCapacityInGB), system disk type and size (ephemeralDisks) required in the request shall be empty or meet the requirements specified in [Optional Specification Configuration for GPU BCC](BCC/API Reference/Appendix.md#GPU-purpose BCC Optional Specification Configuration) or [Optional Specification Configuration for FPGA BCC](BCC/API Reference/Appendix.md#FPGA-purpose BCC Optional Specification Configuration).
- Specify the type of virtual machine (VM) to be created through the instanceType field. For the VM types currently supported by the creation API, refer to [InstanceType](BCC/API Reference/Appendix.md#InstanceType). Parameters
-
Notes for storage:
- When creating an instance, you can specify the system disk size. For Linux systems, the purchase capacity range for the system disk is [20 to 500] GB; for Windows systems, it is [40 to 500] GB. For information on specifying the system disk type, refer to [StorageType](BCC/API Reference/Appendix.md#StorageType).
- The system disk added during instance creation allows online changes to its disk type after creation.
- The system disk cannot be attached, detached, or deleted and fully aligns with the lifecycle of the BCC.
- When creating CDS system disks and data disks, disk sizes can be chosen in 1 GB increments.
- By default, an instance can support a maximum of five attached cloud disk servers. To attach additional data disks, please submit a ticket to get in touch with us.
- The system disk of a BCC instance cannot exceed 500 GB in size.
- When creating a storage-optimized instance, a temporary data disk is mandatory. Specify the size of the temporary data disk through the ephemeralDisks field; the default is an NVMe-type data disk, and no value needs to be provided.
-
Notes for network:
- BCC instances support user-defined security groups and subnets, both of which must be specified within the same VPC. If no security group or subnet is provided, the instance will automatically join the system's default security group and subnet when creating a dedicated instance.
-
Other notes:
- Batch creation is supported. If any instance fails during batch creation, all instances will be rolled back, resulting in no successful creations. If CDS is included in the creation, it will also be rolled back.
- The creation API is asynchronous. Instance status can be queried using the [Query Specified Instance Details](BCC/API Reference/Instance Related Interfaces/Query the details of a specified instance.md) API.
- This API enables you to designate a dedicated server for instance creation. Dedicated instances are not charged. These instances allow only the creation of temporary disks and the specification of disk types through ephemeralDisks.
DCC dedicated instances
This API is also used to create instances on dedicated servers. When creating DCC dedicated instances, the following operations may be relevant to your business:
- Dedicated instances do not incur any charges.
- This API facilitates the creation of one or multiple dedicated instances.
- Batch creation is supported. If a dedicated instance creation fails during the process, all instances will be rolled back, resulting in the cancellation of the entire creation. If CDS is included during the process, it will likewise be rolled back.
- Dedicated instances support the creation and addition of local disks.
- Local disks do not support attaching, detaching, or deletion actions.
- DCC enables users to customize parameters such as CPU and memory for dedicated instances. The resources used by these created instances will utilize DCC's resources.
- Dedicated instances allow only the creation of temporary disks and the specification of disk types through ephemeralDisks.
- Dedicated instances support user-defined security groups and subnets, which must be specified within the same VPC. If neither is specified, the system will automatically assign the instance to the default security group and subnet when a dedicated instance is created.
Request structure
1POST /v{version}/instance?clientToken={clientToken} HTTP/1.1
2Host: bcc.bj.baidubce.com
3Authorization: authorization string
4
5{
6 "instanceType": "instanceType",
7 "cpuCount": cpuCoreCount,
8 "memoryCapacityInGB": memoryCapacityInGB,
9 "rootDiskSizeInGb":rootDiskSizeInGb,
10 "rootDiskStorageType":"rootDiskStorageType",
11 "aspId":"aspId",
12 "specId": "specId",
13 "deletionProtection": deletionProtection,
14 "ephemeralDisks": [
15 {
16 "storageType": "storageType",
17 "sizeInGB": size
18 },
19 {
20 "storageType": "storageType",
21 "sizeInGB": size
22 }
23 ],
24 "createCdsList": [
25 {
26 "storageType": "storageType",
27 "cdsSizeInGB": cdsSizeInGB,
28 "snapshotId": "snapshotId",
29 "encryptKey": "encryptKey"
30 }
31 ],
32 "name": "name",
33 "hostname": "hostname",
34 "adminPass": "adminPass",
35 "autoSeqSuffix": autoSeqSuffix,
36 "isOpenHostnameDomain": isOpenHostnameDomain,
37 "imageId": "imageId",
38 "localDiskSizeInGB": localDiskSizeInGB,
39 "networkCapacityInMbps": networkCapacityInMbps,
40 "eipName": "eipName",
41 "autoRenewTimeUnit": "autoRenewTimeUnit",
42 "autoRenewTime": autoRenewTime,
43 "cdsAutoRenew": cdsAutoRenew,
44 "purchaseCount": purchaseCount,
45 "billing":{
46 "paymentTiming": "paymentTiming",
47 "reservation": {
48 "reservationLength": reservationLength
49 }
50 },
51 "zoneName": "zoneName",
52 "subnetId": "subnetId",
53 "securityGroupId": "securityGroupId",
54 "enterpriseSecurityGroupId": "enterpriseSecurityGroupId",
55 "relationTag": relationTag,
56 "isOpenIpv6": isOpenIpv6,
57 "tags": [
58 {
59 "tagKey": "tagKey",
60 "tagValue": "tagValue"
61 }
62 ],
63 "userData": "userData",
64 "keypairId": "keypairId",
65 "resGroupId": "resGroupId"
66 "cpuThreadConfig": "2"
67 "numaConfig": "1"
68}
Request headers
There are no special headers required beyond the common headers.
Request parameters
| Parameter name | Type | Required or not | Parameter location | Description |
|---|---|---|---|---|
| version | String | Yes | URL parameter | API version number. |
| clientToken | String | Yes | Query | [Idempotence](BCC/API Reference/General Description.md) Token, an ASCII string with a length not exceeding 64 bits. |
| imageId | String | Yes | RequestBody | The image ID for the virtual machine instance to be created. You can select and obtain the required image ID by calling the Query Image List API. |
| billing | [Billing](BCC/API Reference/Appendix.md#Billing) | Yes | RequestBody | Order and billing-related parameters |
| instanceType | String | No | RequestBody | Type of virtual machine instance to be created. For specific options, refer to [InstanceType](BCC/API Reference/Appendix.md#InstanceType) below. If empty, the default virtual machine type will be used |
| cpuCount | int | Yes | RequestBody | The count of CPU cores for the VM instance to be created |
| memoryCapacityInGB | int | Yes | RequestBody | Memory capacity for virtual machine instance to be created, in GB. Refer to [Regional Machine Types and Optional Configurations ](BCC/API Reference/Appendix.md#Regional models and optional configurations) for optional configurations. |
| rootDiskSizeInGb | int | No | RequestBody | The size of the system disk for the VM instance to be created, in GB. The default is 40 GB. For Linux systems, the purchase capacity range for the system disk is [20 to 500] GB; for Windows systems, it is [40 to 500] GB. Note that the specified system disk size must meet the minimum disk space requirements of the image being used. |
| rootDiskStorageType | String | No | RequestBody | Medium of the system disk for the virtual machine instance to be created. By default, an hp1 cloud disk server is used. The disk type for the system disk can be specified; refer to [StorageType](BCC/API Reference/Appendix.md#StorageType). |
| localDiskSizeInGB | int | No | RequestBody | [Deprecated] The size of the temporary data disk (excluding the system disk, which is provided free of charge) for the VM instance to be created, in GB, ranging from 0 to 500G. Please use the ephemeralDisks field. |
| ephemeralDisks | List<[EphemeralDisk](BCC/API Reference/Appendix.md#EphemeralDisk)> | No | RequestBody | DCC instances can create multiple local disks, requiring specifying the disk type and size. Other types of BCC instances can use at most one local disk, using the default disk type and requiring specifying the disk size. FPGA and GPU instances default to using one local disk, with the local disk size specified according to the configuration. For details, refer to [GPU BCC Optional Specification Configurations](BCC/API Reference/Appendix.md#GPU-purpose BCC Optional Specification Configuration) and [FPGA BCC Optional Specification Configurations ](BCC/API Reference/Appendix.md#FPGA-purpose BCC Optional Specification Configuration). |
| createCdsList | List<[CreateCdsModel](BCC/API Reference/Appendix.md#CreateCdsModel)> | No | RequestBody | List of CDS disks to be created. For specific data formats, refer to [CreateCdsModel](BCC/API Reference/Appendix.md#CreateCdsModel) below |
| networkCapacityInMbps | int | No | RequestBody | Public network bandwidth, in Mbps. It must be an integer between 0 and 200. 0 indicates that no public IP will be assigned, defaulting to 0 Mbps. |
| networkPurchaseType | String | No | RequestBody | The EIP line type includes standard BGP (BGP) and enhanced BGP (BGP_S). If unspecified, it defaults to standard BGP. |
| eipName | String | No | RequestBody | Name Specifications: Length: 1–65 bytes, must start with a letter. Permitted characters include letters, numbers, and -_/. If no name is specified, one will be automatically generated. |
| purchaseCount | int | No | RequestBody | Count of virtual machine instances to be created (purchased) in batch, which must be an integer greater than 0 (optional). The default is 1. If the value is set to more than 2, it represents the creation of 2 or more VM instances with the same configuration. |
| name | String | No | RequestBody | Name of the virtual machine (optional) By default, no name is specified. If a name is specified: For batch creation, the name serves as a prefix. The backend will append a suffix, generated as follows: name{-sequence number}. If no name is specified, it will be automatically generated as follows: {instance-eight-digit random string-sequence number}. Note: The random string is generated from 0~9a~z; the sequence number increments according to the magnitude of the count. If the count is 100, the sequence number increments from 000~100; if the count is 10, it increments from 00~10. Support uppercase and lowercase letters, numbers, Chinese characters, and -_ / special characters, starting with a letter and a length of 1-65. |
| hostname | String | No | RequestBody | Hostname of the virtual machine (optional). By default, no hostname is specified. If a hostname is specified: For batch creation, the hostname serves as a prefix. The backend will append a suffix, generated as follows: name{-sequence number}. If no name is specified, it will be automatically generated as follows: {instance-eight-digit random string-sequence number}. Note: The random string is generated from 0~9a~z; the sequence number increments according to the magnitude of the count. If the count is 100, the sequence number increments from 000~100; if the count is 10, it increments from 00~10. Only support lowercase letters, numbers and -_/special characters, starting with a letter and a length of 2-64. Not contain consecutive special characters and not start or end with a special character. |
| autoSeqSuffix | boolean | No | RequestBody | Whether to automatically generate ordered suffixes for name and hostname (optional). Yes: true No: false |
| isOpenHostnameDomain | boolean | No | RequestBody | Whether to automatically generate the hostname domain (optional) Yes: true No: false |
| adminPass | String | No | RequestBody | Instance administrator password to be specified: 8-16 characters; it must contain English letters, numbers, and symbols (limited to !@#$%^*()) simultaneously |
| zoneName | String | No | RequestBody | Specify zone information. By default, it is empty and automatically selected by the system. The list of availability zones can be queried by calling the [ Query Availability Zone List ](BCC/API Reference/Other APIs/Query list of availability zones.md) API. zoneName supports lowercase "country-region-availability zone sequence", such as "cn-bj-a" for Beijing availability zone A. Dedicated instances use the zone where the dedicated server is located, so this field does not need to be specified. |
| subnetId | String | No | RequestBody | Specify the subnet. If empty, the default subnet will be used |
| relationTag | boolean | No | RequestBody | Instance Tag Association: Specify whether the tag for the instance must be linked to an existing tag key (default: false). Note: If set to true, ensure the tag key already exists. |
| isOpenIpv6 | boolean | No | RequestBody | Whether to enable IPv6 for the instance to be created. IPv6 can only be enabled if both the image and subnet support it. True indicates enable, false indicates disable, and not specifying the parameter indicates automatic adaptation to the IPv6 support status of the image and subnet |
| tags | List<[TagModel](BCC/API Reference/Appendix.md#TagModel)> | No | RequestBody | List of tags to be created. For the specific data format, refer to the following [TagModel](BCC/API Reference/Appendix.md#TagModel) |
| securityGroupId | String | No | RequestBody | Specify the security group. If empty, the default security group will be used |
| securityGroupIds | No | RequestBody | Specify the list of security groups | |
| enterpriseSecurityGroupId | String | No | RequestBody | Specify enterprise security group |
| enterpriseSecurityGroupIds | No | RequestBody | Specify the list of enterprise security groups | |
| gpuCard | String | No | RequestBody | Information on the GPU card(s) to be included in the instance to be created. For options, refer to [GpuType](BCC/API Reference/Appendix.md#GpuType). This field is not required for non-GPU instances |
| kunlunCard | String | No | RequestBody | Information about Kunlun cards to be carried by the instance to be created. For options, refer to XX. This field does not need to be specified for non-NPU instances |
| isomerismCard | String | No | RequestBody | Information about heterogeneous cards to be carried by the instance to be created. For options, refer to the relevant document. This field does not need to be specified for non-GPU instances |
| fpgaCard | String | No | RequestBody | Information on the FPGA card(s) to be included in the instance to be created. For options, refer to [FpgaType](BCC/API Reference/Appendix.md#FpgaType). This field is not required for non-FPGA instances |
| cardCount | String | No | RequestBody | The count of GPU or FPGA cards to be included in the instance to be created. This is only valid when the gpuCard or fpgaCard field is not empty and must meet the requirements specified in [Optional Specification Configuration for GPU Instances](BCC/API Reference/Appendix.md#GPU-purpose BCC Optional Specification Configuration) or [Optional Specification Configuration for FPGA Instances](BCC/API Reference/Appendix.md#FPGA-purpose BCC Optional Specification Configuration) |
| autoRenewTimeUnit | String | No | RequestBody | Monthly or yearly payment. "month" for monthly, "year" for yearly |
| autoRenewTime | int | No | RequestBody | Auto-renewal period: 1-9 for monthly renewal, 1-5 for yearly renewal. Only 1-3 are supported for some packages |
| cdsAutoRenew | boolean | No | RequestBody | Whether CDS automatic renewal is enabled. Yes: true No: false |
| keypairId | String | No | RequestBody | ID of the key pair to be bound to the instance to be created |
| aspId | String | No | RequestBody | Automatic snapshot policy ID |
| internetChargeType | String | No | RequestBody | Charge type for public network bandwidth. Optional parameters are detailed in [internetChargeType](BCC/API Reference/Appendix.md#InternetChargeType). If internetChargeType is not specified, the default bill type is the same as that for BCC instances: prepay instances default to subscription bandwidth billing, while postpaid instances default to billing based on actual bandwidth use. |
| dedicatedHostId | String | No | RequestBody | The ID of the dedicated server, required when specifying the placement of the virtual machine. |
| deployId | String | No | RequestBody | Specify IDs of deployment groups where the instance is located |
| deployIdList | No | RequestBody | Specify the list of IDs of deployment groups where the instance is located | |
| userData | String | No | RequestBody | User Data Specifications: If compliant with instance limitations, encode UserData in Base64 before specifying it. As UserData is not encrypted during API transmission, avoid including sensitive information (e.g., passwords, private keys) in plaintext. If necessary, encrypt the data for secure decryption within the instance. |
| specId | String | No | RequestBody | Instance family |
| deletionProtection | int | No | RequestBody | Instance deletion protection: 0 (default) for disabled, 1 for enabled. When enabled, manual release of the virtual machine is prohibited |
| internalIps | List | No | RequestBody | List of intranet IPs |
| isOpenHostEye | Boolean | No | RequestBody | Whether to enable host security: true for "enabled", false for "disabled". It defaults to "enabled" if it is not specified |
| hosteyeType | String | No | RequestBody | Host security type; take effect when isOpenHostEye is true: "enterprise" indicates enterprise-level host security is enabled; "open" or "not specified" indicates basic host security is enabled |
| resGroupId | String | No | RequestBody | Specify the resource group ID to which the instance is to be bound |
| fileSystems | List<[FileSystemModel](BCC/API Reference/Appendix.md#FileSystemModel)> | No | RequestBody | Specify a list of CFS file systems to be mounted by the instance |
| disableRootDiskSerial | Boolean | No | RequestBody | Whether to hide the SN information of the system disk CDS during instance creation. True: hide, False: do not hide. If not specified, the default is not to hide |
| cpuThreadConfig | String | No | RequestBody | Adjust the count of threads per physical core (vCPU), essentially corresponding to whether the hyper-threading capability of each processor is enabled. Value range: 1, 2 Note: 1. By default, it is default to 2 for Baidu AI Cloud’s instances. 2. Only EBC instance with Intel 7th generation or above and AMD 3rd generation or above supports setting the CPU thread count. |
| numaConfig | String | No | RequestBody | Adjust the NUMA configuration of the CPU, with different meanings for values depending on the processor platform. 1. Intel platform: 0 represents disabling NUMA features, 1 represents enabling NUMA features. 2. AMD platform: mainly affect the NPS (Nodes Per Socket) configuration; possible values are 0, 1, 2, 4, auto, corresponding to NPS0, NPS1, NPS2, NPS4 and automatic, respectively. Note: 1. By default, Baidu AI Cloud’s instances are configured with NUMA optimization enabled (Intel instances) or NPS1 (AMD instances), i.e., a default of 1. 2. Only EBC instance with Intel 7th generation or above and AMD 3rd generation or above supports setting NUMA options. |
Response headers
No special headers are required beyond the standard ones.
Response parameters
| Parameter name | Types | Description |
|---|---|---|
| instanceIds | Virtual machine instance IDs must adhere to BCE specifications, consisting of a fixed-length string that permits uppercase and lowercase letters, numbers, hyphens (-), and underscores (_). | |
| warningList | Warning information generated during virtual machine creation |
Error codes
| Error code | Error description | HTTP status code | Chinese explanation |
|---|---|---|---|
| Instance.InvalidateRootDiskStorageType | Invalidate root disk storage type. | 400 | Invalid system disk medium |
| Instance.InstanceBeBanned | The instance is banned, contact technical support for assistance. | 403 | The BCC service has been banned |
| Instance.GlobalInstanceQuotaLimitExceeded | Quota exceeds limit for regional postpaid instances pool, contact technical support for further assistance. | 413 | The count of postpaid virtual machines exceeds the pre-sale quota limit for the current region |
| Instance.InstanceQuotaLimitExceeded | Quota exceeds limit. | 413 | The count of instances exceeds the limit |
| Instance.EipQuotaLimitExceeded | The number of eip will exceed the limit. | 413 | The count of EIPs exceeds the limit during purchase |
| Instance.InvalidateConfiguration | Invalidate cpu memory configuration. | 400 | Invalid virtual machine configuration |
| Instance.InsufficientRootDiskSize | Not enough root disk size. | 400 | The image used is too large, and the system disk size is insufficient |
| Instance.PermissionDeny | Instance permission deny. | 401 | No permission |
| RealNameQualify | No real name authentication. | 409 | Operation is not allowed; real-name certification is not completed |
| Instance.RegionDenyException | You're not allowed to access this region. | 403 | Exception in region access denial |
| BadRequest | cds config error. | 400 | Incorrect CDS configuration |
| Instance.InstanceCountCdsCountNotMatchException | Cds count must be multiple number of Instance count. | 400 | The count of virtual machines created does not match the count of CDS disks |
| Instance.InvalidateZoneException | Invalidate zone name. | 400 | Invalid availability zone |
| Instance.NotSupportInstanceTypeException | not support the instance type. | 403 | This machine type is not supported. |
| BadRequest | Not support serviceType. | 400 | This service type is not supported |
| BadRequest | invalid deploy id. | 400 | Invalid deployment group ID |
| BadRequest | invalid cds count. | 400 | The count of CDS disks should be an integer multiple of the count of BCC disks |
| BadRequest | Can not create Bcc both with gpuCard and fpgaCard. | 400 | Both GPU and FPGA types of BCCs simultaneously cannot be created |
| Instance.InvalidateGpuCardException | GpuCard is invalid. | 400 | The selected GPU card does not exist |
| Instance.InvalidateFpgaCardException | FpgaCard is invalid. | 400 | The selected FPGA card does not exist |
| Instance.MKTImageInstanceNotSupportCreateSnapshotException | Instance with mkt image not support create system snapshot. | 403 | Market images do not support creating system snapshots |
| Instance.CdsSnapshotNotMatchException | No cds for snapshot. | 400 | To be determined. There is no CDS available for snapshots |
| Instance.CdsSnapshotSmallException | Cds for snapshot is smaller than snapshot. | 400 | To be determined. CDS is smaller than the snapshot |
| Instance.InvalidAutoRenewTimeException | Instance autoRenew time is invalid. | 400 | Invalid automatic renewal period. |
| Instance.InvalidAutoRenewTimeUnitException | Instance autoRenew time unit is invalid. | 400 | Invalid automatic renewal unit |
| BadRequest | instanceType invalidate. | 400 | Invalid instance type |
| Instance.InstanceCountCdsCountNotMatchException | Cds count must be multiple number of Instance count | 400 | The count of virtual machines created does not match the count of CDS disks |
| Instance.NoStock | Sales of this resource are temporarily suspended in the specified region. | 403 | Resources are sold out |
| BadRequest | Invalidate root disk size. | 400 | Invalid system disk size |
| BadRequest | Gpu card count not valid. | 400 | Invalid count of GPUs |
| Instance.NameInvalid | Instance name is invalid. | 400 | Invalid instance name |
| Instance.PasswordInvalid | Password format is invalid. | 400 | Invalid password format |
| Keypair.UnsupportOsType | Unsupported os type, only linux supported. | 403 | Unsupported OS |
| NoSuchObject | asp not exist. | 404 | asp does not exist |
| BadRequest | bccCreateWithScript invalid. | 400 | Invalid parameters for BCC creation using the script address specified in the allow list |
| Volume.DiskSizeInvalid | Disk size in invalid. | 400 | Invalid CDS size |
| Volume.StorageTypeInvalid | Storage type is invalid. | 400 | Incorrect disk storage class |
| Image.ImageTypeInvaild | image type invalid. | 400 | Invalid image type |
| BadRequest | invalid bcc flavor config. | 400 | Invalid BCC package |
| Instance.ReleaseTimeInvalid | Fail to update the instance scheduled release time settings. | 400 | Invalid parameters for updating scheduled release |
| Instance.UserDataPermissionDeny | No permission for user data. | 403 | No user data permissions |
| Image.ImageArchTypeExceptions | Image Arch Type illegal. | 400 | The image architecture does not match the instance machine type: ARM machine types can only use ARM architecture images, and x86 machine types cannot use ARM architecture images |
| Volume.DiskQuotaExceededLimit | Number of volumes exceeds limit. | 413 | CDS disk quota exceeded |
| Instance.TagQuotaLimitExceeded | Quota exceeds limit. | 413 | The count of tags exceeds the limit |
| Cds.KmsNotExistException | Kms not exist. | 400 | KMS does not exist |
| Cds.KmsInvalidException | Invalid Kms. | 400 | Invalid KMS |
| Zone denyAccess | zone limit exception. | 403 | Abnormal availability zone restrictions |
| BadRequest | subnetId and securityGroupId should be added | 400 | SubnetId and securityGroupId shall be included. |
| BadRequest | BCC with NAT subnet can not bind eip | 400 | BCCs with NAT subnets cannot be bound to EIPs |
| BadRequest | The subnet is not belong to the logical zone. | 400 | The subnet does not belong to this logical availability zone |
| Vpc.IpInSubnetNotEnoughExceptions | The ip left in the subnet is not enouth for this create. | 400 | Insufficient remaining IPs in the subnet for creation |
| Volume.DiskSizeQuotaExceededLimit | Volume size exceeds total capacity quota. | 413 | CDS disk size quota exceeded |
| Cds.KmsNotMatchException | Kms not match with snapshot encryptKey. | 400 | KMS does not match the snapshot decryption key |
| Instance.PostPayEipPurchaseDenied | Need to pass senior real-name authentication. please download baiducloud App to do face authentication. | 403 | Advanced real-name verification is required. Please download the Baidu Cloud application for facial recognition verification. |
| BadRequest | invalidate bandwidth parameter. | 400 | Invalid bandwidth parameters |
| Instance.EipOperationDenied | Account has no permission to bind EIP. | 403 | EIP purchase and binding are not supported |
| PrepayInvalid | Prepay not support for this instanceType. | 400 | Prepay is not supported |
| Dcc.ResourceNotExist | Dcc Resource not exist. | 400 | DCC resource does not exist |
| BadRequest | validateSubnetSecurityGroupInSameVpc error. | 400 | Failed to verify that the subnet and security group belong to the same VPC |
| BadRequest | securityGroup and subnet must be in same vpc | 400 | The security group and subnet must belong to the same VPC |
| Dcc.FlavorIllegal | unknown dcc flavor. | 400 | Unknown DCC flavor |
| Instance.EphemeralDiskInvalidException | instance ephemeral disk config invalid. | 400 | Invalid temporary disk configuration for the instance |
| BadRequest | invalid create request, instanceForCreate is not specified. | 400 | Invalid creation request. InstanceForCreate must be specified |
Request example for BCC instance creation
1POST /v2/instance?clientToken=be31b98c-5e41-4838-9830-9be700de5a20 HTTP/1.1
2Host: bcc.bj.baidubce.com
3ContentType: application/json
4Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
5
6{
7 "instanceType": "N1",
8 "cpuCount": 2,
9 "memoryCapacityInGB": 2,
10 "rootDiskSizeInGb":45,
11 "rootDiskStorageType":"cloud_hp1",
12 "createCdsList": [
13 {
14 "storageType": "std1",
15 "cdsSizeInGB": 5
16 }
17 ],
18 "name": "example",
19 "imageId": "m-mRjO3cjs",
20 "localDiskSizeInGB": 5,
21 "networkCapacityInMbps": 1,
22 "autoRenewTimeUnit": "month",
23 "autoRenewTime": 1,
24 "cdsAutoRenew": true,
25 "internetChargeType": "BANDWIDTH_POSTPAID_BY_HOUR",
26 "purchaseCount": 1,
27 "billing":{
28 "paymentTiming":"Prepaid",
29 "reservation": {
30 "reservationLength": 1
31 }
32 },
33 "relationTag": true,
34 "tags": [
35 {
36 "tagKey":"tag1",
37 "tagValue":"var1"
38 }
39 ],
40 "keypairId":"k-R0J0BEA9",
41 "deployIdList":["dset-42N1llvY"],
42 "cpuThreadConfig": "2",
43 "numaConfig": "1"
44}
Response example
1HTTP/1.1 200 OK
2x-bce-request-id: 1214cca7-4ad5-451d-9215-71cb844c0a50
3Date: Wed, 03 Dec 2014 06:42:19 GMT
4Content-Type: application/json;charset=UTF-8
5Server: BWS
6
7{
8
9 "instanceIds": [
10 "i-T1I3OtUO"
11 ],
12 "warningList": [
13 "warning info"
14 ]
15}
Request example (GPU instance creation)
1POST /v2/instance?clientToken=be31b98c-5e41-4838-9830-9be700de5a20 HTTP/1.1
2Host: bcc.bj.baidubce.com
3ContentType: application/json
4Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
5
6{
7 "instanceType": "G1",
8 "gpuCard": "P4",
9 "cardCount": 2,
10 "cpuCount": 24,
11 "memoryCapacityInGB": 80,
12 "createCdsList": [
13 {
14 "storageType": "std1",
15 "cdsSizeInGB": 5
16 }
17 ],
18 "name": "example",
19 "imageId": "m-Rx1dCMFF",
20 "networkCapacityInMbps": 0,
21 "purchaseCount": 1,
22 "billing": {
23 "paymentTiming": "Prepaid",
24 "reservation": {
25 "reservationLength": 1
26 }
27 }
28}
Response example
1HTTP/1.1 200 OK
2x-bce-request-id: 1214cca7-4ad5-451d-9215-71cb844c0a50
3Date: Wed, 03 Dec 2014 06:42:19 GMT
4Content-Type: application/json;charset=UTF-8
5Server: BWS
6
7{
8 "instanceIds": [
9 "i-T1I3OtUO"
10 ]
11}
Request example for dedicated instance creation
1POST /v2/instance?clientToken=be31b98c-5e41-4838-9830-9be700de5a20 HTTP/1.1
2Host: bcc.bj.baidubce.com
3ContentType: application/json
4Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
5
6{
7 "cpuCount": 1,
8 "memoryCapacityInGB": 2,
9 "ephemeralDisks": [
10 {
11 "storageType": "sata",
12 "sizeInGB": 1024
13 },
14 {
15 "storageType": "sata",
16 "sizeInGB": 1024
17 }
18 ],
19 "name": "example",
20 "imageId": "m-mRjO3cjs",
21 "networkCapacityInMbps": 0,
22 "purchaseCount": 1
23}
Response example
1HTTP/1.1 200 OK
2x-bce-request-id: 1214cca7-4ad5-451d-9215-71cb844c0a50
3Date: Tue, 06 Sep 2016 10:08:44 GMT
4Content-Type: application/json;charset=UTF-8
5Server: BWS
6
7{
8 "instanceIds": [
9 "i-T1I3OtUO"
10 ],
11 "warningList": [
12 "warning info"
13 ]
14}
