This interface is used to create a BMS.
POST /v2.1/{project_id}/servers
Table 1 lists the parameters.
Parameter |
Mandatory |
Description |
---|---|---|
project_id |
Yes |
Specifies the project ID. For how to obtain the project ID, see Obtaining Required Information. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
server |
Yes |
Object |
Specifies the BMS information, see Table 2. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
imageRef |
Yes |
String |
Specifies the ID of the image used by the BMS or the image resource uniform resource locator (URL).
NOTE:
|
flavorRef |
Yes |
String |
Specifies the ID or URL of the flavor used by the BMS. |
name |
Yes |
String |
Specifies the BMS name. It contains a maximum of 255 characters and cannot be left blank. |
metadata |
No |
Object |
Specifies the BMS metadata. The maximum size for both the metadata key and value is 255 characters. For details, see Table 3. |
user_data |
No |
String |
Specifies the user data to be injected during the BMS creation. Text, text files, and .gzip files can be injected. The content to be injected cannot be greater than 32 KB in size. The content to be injected must be encoded with base64. |
adminPass |
No |
String |
Specifies the initial login password of the BMS administrator account. This parameter is invalid for a Linux BMS. The administrator account of a Windows BMS is Administrator. Password complexity requirements:
Note: If this parameter is not specified, a random password will be generated. Special characters: !@$%^-_=+[{}]:,./? |
security_groups |
No |
Array of objects |
Specifies the security group of a BMS. The default value is default. This parameter is valid when you specify parameter network. You are not allowed to specify multiple security groups. For details, see Table 4. |
networks |
Yes |
Array of objects |
Specifies the BMS NICs. For details, see Table 5. You can specify a maximum of four networks for a BMS, including two VXLAN networks and two GENEVE networks. The first network in the parameter must be a VXLAN network. The network is used as by the primary NIC of the BMS. If multiple groups of network parameters are specified, ensure that the parameters of each group belong to the same VPC. |
key_name |
No |
String |
Specifies the name of a key pair. This is an extended attribute. |
availability_zone |
Yes |
String |
Specifies information about the AZ to which the BMS belongs. You are not allowed to specify host information. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
User-defined field key and value pair |
No |
String |
Specifies the key and value pair of the metadata. Each key or value contains a maximum of 255 characters. |
1 | POST https://{ECS Endpoint}/v2.1/bbf1946d374b44a0a2a95533562ba954/servers |
1 2 3 4 5 6 7 8 9 10 11 12 13 | { "server": { "imageRef": "1a6635d8-afea-4f2b-abb6-27a202bad319", "flavorRef": "physical.o2.medium", "name": "bms_name01", "availability_zone": "az-dc-1", "networks": [ { "uuid": "8470310b-bfa2-4edf-8f64-d15196b2b2c9" } ] } } |
Parameter |
Type |
Description |
---|---|---|
server |
Object |
Specifies the BMS information. For details, see Table 6. |
Parameter |
Type |
Description |
---|---|---|
security_groups |
Array of objects |
Specifies information about the BMS security group. For details, see Table 7. |
OS-DCF:diskConfig |
String |
Specifies the disk configuration. The value can be:
|
id |
String |
Specifies the BMS ID. |
links |
Array of objects |
Specifies the shortcut links of the BMS. For details, see Table 8. |
adminPass |
String |
Specifies the initial login password of the BMS administrator account. |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Specifies the name of the security group to which the BMS belongs. |
Parameter |
Type |
Description |
---|---|---|
rel |
String |
Specifies the shortcut link marker name. The value can be:
|
href |
String |
Specifies the corresponding shortcut link. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | { "server": { "security_groups": [ { "name": "default" } ], "OS-DCF:diskConfig": "MANUAL", "links": [ { "rel": "self", "href": "https://openstack.example.com/v2/c685484a8cc2416b97260938705deb65/servers/9ab74d89-61e7-4259-8546-465fdebe4944" }, { "rel": "bookmark", "href": "https://openstack.example.com/c685484a8cc2416b97260938705deb65/servers/9ab74d89-61e7-4259-8546-465fdebe4944" } ], "id": "9ab74d89-61e7-4259-8546-465fdebe4944", "adminPass": "RjdD3h8U2DBe" } } |
Returned Values |
Description |
---|---|
200 |
The request has been successfully processed. |
For details about other returned values, see Status Codes.
See Error Codes.