Server installation method, device, equipment, medium and product

By generating installation scripts using custom configuration files and installation information, the lack of flexibility in the existing server installation process is resolved, achieving automated and efficient operating system installation.

CN120743312BActive Publication Date: 2025-11-28CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511262104.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-05
Publication Date
2025-11-28
Estimated Expiration
2045-09-05

AI Technical Summary

Technical Problem

In existing technologies, installing different types of operating systems requires manual modification of underlying configuration files, resulting in insufficient flexibility and scalability in the server installation process.

Method used

It adopts a custom configuration file and generates installation scripts based on the declarative configuration file. It generates installation scripts for the target server by using the custom configuration file and installation information, thereby realizing automated installation processing for different types of servers.

Benefits of technology

It improves the flexibility and scalability of the server installation process, supports the installation of various server service types, and ensures the accuracy and continuity of the installation process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120743312B_ABST
    Figure CN120743312B_ABST
Patent Text Reader

Abstract

The present disclosure relates to the technical field of cloud computing, and in particular, to a server installation method, device, equipment, medium and product, comprising: obtaining a custom configuration file; wherein the custom configuration file is a declarative configuration file used to define the target operating system configuration of at least one type of server; obtaining installation information of a target server to be installed; generating an installation script of the target server based on the custom configuration file and the installation information, and performing installation processing on the target server according to the installation script. The final state of the desired operating system resource is determined through the custom configuration file, and different configuration mechanisms are automatically selected according to different types of servers, which can effectively improve the flexibility and scalability of the server installation process.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of cloud computing, and in particular, to a server installation method, device, equipment, medium and product. BACKGROUND

[0002] With the increasing demand for cloud resource pool construction, the demand for multiple types of physical servers in Internet data centers is increasing. On-site personnel need to manually or use scattered script tools to install operating systems on machines of numerous server manufacturers and models.

[0003] In the related art, the installation process of the same type of operating system or server is usually supported, and if other types of operating systems need to be deployed, the underlying configuration file needs to be manually modified, which leads to insufficient flexibility and scalability of the installation process. SUMMARY

[0004] The present disclosure is proposed in view of the above problems. The present disclosure provides a server installation method, device, equipment, medium and product.

[0005] According to one aspect of the present disclosure, a server installation method is provided, comprising:

[0006] obtaining a custom configuration file; wherein the custom configuration file is a declarative configuration file used to define the target operating system configuration of at least one type of server;

[0007] obtaining installation information of a target server to be installed;

[0008] generating an installation script of the target server based on the custom configuration file and the installation information, and performing installation processing on the target server according to the installation script.

[0009] In addition, according to one aspect of the present disclosure, the installation script of the target server is generated based on the custom configuration file and the installation information, comprising:

[0010] determining a target network area associated with the target server in a plurality of network areas applicable to the custom configuration file;

[0011] obtaining a service type of the target server;

[0012] determining a target installation instance based on the matching degree between the service type of the target server and the resource type supported by the target network area; wherein the target installation instance includes a hard disk partition instance and a network configuration instance;

[0013] combining the target installation instance and the installation information to obtain the installation script of the target server.

[0014] Further, the target installation instance is determined based on a matching degree between the service type of the target server and the resource type supported by the target network area according to an aspect of the present disclosure, including:

[0015] In a case where the service type of the target server and the resource type supported by the target network area match, target installation template identification information associated with the target network area is determined.

[0016] An installation instance corresponding to the target installation template identification information in a local template library is obtained as the target installation instance.

[0017] Further, the target installation instance is determined based on a matching degree between the service type of the target server and the resource type supported by the target network area according to an aspect of the present disclosure, including:

[0018] In a case where the service type of the target server and the resource type supported by the target network area do not match, the target installation instance is generated based on the service type of the target server and the installation information.

[0019] Further, the self-defined configuration file according to an aspect of the present disclosure includes an evaluation threshold value; and the installation processing of the target server according to the installation script includes:

[0020] In a case where there are multiple target servers, a target server to be installed at a current time is determined.

[0021] A first installation queue is determined based on a first number of the target servers to be installed at the current time and the evaluation threshold value.

[0022] The target servers in the first installation queue are installed according to the installation script.

[0023] Further, the first installation queue is determined based on the first number of the target servers to be installed at the current time and the evaluation threshold value according to an aspect of the present disclosure, including:

[0024] A first evaluation parameter is calculated based on the first number.

[0025] The first evaluation parameter and the evaluation threshold value are compared to obtain a comparison result.

[0026] The first installation queue is determined according to the comparison result.

[0027] Further, the first installation queue is determined according to the comparison result according to an aspect of the present disclosure, including:

[0028] In a case where it is determined based on the comparison result that the first evaluation parameter is less than or equal to the evaluation threshold, a first server is determined from the plurality of target servers; wherein the first server is a target server that is to be installed after the current time point;

[0029] Based on the target server to be installed at the current time point and the first server, the first installation queue is determined.

[0030] Further, the first evaluation parameter is calculated based on the first quantity according to an aspect of the present disclosure, comprising:

[0031] A bandwidth peak value in the process of installing the first installation queue is determined;

[0032] The first quantity and the bandwidth peak value are operated to obtain an operation result;

[0033] A product of the first quantity and the evaluation threshold is calculated to obtain a product result;

[0034] A ratio of the operation result and the product result is determined to obtain the first evaluation parameter.

[0035] Further, the first installation queue is determined according to the comparison result according to an aspect of the present disclosure, comprising:

[0036] In a case where the first evaluation parameter is greater than the evaluation threshold, the first installation queue is determined based on the target server to be installed at the current time point.

[0037] Further, the self-defined configuration file includes a reinstallation policy according to an aspect of the present disclosure, and after the target server is installed according to the installation script, the method further comprises:

[0038] In a case where the first installation of the target server fails, the target server is reinstalled based on the reinstallation policy in the self-defined configuration file;

[0039] A retry number of installing the target server is determined;

[0040] If the retry number is greater than a reinstallation number in the reinstallation policy, it is determined that the installation of the target server fails, and installation failure information is generated based on the retry number and an installation failure reason.

[0041] According to another aspect of the present disclosure, a server installation device is provided, comprising:

[0042] The data acquisition unit is configured to acquire a customized configuration file, wherein the customized configuration file is a declarative configuration file used to define target operating system configurations of at least one type of server.

[0043] The installation information acquisition unit is configured to acquire installation information of the target server to be installed.

[0044] The installation processing unit is configured to generate an installation script of the target server based on the customized configuration file and the installation information, and perform installation processing on the target server according to the installation script.

[0045] According to yet another aspect of the present disclosure, an electronic device is provided, which includes a processor, a memory, and a bus, the memory stores machine readable instructions executable by the processor, when the electronic device is running, the processor communicates with the memory through the bus, and the machine readable instructions are executed by the processor to perform the steps of the server installation method.

[0046] According to yet another aspect of the present disclosure, a computer readable storage medium is provided, which stores a computer program, when the computer program is executed by a processor, the steps of the server installation method are performed.

[0047] According to yet another aspect of the present disclosure, a computer program product is provided, which is stored in a storage medium, and the program product is executed by at least one processor to perform the steps of the server installation method.

[0048] As will be described in detail below, according to the server installation method, device, equipment, medium and product of the embodiments of the present disclosure, a customized configuration file is acquired, wherein the customized configuration file is a declarative configuration file used to define target operating system configurations of at least one type of server; then, installation information of a target server to be installed is acquired; finally, an installation script of the target server is generated based on the customized configuration file and the installation information, and installation processing is performed on the target server according to the installation script. Through the above processing manner, the final state of the desired operating system resource is determined through the customized configuration file, and the configuration information such as the type of the operating system desired to be configured by the user, the resource type, and the installation template identification information is defined individually, so that different configuration mechanisms are automatically selected according to different types of servers, the flexibility of the server installation process is improved, and if the server configuration needs to be modified, updating the customized configuration file can trigger updating, so that the processing logic of the installation process is determined based on the generated installation script, which can effectively improve the flexibility and expansibility of the server installation process.

[0049] It should be understood that both the foregoing general description and the following detailed description are exemplary and intended to provide further illustration of the claimed technology. Attached Figure Description

[0050] The above and other objects, features, and advantages of this disclosure will become more apparent from the more detailed description of the embodiments thereof in conjunction with the accompanying drawings. The drawings are provided to further illustrate the embodiments of this disclosure and form part of the specification. They are used together with the embodiments of this disclosure to explain the disclosure and do not constitute a limitation thereof. In the drawings, the same reference numerals generally represent the same components or steps.

[0051] Figure 1 This is a flowchart illustrating a server installation method according to an embodiment of the present disclosure.

[0052] Figure 2 This is a schematic diagram illustrating a custom configuration file in a server installation method according to an embodiment of the present disclosure.

[0053] Figure 3 This is a schematic diagram illustrating the server installation process in a server installation method according to an embodiment of the present disclosure.

[0054] Figure 4 This is a block diagram illustrating a server installation apparatus according to an embodiment of the present disclosure.

[0055] Figure 5 This is a hardware block diagram illustrating an electronic device according to an embodiment of the present disclosure.

[0056] Figure 6 This is a schematic diagram illustrating a computer program product according to an embodiment of the present disclosure. Detailed Implementation

[0057] To make the objectives, technical solutions, and advantages of this disclosure more apparent, exemplary embodiments according to this disclosure will now be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this disclosure, and not all embodiments of this disclosure. It should be understood that this disclosure is not limited to the exemplary embodiments described herein.

[0058] To facilitate understanding of this embodiment, a server installation method disclosed in this disclosure will first be described in detail. The execution subject of the server installation method provided in this disclosure is generally an electronic device with a certain computing power, such as a terminal device, a server, or other processing device. In some possible implementations, the server installation method can be implemented by a processor calling computer-readable instructions stored in memory.

[0059] See Figure 1As shown, a flowchart of a server installation method provided by an embodiment of the present disclosure is shown, wherein the method comprises steps S101-S103, wherein:

[0060] Step S101: Obtain a custom configuration file; wherein the custom configuration file is a declarative configuration file, used to define the target operating system configuration of at least one type of server.

[0061] The execution subject of the server installation method can be a management platform, which comprises a regional agent and an instance management module. The agent is responsible for the process tuning control of the operating system resource state, and processes the custom configuration file according to the list-watch mechanism of continuous monitoring of resource changes. Here, the custom configuration file can be a JSON file, a YAML file or a custom resource file CR (Custom Resource). The instance management module is used to manage the installation instances in the local template library and the metadata of the installation instances.

[0062] The operating system definition can be represented by a custom resource description CRD (Custom Resource Definition) in kubernetes. The CRD describes a specific operating system resource instance, which serves as an operating system information record carrier of the custom configuration file, and can use a yaml file to customize the type of operating system.

[0063] Specifically, the custom configuration file includes a plurality of network regions selector applicable to it, the name name of the server, the type image of the operating system expected to be configured by the user, the mapping relationship between the resource type and the installation template identification information, the final installation state status of the server, the network address instance ntp of the internal network time protocol server NTP (Network Time Protocol Server) in the resource pool, the operating system reinstallation policy retryPolicy, and the evaluation threshold bandwidth. The content in the custom configuration file can be adjusted as needed, and the present disclosure does not require this.

[0064] The custom configuration file is applicable to multiple network areas, for example, a core control area CORE, a demilitarized zone DMZ, a physical or logical resource pool (availability zone) POD1, and the name of the server can be configured by a hostNameTemplate template in the instance management module. The type of the operating system expected to be configured by the user in each network area can be the same or different. The installation template identification information of each network area can be the same or different. The installation template identification information includes hard disk partition template identification information and network configuration template identification information. The installation template identification information can be an installation template name, an installation template id, or a hash value of the installation template, and the like. Correspondingly, the mapping relationship includes a mapping relationship between a resource type and hard disk partition template identification information partition, and a mapping relationship between a resource type and network configuration template identification information network. The ntp can also be obtained from the instance management module. The resource type can be computing type, block storage type, or network type. The resource types supported by different network areas can be the same or different. In this way, the usability of the custom configuration file can be improved while ensuring network area isolation.

[0065] Step S102: Obtain installation information of a target server to be installed.

[0066] Here, the installation information includes the name of the target server, the network area in which the target server is located, and the serial number of the target server.

[0067] In the embodiment of the present disclosure, after obtaining the custom configuration file, the management platform parses the custom configuration file through an agent, calls an instance management module through a Restful interface, checks the legality of the content in the custom configuration file, stops processing the custom configuration file if it is not legal, and obtains installation information of a target server to be installed from the instance management module if it is legal.

[0068] Step S103: Generate an installation script of the target server based on the custom configuration file and the installation information, and perform installation processing on the target server according to the installation script.

[0069] In the embodiment of the present disclosure, an installation script Kickstart file of the target server is generated according to the custom configuration file and the installation information, and installation processing is performed on the target server according to the installation script.

[0070] In the above embodiment, the final state of the desired operating system resource is determined by the custom configuration file, and the configuration information such as the type of the operating system expected to be configured by the user, the resource type, and the installation template identification information is defined individually, so that different configuration mechanisms are automatically selected according to different types of servers, and the flexibility of the server installation process is improved. In addition, if the server configuration needs to be modified, updating the custom configuration file can trigger the update, so that the processing logic of the installation process is determined based on the generated installation script, which can effectively improve the flexibility and expansibility of the server installation process.

[0071] In an optional embodiment, the above step of generating the installation script of the target server based on the custom configuration file and the installation information includes:

[0072] determining a target network area associated with the target server in a plurality of network areas to which the custom configuration file applies;

[0073] obtaining a service type of the target server;

[0074] determining a target installation instance based on a matching degree between the service type of the target server and a resource type supported by the target network area; wherein the target installation instance includes a hard disk partition instance and a network configuration instance;

[0075] combining the target installation instance and the installation information to obtain the installation script of the target server.

[0076] Here, if the resource type supported by the target network area is computing type, block storage type, or network type, and the service type of the target server is computing type, a target installation instance corresponding to the computing type is determined. This will be described exemplarily hereinafter.

[0077] The present disclosure does not limit the specific content of the target installation instance, which can be adjusted adaptively according to actual application scenarios.

[0078] In the embodiments of the present disclosure, the agent in the management platform can first determine the network area in the custom configuration file that matches the target server, i.e., the target network area, then match the service type of the target server with the resource type supported by the target network area, and pull the corresponding hard disk partition instance and network configuration instance according to the matching degree, and finally combine the hard disk partition instance, the network configuration instance, and the installation information to obtain the installation script of the target server.

[0079] In the above embodiment, the installation script of the target server is automatically generated by means of double alignment between the custom configuration file and the target server, i.e., network area and service type, so as to improve the accuracy of the server installation process, support the installation of multiple server service types, and effectively improve the flexibility of the installation process.

[0080] In an optional embodiment, the step of determining the target installation instance based on the matching degree between the service type of the target server and the resource type supported by the target network area comprises the following steps:

[0081] In the case where the service type of the target server matches the resource type supported by the target network area, the target installation template identification information associated with the target network area is determined.

[0082] The installation instance corresponding to the target installation template identification information in the local template library is obtained as the target installation instance.

[0083] If the service type of the target server matches at least one resource type supported by the target network area, the target installation template identification information associated with the target network area can be determined based on the mapping relationship.

[0084] In the embodiment of the present disclosure, in the case where the service type of the target server matches the resource type supported by the target network area, the corresponding installation template identification information in the custom configuration file, i.e., the target installation template identification information, is determined, and the target installation instance corresponding to the target installation template identification information is found in the local database by the instance management module.

[0085] In the above embodiment, the accurate matching between the service type and the resource type is realized, and the link from the installation template name to the template instance is realized, and the complete template instance is not carried in the custom configuration file, so that when the template instance needs to be updated, the custom configuration file does not need to be reissued, which realizes the lightweight of the custom configuration file.

[0086] In an optional embodiment, the step of determining the target installation instance based on the matching degree between the service type of the target server and the resource type supported by the target network area comprises the following steps:

[0087] In the case where the service type of the target server does not match the resource type supported by the target network area, the target installation instance is generated based on the service type of the target server and the installation information.

[0088] In the embodiments of the present disclosure, in the case that the service type of the target server and the resource type supported by the target network area do not match, the target installation instance can be directly generated according to the service type of the target server and the installation information, the fault tolerance of the matching process is improved, and the continuity of the installation process is ensured.

[0089] In an optional implementation, after the target installation instance is generated based on the service type of the target server and the installation information, the method further includes the following steps:

[0090] determining first installation template identification information corresponding to the target installation instance;

[0091] establishing a first mapping relationship between the service type of the target server and the first installation template identification information, and adding the first mapping relationship to the self-defined configuration file to obtain an updated self-defined configuration file.

[0092] As mentioned above, the self-defined configuration file includes the mapping relationship between the resource type and the installation template identification information. In this regard, after the target installation instance is obtained, the mapping relationship can be added in the self-defined configuration file for the target installation instance, and the self-defined configuration file is updated.

[0093] In the embodiments of the present disclosure, the first installation template identification information of the target installation instance can be determined, and a first mapping relationship between the service type of the target server and the first installation template identification information is established, and the first mapping relationship is added in the self-defined configuration file, which can improve the expansibility of the self-defined configuration file, so that the updated self-defined configuration file can support more resource types, and then facilitate matching with more service types, so as to improve the flexibility of the server installation process.

[0094] In an optional implementation, the self-defined configuration file includes an evaluation threshold; and the installation processing of the target server according to the installation script includes the following steps:

[0095] when the target server is multiple, determining a target server to be installed at the current time;

[0096] determining a first installation queue based on the first number of the target server to be installed at the current time and the evaluation threshold;

[0097] performing installation processing on the target servers in the first installation queue according to the installation script.

[0098] The agent in the management platform is bound with a network card, and after starting the installation process, the agent limits the number of servers to be concurrently installed according to the bandwidth of the bound network card.

[0099] Specifically, when the target server is multiple, the target server to be installed at the current time is determined, and the target server to be installed can be one or more.

[0100] Then, according to the first number of the target server to be installed at the current time and the evaluation threshold, the first installation queue finally needed to be installed at the current time is determined, so that the target server in the first installation queue can be installed according to the installation script.

[0101] In the above embodiment, the concurrent upper limit at the current time can be dynamically determined according to the first number of the target server to be installed at the current time and the evaluation threshold, the resource utilization rate of the network card bound by the agent is maximized, and the success rate and efficiency of the server installation process are improved.

[0102] In an optional embodiment, the above step of determining the first installation queue based on the first number of the target server to be installed at the current time and the evaluation threshold comprises the following steps:

[0103] Calculate a first evaluation parameter based on the first number;

[0104] Compare the first evaluation parameter with the evaluation threshold to obtain a comparison result;

[0105] Determine the first installation queue according to the comparison result.

[0106] The disclosure exemplarily describes the determination process of the first installation queue.

[0107] Specifically, in the embodiment of the disclosure, a first evaluation parameter is calculated for the number of servers to be concurrently installed at the current time, and the first evaluation parameter and the evaluation threshold are compared to determine whether there is a remaining network card bandwidth at the current time, so as to determine the first installation queue of the servers finally needed to be installed at the current time.

[0108] In the above embodiment, the number of concurrently installed servers and the first installation queue, i.e., the first number and the first installation queue, are associated, the first installation queue can be adjusted in real time, the processing capacity for the target server in the first installation queue can be ensured, the resource utilization is maximized, and the success rate of the installation process is effectively improved.

[0109] In an optional embodiment, the above step of determining the first installation queue according to the comparison result comprises the following steps:

[0110] determine a first server from the plurality of target servers, in a case where the first evaluation parameter is determined to be less than or equal to the evaluation threshold based on the comparison result; wherein the first server is a target server that is to be installed at a time point after the current time point;

[0111] determine the first installation queue based on the target server to be installed at the current time point and the first server.

[0112] In the embodiments of the present disclosure, if the first evaluation parameter is less than or equal to the evaluation threshold, it indicates that there is remaining bandwidth of the network card to which the agent is bound at the current time point, and other target servers can also be installed at the current time point. In this regard, a first server is determined from the plurality of target servers, and the first server is added to the target servers to be installed at the current time point to obtain a first installation queue at the current time point.

[0113] The number of the first servers can be one or more. After the first server is added to the target servers to be installed at the current time point, it can be determined whether other target servers can be installed by comparing the evaluation parameter and the evaluation threshold again until the first evaluation parameter is greater than the evaluation threshold.

[0114] Moreover, after installation of at least one target server in the first installation queue is completed, the first installation queue after the installation is completed can be determined again by using the above evaluation method.

[0115] In the above embodiments, it can be determined according to the comparison result whether there is idle bandwidth at the current time point, and then a first installation queue that needs to be installed at the current time point is determined, so that the installation queue can be adjusted in real time according to the number of servers to be installed in parallel, thereby effectively reducing the installation time delay of each target server on the basis of improving the bandwidth utilization rate.

[0116] In an optional embodiment, the above step of calculating the first evaluation parameter based on the first number includes the following steps:

[0117] determining a bandwidth peak value in the process of installing the first installation queue;

[0118] performing an operation on the first number and the bandwidth peak value to obtain an operation result;

[0119] calculating a product of the first number and the evaluation threshold to obtain a product result;

[0120] determining a ratio of the operation result and the product result to obtain the first evaluation parameter.

[0121] The present disclosure can be used to calculate a first evaluation parameter, wherein a first evaluation parameter, a bandwidth peak value in the process of installing the first installation queue, which can also be understood as a network card bandwidth peak value of the network card to which the agent is bound, a first number, an evaluation threshold.

[0122] In the above embodiment, the server installation concurrency and the bandwidth, i.e., the first number and the bandwidth peak value, are associated, the first evaluation parameter can be calculated in real time to measure the bandwidth occupation at different times, resource utilization maximization is realized, and the number of concurrent installations of the server is accurately controlled according to the first evaluation parameter.

[0123] In an optional embodiment, the step of determining the first installation queue according to the comparison result specifically includes the following steps:

[0124] In the case where the first evaluation parameter is greater than the evaluation threshold, the first installation queue is determined based on the target servers to be installed at the current time.

[0125] In the embodiment of the present disclosure, if the first evaluation parameter is greater than the evaluation threshold, the addition of other target servers to be installed at the current time is suspended, the utilization rate of the network card bandwidth is maximized at the current time, the first installation queue is determined according to the target servers to be installed at the current time, and the continuity of the server installation process is ensured.

[0126] In an optional embodiment, the method in the above step further specifically includes the following steps:

[0127] In the process of installing the target servers in the first installation queue, if it is detected that any one of the target servers in the first installation queue is installed, the target servers in the first installation queue are updated based on the number of target servers in the first installation queue at the current time.

[0128] As mentioned above, in the embodiment of the present disclosure, in the process of installing the target servers in the first installation queue, if any one or more of the target servers in the first installation queue is installed, the evaluation parameter is recalculated based on the number of target servers in the first installation queue to obtain a second evaluation parameter, the second evaluation parameter is compared with the evaluation threshold to obtain a corresponding comparison result, and finally the target servers in the first installation queue are updated based on the comparison result in the manner mentioned above to obtain an updated installation queue at the current time, so that the target servers in the updated installation queue can be installed according to the installation script to form a complete installation processing link, thereby ensuring the flexibility of the server installation process.

[0129] In an optional embodiment, the step of customizing the configuration file includes a reinstallation strategy, and after the installation script is used to install the target server, the method comprises the following steps:

[0130] In the case of a first installation failure of the target server, the target server is reinstalled based on the reinstallation strategy in the custom configuration file;

[0131] The number of retries for installing the target server is determined.

[0132] If the number of retries is greater than the number of reinstallation times in the reinstallation strategy, it is determined that the target server installation fails, and installation failure information is generated based on the number of retries and the installation failure reason.

[0133] If the first installation of the target server fails or times out, the target server is added to the retry queue according to the reinstallation strategy, and the target server is reinstalled after waiting for a while.

[0134] If the number of retries for installing the target server is greater than the number of reinstallation times, it is determined that the target server finally fails to install, and the target server is added to the installation failure queue, and installation failure information is generated based on the number of retries and the installation failure reason. The number of retries can include or not include the number of first installation failures, and can be adjusted as needed.

[0135] The agent in the management platform can periodically process the target servers in the installation failure queue, and power off the target servers that fail to install.

[0136] To this end, the agent can set a temporary PXE (Preboot Execution Environment) for the target server to be installed, and perform a hard reboot operation. After the target server to be installed is powered on, a network address request is sent to a DHCP (Dynamic Host Configuration Protocol) server, which can be used to obtain an IP address (Internet Protocol Address) and a DHCP address. After the DHCP server receives the network address request, the target server to be installed is configured with an IP address, and the installation state of the target server to be installed is switched from CLOSED to PXE-ING.

[0137] The agent can sustainably manage the local DHCP service. If the target server to be installed successfully acquires the DHCP address, the installation state of the target server to be installed is switched to PXE-SUCCESS. Then, an image file is acquired to start the operating system according to the image file. In the case that the operating system is successfully installed, the installation state of the target server to be installed is switched to CONFIGURATION, and the configuration phase of the target server is entered. When the target server is successfully configured, the installation state of the target server to be installed is switched to AIREADY.

[0138] The agent of the present disclosure can automatically flow the installation state of the target server, and execute corresponding processes according to the installation state. Each process can be state rollback, and the corresponding installation state is updated.

[0139] In the present disclosure, the agent is deployed in a container pod in a kubernetes environment. The container pod includes a main service container and a sidecar container. The main service container is used to acquire the installation information of the target server to be installed, and to analyze the installation information to dynamically generate an installation script of the target server. The sidecar container is used to implement PXE, DHCP and other services. The host computer where the sidecar container is located and the target server to be installed are in network intercommunication.

[0140] The following will be described in combination with Figure 2 and Figure 3 The above server installation process is described as follows, such as Figure 2The custom configuration file includes a plurality of network area selectors applicable, which can be a core control area CORE, a demilitarized zone DMZ, a physical or logical resource pool (availability zone) POD1; a name of a server name: hostNameTemplate; a type of an operating system expected to be configured by a user of each network area image: bclinux-for-euler 21.10; a mapping relationship between resource types and hard disk partition template identification information, the resource type can be computing type, block storage type, and network type, the computing type corresponds to hard disk partition template FQ-01, the block storage type corresponds to hard disk partition template FQ-02, and the network type corresponds to hard disk partition template FQ-04; a mapping relationship between resource types and network configuration template identification information, the computing type corresponds to network configuration template NET-01, the block storage type corresponds to network configuration template NET-02, and the network type corresponds to network configuration template NET-04, the hard disk partition template identification information and the network configuration template identification information are installation template identification information; a final installation state of the server status: REDAY; a network address instance of a resource pool internal network time protocol server NTP (Network Time Protocol Server) ntp: ntpServer; a reinstall policy of the operating system retryPolicy: the number of reinstallation is 3 times; an evaluation threshold bandwidth: 0.75.

[0141] With reference to Figure 2 As shown, each network area corresponds to an agent, that is, each network area corresponds to an agent, and each agent is used to control the installation process of the target server in the network area.

[0142] As Figure 3 shown, the specific process is described as follows:

[0143] S301: Obtain a custom configuration file.

[0144] The custom configuration file is a declarative configuration file, and is used to define a target operating system configuration of at least one type of server.

[0145] S302: Obtain installation information of a target server to be installed.

[0146] The installation information includes a name of the target server, a network area where the target server is located, and a serial number of the target server.

[0147] S303: Determine whether the target server is associated with a plurality of network areas applicable to the custom configuration file.

[0148] If yes, S304-S305 are executed; if no, S306 is executed.

[0149] S304: determining a target network area associated with the target server in a plurality of network areas to which the self-defined configuration file is applied.

[0150] S305: obtaining a service type of the target server.

[0151] S306: ending and rejecting the processing.

[0152] S307: judging whether the service type of the target server matches a resource type supported by the target network area.

[0153] If yes, S308-S309 are executed; if no, S310 is executed.

[0154] S308: determining target installation template identification information associated with the target network area based on a mapping relationship.

[0155] S309: obtaining an installation instance corresponding to the target installation template identification information in a local template library as a target installation instance.

[0156] S310: generating the target installation instance based on the service type of the target server and installation information.

[0157] S311: combining the target installation instance and the installation information to obtain an installation script of the target server.

[0158] S312: in a case where the first installation of the target server fails, re-installing the target server based on a re-installation strategy in the self-defined configuration file.

[0159] S313: determining a retry number of the installation of the target server.

[0160] S314: if the retry number is greater than a re-installation number in the re-installation strategy, determining that the installation of the target server fails, and generating installation failure information based on the retry number and an installation failure cause.

[0161] It can be known from the above description that the technical scheme of the present disclosure has the following advantages:

[0162] The present disclosure is based on a terminal state-oriented idea. A user declares different types of operating system resources respectively, including the operating system type of the type of server, hard disk partition, network configuration, and other resource objects, defines the resource objects into a custom resource description CRD in Kubernetes, and generates a custom configuration file. Based on the declarative idea, the system continuously approaches the terminal state and finally reaches the terminal state. If the server configuration needs to be modified later, updating the corresponding custom configuration file can trigger the update. This approach has higher flexibility and maintainability. Moreover, the server installation process is applicable to multiple network regions and is uniformly managed by a management platform, achieving global maintenance of the configuration and visualization of the installation process.

[0163] Among them, the terminal state-oriented is a kind of idea that declaratively describes the desired configuration of infrastructure and application, continuously monitors the actual running state of the application, and repeatedly adjusts the system itself until it approaches the terminal state. The terminal state-oriented indicates that it is not one-time, but needs to be continuously maintained in the target state.

[0164] Based on the same inventive concept, the present disclosure also provides a server installation device corresponding to the server installation method. Since the principle of solving problems in the device of the present disclosure is similar to the above-mentioned server installation method of the present disclosure, the implementation of the device can be referred to the implementation of the method, and the repeated parts will not be described again.

[0165] Referring to Figure 4 Fig. 1 is a schematic diagram of a server installation device provided by an embodiment of the present disclosure. The device comprises a data acquisition unit 40, an installation information acquisition unit 41, and an installation processing unit 42. Wherein:

[0166] The data acquisition unit is configured to acquire a custom configuration file. The custom configuration file is a declarative configuration file, which is used to define the target operating system configuration of at least one type of server.

[0167] The installation information acquisition unit is configured to acquire installation information of a target server to be installed.

[0168] The installation processing unit is configured to generate an installation script of the target server based on the custom configuration file and the installation information, and perform installation processing on the target server according to the installation script.

[0169] In a possible implementation, the server installation device is further configured to:

[0170] Determine a target network region associated with the target server in a plurality of network regions to which the custom configuration file is applicable;

[0171] Acquire a service type of the target server.

[0172] determine a target installation instance based on a matching degree between the service type of the target server and a resource type supported by the target network area, wherein the target installation instance comprises a hard disk partition instance and a network configuration instance;

[0173] combine the target installation instance and the installation information to obtain an installation script of the target server.

[0174] In a possible implementation, the server installation apparatus is further configured to:

[0175] determine target installation template identification information associated with the target network area in a case where the service type of the target server matches the resource type supported by the target network area;

[0176] obtain, in a local template library, an installation instance corresponding to the target installation template identification information as the target installation instance.

[0177] In a possible implementation, the server installation apparatus is further configured to:

[0178] generate the target installation instance based on the service type of the target server and the installation information in a case where the service type of the target server does not match the resource type supported by the target network area.

[0179] In a possible implementation, the server installation apparatus is further configured to:

[0180] determine first installation template identification information corresponding to the target installation instance;

[0181] establish a first mapping relationship between the service type of the target server and the first installation template identification information, and add the first mapping relationship to the custom configuration file to obtain an updated custom configuration file.

[0182] In a possible implementation, the server installation apparatus is further configured to:

[0183] determine a target server to be installed at a current time in a case where the target server is a plurality of target servers;

[0184] determine a first installation queue based on a first number of target servers to be installed at the current time and the evaluation threshold value;

[0185] perform installation processing on target servers in the first installation queue according to the installation script.

[0186] In a possible implementation, the server installation apparatus is further configured to:

[0187] calculate a first evaluation parameter based on the first quantity;

[0188] compare the first evaluation parameter with the evaluation threshold to obtain a comparison result;

[0189] determine the first installation queue according to the comparison result.

[0190] In a possible implementation, the server installation device is further configured to:

[0191] determine a first server from the target servers based on the comparison result, wherein the first server is a target server that performs installation processing after the current time point;

[0192] determine the first installation queue based on the target servers to be installed at the current time point and the first server.

[0193] In a possible implementation, the server installation device is further configured to:

[0194] determine a bandwidth peak value in the process of installing the first installation queue;

[0195] perform an operation on the first quantity and the bandwidth peak value to obtain an operation result;

[0196] calculate a product of the first quantity and the evaluation threshold to obtain a product result;

[0197] determine a ratio of the operation result and the product result to obtain the first evaluation parameter.

[0198] In a possible implementation, the server installation device is further configured to:

[0199] determine the first installation queue based on the target servers to be installed at the current time point in a case where the first evaluation parameter is greater than the evaluation threshold.

[0200] In a possible implementation, the server installation device is further configured to:

[0201] update the target servers in the first installation queue based on the number of target servers in the first installation queue at the current time point in a case where installation of any target server in the first installation queue is detected in the process of performing installation processing on the target servers in the first installation queue.

[0202] In a possible implementation, the server installation device is further configured to:

[0203] In a case of a first installation failure of the target server, reinstalling the target server based on a reinstall policy in the custom configuration file;

[0204] Determining a retry number of the installation of the target server;

[0205] If the retry number is greater than a reinstall number in the reinstall policy, determining that the installation of the target server fails, and generating installation failure information based on the retry number and an installation failure cause.

[0206] The description of the processing flow of each module and the interaction flow between the modules can refer to the related description in the above method embodiments, and will not be described in detail here.

[0207] Corresponding to the server installation method in Figure 1 The embodiments of the present disclosure also provide an electronic device 50, as shown in Figure 5 The electronic device 50 provided by the embodiments of the present disclosure is a structural schematic diagram, which includes:

[0208] A processor 51, a memory 52, and a bus 53; the memory 52 is used to store execution instructions, including an internal memory 521 and an external memory 522; the internal memory 521 is also called an internal storage, which is used to temporarily store operation data in the processor 51 and exchange data with the external memory 522 such as a hard disk, and the processor 51 exchanges data with the external memory 522 through the internal memory 521; when the electronic device 50 is running, the processor 51 and the memory 52 communicate through the bus 53, so that the processor 51 executes the following instructions:

[0209] Obtaining a custom configuration file; wherein the custom configuration file is a declarative configuration file, which is used to define target operating system configurations of at least one type of server;

[0210] Obtaining installation information of a target server to be installed;

[0211] Generating an installation script of the target server based on the custom configuration file and the installation information, and performing installation processing on the target server according to the installation script.

[0212] The embodiments of the present disclosure also provide a computer readable storage medium, which stores a computer program, and the computer program is run by a processor to execute the steps of the server installation method described in the above method embodiments. The storage medium can be a volatile or non-volatile computer readable storage medium.

[0213] The embodiments of the present disclosure also provide a computer program product 60, as shown in Figure 6As shown, a computer program product 60 provided by the embodiment of the present disclosure is provided, and the computer program product 60 carries a computer program 61. The computer program 61 includes a program that can be used to execute the steps of the server installation method described in the above method embodiments. For details, refer to the above method embodiments, which will not be described here.

[0214] The server installation method, device, equipment, medium and product according to the embodiment of the present disclosure are described above with reference to the drawings. First, a custom configuration file is acquired. The custom configuration file is a declarative configuration file, which is used to define the target operating system configuration of at least one type of server. Then, installation information of a target server to be installed is acquired. Finally, an installation script of the target server is generated based on the custom configuration file and the installation information, and the target server is installed according to the installation script. Through the above processing mode, the final state of the desired operating system resource is determined through the custom configuration file, and the configuration information such as the type of the operating system expected to be configured by the user, the resource type and the installation template identification information is defined individually. Different configuration mechanisms are automatically selected according to different types of servers, the flexibility of the server installation process is improved, and if the server configuration needs to be modified, the custom configuration file can be updated to trigger the update, so that the processing logic of the installation process is determined based on the generated installation script, which can effectively improve the flexibility and expansibility of the server installation process.

[0215] The basic principles of the present disclosure are described above in combination with specific embodiments. However, it should be pointed out that the advantages, advantages, effects and the like mentioned in the present disclosure are only examples and are not limiting, and these advantages, advantages, effects and the like cannot be considered as the necessary possession of each embodiment of the present disclosure. In addition, the above specific details are only for the purpose of example and understanding, and are not limiting, and the above details do not limit the present disclosure to the above specific details.

[0216] The block diagrams of the devices, apparatuses, equipment, systems involved in the present disclosure are only illustrative examples and are not intended to require or imply that the connection, arrangement, configuration must be as shown in the block diagram. As those skilled in the art will recognize, these devices, apparatuses, equipment, systems can be connected, arranged, configured in any manner. Words such as "include", "contain", "have" and the like are open-ended words, which mean "including but not limited to", and can be used interchangeably. The words "or" and "and" used herein mean the word "and / or", and can be used interchangeably unless the context clearly indicates otherwise. The word "such as" used herein means the phrase "such as but not limited to", and can be used interchangeably.

[0217] Also, as used in the description herein and throughout the claims that follow, the meaning of "or" includes "and / or" unless the context clearly dictates otherwise. For example, when used in the examination of "at least one of A or / and B" the phrase "at least one of A or B" means A or B or both. As used in the examination of "between one and three of A, B, and C," the phrase means A or B or C, or any combination thereof.

[0218] It is also important to note that the systems and methods of the disclosure can be embodied in a variety of forms depending on the particular requirements of the applications. Some embodiments can be implemented in software, while other embodiments can be implemented in hardware or a combination of software and hardware. As used herein the term "software" includes but is not limited to one or more computer program(s) or other computer readable instructions that can be stored or carried on a computer readable medium, such as a floppy disk, a flexible disk, a hard disk, a magnetic tape, a magnetic disk, an optical disk, a CD-ROM, RAM, ROM, PROM, EPROM, a flash memory, a solid state drive, or other memory chip or cartridge, or the like.

[0219] Various changes, modifications and alterations to the techniques described herein can be made without departing from the teachings of the attached claims. Moreover, the scope of the claims should not be limited to the particular aspects described in the above description and drawings. Rather, the scope of the claims should be understood to include all aspects and equivalents thereof that are within the scope of the claims. The disclosure is not intended to be limited to the aspects specifically identified hereinabove. Rather, the scope of the disclosure includes all aspects and equivalents thereof that are within the scope of the claims.

[0220] The above description of disclosed aspects is intended to be illustrative, and not restrictive. Many other aspects can be apparent to those of skill in the art upon reviewing the above description. The scope of the disclosure should therefore be determined with reference to the appended claims, along with the full scope of equivalents to which such claims are entitled. The claims should not be limited to the features described hereinabove, but should be given their full scope since numerous modifications and alterations mentioned above are within the scope of the present disclosure. Accordingly, the disclosure is not limited to particular aspects described herein as such, but can vary considerably.

[0221] The above description has been presented for the purpose of illustration and description. Further, the description is not intended to limit the embodiments of the disclosure to the form disclosed herein. Although various example aspects and embodiments have been discussed above, those of skill in the art will recognize certain modifications, permutations, additions, and sub-combinations thereof.

Claims

1. A server installation method, characterized by, The method comprises the following steps: obtaining a custom configuration file; wherein the custom configuration file is a declarative configuration file used for defining target operating system configurations of at least one type of server; obtaining installation information of a target server to be installed; generating an installation script of the target server based on the custom configuration file and the installation information, and performing installation processing on the target server according to the installation script; wherein the step of generating the installation script of the target server based on the custom configuration file and the installation information comprises: determining a target network area associated with the target server in a plurality of network areas applicable to the custom configuration file; obtaining a service type of the target server; determining a target installation instance based on a matching degree between the service type of the target server and a resource type supported by the target network area; wherein the target installation instance comprises a hard disk partition instance and a network configuration instance; combining the target installation instance and the installation information to obtain the installation script of the target server.

2. The method of claim 1, wherein, The step of determining the target installation instance based on the matching degree between the service type of the target server and the resource type supported by the target network area comprises: in the case that the service type of the target server matches the resource type supported by the target network area, determining target installation template identification information associated with the target network area; obtaining an installation instance corresponding to the target installation template identification information in a local template library as the target installation instance.

3. The method of claim 1, wherein, The step of determining the target installation instance based on the matching degree between the service type of the target server and the resource type supported by the target network area comprises: in the case that the service type of the target server does not match the resource type supported by the target network area, generating the target installation instance based on the service type of the target server and the installation information.

4. The method of claim 1, wherein, The custom configuration file comprises an evaluation threshold; the step of performing installation processing on the target server according to the installation script comprises: in the case that there are a plurality of target servers, determining a target server to be installed at a current time; determining a first installation queue based on a first number of target servers to be installed at the current time and the evaluation threshold; performing installation processing on target servers in the first installation queue according to the installation script.

5. The method of claim 4, wherein, The step of determining the first installation queue based on the first number of target servers to be installed at the current time and the evaluation threshold comprises: calculating a first evaluation parameter based on the first number; comparing the first evaluation parameter and the evaluation threshold to obtain a comparison result; determining the first installation queue according to the comparison result.

6. The method of claim 5, wherein, The step of calculating the first evaluation parameter based on the first number comprises: determining a bandwidth peak value in the process of installing the first installation queue; performing an operation on the first number and the bandwidth peak value to obtain an operation result; calculating a product of the first number and the evaluation threshold to obtain a product result; determining a ratio of the operation result and the product result to obtain the first evaluation parameter.

7. The method of claim 5, wherein, The determining the first installation queue according to the comparison result comprises: In a case where the first evaluation parameter is determined to be less than or equal to the evaluation threshold based on the comparison result, a first server is determined from the target servers; the first server is a target server to be installed after the current time point; The first installation queue is determined based on the target server to be installed at the current time point and the first server.

8. The method of claim 5, wherein, The determining the first installation queue according to the comparison result comprises: In a case where the first evaluation parameter is greater than the evaluation threshold, the first installation queue is determined based on the target server to be installed at the current time point.

9. The method of claim 1, wherein, The self-defined configuration file comprises a reinstallation strategy, and after the target server is installed according to the installation script, the method further comprises: In a case where the target server fails to be installed for the first time, the target server is reinstalled based on the reinstallation strategy; A retry number of installation of the target server is determined; If the retry number is greater than a reinstallation number in the reinstallation strategy, it is determined that the target server fails to be installed, and installation failure information is generated based on the retry number and an installation failure cause.

10. A server installation device, characterized by Comprise: A data acquisition unit is configured to acquire a self-defined configuration file; the self-defined configuration file is a declarative configuration file, and is configured to define target operating system configurations of at least one type of server; An installation information acquisition unit is configured to acquire installation information of a target server to be installed; An installation processing unit is configured to generate an installation script of the target server based on the self-defined configuration file and the installation information, and to install the target server according to the installation script; Further configured to: Determine a target network area associated with the target server from a plurality of network areas to which the self-defined configuration file applies; Acquire a service type of the target server; Determine a target installation instance based on a matching degree between the service type of the target server and a resource type supported by the target network area; the target installation instance comprises a hard disk partition instance and a network configuration instance; Combine the target installation instance and the installation information to obtain the installation script of the target server.

11. An electronic device, comprising: Comprise: A processor, a memory and a bus; the memory stores machine readable instructions executable by the processor; when the electronic device is running, the processor and the memory communicate through the bus; when the machine readable instructions are executed by the processor, the steps of the server installation method in any one of claims 1 to 9 are executed.

12. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program; when the computer program is executed by the processor, the steps of the server installation method in any one of claims 1 to 9 are executed.

13. A computer program product, characterised in that, The computer program product is stored in a storage medium; the program product is executed by at least one processor to implement the server installation method in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Resource deployment method and device, terminal equipment and storage medium

    CN118796409A

  • Installation method of server operating system, server management system, storage medium and electronic device

    CN120215966A