Installation method of server operating system, server management system, storage medium and electronic device
By automatically detecting the CPU architecture and generating installation scripts through the server management system, the problem of low installation efficiency of operating systems on servers with different CPU architectures is solved, and efficient and accurate operating system configuration is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SONGSHAN LAB
- Filing Date
- 2025-03-12
- Publication Date
- 2026-04-14
AI Technical Summary
In existing technologies, when installing operating systems for servers with different CPU architectures, the installation efficiency is low and manual installation is prone to errors.
The server management system automatically detects the server's central processing unit architecture type, selects the corresponding installation package from the preset operating system installation packages, and generates an installation script to achieve automated operating system configuration.
It improves the installation efficiency and configuration accuracy of server operating systems, reduces operation and maintenance costs, and enhances installation flexibility.
Smart Images

Figure CN120215966B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of server operating system management, and more specifically, to a method for installing a server operating system, a server management system, a storage medium, and an electronic device. Background Technology
[0002] Currently, with the rapid development of information technology, server applications are becoming increasingly widespread, and the performance and functional requirements for servers are also increasing. In practical applications, different types of operating systems need to be installed depending on the CPU architecture.
[0003] In related technologies, most existing server operating systems rely on manual installation, such as using the server's built-in BMC (Baseboard Management Controller) interface or installing via USB flash drive. This method is inefficient and prone to errors. Although there are non-manual installation methods, these methods can only install operating systems in batches on servers with specific CPU architectures such as x86, and can only use the same installation script for batch installation. When installing operating systems on servers with different CPU architectures, manual installation is still required, resulting in low installation efficiency.
[0004] There is still no effective solution to the technical problem of low operating system installation efficiency when dealing with servers with different CPU architectures. Summary of the Invention
[0005] This application provides a method for installing a server operating system, a server management system, a storage medium, and an electronic device to at least solve the technical problem of low installation efficiency of server operating systems when facing servers with different CPU architectures in the related art.
[0006] According to one embodiment of this application, a method for installing a server operating system is provided, comprising: selecting an operating system installation package from a preset operating system installation package that corresponds to the CPU architecture type of the server to be installed; installing the operating system installation package on the server to be installed, wherein the CPU architecture type is detected by a CPU architecture detection module of the server management system; and the operating system installation package includes at least the metadata required for installing the operating system; obtaining a configuration file obtained by parsing configuration instructions for a target object; generating an installation script using configuration parameters in the configuration file; wherein the configuration instructions are received through a central management interface of the server management system; and executing the installation task of the installation script to configure the operating system installed on the server to be installed.
[0007] In an exemplary embodiment, before selecting an operating system installation package from preset operating system installation packages that corresponds to the CPU architecture type of the server to be installed, the method further includes: using the CPU architecture detection module to parse the interface information of the out-of-band management interface of the server to be installed to obtain the CPU architecture type of the server to be installed; or, using the CPU architecture detection module to parse the request message of the server to be installed requesting network booting to obtain the architecture type field and physical address, and determining the CPU architecture type of the server to be installed based on the architecture type field and the physical address.
[0008] In one exemplary embodiment, the server management system further includes an operating system installation module, which selects an operating system installation package from a preset operating system installation package that corresponds to the CPU architecture type of the server to be installed. This includes: querying the system versions of different operating system installation packages in the preset operating system installation package through the operating system installation module, and selecting an operating system installation package whose system version matches the CPU architecture type from the different operating system installation packages; and / or, querying the installation priorities of different operating system installation packages in the preset operating system installation package through the operating system installation module, and selecting the operating system installation package with the highest installation priority from the different operating system installation packages, wherein the installation priority is determined based on the operating system release version.
[0009] In one exemplary embodiment, installing the operating system installation package on the server to be installed includes at least one of the following: installing the operating system installation package on the server to be installed via a diskless installation method when the server to be installed is network-booted; installing the operating system installation package on the server to be installed using the configuration file of the server to be installed; or installing the operating system installation package on the server to be installed using the configuration management tool of the server to be installed.
[0010] In one exemplary embodiment, the server management system further includes a script management module, which generates an installation script using configuration parameters in the configuration file. This includes: parsing the configuration file through the script management module to obtain the configuration requirement type of the server to be installed; selecting an initial script template corresponding to the configuration requirement type from the script template library of the script management module; replacing the initial parameters of the initial script template with the configuration parameters to obtain an intermediate script template; and modifying the template parameters of the intermediate script template according to the custom parameters of the configuration instructions to generate the installation script.
[0011] In one exemplary embodiment, executing the installation task of the installation script to configure the operating system installed on the server to be installed includes at least one of the following: establishing a remote communication channel between the script management module and the server to be installed based on a remote connection protocol; sending the installation script and its configuration file to the installation path of the server to be installed through the remote communication channel; sending an execution command to the server to be installed through the script management module, so that the server to be installed configures the operating system installed on the server to be installed based on the execution command, wherein the execution command is used to execute the installation task of the installation script; and, upon receiving a prompt message generated after the operating system is installed on the server to be installed, executing the installation task of the installation script on the server to be installed to configure the operating system installed on the server to be installed.
[0012] In one exemplary embodiment, the method further includes: determining first installation information when installing the operating system installation package on the server to be installed, and generating a first installation log based on the first installation information; and / or determining second installation information when the installation task is executed, and generating a second installation log based on the second installation information.
[0013] According to another aspect of the embodiments of this application, a server management system is also provided, including: a central processing unit (CPU) architecture detection module, an operating system installation module, a script management module, and a central management interface. The operating system installation module is connected to the CPU architecture detection module, the script management module, and the central management interface, respectively. The script management module is connected to the central management interface. The CPU architecture detection module is used to detect the CPU architecture type of the server to be installed. The operating system installation module is used to select an operating system installation package corresponding to the CPU architecture type from preset operating system installation packages and install the operating system installation package on the server to be installed. The script management module is used to receive configuration instructions for a target object from the central management interface, obtain a configuration file obtained by parsing the configuration instructions, and generate an installation script using the configuration parameters in the configuration file.
[0014] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer program, and the computer program is configured to execute the above-described server operating system installation method when it runs.
[0015] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the above-described server operating system installation method through the computer program.
[0016] According to another aspect of the embodiments of this application, a computer program product is also provided, including a computer program that, when executed by a processor, implements the above-described method for installing a server operating system.
[0017] In this embodiment, an operating system installation package corresponding to the CPU architecture type of the server to be installed is selected from a preset operating system installation package. This package is then installed on the server. The CPU architecture type is detected by the CPU architecture detection module of the server management system. The operating system installation package includes at least the metadata required for operating system installation. A configuration file obtained by parsing configuration instructions for the target object is acquired. An installation script is generated using the configuration parameters in the configuration file. The configuration instructions are received through the central management interface of the server management system. The installation script is executed to configure the operating system installed on the server. By automatically detecting the CPU architecture type of the server and automatically selecting a suitable operating system for installation, the probability of installation failure due to human error is effectively reduced. Simultaneously, the automatic configuration of the server operating system is achieved through the generation and execution of the installation script, greatly improving the efficiency and accuracy of server management. Overall, this solution solves the technical problem of low installation efficiency of server operating systems for servers with different CPU architecture types. It significantly improves the installation and configuration efficiency of server operating systems, reduces maintenance costs, and enhances the installation flexibility of server operating systems. Attached Figure Description
[0018] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a schematic diagram of the hardware environment for a method of installing a server operating system according to an embodiment of this application;
[0021] Figure 2 This is a flowchart (a) of a server operating system installation method according to an embodiment of this application;
[0022] Figure 3 This is a flowchart (II) of a server operating system installation method according to an embodiment of this application;
[0023] Figure 4 This is a schematic diagram of the architecture of a server management system according to an embodiment of this application (I);
[0024] Figure 5 This is a schematic diagram (II) of the architecture of the server management system according to an embodiment of this application. Detailed Implementation
[0025] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0026] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0027] According to one aspect of the embodiments of this application, a method for installing a server operating system is provided. This method is widely applicable to automated installation scenarios of server operating systems. Optionally, in this embodiment, the above-described method for installing a server operating system can be applied to scenarios such as... Figure 1 The hardware environment shown consists of the server 102 to be installed and the server management system 104. For example, the server management system described above can be directly installed onto the server to be installed. Figure 1As shown, the server management system 104 connects to the server 102 to be installed via a network and can be used to provide services (such as application services) to the server or the corresponding client. It can set up a database on the server or independently of the server to provide data storage services for the server management system 104. It can also configure cloud computing and / or edge computing services on the server or independently of the server to provide data processing services for the server management system 104.
[0028] The aforementioned networks may include, but are not limited to, at least one of the following: wired network, wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: wide area network, metropolitan area network, local area network. The aforementioned wireless network may include, but is not limited to, at least one of the following: Wi-Fi (Wireless Fidelity), Bluetooth.
[0029] This embodiment provides a method for installing a server operating system, applied to the aforementioned server management system. Figure 2 This is a flowchart (a) of a server operating system installation method according to an embodiment of this application, which includes the following steps:
[0030] Step S202: Select an operating system installation package from the preset operating system installation packages that corresponds to the CPU architecture type of the server to be installed, and install the operating system installation package on the server to be installed. The CPU architecture type is detected by the CPU architecture detection module of the server management system. The operating system installation package includes at least the metadata required to install the operating system.
[0031] It should be noted that the aforementioned preset operating system installation packages refer to the installation packages in the operating system installation package repository. This repository centrally stores operating system installation packages for different CPU architectures.
[0032] Operating system installation package repositories can be organized using a hierarchical directory structure, such as categorizing them by CPU architecture (x86, ARM), operating system distribution (CentOS, Ubuntu, Debian, etc.), and operating system version. Each operating system installation package in the repository contains a complete installation image (ISO or other format), necessary installation configuration files (such as Kickstart, Preseed, etc.), and description files (such as YAML or JSON format, describing the CPU architecture to which the installation package is applicable), operating system version, default configuration, and other metadata information required for installing the operating system.
[0033] Furthermore, the operating system installation package repository also needs to be maintained and updated regularly to ensure the timeliness and security of the installation packages. This update can be accomplished through manual uploading, automatic synchronization with the official mirror source, or other methods.
[0034] Step S204: Obtain the configuration file obtained by parsing the configuration instructions of the target object, and generate an installation script using the configuration parameters in the configuration file. The configuration instructions are received through the central management interface of the server management system.
[0035] Step S206: Execute the installation task of the installation script to configure the operating system installed on the server to be installed.
[0036] For example, such as Figure 5 As shown, the server management system includes a CPU architecture detection module 52, an operating system installation module 54, a script management module 56, and a central management interface 58. The CPU architecture detection module can detect the server's CPU architecture type (corresponding to the CPU architecture type mentioned above). The operating system installation module selects a suitable operating system installation image from a predefined operating system installation package library based on the CPU architecture type detected by the CPU architecture detection module and automatically executes the operating system installation process. Then, the script management module determines the user's specific needs based on instructions from the central management interface, generates and executes customized automated installation scripts to complete the software installation, service configuration, network settings, security hardening, and other configuration processes after the operating system installation.
[0037] Through the above steps, an operating system installation package corresponding to the CPU architecture type of the server to be installed is selected from the preset operating system installation packages. This package is then installed on the server. The CPU architecture type is detected by the CPU architecture detection module of the server management system. The operating system installation package includes at least the metadata required for operating system installation. A configuration file obtained by parsing the configuration instructions for the target object is acquired. An installation script is generated using the configuration parameters in the configuration file. The configuration instructions are received through the central management interface of the server management system. The installation script is executed to configure the operating system installed on the server. This technical solution automatically detects the server's CPU architecture type and automatically selects the appropriate operating system for installation, effectively reducing the probability of installation failure due to human error. Simultaneously, by generating and executing the installation script through configuration instructions, automated configuration of the server operating system is achieved, significantly improving the efficiency and accuracy of server management. Overall, this solution solves the technical problem of low operating system installation efficiency for servers with different CPU architecture types, significantly improving the installation and configuration efficiency of server operating systems, reducing maintenance costs, and enhancing the flexibility of server operating system installation.
[0038] In one exemplary embodiment, before selecting an operating system installation package from preset operating system installation packages that corresponds to the CPU architecture type of the server to be installed, the CPU architecture detection module can further parse the interface information of the out-of-band management interface of the server to be installed to obtain the CPU architecture type of the server to be installed; or, the CPU architecture detection module can parse the request message of the server to be installed requesting network booting to obtain the architecture type field and physical address, and determine the CPU architecture type of the server to be installed based on the architecture type field and the physical address. This embodiment automatically detects the CPU architecture type of the server through multiple methods, ensuring the accuracy and comprehensiveness of the detection.
[0039] It should be noted that the central processing unit architecture detection module can detect CPU architecture types such as x86 and ARM.
[0040] The process of parsing the interface information of the out-of-band management interface of the server to be installed can be understood as reading the CPU architecture type based on the hardware information of the out-of-band management interface (such as BMC / IPMI). Specifically, the process involves connecting to the server's out-of-band management interface through protocols such as SSH (Secure Shell) and IPMItool (Intelligent Platform Management Interface Tool), executing hardware information query commands (such as dmidecode, lscpu, etc.), parsing the returned results, and obtaining detailed information such as the CPU manufacturer, model, and architecture type.
[0041] The process described above, where the central processing unit architecture detection module parses the request message from the server to be installed requesting network booting, can be understood as the parsing process of DHCP (Dynamic Host Configuration Protocol Request Message) messages based on a network preboot execution environment (PXE). PXE booting is a network booting method that downloads and executes a boot image or software from a remote server over a network, used for remote server management and automated deployment. DHCP is a network protocol used to automatically assign IP addresses and other network parameters; a DHCP message is the initial message sent by the client to the DHCP server.
[0042] During the server's PXE boot process, the `archType` (ArchitectureType) and `MAC Address` fields in the DHCP request message can be detected. The `archType` field, as mentioned above, indicates the architecture type requested by the client for booting. Combined with the `MAC Address` field indicating the MAC address (corresponding to the physical address), the server can be uniquely identified.
[0043] The above method utilizes a central processing unit architecture detection module to cope with various complex network environments and server configurations, quickly identify server architecture, and eliminate the need for pre-installed operating systems on servers. In scenarios such as automated batch deployment in bare-metal environments, it can provide accurate server architecture types, facilitating subsequent operating system selection and installation.
[0044] In one exemplary embodiment, the server management system further includes an operating system installation module. The process of selecting an operating system installation package from a preset operating system installation package that corresponds to the CPU architecture type of the server to be installed may include: querying the system versions of different operating system installation packages in the preset operating system installation package through the operating system installation module, and selecting an operating system installation package whose system version matches the CPU architecture type from the different operating system installation packages; and / or, querying the installation priorities of different operating system installation packages in the preset operating system installation package through the operating system installation module, and selecting the operating system installation package with the highest installation priority from the different operating system installation packages, wherein the installation priority is determined based on the operating system distribution version. This embodiment, through the query and selection functions of the operating system installation module, can install an operating system that matches the CPU architecture type of the server. For example, the operating system installation module queries a preset operating system installation package library and finds multiple Linux distributions suitable for the x86_64 architecture type. By comparing the system versions and installation priorities of these distributions, it selects the latest version and the one with the highest installation priority, Ubuntu Server, for installation.
[0045] like Figure 4 As shown, the operating system installation module includes an operating system selection engine (which can be simply referred to as the selection engine). In this embodiment, the operating system selection engine queries the description files of installation packages in the operating system installation package library based on the detection results of the CPU architecture detection module, and then automatically selects an operating system installation package whose system version matches the CPU architecture type according to a preset selection strategy. The system version matching the CPU architecture type can be an exact match (e.g., the CPU architecture and operating system version are completely identical) or a fuzzy match (e.g., selecting the closest operating system version). Alternatively, predefined user preferences can be considered (e.g., user-specified preferred operating system distributions have higher priority).
[0046] In one exemplary embodiment, the implementation of installing the operating system installation package on the server to be installed includes at least one of the following: installing the operating system installation package on the server to be installed using a diskless installation method during network booting; installing the operating system installation package on the server to be installed using the configuration file of the server to be installed; or installing the operating system installation package on the server to be installed using the configuration management tool of the server to be installed. This embodiment provides multiple operating system installation methods to meet installation needs in different scenarios. Figure 4 As shown, for example, the installation engine sends the diskless Linux operating system installation package to the server to be installed via network boot (such as PXE), and the server to be installed installs the operating system based on the received installation package; or, the server management system reads the configuration file of the server to be installed (such as kickstart / Preseed) and automatically executes the operating system installation according to the parameters in the configuration file; or, the server management system uses the configuration management tool of the server to be installed (such as Ansible / SaltStack) to execute the operating system installation remotely.
[0047] In an exemplary embodiment, the server management system further includes a script management module, which describes the specific process of generating an installation script using configuration parameters in the configuration file through the following steps: The script management module parses the configuration file to obtain the configuration requirement type of the server to be installed; an initial script template corresponding to the configuration requirement type is selected from the script template library of the script management module; the initial parameters of the initial script template are replaced with the configuration parameters to obtain an intermediate script template; the template parameters of the intermediate script template are modified according to the custom parameters of the configuration instructions to generate the installation script. This embodiment achieves automated configuration of the server operating system through the script generation function of the script management module, greatly improving the efficiency and accuracy of server management. For example, the script management module parses the configuration file and finds that the configuration requirement type of the server to be installed is "network configuration." It selects an initial script template corresponding to the "network configuration" requirement from the script template library, replaces the initial parameters (such as the default IP address, subnet mask, etc.) in the template with configuration parameters (such as the actual IP address, subnet mask, etc.) to obtain an intermediate script template, and then modifies the intermediate script template according to the custom parameters (such as the DNS server address, gateway address, etc.) of the configuration instructions to generate the final installation script.
[0048] like Figure 4As shown, the automated installation script management module (corresponding to the script management module) includes a script template library. In this embodiment, the script template library is specifically used to store and manage predefined initial script templates for automated installation. Each initial script template is categorized and organized according to different application scenarios and configuration tasks, and adopts a parameterized design, allowing users to flexibly define specific parameters and configuration items through configuration files.
[0049] For example: Basic configuration templates are used to configure basic system settings such as hostname, network, time zone, and user accounts. Software installation templates are used for batch installation of commonly used software (such as databases, web servers, monitoring agents, etc.). Service configuration templates are used to configure parameters and startup items for specific services (such as SSH, NTP, DNS, etc.). Security hardening templates are used to implement security policies, such as firewall configuration and SELinux settings.
[0050] In addition, the script template library also has version management and update functions, making it convenient for users to maintain and extend script templates.
[0051] In one embodiment, such as Figure 4 As shown, the automated installation script management module also includes a script generator. In this embodiment, the script generator can select a suitable script template from the script template library based on the user's specific server requirements (determined by configuration parameters in the configuration file), and automatically generate a specific automated installation script according to the configuration parameter values in the configuration file.
[0052] The configuration file can use a structured data format (such as YAML or JSON) to describe the specific requirements of the server. The description may include: a list of software to be installed, a list of services to be configured and their parameters, network configuration information (IP address, subnet mask, gateway, DNS), and security policy configuration (firewall rules, SELinux policy).
[0053] Understandably, the script generator can parse configuration files and use the obtained configuration parameters to replace the parameters of the initial script template, thereby generating different installation scripts based on different configuration files. If the configuration instructions do not contain custom parameters, the intermediate script template obtained by replacing the parameters of the initial script template with configuration parameters is the installation script to be installed. Of course, if the configuration instructions contain custom parameters, the script generator needs to modify the template parameters of the intermediate script template according to the custom parameters of the configuration instructions, and then generate the installation script.
[0054] In one exemplary embodiment, several technical solutions are proposed to execute the installation script's installation task to configure the operating system installed on the server to be installed. These solutions include at least one of the following: establishing a remote communication channel between the script management module and the server to be installed based on a remote connection protocol; sending the installation script and its configuration file to the installation path of the server to be installed via the remote communication channel; sending an execution command to the server to be installed via the script management module, causing the server to configure the operating system installed on the server to be installed based on the execution command; and, upon receiving a prompt message generated after the operating system installation is completed on the server to be installed, executing the installation script's installation task on the server to be installed to configure the operating system installed on the server to be installed. This embodiment achieves remote automated configuration of the server operating system through the remote execution function of the script management module, greatly improving the efficiency and accuracy of server management.
[0055] In this embodiment, the script executor essentially executes the script directly on the server after the operating system installation is complete. This requires SSH login or manual execution on the local console. For example, the script management module establishes a remote communication channel with the server to be installed based on the SSH protocol (corresponding to the remote connection protocol mentioned above), sends the installation script and configuration files to the specified installation path on the server, and then sends an execution command. After receiving the execution command, the server automatically executes the installation tasks in the installation script to complete the operating system configuration; or, after the server completes the operating system installation, it generates prompt information (such as completion status, installation logs, etc.). After receiving the prompt information, the script management module automatically executes the installation script to complete the operating system configuration.
[0056] In one embodiment, the process of remotely executing an installation script based on the SSH protocol can include: the script executor connecting to the target server via the SSH protocol. After the SSH connection is established, the script executor can transfer necessary files such as the automated installation script and configuration files to a specified path on the target server, such as the / tmp or / home directory, via SFTP or SCP. Then, it executes a command via SSH, such as "chmod +x scriptname.sh", to set the script's execution permissions. After the permissions are set, the script is remotely executed via SSH, for example, by executing the command "bashscriptname.sh". The script contains all the steps for automating the installation of the operating system, including but not limited to downloading and verifying the operating system image, formatting the hard drive, mounting the image, performing the installation, setting network parameters, and configuring system services.
[0057] The process of executing the installation script on the server to be installed can include: creating a service file (such as my-script.service) in systemd (a service management tool) and configuring the script's execution path and parameters to automatically trigger the installation script's installation task; or using a Cron job process to execute the script at a specific time or periodically.
[0058] In one exemplary embodiment, first installation information may be determined when the operating system installation package is installed on the server to be installed, and a first installation log may be generated based on the first installation information; and / or, second installation information may be determined when the installation task is executed, and a second installation log may be generated based on the second installation information. This embodiment, through the recording function of the log recording module, achieves full monitoring of the server operating system installation and configuration process, providing a basis for subsequent system maintenance and troubleshooting.
[0059] For example, the first installation information includes, but is not limited to, the installation start time, the installation end time, error messages during the installation process, and the installation results. The first installation log records the entire process of operating system installation, which can provide a basis for subsequent system maintenance and troubleshooting. The second installation information includes, but is not limited to, the configuration start time, the configuration end time, error messages during the configuration process, and the configuration results. The second installation log records the entire process of operating system configuration, which also provides a basis for subsequent system maintenance and troubleshooting.
[0060] like Figure 4 As shown in this embodiment, the server operating system also includes a log recording module. By storing the first installation log and the second installation log generated in this embodiment into the log recording module, the monitoring of the entire installation process and subsequent maintenance become more convenient, thereby improving the stability and maintainability of the system.
[0061] To better understand the process of installing the server operating system described above, the implementation flow of the installation method of the server operating system will be further described below with reference to optional embodiments, but this is not intended to limit the technical solution of the embodiments of this application.
[0062] Furthermore, in combination Figure 3 The process shown and Figure 4 The system architecture shown illustrates the installation and configuration process of a specific server operating system.
[0063] This embodiment provides a method for installing a server operating system. Figure 3 This is a flowchart (II) of a server operating system installation method according to an embodiment of this application, as shown below. Figure 3 As shown, the specific steps are as follows:
[0064] Step 1: Detect the CPU architecture type of the server to be installed.
[0065] The CPU architecture detection module can automatically detect the CPU architecture type of the server to be installed, such as x86, ARM, or other variants. Detection methods include, but are not limited to, reading the server's system or hardware information through the out-of-band management interface, or analyzing DHCP messages during the PXE boot process.
[0066] To read server hardware information through an out-of-band management interface, you can connect to a server with an installed and running operating system via SSH or Ansible to obtain hardware information such as CPU and MAC addresses.
[0067] To analyze DHCP messages during the PXE boot process, relevant hardware information can be obtained by analyzing the archType and MAC address fields carried in the DHCP request message when PXE starts.
[0068] Step 2: Select and automatically install the operating system.
[0069] Based on the CPU architecture detected in step 1, the operating system installation module selects a compatible operating system installation package from a predefined operating system installation package library and automatically executes the operating system installation process. This automatic execution of the operating system installation process can be understood as redirecting to the operating system installation page for installation.
[0070] Step 3: Define specific server requirements. Users describe their personalized server requirements in detail using a pre-configured configuration file (e.g., YAML or JSON format), including the software to be installed, the services to be configured, network settings, security policies, etc. This configuration file will serve as the basis for generating subsequent automated scripts.
[0071] Combination Figure 4 The operating system installation module includes an operating system installation package library, a selection engine, and an installation engine. The selection engine can be used to select the corresponding operating system installation package from the operating system installation package library based on the detected CPU architecture, and then the installation engine can be used to automatically install the operating system.
[0072] The operating system installation package library stores operating system installation packages suitable for different CPU architectures, such as CentOS operating system installation packages for x86 architecture and Ubuntu operating system installation packages for ARM architecture.
[0073] In addition, the installation engine can handle various abnormal situations (such as network failures, corrupted installation packages, etc.) and provides detailed installation logs and progress information to facilitate user monitoring and troubleshooting.
[0074] Next, we will provide the steps to generate and execute the automated installation script.
[0075] Step 4: Generate an automated installation script.
[0076] like Figure 4 As shown, the automated installation script management module includes a script template library, a script generator, and a script executor. The script template library stores script templates suitable for different application scenarios. The script generator selects the appropriate script template from the script template library based on the specific needs of the server and generates a specific automated installation script according to the configuration file. The configuration file defines the specific requirements of the server, such as which software to install and which services to configure. The script executor is responsible for executing the generated automated installation script.
[0077] In step 4, the script generator parses the configuration file defined in step 3 and selects a suitable script template from the script template library. Based on the specific parameters in the configuration file, the script generator performs parameter replacements and customization modifications on the selected script template, ultimately generating an automated installation script that meets the specific server requirements.
[0078] Step 5: Execute the automated installation script.
[0079] In step 5, the script executor executes the automated installation script generated in step 4 to complete further configuration and deployment of the operating system, such as software installation, service configuration, network settings, and security hardening.
[0080] In addition, the script executor can monitor the script execution status in real time and record detailed execution logs to facilitate later troubleshooting and auditing.
[0081] By following the steps above, the server's CPU architecture can be automatically identified, and the corresponding operating system can be automatically selected and installed based on the CPU architecture. At the same time, different automated installation scripts can be customized and executed according to the specific needs of the server, thereby improving the server installation efficiency and flexibility.
[0082] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a server to be installed (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.
[0083] Figure 5 This is a schematic diagram (II) of the server management system architecture according to an embodiment of this application; as shown Figure 5 As shown, it includes: a central processing unit architecture detection module 52, an operating system installation module 54, a script management module 56, and a central management interface 58.
[0084] Optionally, the aforementioned server operating system may have been connected to the server to be installed, for example, in the form of software or a plug-in.
[0085] The operating system installation module is connected to the CPU architecture detection module, the script management module, and the central management interface, respectively. The script management module is connected to the central management interface. The CPU architecture detection module is used to detect the CPU architecture type of the server to be installed. The operating system installation module is used to select the operating system installation package corresponding to the CPU architecture type from the preset operating system installation packages and install the operating system installation package on the server to be installed. The script management module is used to receive the configuration instructions of the target object from the central management interface, obtain the configuration file obtained by parsing the configuration instructions, and generate an installation script using the configuration parameters in the configuration file.
[0086] The system selects an operating system installation package from preset installation packages that corresponds to the CPU architecture type of the server to be installed. This package is then installed on the server. The CPU architecture type is detected by the CPU architecture detection module of the server management system. The operating system installation package includes at least the metadata required for operating system installation. A configuration file is obtained by parsing configuration instructions for the target object. An installation script is generated using the configuration parameters in the configuration file. These configuration instructions are received through the central management interface of the server management system. The installation script is then executed to configure the installed operating system on the server. Through the cooperation of the CPU architecture detection module, the operating system installation module, and the script management module, automated installation and configuration of the server operating system are achieved. This solves the technical problem of low installation efficiency for server operating systems with different CPU architecture types, reduces the probability of errors caused by manual operation during traditional server operating system installation and configuration, and improves the efficiency and accuracy of server management.
[0087] In one exemplary embodiment, the CPU architecture detection module is further configured to parse the interface information of the out-of-band management interface of the server to be installed to obtain the CPU architecture type of the server to be installed; or, to parse the request message of the server to be installed requesting network booting to obtain the architecture type field and physical address, and determine the CPU architecture type of the server to be installed based on the architecture type field and the physical address. The detection function of the CPU architecture detection module ensures the accuracy and comprehensiveness of the detection, providing a basis for subsequent operating system selection and installation.
[0088] In an exemplary embodiment, the operating system installation module includes an operating system installation package library and an operating system selection engine. The operating system installation package library includes the preset operating system installation packages. The operating system selection engine is configured to obtain the preset operating system installation packages from the operating system installation package library, query the system versions of different operating system installation packages in the preset operating system installation packages, and select an operating system installation package whose system version matches the central processing unit architecture type from the different operating system installation packages; and / or, query the installation priorities of different operating system installation packages in the preset operating system installation packages, and select the operating system installation package with the highest installation priority from the different operating system installation packages. The installation priority is determined based on the operating system release version, and the installation priority is obtained by the operating system selection engine through the central management interface.
[0089] In one exemplary embodiment, the operating system installation module includes an installation engine connected to the operating system selection engine. The installation engine is configured to receive the operating system installation package selected by the operating system selection engine and install the operating system installation package on the server to be installed via one of the following methods: installing the operating system installation package on the server to be installed using a diskless installation method during network booting; installing the operating system installation package on the server to be installed using a configuration file of the server to be installed; or installing the operating system installation package on the server to be installed using a configuration management tool of the server to be installed. This embodiment achieves automated installation of the server operating system through the installation function of the installation engine, greatly improving the efficiency and accuracy of server management.
[0090] In one exemplary embodiment, the script management module includes a script template library and a script generator, the script generator being connected to the script template library. The script generator is used to parse the configuration file to obtain the configuration requirement type of the server to be installed; select an initial script template corresponding to the configuration requirement type from the script template library; replace the initial parameters of the initial script template with the configuration parameters to obtain an intermediate script template; modify the template parameters of the intermediate script template according to the custom parameters of the configuration instructions to generate the installation script. This embodiment achieves automated configuration of the server operating system through the script generation function of the script generator.
[0091] In one exemplary embodiment, the script management module further includes a script executor connected to the script template library. The script executor is configured to: retrieve the installation script from the script template library after the script generator stores the installation script in the script template library; establish a remote communication channel between the script executor and the server to be installed based on a remote connection protocol; send the installation script and its configuration file to the installation path of the server to be installed via the remote communication channel; and send an execution command to the server to be installed, enabling the server to configure the operating system installed on the server based on the execution command. The execution command is used to execute the installation task of the installation script. Alternatively, upon receiving a prompt message generated after the operating system installation is completed on the server to be installed, the execution command executes the installation task of the installation script on the server to configure the operating system installed on the server. This embodiment achieves remote automated configuration of the server operating system through the remote execution function of the script executor, greatly improving the efficiency and accuracy of server management.
[0092] In one exemplary embodiment, the server management system further includes a log recording module connected to the CPU architecture detection module. The CPU architecture detection module is further configured to send detection data regarding the CPU architecture type of the server to be installed to the log recording module. This embodiment, through the logging function of the log recording module, achieves full monitoring of the server operating system installation and configuration process, providing a basis for subsequent system maintenance and troubleshooting, and solving the maintenance difficulties and troubleshooting problems caused by insufficient monitoring during traditional server operating system installation and configuration.
[0093] In one exemplary embodiment, the log recording module is connected to the installation engine of the operating system installation module, and is used to determine the first installation information when installing the operating system installation package on the server to be installed, generate a first installation log based on the first installation information, and store the first installation log in the log recording module. This embodiment, through the recording function of the installation engine, achieves full monitoring of the server operating system installation process, can handle various abnormal situations (such as network failures, corrupted installation packages, etc.), and provides detailed installation logs and progress information, providing a basis for subsequent system maintenance and troubleshooting.
[0094] In one exemplary embodiment, the log recording module is connected to the script executor of the script management module, and is used to determine second installation information when the installation task is executed, generate a second installation log based on the second installation information, and store the second installation log in the log recording module. This embodiment, through the recording function of the script executor, monitors the script execution status in real time and records detailed execution logs, realizing full monitoring of the server operating system configuration process. This provides a basis for subsequent system maintenance and troubleshooting, solving the maintenance difficulties and troubleshooting problems caused by insufficient monitoring in traditional server operating system configuration processes.
[0095] Embodiments of this application also provide a storage medium including a stored program, wherein the program executes any of the methods described above when it is run.
[0096] Optionally, in this embodiment, the storage medium may be configured to store program code for performing the following steps:
[0097] S1. Select an operating system installation package from the preset operating system installation packages that corresponds to the CPU architecture type of the server to be installed, and install the operating system installation package on the server to be installed. The CPU architecture type is detected by the CPU architecture detection module of the server management system. The operating system installation package includes at least the metadata required to install the operating system.
[0098] S2, obtain the configuration file obtained by parsing the configuration instructions of the target object, and generate an installation script using the configuration parameters in the configuration file. The configuration instructions are received through the central management interface of the server management system.
[0099] S3, execute the installation script to configure the operating system installed on the server to be installed.
[0100] Embodiments of this application also provide an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0101] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0102] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0103] S1. Select an operating system installation package from the preset operating system installation packages that corresponds to the CPU architecture type of the server to be installed, and install the operating system installation package on the server to be installed. The CPU architecture type is detected by the CPU architecture detection module of the server management system. The operating system installation package includes at least the metadata required to install the operating system.
[0104] S2, obtain the configuration file obtained by parsing the configuration instructions of the target object, and generate an installation script using the configuration parameters in the configuration file. The configuration instructions are received through the central management interface of the server management system.
[0105] S3, execute the installation script to configure the operating system installed on the server to be installed.
[0106] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0107] Optionally, embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.
[0108] Optionally, embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.
[0109] Optionally, embodiments of this application also provide a computer program that includes computer instructions stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the steps in any of the above method embodiments.
[0110] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.
[0111] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.
[0112] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for installing a server operating system, characterized in that, Applied to server management systems, including: Select an operating system installation package from the preset operating system installation packages that corresponds to the CPU architecture type of the server to be installed, and install the operating system installation package on the server to be installed. The CPU architecture type is detected by the CPU architecture detection module of the server management system. The operating system installation package includes at least the metadata required to install the operating system. Obtain the configuration file obtained by parsing the configuration instructions for the target object, and use the configuration parameters in the configuration file to generate an installation script. The configuration instructions are received through the central management interface of the server management system. The installation script is executed to configure the operating system installed on the server to be installed. Before selecting an operating system installation package from preset operating system installation packages that corresponds to the CPU architecture type of the server to be installed, the method further includes: The CPU architecture detection module is used to parse the interface information of the out-of-band management interface of the server to be installed, so as to obtain the CPU architecture type of the server to be installed. Alternatively, the CPU architecture detection module can be used to parse the request message for network booting of the server to be installed in the network pre-booting execution environment to obtain the architecture type field and physical address, and the CPU architecture type of the server to be installed can be determined based on the architecture type field and the physical address. The server management system also includes a script management module, which generates installation scripts using configuration parameters in the configuration file, including: The configuration file is parsed by the script management module to obtain the configuration requirement type of the server to be installed; an initial script template corresponding to the configuration requirement type is selected from the script template library of the script management module; the initial parameters of the initial script template are replaced with the configuration parameters to obtain an intermediate script template; the template parameters of the intermediate script template are modified according to the custom parameters of the configuration instructions to generate the installation script. The method further includes: if the configuration instruction does not contain custom parameters, then the intermediate script template is determined as the installation script; if the configuration instruction contains custom parameters, then the template parameters of the intermediate script template are modified according to the custom parameters of the configuration instruction to generate the installation script.
2. The method for installing a server operating system according to claim 1, characterized in that, The server management system also includes an operating system installation module, which selects an operating system installation package from preset operating system installation packages that corresponds to the CPU architecture type of the server to be installed, including: The operating system installation module queries the system versions of different operating system installation packages in the preset operating system installation package, and selects an operating system installation package whose system version matches the central processing unit architecture type from the different operating system installation packages. And / or, by querying the installation priority of different operating system installation packages in the preset operating system installation package through the operating system installation module, the operating system installation package with the highest installation priority is selected from the different operating system installation packages, and the installation priority is determined based on the distribution version of the operating system.
3. The method for installing a server operating system according to claim 2, characterized in that, The operating system installation package is installed on the server to be installed, comprising at least one of the following: The operating system installation package is installed on the server to be installed using a diskless installation method during network booting. The operating system installation package is installed on the server to be installed using the configuration file of the server to be installed; Use the configuration management tool of the server to be installed to install the operating system installation package on the server to be installed.
4. The method for installing a server operating system according to claim 1, characterized in that, The installation script is executed to configure the operating system installed on the server to be installed, including at least one of the following: A remote communication channel is established between the script management module and the server to be installed based on a remote connection protocol. The installation script and its configuration file are sent to the installation path of the server to be installed through the remote communication channel. The script management module sends an execution command to the server to be installed so that the server to be installed can configure the operating system installed on the server to be installed based on the execution command. The execution command is used to execute the installation task of the installation script. Upon receiving a prompt message generated after the operating system installation is completed on the server to be installed, the installation script is executed on the server to be installed to configure the operating system that has been installed on the server to be installed.
5. The method for installing a server operating system according to claim 1, characterized in that, The method further includes: Determine the first installation information when installing the operating system installation package on the server to be installed, and generate a first installation log based on the first installation information; And / or, determine the second installation information when the installation task is executed, and generate a second installation log based on the second installation information.
6. A server management system, characterized in that, include: The system includes a central processing unit architecture detection module, an operating system installation module, a script management module, and a central management interface. The operating system installation module is connected to the central processing unit architecture detection module, the script management module, and the central management interface, respectively. The script management module and the central management interface are also connected. The central processing unit architecture detection module is used to detect the central processing unit architecture type of the server to be installed. The operating system installation module is used to select an operating system installation package corresponding to the central processing unit architecture type from a preset operating system installation package, and install the operating system installation package on the server to be installed. The script management module is used to receive configuration instructions for the target object from the central management interface, obtain the configuration file obtained by parsing the configuration instructions, and generate an installation script using the configuration parameters in the configuration file. The central processing unit architecture detection module is also used to parse the interface information of the out-of-band management interface of the server to be installed to obtain the central processing unit architecture type of the server to be installed; or, to parse the request message of the server to be installed in the network pre-boot execution environment to request network booting to obtain the architecture type field and physical address, and to determine the central processing unit architecture type of the server to be installed based on the architecture type field and the physical address. The script management module includes a script template library and a script generator, and the script generator is connected to the script template library. The script generator is used to parse the configuration file to obtain the configuration requirement type of the server to be installed; and to select an initial script template corresponding to the configuration requirement type from the script template library. The initial parameters of the initial script template are replaced with the configuration parameters to obtain the intermediate script template; the template parameters of the intermediate script template are modified according to the custom parameters of the configuration instructions to generate the installation script; The script generator is further configured to: if the configuration instruction does not contain custom parameters, determine the intermediate script template as the installation script; if the configuration instruction contains custom parameters, modify the template parameters of the intermediate script template according to the custom parameters of the configuration instruction to generate the installation script.
7. The server management system according to claim 6, characterized in that, The operating system installation module includes an operating system installation package library and an operating system selection engine. The operating system installation package library includes the preset operating system installation package. An operating system selection engine is used to obtain preset operating system installation packages from the operating system installation package library, query the system versions of different operating system installation packages in the preset operating system installation packages, and select an operating system installation package whose system version matches the central processing unit architecture type from the different operating system installation packages; and / or, query the installation priority of different operating system installation packages in the preset operating system installation packages, and select the operating system installation package with the highest installation priority from the different operating system installation packages, wherein the installation priority is determined based on the operating system release version, and the installation priority is obtained by the operating system selection engine through the central management interface.
8. The server management system according to claim 7, characterized in that, The operating system installation module includes an installation engine, which is connected to the operating system selection engine. The installation engine is configured to receive the operating system installation package selected by the operating system selection engine, and install the operating system installation package on the server to be installed in one of the following ways: by installing the operating system installation package on the server to be installed using a diskless installation method when the server to be installed is network-booted; by installing the operating system installation package on the server to be installed using the configuration file of the server to be installed; or by installing the operating system installation package on the server to be installed using the configuration management tool of the server to be installed.
9. The server management system according to claim 6, characterized in that, The script management module also includes a script executor, which is connected to the script template library; The script executor is configured to: retrieve the installation script from the script template library after the script generator stores the installation script in the script template library; establish a remote communication channel between the script executor and the server to be installed based on a remote connection protocol; send the installation script and its configuration file to the installation path of the server to be installed via the remote communication channel; and send an execution command to the server to be installed, so that the server to be installed configures the operating system installed on the server to be installed based on the execution command. The execution command is used to execute the installation task of the installation script; or, upon receiving a prompt message generated after the operating system installation is completed on the server to be installed, execute the installation task of the installation script on the server to be installed to configure the operating system installed on the server to be installed.
10. The server management system according to claim 6, characterized in that, The server management system also includes a log recording module, which is connected to the central processing unit architecture detection module; The central processing unit architecture detection module is also used to send the detection data when detecting the central processing unit architecture type of the server to be installed to the log recording module.
11. The server management system according to claim 10, characterized in that, The log recording module is connected to the installation engine of the operating system installation module, and is used to determine the first installation information when installing the operating system installation package on the server to be installed, generate a first installation log based on the first installation information, and store the first installation log in the log recording module.
12. The server management system according to claim 10, characterized in that, The log recording module is connected to the script executor of the script management module, and is used to determine the second installation information when the installation task is executed, generate a second installation log based on the second installation information, and store the second installation log in the log recording module.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed, performs the method described in any one of claims 1 to 5.
14. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method described in any one of claims 1 to 5 through the computer program.
Citation Information
Patent Citations
Configuration method for access hardware and related equipment
CN117632265A