Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Creating a BMS (Discarded)

Updated on 2024-10-22 GMT+08:00

Function

This API is used to create a BMS.

This API has been discarded. Use the API in Creating BMSs.

Constraints

  • This API cannot be used to create BMSs in a batch.
  • 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.

URI

POST /v2.1/{project_id}/servers

Table 1 lists the parameters.

Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

Request Parameters

Parameter

Mandatory

Type

Description

server

Yes

Object

Specifies the BMS information, see Table 2.

Table 2 server field data structure description

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).

  • Example image ID: 3b8d6fef-af77-42ab-b8b7-5a7f0f0af8f2
  • Example image URL: http://glance.openstack.example.com/images/3b8d6fef-af77-42ab-b8b7-5a7f0f0af8f2
NOTE:
  • BMSs using certain flavors do not support all public images provided by the cloud service platform. To obtain the images supported by a BMS flavor, log in to the management console, view the images displayed on the Create ECS page, and obtain the image IDs on the Image Management Service page.
  • If the creation fails, modify the parameter settings.

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:

  • The password contains 8 to 26 characters.
  • The password must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters (!@$%^-_=+[{}]:,./?).
  • The password cannot contain the username or the username in reverse.
  • The Windows BMS password cannot contain the username, the username in reverse order, or more than two consecutive characters in the username.

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.

Table 3 metadata field data structure description

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.

Table 4 security_groups field data structure description

Parameter

Mandatory

Type

Description

name

Yes

String

Specifies the name of the security group to which the BMS belongs.

Table 5 networks field data structure description

Parameter

Mandatory

Type

Description

port

No

String

Specifies the UUID of the network port.

uuid

No

String

Specifies the network UUID.

fixed_ip

No

String

Specifies the fixed IP address.

Example Request

Creating a BMS (ID: 1a6635d8-afea-4f2b-abb6-27a202bad319; flavor: physical.o2.medium; name: bms_name01; AZ: az-dc-1; network UUID: 8470310b-bfa2-4edf-8f64-d15196b2b2c9)
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.

Table 6 server field data structure description

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:

  • MANUAL: The API uses the partitioning scheme in the image and the file system to create a BMS. If the target flavor has a large disk, the API does not partition the remaining disk space.
  • AUTO: The API uses a single partition with the same size as the disk of the target flavor to create a BMS. The API automatically adjusts the file system to adapt to the entire partition.

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.

Table 7 security_groups field data structure description

Parameter

Type

Description

name

String

Specifies the name of the security group to which the BMS belongs.

Table 8 links field data structure description

Parameter

Type

Description

rel

String

Specifies the shortcut link marker name. The value can be:

  • self: resource link that contains the version number. It is used when immediate tracing is required.
  • bookmark: resource link that can be stored for a long time.

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

Normal 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.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback