Server installation method, device, equipment, medium and product
By automatically matching custom configuration files and installation information to generate installation scripts, the problem of insufficient flexibility in the server installation process in the existing technology is solved, and automated installation and efficient installation processing of multiple server types are achieved.
Patent Information
- Application Number
- CN202511262104.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-05
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-09-05
AI Technical Summary
In the prior art, when installing different types of operating systems, it is necessary to manually modify the underlying configuration files, resulting in insufficient flexibility and scalability in the server installation process.
Use custom configuration files to generate installation scripts based on declarative configuration files. Automatically match the network area and service type of the target server through the custom configuration files and installation information to generate personalized installation scripts. Support installation of multiple server types, and retry and record failure information when installation fails.
It improves the flexibility and scalability of the server installation process, supports automated installation of multiple server types, reduces manual operations, and improves installation success rate and efficiency.
Smart Images

Figure CN120743312A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of cloud computing, and in particular to a server installation method, apparatus, device, medium, and product. Background Art
[0002] As demand for cloud resource pools continues to expand, internet data centers are increasingly demanding a wide variety of physical servers. On-site personnel must manually install operating systems on a wide range of server manufacturers and models, either manually or using sporadic scripting tools.
[0003] Related technologies generally support the installation process of the same type of operating system or server. If other types of operating systems need to be deployed, the underlying configuration files need to be manually modified, which results in insufficient flexibility and scalability of the installation process. Summary of the Invention
[0004] In view of the above problems, the present disclosure is proposed. 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: Obtaining a custom configuration file; wherein the custom configuration file is a declarative configuration file for defining a target operating system configuration for at least one type of server; Obtain the installation information of the target server to be installed; An installation script for 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.
[0006] In addition, according to one aspect of the present disclosure, generating the installation script of the target server based on the custom configuration file and the installation information includes: determining a target network zone associated with the target server among the plurality of network zones to which the custom configuration file is applicable; Obtain the service type of the target server; Determining a target installation instance based on a degree of matching 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; The target installation instance and the installation information are combined to obtain an installation script for the target server.
[0007] In addition, according to one aspect of the present disclosure, determining a target installation instance based on a degree of matching between a service type of the target server and a resource type supported by the target network area includes: In a case where 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; An installation instance corresponding to the target installation template identification information is obtained in a local template library as the target installation instance.
[0008] In addition, according to one aspect of the present disclosure, determining a target installation instance based on a degree of matching between a service type of the target server and a resource type supported by the target network area includes: In a 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.
[0009] In addition, according to one aspect of the present disclosure, the custom configuration file includes an evaluation threshold; and the step of performing installation processing on the target server according to the installation script includes: When there are multiple target servers, determining the target server to be installed at the current moment; Determining a first installation queue based on the first number of target servers to be installed at the current moment and the evaluation threshold; The target servers in the first installation queue are installed according to the installation script.
[0010] In addition, according to one aspect of the present disclosure, determining the first installation queue based on the first number of target servers to be installed at the current moment and the evaluation threshold includes: calculating a first evaluation parameter based on the first quantity; Comparing the first evaluation parameter with the evaluation threshold to obtain a comparison result; The first installation queue is determined according to the comparison result.
[0011] In addition, according to one aspect of the present disclosure, determining the first installation queue according to the comparison result includes: If it is determined based on the comparison result that the first evaluation parameter is less than or equal to the evaluation threshold, determining a first server from the plurality of target servers; wherein the first server is a target server that is to be installed after the current moment; The first installation queue is determined based on the target server to be installed at the current moment and the first server.
[0012] In addition, according to one aspect of the present disclosure, calculating a first evaluation parameter based on the first quantity includes: Determining a bandwidth peak value during installation of the first installation queue; Performing a calculation on the first number and the bandwidth peak value to obtain a calculation result; Calculating the product of the first number and the evaluation threshold to obtain a product result; A ratio of the operation result to the multiplication result is determined to obtain the first evaluation parameter.
[0013] In addition, according to one aspect of the present disclosure, determining the first installation queue according to the comparison result includes: When 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 moment.
[0014] In addition, according to one aspect of the present disclosure, the custom configuration file includes a reinstallation strategy. After the target server is installed according to the installation script, the method further includes: In the event that the initial installation of the target server fails, reinstalling the target server based on the reinstallation policy in the custom configuration file; Determining a number of retries for installing the target server; If the number of retries is greater than the number of retries in the reinstallation strategy, it is determined that the installation of the target server has failed, and installation failure information is generated based on the number of retries and the reason for the installation failure.
[0015] According to another aspect of the present disclosure, a server installation device is provided, comprising: A data acquisition unit, configured to acquire a custom configuration file; wherein the custom configuration file is a declarative configuration file, configured to define a target operating system configuration for at least one type of server; An installation information acquisition unit, used to acquire installation information of a target server to be installed; An installation processing unit is configured to generate an installation script for 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.
[0016] According to another aspect of the present disclosure, an electronic device is provided, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps in the above-mentioned server installation method are performed.
[0017] According to another aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned server installation method are executed.
[0018] According to another aspect of the present disclosure, a computer program product is provided. The computer program product is stored in a storage medium and is executed by at least one processor to implement the steps in the above-mentioned server installation method.
[0019] As will be described in detail below, according to the server installation method, apparatus, equipment, medium and product of the embodiment of the present disclosure, a custom configuration file is obtained; wherein, 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, the installation information of the target server to be installed is obtained; finally, an installation script for 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 method, the final state of the desired operating system resources is determined through the custom configuration file, and the configuration information such as the type of operating system, resource type and installation template identification information that the user desires to configure is personalized, so as to realize automatic selection of different configuration mechanisms according to different types of servers, thereby improving the flexibility of the server installation process. Moreover, if the server configuration needs to be modified, updating the custom configuration file can trigger the update, thereby determining the processing logic of the installation process based on the generated installation script, which can effectively improve the flexibility and scalability of the server installation process.
[0020] It is to be understood that both the foregoing general description and the following detailed description are exemplary, and are intended to provide further explanation of the technology as claimed. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The above and other purposes, features, and advantages of the present disclosure will become more apparent through a more detailed description of the embodiments of the present disclosure in conjunction with the accompanying drawings. The accompanying drawings are intended to provide a further understanding of the embodiments of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the present disclosure and are not intended to limit the present disclosure. In the drawings, the same reference numerals generally represent the same components or steps.
[0022] Figure 1 is a flowchart illustrating a server installation method according to an embodiment of the present disclosure.
[0023] Figure 2 3 is a schematic diagram illustrating a customized configuration file in a server installation method according to an embodiment of the present disclosure.
[0024] Figure 3It is a schematic diagram illustrating a server installation process in a server installation method according to an embodiment of the present disclosure.
[0025] Figure 4 is a block diagram illustrating a server installation device according to an embodiment of the present disclosure.
[0026] Figure 5 is a hardware block diagram illustrating an electronic device according to an embodiment of the present disclosure.
[0027] Figure 6 is a schematic diagram illustrating a computer program product according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solutions and advantages of the present disclosure more apparent, the following will describe in detail exemplary embodiments of the present disclosure with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all the embodiments of the present disclosure, and it should be understood that the present disclosure is not limited to the exemplary embodiments described herein.
[0029] To facilitate understanding of this embodiment, a server installation method disclosed in this embodiment is first described in detail. The server installation method provided in this embodiment is generally executed by an electronic device with certain computing capabilities, such as a terminal device, a server, or other processing device. In some possible implementations, this server installation method can be implemented by a processor invoking computer-readable instructions stored in a memory.
[0030] See also Figure 1 FIG. 1 is a flow chart of a server installation method provided by an embodiment of the present disclosure, wherein the method includes steps S101 to S103, wherein: Step S101: Obtain a custom configuration file; wherein the custom configuration file is a declarative configuration file, which is used to define a target operating system configuration of at least one type of server.
[0031] The execution entity of the server installation method can be a management platform, which includes a regional agent and an instance management module. The agent is responsible for process tuning and control of the operating system resource status and processes custom configuration files based on a list-watch mechanism that continuously monitors resource changes. The custom configuration files here can be JSON files, YAML files, or custom resource files (CR). The instance management module is used to manage the installation instances in the local template library and the metadata of the installation instances.
[0032] The operating system definition can be represented by a custom resource description (CRD) in Kubernetes. CRD describes a specific operating system resource instance, which serves as the operating system information record carrier for custom configuration files and can use YAML files to customize the operating system type.
[0033] Specifically, the custom configuration file includes the applicable multiple network zone selectors, the server name (name), the desired operating system type (image), the mapping between resource types and installation template identifiers, the server's final installation status (status), the network address instance (ntp) of the resource pool's internal Network Time Protocol (NTP) server, the operating system retry policy (retryPolicy), and the evaluation threshold (bandwidth). The contents of the custom configuration file can be adjusted as needed; this disclosure does not require this.
[0034] Among them, the custom profile is applicable to multiple network areas, such as the core control area CORE, the demilitarized zone DMZ, and the physical or logical resource pool (availability zone) POD1. The server name can be configured through the hostNameTemplate template in the instance management module. The type of operating system that users in each network area want to configure 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 the installation template name, installation template ID, or a hash value of the installation template. Correspondingly, the mapping relationship includes the mapping relationship partition between the resource type and the hard disk partition template identification information, and the mapping relationship network between the resource type and the network configuration template identification information. NTP can also be obtained from the instance management module. The resource type can be computing, block storage, or network. The resource types supported by different network areas can be the same or different. In this way, the availability of the custom profile can be improved while ensuring the isolation of network areas.
[0035] Step S102: Obtain installation information of the target server to be installed.
[0036] Here, the installation information includes information such as the name of the target server, the network area where the target server is located, and the serial number of the target server.
[0037] In the embodiment of the present disclosure, after obtaining the custom configuration file, the management platform parses the custom configuration file through the agent, and calls the instance management module through the Restful interface to verify the legality of the content in the custom configuration file. If it is illegal, the processing of the custom configuration file is stopped; if it is legal, the installation information of the target server to be installed is obtained from the instance management module.
[0038] Step S103: generating an installation script for 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.
[0039] In the embodiment of the present disclosure, a Kickstart file, an installation script of the target server, is generated according to the custom configuration file and the installation information, and the target server is installed according to the installation script.
[0040] In the above implementation, the final state of the desired operating system resources is determined through a custom configuration file, and personalized definition is performed for configuration information such as the type of operating system, resource type, and installation template identification information that the user desires to configure, so as to automatically select different configuration mechanisms according to different types of servers, thereby improving the flexibility of the server installation process. Moreover, if the server configuration needs to be modified, updating the custom configuration file can trigger the update, thereby determining the processing logic of the installation process based on the generated installation script, which can effectively improve the flexibility and scalability of the server installation process.
[0041] In an optional embodiment, the above step of generating an installation script for the target server based on the custom configuration file and the installation information includes: determining a target network zone associated with the target server among the plurality of network zones to which the custom configuration file is applicable; Obtain the service type of the target server; Determining a target installation instance based on a degree of matching 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; The target installation instance and the installation information are combined to obtain an installation script for the target server.
[0042] Here, if the resource types supported by the target network area are computing, block storage, and network, and the service type of the target server is computing, then a target installation instance corresponding to the computing type is determined.
[0043] The present disclosure does not limit the specific content of the target installation instance, and can be adaptively adjusted according to the actual application scenario.
[0044] In the embodiment 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, that is, the target network area, and 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 degree of matching, and finally combine the hard disk partition instance, network configuration instance and installation information to obtain the installation script of the target server.
[0045] In the above implementation, the installation script of the target server is automatically generated by dual alignment between the custom configuration file and the target server, namely the network area and service type, thereby improving the accuracy of the server installation process and supporting the installation of multiple server service types, thereby effectively improving the flexibility of the installation process.
[0046] In an optional embodiment, the above step of determining the target installation instance based on the degree of matching between the service type of the target server and the resource type supported by the target network area specifically includes the following steps: In a case where 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; An installation instance corresponding to the target installation template identification information is obtained in a local template library as the target installation instance.
[0047] If the service type of the target server matches at least one resource type supported by the target network area, target installation template identification information associated with the target network area may be determined based on the mapping relationship.
[0048] In an embodiment of the present disclosure, when 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, that is, the target installation template identification information, is determined, and the target installation instance corresponding to the target installation template identification information is searched in the local database through the instance management module.
[0049] In the above implementation, accurate matching of service type and resource type is achieved, and a link from the installation template name to the template instance is established. The custom configuration file does not carry the complete template instance. When the template instance needs to be updated, there is no need to re-issue the custom configuration file, which can achieve lightweight custom configuration files.
[0050] In an optional embodiment, the above step of determining the target installation instance based on the degree of matching between the service type of the target server and the resource type supported by the target network area specifically includes the following steps: In a 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.
[0051] In the embodiment of the present disclosure, when the service type of the target server and the resource type supported by the target network area do not match, a target installation instance can be generated directly based on the service type and installation information of the target server to improve the fault tolerance of the matching process and thus ensure the continuity of the installation process.
[0052] In an optional embodiment, after the target installation instance is generated based on the service type of the target server and the installation information, the method further specifically includes the following steps: Determine the first installation template identification information corresponding to the target installation instance; 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 to the custom configuration file to obtain an updated custom configuration file.
[0053] As mentioned above, the custom configuration file includes the mapping relationship between resource types and installation template identification information. In this regard, after obtaining the target installation instance, the present disclosure can add a new mapping relationship in the custom configuration file for the target installation instance to achieve the update of the custom configuration file.
[0054] In an embodiment 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 can be established, and the first mapping relationship can be added to the custom configuration file. This can improve the scalability of the custom configuration file, so that the updated custom configuration file can support more resource types, and then facilitate matching with more service types to improve the flexibility of the server installation process.
[0055] In an optional embodiment, the custom configuration file in the above step includes an evaluation threshold; and the installation process on the target server according to the installation script specifically includes the following steps: When there are multiple target servers, determining the target server to be installed at the current moment; Determining a first installation queue based on the first number of target servers to be installed at the current moment and the evaluation threshold; The target servers in the first installation queue are installed according to the installation script.
[0056] The agent in the management platform is bound to a network card. After starting the installation process, the agent will limit the number of concurrently installed servers based on the network card bandwidth of the bound network card.
[0057] Specifically, when there are multiple target servers, the target server to be installed at the current moment is determined, and the target server to be installed may be one or more.
[0058] Then, according to the first number of target servers to be installed at the current moment and the evaluation threshold, the first installation queue that ultimately needs to be installed at the current moment is determined, so that the target servers in the first installation queue can be installed according to the installation script.
[0059] In the above implementation, the current concurrency upper limit can be dynamically determined based on the first number of target servers to be installed and the evaluation threshold, so as to maximize the resource utilization of the network card bound to the agent, thereby improving the success rate and efficiency of the server installation process.
[0060] In an optional embodiment, the above step of determining the first installation queue based on the first number of target servers to be installed at the current moment and the evaluation threshold specifically includes the following steps: calculating a first evaluation parameter based on the first quantity; Comparing the first evaluation parameter with the evaluation threshold to obtain a comparison result; The first installation queue is determined according to the comparison result.
[0061] The present disclosure hereby provides an exemplary description of the process of determining the first installation queue.
[0062] Specifically, in the embodiment of the present disclosure, a first evaluation parameter is calculated based on the number of servers that are being installed concurrently at the current moment, and the first evaluation parameter and the evaluation threshold are used to measure whether there is any surplus network card bandwidth at the current moment, so as to determine the first installation queue of servers that ultimately need to be installed at the current moment.
[0063] In the above implementation, an association can be established between the concurrent number of server installations and the first installation queue, that is, the first number and the first installation queue, so that the first installation queue can be adjusted in real time to ensure that there is processing capacity for the target server in the first installation queue, maximize resource utilization, and effectively improve the success rate of the installation process.
[0064] In an optional embodiment, the above step of determining the first installation queue according to the comparison result specifically includes the following steps: If it is determined based on the comparison result that the first evaluation parameter is less than or equal to the evaluation threshold, determining a first server from the plurality of target servers; wherein the first server is a target server that is to be installed after the current moment; The first installation queue is determined based on the target server to be installed at the current moment and the first server.
[0065] In the embodiment of the present disclosure, if the first evaluation parameter is less than or equal to the evaluation threshold, it means that the network card bandwidth of the network card bound to the agent at the current moment is surplus, and other target servers can also be installed at the current moment. To this end, the first server is determined among multiple target servers, and the first server is added to the target server to be installed at the current moment to obtain the first installation queue at the current moment.
[0066] Among them, the number of the first servers can be one or more. After adding the first server to the target server to be installed at the current moment, the above-mentioned evaluation parameters and evaluation thresholds can be compared again to determine whether other target servers can still be installed until the first evaluation parameter is greater than the evaluation threshold.
[0067] Furthermore, after the installation of at least one target server in the first installation queue is completed, the above-mentioned evaluation method may be used again to determine the first installation queue after the installation is completed.
[0068] In the above implementation, whether there is idle bandwidth at the current moment can be determined based on the comparison results, and then the first installation queue that needs to be installed at the current moment can be determined, so that the installation queue can be adjusted in real time with the number of servers installed concurrently, thereby effectively reducing the installation delay of each target server on the basis of improving bandwidth utilization.
[0069] In an optional embodiment, the above step of calculating the first evaluation parameter based on the first quantity specifically includes the following steps: Determining a bandwidth peak value during installation of the first installation queue; Performing a calculation on the first number and the bandwidth peak value to obtain a calculation result; Calculating the product of the first number and the evaluation threshold to obtain a product result; A ratio of the operation result to the multiplication result is determined to obtain the first evaluation parameter.
[0070] This disclosure can be Calculate the first evaluation parameter, where is the first evaluation parameter, The peak bandwidth during the installation of the first installation queue, which can also be understood as the peak bandwidth of the network card bound to the agent. The first quantity, Evaluation threshold.
[0071] In the above implementation, the concurrent number of server installations and bandwidth, that is, the first number and the bandwidth peak, can be associated, and the first evaluation parameter can be calculated in real time to measure the bandwidth occupancy at different times, maximize resource utilization, and accurately control the concurrent number of server installations based on the first evaluation parameter.
[0072] In an optional embodiment, the above step of determining the first installation queue according to the comparison result specifically includes the following steps: When 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 moment.
[0073] 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 moment will be temporarily suspended, the utilization of the network card bandwidth has been maximized at the current moment, and the first installation queue is determined based on the target servers to be installed at the current moment to ensure the continuity of the server installation process.
[0074] In an optional embodiment, the method described in the above steps further specifically includes the following steps: During the installation process of the target servers in the first installation queue, if it is detected that the installation of any target server in the first installation queue is completed, 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 moment.
[0075] As mentioned above, in the embodiment of the present disclosure, during the installation process of the target servers in the first installation queue, if the installation of any one or more target servers in the first installation queue is completed, the evaluation parameter is recalculated based on the number of target servers in the first installation queue to obtain a second evaluation parameter, and the second evaluation parameter is compared with the evaluation threshold to obtain a corresponding comparison result. Finally, through the method mentioned above, the target servers in the first installation queue are updated based on the comparison result to obtain the updated installation queue at the current moment, 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.
[0076] In an optional embodiment, the custom configuration file in the above step includes a reinstallation strategy. After the target server is installed according to the installation script, the following steps are specifically included: In the event that the initial installation of the target server fails, reinstalling the target server based on the reinstallation policy in the custom configuration file; Determining a number of retries for installing the target server; If the number of retries is greater than the number of retries in the reinstallation strategy, it is determined that the installation of the target server has failed, and installation failure information is generated based on the number of retries and the reason for the installation failure.
[0077] If the first installation of the target server fails or times out, the target server with the failed or timed-out installation will be added to the retry queue according to the reinstallation strategy, and the target server will be reinstalled after a while.
[0078] If the number of retries for installing the target server exceeds the number of reinstallations, the target server is determined to have failed installation. The target server that failed the retry is added to the installation failure queue, and an installation failure message is generated based on the number of retries and the reason for the installation failure. The number of retries may or may not include the number of initial installation failures and can be adjusted as needed.
[0079] The agent in the management platform can periodically process the target servers in the installation failure queue and power off the target servers that have failed to be installed.
[0080] To address this, the agent can set up a temporary Preboot eXecution Environment (PXE) for the target server to be installed and perform a hard reboot. After the target server is powered on, it sends a network address request to the Dynamic Host Configuration Protocol (DHCP) server. This network address request is used to obtain an Internet Protocol (IP) address and a DHCP address. After receiving the network address request, the DHCP server assigns an IP address to the target server to be installed, and the installation status of the target server changes from CLOSED to PXE-ING.
[0081] The agent can continuously manage the local DHCP service. If the target server to be installed successfully obtains the DHCP address, the installation status of the target server to be installed is switched to PXE-SUCCESS. After that, the image file is obtained to start the operating system according to the image file. If the operating system is installed successfully, the installation status of the target server to be installed is switched to CONFIGURATION, entering the configuration phase of the target server. When the target server is configured successfully, the installation status of the target server to be installed is switched to AIREADY.
[0082] The agent disclosed in the present invention can automatically transmit the installation status of the target server and execute the corresponding process according to the installation status. Each process can also perform status rollback and update the corresponding installation status.
[0083] Among them, the agent disclosed in the present invention is deployed in a container pod in the Kubernetes environment. The container pod includes a main service container and a sidecar container. The main service container is used to obtain the installation information of the target server to be installed, parse the installation information, and dynamically generate the installation script of the target server; the sidecar container is used to implement services such as PXE and DHCP, and the network interconnection between the host machine where the sidecar container is located and the target server to be installed.
[0084] The following combination Figure 2 and Figure 3 Describe the server installation process as follows: Figure 2The custom configuration file includes multiple applicable network area selectors, which can be the core control area CORE, the isolation area DMZ, and the physical or logical resource pool (availability zone) POD1; the name of the server name: hostNameTemplate; the type of operating system that the user of each network area expects to configure image: bclinux-for-euler 21.10; the mapping relationship between the resource type and the hard disk partition template identification information partition, the resource type can be computing type, block storage type, and network type, the computing type corresponds to the hard disk partition template FQ-01, the block storage type corresponds to the hard disk partition template FQ-02, and the network type corresponds to the hard disk partition template FQ-04; the mapping relationship between the resource type and the network configuration template identification information network, the computing type corresponds to the network configuration template NET-01, the block storage type corresponds to the network configuration template NET-02, and the network type corresponds to the network configuration template NET-04, the hard disk partition template identification information and the network configuration template identification information are installation template identification information; the final installation status of the server status: REDAY; the internal network time protocol server NTP (Network Time Protocol) of the resource pool The network address of the ntp server is ntpServer; the operating system retry policy is set to 3 times; and the evaluation threshold bandwidth is 0.75.
[0085] Continue to refer Figure 2 As shown, each network area corresponds to an agent, that is, each network area corresponds to an agent program, and each agent program is used to control the installation process of the target server in the network area.
[0086] like Figure 3 The specific process is described as follows: S301: Obtain a custom configuration file.
[0087] 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.
[0088] S302: Obtain installation information of the target server to be installed.
[0089] The installation information includes: the name of the target server, the network area where the target server is located, and the serial number of the target server.
[0090] S303: Determine whether the target server is associated with multiple network areas to which the custom configuration file is applicable.
[0091] If so, execute S304-S305; if not, execute S306.
[0092] S304: Determine a target network area associated with the target server from among the multiple network areas to which the custom configuration file is applicable.
[0093] S305: Obtain the service type of the target server.
[0094] S306: End, reject the process.
[0095] S307: Determine whether the service type of the target server matches the resource type supported by the target network area.
[0096] If so, execute S308-S309; if not, execute S310.
[0097] S308: Determine target installation template identification information associated with the target network area based on the mapping relationship.
[0098] S309: Acquire an installation instance corresponding to the target installation template identification information in the local template library as the target installation instance.
[0099] S310: Generate a target installation instance based on the service type and installation information of the target server.
[0100] S311: Combine the target installation instance and the installation information to obtain an installation script for the target server.
[0101] S312: When the first installation of the target server fails, the target server is reinstalled based on the reinstallation policy in the custom configuration file.
[0102] S313: Determine the number of retries for installing the target server.
[0103] S314: If the number of retries is greater than the number of reinstallations in the reinstallation policy, it is determined that the target server installation has failed, and installation failure information is generated based on the number of retries and the reason for the installation failure.
[0104] From the above description, it can be seen that the technical solution disclosed in this disclosure has the following advantages: The present disclosure is based on the idea of oriented to the end state. Users declare different types of operating system resources separately, including the operating system type, hard disk partition, network configuration and other resource objects of this type of server, which are defined as custom resource descriptions CRD in kubernetes, and generate custom configuration files. Based on the declarative idea, it continuously approaches the end state and finally reaches the end state. If the server configuration needs to be modified later, the update can be triggered by updating the corresponding custom configuration file. This method is more flexible and maintainable. Moreover, the server installation process is applicable to multiple network areas and is uniformly managed by the management platform to achieve global maintenance of the configuration and visualization of the installation process.
[0105] Among them, end-state orientation refers to the idea of declaratively describing the expected configuration of infrastructure and applications, continuously paying attention to the actual operating status of applications, and repeatedly adjusting the system itself until it infinitely approaches the end state. End-state orientation means that it is not a one-time thing, but a continuous maintenance of the target state.
[0106] Based on the same inventive concept, the embodiment of the present disclosure also provides a server installation device corresponding to the server installation method. Since the principle of solving the problem by the device in the embodiment of the present disclosure is similar to the above-mentioned server installation method in the embodiment of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0107] Reference Figure 4 FIG. 1 is a schematic diagram of a server installation device provided by an embodiment of the present disclosure, wherein the device includes: a data acquisition unit 40, an installation information acquisition unit 41, and an installation processing unit 42; wherein: A data acquisition unit, configured to acquire a custom configuration file; wherein the custom configuration file is a declarative configuration file, configured to define a target operating system configuration for at least one type of server; An installation information acquisition unit, used to acquire installation information of a target server to be installed; An installation processing unit is configured to generate an installation script for 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.
[0108] In a possible implementation manner, the server installation device is further used to: determining a target network zone associated with the target server among the plurality of network zones to which the custom configuration file is applicable; Obtain the service type of the target server; Determining a target installation instance based on a degree of matching 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; The target installation instance and the installation information are combined to obtain an installation script for the target server.
[0109] In a possible implementation manner, the server installation device is further used to: In a case where 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; An installation instance corresponding to the target installation template identification information is obtained in a local template library as the target installation instance.
[0110] In a possible implementation manner, the server installation device is further used to: In a 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.
[0111] In a possible implementation manner, the server installation device is further used to: Determine the first installation template identification information corresponding to the target installation instance; 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 to the custom configuration file to obtain an updated custom configuration file.
[0112] In a possible implementation manner, the server installation device is further used to: When there are multiple target servers, determining the target server to be installed at the current moment; Determining a first installation queue based on the first number of target servers to be installed at the current moment and the evaluation threshold; The target servers in the first installation queue are installed according to the installation script.
[0113] In a possible implementation manner, the server installation device is further used to: calculating a first evaluation parameter based on the first quantity; Comparing the first evaluation parameter with the evaluation threshold to obtain a comparison result; The first installation queue is determined according to the comparison result.
[0114] In a possible implementation manner, the server installation device is further used to: If it is determined based on the comparison result that the first evaluation parameter is less than or equal to the evaluation threshold, determining a first server from the plurality of target servers; wherein the first server is a target server that is to be installed after the current moment; The first installation queue is determined based on the target server to be installed at the current moment and the first server.
[0115] In a possible implementation manner, the server installation device is further used to: Determining a bandwidth peak value during installation of the first installation queue; Performing a calculation on the first number and the bandwidth peak value to obtain a calculation result; Calculating the product of the first number and the evaluation threshold to obtain a product result; A ratio of the operation result to the multiplication result is determined to obtain the first evaluation parameter.
[0116] In a possible implementation manner, the server installation device is further used to: When 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 moment.
[0117] In a possible implementation manner, the server installation device is further used to: During the installation process of the target servers in the first installation queue, if it is detected that the installation of any target server in the first installation queue is completed, 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 moment.
[0118] In a possible implementation manner, the server installation device is further used to: In the event that the initial installation of the target server fails, reinstalling the target server based on the reinstallation policy in the custom configuration file; Determining a number of retries for installing the target server; If the number of retries is greater than the number of retries in the reinstallation strategy, it is determined that the installation of the target server has failed, and installation failure information is generated based on the number of retries and the reason for the installation failure.
[0119] For descriptions of the processing flow of each module and the interaction flow between modules, please refer to the relevant descriptions in the above method embodiments, which will not be described in detail here.
[0120] Corresponding to Figure 1 The server installation method in the present disclosure also provides an electronic device 50, such as Figure 5FIG. 1 is a schematic diagram of the structure of an electronic device 50 provided in an embodiment of the present disclosure, including: Processor 51, memory 52, and bus 53; memory 52 is used to store execution instructions, including internal memory 521 and external memory 522; the internal memory 521 is also called internal memory, which is used to temporarily store operation data in the processor 51 and data exchanged with external memory 522 such as a hard disk. 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 communicates with the memory 52 via the bus 53, so that the processor 51 executes the following instructions: Obtaining a custom configuration file; wherein the custom configuration file is a declarative configuration file for defining a target operating system configuration for at least one type of server; Obtain the installation information of the target server to be installed; An installation script for 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.
[0121] The present disclosure also provides a computer-readable storage medium having a computer program stored thereon. When executed by a processor, the computer program executes the steps of the server installation method described in the above method embodiment. The storage medium may be a volatile or non-volatile computer-readable storage medium.
[0122] The present disclosure also provides a computer program product 60, such as Figure 6 As shown, it is a structural diagram of a computer program product 60 provided in an embodiment of the present disclosure. The computer program product 60 carries a computer program 61. The program included in the computer program 61 can be used to execute the steps of the server installation method described in the above method embodiment. For details, please refer to the above method embodiment and will not be repeated here.
[0123] The server installation method, apparatus, device, medium and product according to the embodiment of the present disclosure are described above with reference to the accompanying drawings. First, a custom configuration file is obtained; 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; then, the installation information of the target server to be installed is obtained; finally, an installation script for 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 method, the final state of the desired operating system resources is determined through the custom configuration file, and the configuration information such as the type of operating system, resource type and installation template identification information desired by the user is personalized, so as to realize automatic selection of different configuration mechanisms according to different types of servers, thereby improving the flexibility of the server installation process. Moreover, if the server configuration needs to be modified, updating the custom configuration file can trigger the update, thereby determining the processing logic of the installation process based on the generated installation script, which can effectively improve the flexibility and scalability of the server installation process.
[0124] The basic principles of the present disclosure have been described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, and effects mentioned in this disclosure are merely illustrative and not restrictive, and should not be construed as necessarily possessed by each embodiment of the present disclosure. Furthermore, the specific details disclosed above are provided for illustrative purposes and to facilitate understanding, rather than as limitations. These details do not limit the present disclosure to necessarily being implemented using these specific details.
[0125] The block diagrams of the devices, devices, equipment, and systems involved in this disclosure are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As will be appreciated by those skilled in the art, these devices, devices, equipment, and systems can be connected, arranged, or configured in any manner. Words such as "include," "comprise," "have," and the like are open-ended words, meaning "including but not limited to," and can be used interchangeably therewith. The words "or" and "and" used herein refer to the words "and / or" and can be used interchangeably therewith, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to," and can be used interchangeably therewith.
[0126] Additionally, as used herein, "or" used in a list of items beginning with "at least one" indicates a separate list, so that, for example, a list of "at least one of A, B, or C" means A or B or C, or AB or AC or BC, or ABC (i.e., A and B and C). Furthermore, the word "exemplary" does not mean that the example described is preferred or better than other examples.
[0127] It should also be noted that in the system and method of the present disclosure, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present disclosure.
[0128] Various changes, substitutions, and modifications may be made to the technology described herein without departing from the teachings defined by the appended claims. Moreover, the scope of the claims of this disclosure is not limited to the specific aspects of the processes, machines, manufactures, compositions of things, means, methods, and actions described above. Currently existing or later developed processes, machines, manufactures, compositions of things, means, methods, or actions that perform substantially the same function or achieve substantially the same results as the corresponding aspects described herein may be utilized. Accordingly, the appended claims include within their scope such processes, machines, manufactures, compositions of things, means, methods, or actions.
[0129] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but rather to be accorded the widest scope consistent with the principles and novel features disclosed herein.
[0130] The above description has been provided for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although a number of example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations thereof.
Claims
1. A server installation method, characterized in that: include: Obtaining a custom configuration file; wherein the custom configuration file is a declarative configuration file for defining a target operating system configuration for at least one type of server; Obtain the installation information of the target server to be installed; An installation script for 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.
2. The method according to claim 1, characterized in that The generating of the installation script of the target server based on the custom configuration file and the installation information includes: determining a target network zone associated with the target server among the plurality of network zones to which the custom configuration file is applicable; Obtain the service type of the target server; Determining a target installation instance based on a degree of matching 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; The target installation instance and the installation information are combined to obtain an installation script for the target server.
3. The method according to claim 2, characterized in that The determining of the target installation instance based on the degree of matching between the service type of the target server and the resource type supported by the target network area includes: In a case where 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; An installation instance corresponding to the target installation template identification information is obtained in a local template library as the target installation instance.
4. The method according to claim 2, characterized in that The determining of the target installation instance based on the degree of matching between the service type of the target server and the resource type supported by the target network area includes: In a 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.
5. The method according to claim 1, wherein The custom configuration file includes an evaluation threshold; and the installation process on the target server according to the installation script includes: When there are multiple target servers, determining the target server to be installed at the current moment; Determining a first installation queue based on the first number of target servers to be installed at the current moment and the evaluation threshold; The target servers in the first installation queue are installed according to the installation script.
6. The method according to claim 5, characterized in that The determining of the first installation queue based on the first number of target servers to be installed at the current moment and the evaluation threshold includes: calculating a first evaluation parameter based on the first quantity; Comparing the first evaluation parameter with the evaluation threshold to obtain a comparison result; The first installation queue is determined according to the comparison result.
7. The method according to claim 6, characterized in that The calculating a first evaluation parameter based on the first quantity includes: Determining a bandwidth peak value during installation of the first installation queue; Performing a calculation on the first number and the bandwidth peak value to obtain a calculation result; Calculating the product of the first number and the evaluation threshold to obtain a product result; A ratio of the operation result to the multiplication result is determined to obtain the first evaluation parameter.
8. The method according to claim 6, characterized in that Determining the first installation queue according to the comparison result includes: If it is determined based on the comparison result that the first evaluation parameter is less than or equal to the evaluation threshold, determining a first server from the plurality of target servers; wherein the first server is a target server that is to be installed after the current moment; The first installation queue is determined based on the target server to be installed at the current moment and the first server.
9. The method according to claim 6, characterized in that Determining the first installation queue according to the comparison result includes: When 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 moment.
10. The method according to claim 1, characterized in that The custom configuration file includes a reinstallation strategy. After the target server is installed according to the installation script, the method further includes: If the first installation of the target server fails, reinstall the target server based on the reinstallation strategy; Determining a number of retries for installing the target server; If the number of retries is greater than the number of retries in the reinstallation strategy, it is determined that the installation of the target server has failed, and installation failure information is generated based on the number of retries and the reason for the installation failure.
11. A server installation device, characterized in that: include: A data acquisition unit, configured to acquire a custom configuration file; wherein the custom configuration file is a declarative configuration file, configured to define a target operating system configuration for at least one type of server; An installation information acquisition unit, used to acquire installation information of a target server to be installed; An installation processing unit is configured to generate an installation script for 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.
12. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor and the memory communicate via the bus. When the machine-readable instructions are executed by the processor, the steps of the server installation method according to any one of claims 1 to 10 are performed.
13. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, executes the steps of the server installation method according to any one of claims 1 to 10.
14. A computer program product, characterized in that The computer program product is stored in a storage medium, and the program product is executed by at least one processor to implement the server installation method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Filtering service deployment recommendation device and method
CN105208095A
Configuration, mounting method and configuration device
CN109542470A
Installation method and device for active directory program, computing equipment and medium
CN113542322A
Multi-instance creation method, platform and equipment based on Ambari and storage medium
CN114356349A
Resource deployment method and device, terminal equipment and storage medium
CN118796409A