Creating a BMS (Native OpenStack API)
Function
This interface is used to create a BMS.
Constraints
- This interface cannot be used to create BMSs in batches.
- When you create a BMS using an image that supports Cloud-Init or Cloudbase-Init, only parameter key_name can be configured. (Parameter adminPass is invalid.) The password of a Linux BMS can be injected only using parameter user_data. The password of a Windows BMS can be injected only using metadata admin_pass.
- When you create a BMS using an image that does not support Cloud-Init or Cloudbase-Init, both parameters adminPass and key_name are invalid. You need to use the password or certificate of the image to log in to the BMS.
- File injection is not supported.
- BMS creation from a system volume is not supported.
- Parameter port in the three network parameters (port, uuid, and fixed_ip) has the highest priority. If parameter fixed_ip is set, you must specify the UUID.
- After a BMS is created, it is recommended that you attach the __type_baremetal tag to the BMS. This tag specifies that the created server is a BMS. Otherwise, the BMS may not be displayed in the BMS list on the management console.
- A BMS can have a maximum of two VPCs, in which case the first VPC will be used by the primary NIC.
Request Parameters
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. |
Example Request
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" } ] } } |
Response Parameters
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. |
Example Response
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
Returned Values |
Description |
---|---|
200 |
The request has been successfully processed. |
For details about other returned values, see Status Codes.
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.