El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.

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

Reinstalling a BMS OS

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

Function

This API is used to reinstall the BMS OS. The OS of BMSs supporting quick provisioning can be reinstalled using the original image without any change to the data disks. Password and key pair injection are supported during OS reinstallation.

NOTE:

To check whether a BMS is quickly provisioned, use the Querying Flavor Details and Extended Flavor Information API.

This is an asynchronous API. Calling the API successfully indicates that the task is delivered successfully. To check whether the task is successful, use the Querying Task Statuses API.

Constraints

  • For BMSs created from private images, ensure that Cloud-Init (for Linux) or Cloudbase-Init (for Windows) has been installed for the image. If an image without Cloud-Init or Cloudbase-Init is used, this API cannot inject a key pair or password. Cloud-Init or Cloudbase-Init has been installed for public images by default.
  • You are not allowed to perform other operations when reinstalling the OS. Otherwise, reinstalling the OS will fail.
  • You can reinstall the OS only on a BMS that is stopped or for which OS reinstallation has failed.
  • Windows images do not support password injection. An encrypted password will be used as the value of user_data for Linux images.

URI

POST /v1/{project_id}/baremetalservers/{server_id}/reinstallos

Table 1 lists the parameters.
Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

For details about how to obtain the project ID, see Obtaining a Project ID.

server_id

Yes

Specifies the BMS ID.

You can obtain the BMS ID from the BMS console or by calling the Querying BMSs (Discarded).

Request Parameters

Parameter

Mandatory

Type

Description

os-reinstall

Yes

Object

Specifies the operation of reinstalling the BMS OS. For details, see Table 2.

Table 2 os-reinstall field data structure description

Parameter

Mandatory

Type

Description

adminpass

No

String

Specifies the initial login password of the BMS administrator account.

The Linux administrator is root, and the Windows administrator is Administrator.

Recommended password complexity requirements are as follows:

  • The password contains 8 to 26 characters.
  • Contains 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.
NOTE:
  • For Windows BMSs, the password cannot contain more than two consecutive characters in the username.
  • For Linux BMSs, user_data can be used to inject a password. In this case, adminpass is invalid.
  • Either adminpass or keyname can be set.
  • If both adminpass and keyname are empty, user_data in metadata must be set.

keyname

No

String

Specifies the key pair name.

You can create a key pair using the Creating or Importing an SSH Key Pair (Native OpenStack API) API, or query existing key pairs using the Querying SSH Key Pairs (Native OpenStack API) API.

userid

No

String

Specifies the user ID. You can obtain the user ID from My Credential on the management console.

metadata

No

Object

Specifies the BMS metadata. For details, see Table 3.

Table 3 metadata field data structure description

Parameter

Mandatory

Type

Description

user_data

No

String

Specifies the Linux image root password injected during the BMS OS reinstallation. It is a user-defined initial password.

Note: The password change script must be encoded using Base64.

Recommended password complexity requirements are as follows:

  • Contains 8 to 26 characters.
  • Contains at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters !@$%^-_=+[{}]:,./?
An example is as follows:
1
2
#!/bin/bash 
echo 'root:$6$V6azyeLwcD3CHlpY$BN3VVq18fmCkj66B4zdHLWevqcxlig/GpOkLcOhab9smJoLKYm/Tf9Hcwa6DpiPDhdHfGEAPajFmLZa0YDd910' | chpasswd -e
  • This script must be encoded using Base64.

where, $6$V6azyeLwcD3CHlpY$BN3VVq18fmCkj66B4zdHLWevqcxlig is the ciphertext password, which can be generated as follows:

  1. Generate an encrypted salt value.
    1
    2
    [root@test linux]# python -c "import crypt, getpass, pwd;print crypt.mksalt()" 
    $6$V6azyeLwcD3CHlpY
    
  2. Generate a ciphertext password based on the salt value.
    1
    2
    [root@test linux]# python -c "import crypt, getpass, pwd;print crypt.crypt('Cloud.1234','\$6\$V6azyeLwcD3CHlpY')" 
     $6$V6azyeLwcD3CHlpY$BN3VVq18fmCkj66B4zdHLWevqcxlig/GpOkLcOhab9smJoLKYm/Tf9Hcwa6DpiPDhdHfGEAPajFmLZa0YDd910
    
  3. After the ciphertext is generated, the password change script must be encoded using Base64.

Example Request

Reinstalling the OS of a BMS (ID: cf2a8b97-b5c6-47ef-9714-eb27adf26e5b; key name: KeyPair-350b; user ID: 7e25b1da389f4697a79df3a0e5bd494e)
1
POST https://{BMS Endpoint}/v1/bbf1946d374b44a0a2a95533562ba954/baremetalservers/cf2a8b97-b5c6-47ef-9714-eb27adf26e5b/reinstallos
1
2
3
4
5
6
7
8
9
{
    "os-reinstall": {
        "keyname": "$key_name", 
        "userid": "7e25b1da389f4697a79df3a0e5bd494e", 
        "metadata": {
              "user_data": "$USER_DATA"
        }
    }
}

Response Parameters

Table 4 Normal response

Parameter

Type

Description

job_id

String

Specifies the task ID returned after a task command is issued. The task ID can be used to query the execution status of the task.

For details about how to query the task execution status based on job_id, see Querying Task Statuses.

Table 5 Abnormal response

Parameter

Type

Description

error

Dictionary data structure

Specifies the error returned when a task submission encounters an exception. For details, see Table 6.

Table 6 error data structure

Parameter

Type

Description

message

String

Specifies the error message.

code

String

Specifies the error code.

Example Response

  • Normal response
{ 
    "job_id": "70a599e0-31e7-49b7-b260-868f441e862b" 
} 

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.

Utilizamos cookies para mejorar nuestro sitio y tu experiencia. Al continuar navegando en nuestro sitio, tú aceptas nuestra política de cookies. Descubre más

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback