Server configuration method and device, electronic equipment, storage medium and product
By automatically obtaining the configuration mode, option relationship and BMC network address by preset attachment files, the server is automatically configured, solving the problem of manual configuration extending delivery time, and improving configuration efficiency and delivery time.
Patent Information
- Application Number
- CN202510308293.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-16
- Publication Date
- 2025-06-17
AI Technical Summary
During the server delivery process, each server needs to be initialized and configured, resulting in an extended delivery time and manual configuration verification of each server is required, affecting the delivery time.
By presetting the attachment file, the execution server can obtain the corresponding relationship between the configuration mode and the configuration options, as well as the BMC network address of the server to be configured, and realize automatic configuration without manual operations.
It improves the efficiency of server configuration, reduces server delivery time, reduces the demand for manual operations, and improves delivery time.
Smart Images

Figure CN120166040A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computers, and in particular, to a server configuration method, apparatus, electronic device, storage medium, and product. Background Art
[0002] During the current server delivery process, it is usually necessary to initialize the server. The initialization content includes refreshing the firmware version, configuring the Baseboard Management Controller (BMC), configuring the Basic Input Output System (BIOS), alarm policies, and other customization requirements, etc. For the initialization requirements proposed by different customers, when configuring the server (especially for a large number of servers), it is necessary to perform configuration operations and verifications on each server, thus prolonging the delivery time. And when configuring the server, it is necessary to connect the server to be configured to a specified system, which further leads to an extension of the delivery time and affects the delivery efficiency. Summary of the Invention
[0003] The present disclosure provides a server configuration method, apparatus, electronic device, storage medium, and product. By presetting an attachment file, the execution server can obtain the correspondence between the configuration mode and the configuration option, as well as the BMC network address of the server to be configured. The execution server can determine the network location of the server to be processed according to the BMC network address, and determine the setting of the configuration option for the server to be processed according to the correspondence between the configuration mode and the configuration option, so as to realize the configuration of the server to be configured by the execution server, without the need for manual configuration operations and verifications on each server to be configured, improving the configuration efficiency of the server to be configured and shortening the server delivery time.
[0004] An embodiment of the first aspect of the present disclosure provides a server configuration method, including: determining whether there is a communication connection between the server to be configured and the execution server based on an operation command set, where the execution server is used to configure the processor of the server to be configured; when there is a communication connection between the server to be configured and the execution server, obtaining a preset attachment file in a first file path, where the first file path is the path corresponding to the first program software of the execution server, and the preset attachment file includes at least one of the following: a detection attachment, a configuration attachment, and a network address attachment; configuring the processor of the server to be configured based on the preset attachment file.
[0005] In some embodiments of the present disclosure, the method further includes: obtaining an identity parameter set of the server to be configured, where the identity parameter set includes at least one of the following: the network address of the baseboard management controller (BMC) of the server to be configured, the username of the BMC, and the password of the BMC. Wherein, the server to be configured is connected to the out-of-band network of the network system, an in-band network connection between the server and the network system is performed, and the out-of-band network address of the server to be configured and the in-band network address of the execution server are in the same network segment.
[0006] In some embodiments of the present disclosure, determining whether there is a communication connection between the server to be configured and the execution server based on an operation command set includes: determining whether there is network connectivity between the execution server and the server to be configured based on a first operation command; determining whether the remote management control protocol port of the server to be configured is open based on a second operation command; when there is network connectivity between the execution server and the server to be configured and the remote management control protocol port of the server to be configured is open, determining that there is a communication connection between the server to be configured and the execution server.
[0007] In some embodiments of the present disclosure, configuring the processor of the server to be configured based on a preset attachment file includes: invoking a configuration attachment based on a third operation command to select a configuration mode of the processor, where the configuration mode includes at least one of the following: dynamic balancing mode, locked base frequency mode, and locked overclocking mode; writing the identity parameter set into a network address attachment in a preset format to obtain a network address update attachment; determining the network address of the BMC of the server to be configured based on the network address update attachment; determining a configuration option corresponding to the configuration mode in the configuration attachment based on the configuration mode; and configuring the processor using the configuration option based on the network address of the BMC of the server to be configured.
[0008] In some embodiments of the present disclosure, determining a configuration option corresponding to the configuration mode in the configuration attachment based on the configuration mode includes: when the configuration mode is the dynamic balancing mode, determining that the configuration options are: turning off the wait state option, the invalid first state option, and turning on the second state option; when the configuration mode is the locked base frequency mode, determining that the configuration option is: turning off the second state option on the premise that the power configuration option is set to custom; when the configuration mode is the locked overclocking mode, determining that the configuration option is: setting the third state option to a preset value and turning on the static turbo option on the premise that the power configuration option is set to custom.
[0009] In some embodiments of the present disclosure, the method further includes: generating a configuration log when the configuration of the processor is completed, and exporting the directory location of the preset attachment file in the execution server; detecting the configuration result of the server to be configured using a detection attachment at a preset time point after the configuration of the processor is completed.
[0010] A second aspect embodiment of the present disclosure provides a server configuration device, including: a determination unit configured to determine whether there is a communication connection between a server to be configured and an execution server based on an operation command set, where the execution server is used to configure the processor of the server to be configured; an acquisition unit configured to, when there is a communication connection between the server to be configured and the execution server, acquire a preset attachment file in a first file path, where the first file path is the path corresponding to the first program software of the execution server, and the preset attachment file includes at least one of the following: a detection attachment, a configuration attachment, and a network address attachment; and a configuration unit configured to configure the processor of the server to be configured based on the preset attachment file.
[0011] A third aspect embodiment of the present disclosure provides an electronic device, including: a processor and a memory for storing a computer program that can run on the processor, where the processor is configured to execute the method described in the first aspect embodiment of the present disclosure when running the computer program.
[0012] A fourth aspect embodiment of the present disclosure provides a non-transitory computer-readable storage medium storing computer instructions, where the computer instructions are used to cause a computer to execute the method described in the first aspect embodiment of the present disclosure.
[0013] A fifth aspect embodiment of the present disclosure provides a computer program product, including a computer program that implements the method described in the first aspect embodiment of the present disclosure when executed by a processor.
[0014] In summary, according to a server configuration method provided by the present disclosure, the method includes: determining whether there is a communication connection between a server to be configured and an execution server based on an operation command set, where the execution server is used to configure the processor of the server to be configured; when there is a communication connection between the server to be configured and the execution server, acquiring a preset attachment file in a first file path, where the first file path is the path corresponding to the first program software of the execution server, and the preset attachment file includes at least one of the following: a detection attachment, a configuration attachment, and a network address attachment; and configuring the processor of the server to be configured based on the preset attachment file. By means of the preset attachment file, the execution server can obtain the correspondence between the configuration mode and the configuration options, as well as the BMC network address of the server to be configured, so that the execution server can determine the network location of the server to be processed according to the BMC network address, and determine the setting of the configuration options for the server to be processed according to the correspondence between the configuration mode and the configuration options, thereby realizing the configuration of the server to be configured by the execution server, without the need for manual configuration operations and verification for each server to be configured, improving the configuration efficiency of the server to be configured, and shortening the server delivery time.
[0015] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it used to limit the scope of the present application. Other features of the present application will become readily understood from the following description. Description of the Drawings
[0016] The drawings are used to better understand the present solution and do not constitute a limitation to the present disclosure. Among them: Figure 1 It is a schematic flowchart of a server configuration method provided by an embodiment of the present disclosure; Figure 2 It is a schematic flowchart of another server configuration method provided by an embodiment of the present disclosure; Figure 3 It is an example diagram of a network connectivity detection provided by an embodiment of the present disclosure; Figure 4 It is an example diagram of a remote management control protocol port detection provided by an embodiment of the present disclosure; Figure 5 It is an example diagram of a configuration selection provided by an embodiment of the present disclosure; Figure 6 It is an example diagram of a process of a network address update attachment provided by an embodiment of the present disclosure; Figure 7 It is an example diagram of a configuration selection provided by an embodiment of the present disclosure; Figure 8 It is an example diagram of a configuration log provided by an embodiment of the present disclosure; Figure 9 It is an example diagram of an execution log provided by an embodiment of the present disclosure; Figure 10 It is an example flowchart of a server configuration method provided by an embodiment of the present disclosure; Figure 11 It is a schematic structural diagram of a server configuration device provided by an embodiment of the present disclosure; Figure 12 It is a schematic diagram of the hardware composition structure of an electronic device provided by an embodiment of the present disclosure. Detailed Embodiments
[0017] The following describes exemplary embodiments of the present disclosure in conjunction with the accompanying drawings. Various details of the embodiments of the present disclosure are included to facilitate understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0018] During the current server delivery process, it is usually necessary to initialize the server. The initialization content includes refreshing the firmware version, BMC configuration, BIOS configuration, alarm policies, and other customization requirements. For the initialization requirements proposed by different customers, when configuring the server (especially for a large number of servers), it is necessary to perform configuration operations and verification on each server, which prolongs the delivery time. Moreover, when configuring the server, it is necessary to connect the server to be configured to a specified system, which further prolongs the delivery time and affects the delivery efficiency.
[0019] BIOS option configuration is a relatively common initialization function in server configuration. The existing configuration methods include single-server configuration: it can be operated through the Kernel-based Virtual Machine (KVM) interface on the BMC web page, directly on the BIOS interface, or through tools within the system. Usually, most operations in the BIOS settings require configuring the performance mode of the Central Processing Unit (CPU). Since the performance mode involves multiple BIOS options and there are limitations on option linkage, if the characteristics of the server's BIOS options are not well understood when configuring this function, it may lead to unsuccessful configuration options or the inability to find the parameters to be configured in the configuration column and other problems.
[0020] In related technologies, the following methods are usually used to configure the CPU in the server: Related technology 1: For the server BIOS option "CPU mode", the operator manually selects options through the out-of-band BMC to achieve batch configuration of the CPU.
[0021] Related technology 2: The operator configures the BIOS options under a specified system through the in-band tool "SCELNX_64".
[0022] However, the following defects exist in related technologies: For related technology 1, when the operator does not understand the BIOS options, it is impossible to confirm the specific BIOS options corresponding to the "CPU mode", and due to the linkage between different BIOS options (that is, there is a configuration order between BIOS options), it is easy to cause the configuration of the CPU to fail.
[0023] For related technology 2, the environment for implementing this method has limitations. The server to be configured needs to enter the specified system, and the corresponding in-band IP needs to be configured for the server to be configured. The operation is relatively cumbersome, and when the server to be configured involves sensitive projects, this method cannot be implemented.
[0024] To solve the technical problems existing in the related art, an embodiment of the present disclosure provides a server configuration method.
[0025] The embodiments of the present disclosure will be described in detail below.
[0026] As Figure 1 shown, an embodiment of the present disclosure provides a server configuration method, including the following steps: Step 101, based on the operation command set, determine whether there is a communication connection between the server to be configured and the execution server.
[0027] In some embodiments, although the network is connected between the execution server and the server to be configured, since the remote management control protocol port of the server to be configured is not opened, at this time, communication and configuration operations cannot be realized between the execution server and the server to be configured. Therefore, it is possible to determine whether the network is connected between the execution server and the server to be configured; and determine whether the remote management control protocol port of the server to be configured is opened, so as to judge whether there is a communication connection between the server to be configured and the execution server.
[0028] In some embodiments, the server to be configured can be one or more, that is, the method in the present application can realize batch configuration of multiple servers to be configured.
[0029] In some embodiments, it is possible to determine whether the network is connected between the execution server and the server to be configured through a first operation command. Among them, the first operation command can be a Ping command, but it is not limited thereto. Any operation command that can detect network connectivity can be the first operation command, such as the tracert command, etc.
[0030] In some embodiments, it is possible to determine whether the remote management control protocol port of the server to be configured is opened through a second operation command. Among them, the second operation command can be ipmitool, but it is not limited thereto. Any command that can detect whether the remote management control protocol port is opened can be the second operation command, such as: the nmap command, the PortQry command, etc. Step 102, when there is a communication connection between the server to be configured and the execution server, obtain the preset attachment file in the first file path.
[0031] In some embodiments, when there is a communication connection between the server to be configured and the execution server, it is determined that the processor of the server to be configured can be configured. Here, a preset attachment file for configuring and / or detecting the server to be configured can be obtained.
[0032] In some embodiments, the first file path is the path corresponding to the first program software of the execution server, where the first program software can be Python programming software.
[0033] In some embodiments, the preset attachment file includes at least one of the following: a detection attachment, a configuration attachment, and a network address attachment.
[0034] In some embodiments, since the preset attachment file and the first program software are in the same path, when the execution server configures the server to be configured, it can directly call the preset attachment file without programming in the first program software, thus reducing the configuration time.
[0035] In some embodiments, when the first program software does not exist in the execution server, the first program software can be downloaded through the network and stored in the same path as the preset attachment file.
[0036] In some embodiments, when the preset attachment file does not exist in the execution server, the preset attachment file can be copied through devices such as the network and the memory, and the preset attachment file is copied to the first path.
[0037] Step 103: Configure the processor of the server to be configured based on the preset attachment file.
[0038] In some embodiments, determine the configuration options of the server to be configured according to the configuration attachment; and determine the network address of the server to be configured according to the network address attachment, so as to configure the server to be configured according to the network address of the server to be configured and the determined configuration options.
[0039] In summary, the server configuration method proposed according to the present disclosure includes: determining whether there is a communication connection between the server to be configured and the execution server based on the operation command set, where the execution server is used to configure the processor of the server to be configured; when there is a communication connection between the server to be configured and the execution server, obtain the preset attachment file in the first file path, where the first file path is the path corresponding to the first program software of the execution server, and the preset attachment file includes at least one of the following: a detection attachment, a configuration attachment, and a network address attachment; configure the processor of the server to be configured based on the preset attachment file. The method of the present disclosure enables the execution server to obtain the correspondence between the configuration mode and the configuration options, as well as the BMC network address of the server to be configured through the preset attachment file, so that the execution server can determine the network location of the server to be processed according to the BMC network address, and determine the setting of the configuration options for the server to be processed according to the correspondence between the configuration mode and the configuration options, thereby realizing the configuration of the server to be configured by the execution server, without the need for manual configuration operations and verification for each server to be configured, improving the configuration efficiency of the server to be configured and reducing the server delivery time.
[0040] Figure 2The flowchart of a server configuration method proposed by the present disclosure is further shown. Based on Figure 1 the embodiments shown below, Figure 2 the following steps may be included.
[0041] Step 201: Based on the first operation command, determine whether there is network connectivity between the execution server and the server to be configured.
[0042] In some embodiments, taking the first operation command as the Ping command and the IP address of the server to be configured as 10.49.32.12 as an example for illustration: By entering the command Ping 10.49.32.12 on the execution server, if it shows that the Ping statistics information of 10.49.32.12 can be received, for example Figure 3 as shown, it can be determined that there is network connectivity between the execution server and the server to be configured. If other information is shown, it is determined that there is no network connectivity between the execution server and the server to be configured.
[0043] Step 202: Based on the second operation command, determine whether the remote management control protocol port of the server to be configured is open.
[0044] In some embodiments, taking the first operation command as the ipmitool command and the IP address of the server to be configured as 10.49.32.12 as an example for illustration: The command ipmitool.exe -I lanplus -H 10.49.32.12 -U admin -P user name fru list can be entered on the execution server, and based on the value returned by entering this command, determine whether the remote management control protocol port of the server to be configured is open. For example Figure 4 as shown, when the returned value meets the preset requirements, it is determined that the remote management control protocol port is open.
[0045] In some embodiments, the remote management control protocol port is the UDP port 623.
[0046] Step 203: When there is network connectivity between the execution server and the server to be configured, and the remote management control protocol port of the server to be configured is open, determine that there is a communication connection between the server to be configured and the execution server.
[0047] Step 204: Obtain the preset attachment file in the first file path.
[0048] In some embodiments, the principle of step 204 is the same as that of step 102. The relevant descriptions and embodiments in step 102 can be referred to, and details are not repeated here.
[0049] Step 205: Obtain the identity parameter set of the server to be configured.
[0050] In some embodiments, the identity parameter set includes at least one of the following: the network address of the baseboard management controller (BMC) of the server to be configured, the username of the BMC, and the password of the BMC.
[0051] In some embodiments, in order for the execution server to obtain the identity parameter set of the server to be configured, it is necessary to connect the server to be configured to the out-of-band network of the network system and connect the execution server to the in-band network of the network system, and at the same time, the out-of-band network address of the server to be configured and the in-band network address of the execution server are in the same network segment.
[0052] Step 206: Based on the third operation command, call the configuration attachment to select the configuration mode of the processor.
[0053] In some embodiments, the third operation instruction is used to call the configuration attachment through the first software program to pull up the interface for selecting the configuration mode.
[0054] For example, taking the third operation instruction as: "python.exe config.py" for illustration, where python.exe is the first program software and config.py is the configuration attachment, the interface for selecting the configuration mode is as follows Figure 5 shown, and then the configuration mode of the processor can be selected according to the option numbers of each configuration mode.
[0055] Step 207: Write the identity parameter set into the network address attachment in a preset format to obtain the network address update attachment.
[0056] In some embodiments, the identity parameter set can be written into the network address attachment in a preset format to obtain the network address update attachment.
[0057] For example, taking the identity parameter set including the IP of the BMC, there are two servers to be configured, and the IPs of the BMCs of the servers to be configured are 10.49.23.12 and 10.49.32.58 respectively for illustration, then the network address update attachment can be as follows Figure 6 shown. In other words, the network address attachment can be a blank file without any content, and the network address update attachment can be a file written with the BMC IPs of each server to be configured.
[0058] Step 208: Based on the network address update attachment, determine the network address of the BMC of the server to be configured.
[0059] In some embodiments, the execution server may update the network address of the BMC written in the attachment according to the network address, determine the network address of the BMC of each server to be configured, and thus configure the processor of the server to be configured according to the network address of the BMC.
[0060] Step 209: Based on the configuration mode, determine the configuration options corresponding to the configuration mode in the configuration attachment.
[0061] In some embodiments, when the configuration mode is the dynamic balance mode, the determined configuration options are: closing the wait state option, invalidating the first state option, and enabling the second state option.
[0062] In some embodiments, when the configuration mode is the locked frequency mode, the determined configuration option is: closing the second state option on the premise that the power configuration option is set to custom.
[0063] In some embodiments, when the configuration mode is the locked overclocking mode, the determined configuration options are: setting the third state option to a preset value and enabling the static turbo option on the premise that the power configuration option is set to custom.
[0064] In some embodiments, the wait state is the mwait option, the first state option is the cstates option, the second state option is the Pstates option, the power configuration option is the PowerProfile option, the third state option is set to the BootPState option, the preset value is the maximum value Max Performance, and the static turbo option is the static turbo option.
[0065] Exemplarily, three options need to be set for dynamic balance under the BIOS, that is, closing the mwait option, setting the cstates option to be invalid (disabled), and enabling the Pstates option. Further, the definition of the map unique identifier MapID corresponding to the mwait option is: "ProcessorMwait": "Disabled"; the definition of the MapID corresponding to the cstates option is: "PackageCstateReport": "C0 / C1 state", and the definition of the MapID corresponding to the Pstates option is: "ProcessorEist": "Disabled".
[0066] Exemplarily, to lock the standard frequency, two options need to be set under the default BIOS, that is, with the PowerProfile option set to the custom policy, the Pstates option is turned off. Further, the definition of the MapID corresponding to the PowerProfile option is “PowerProfile”: “Custom”; the definition of the MapID corresponding to the Pstates option is “ProcessorEist”: “Disabled”.
[0067] Exemplarily, to lock the overclocking, three options need to be set under the default BIOS, that is, with the PowerProfile option set to the custom policy, the BootPState option is set to the maximum performance, and the static turbo option is turned on. Further, the definition of the MapID corresponding to the PowerProfile option is: “PowerProfile”: “Custom”; the definition of the MapID corresponding to the BootPState option is “BootPState”: “Max Performance”, and the definition of the MapID corresponding to the static turbo option is “TurboModeEn”: “Enabled”.
[0068] Step 210: Based on the network address of the BMC of the server to be configured, use the configuration options to configure the processor.
[0069] In some embodiments, according to the network address of the BMC, determine the address of the server to be configured, and implement the configuration of the processor of the server to be configured according to the determined configuration options.
[0070] Step 211: When the configuration of the processor is completed, generate a configuration log and export the directory location of the preset attachment file in the execution server In some embodiments, the directory location can be named by time, but is not limited thereto.
[0071] In some examples, when there are multiple servers to be configured, all the servers to be configured can be traversed to generate a configuration log after it is determined that the processors of all the servers to be configured are completely configured.
[0072] Exemplarily, taking the IP of the BMC of the server to be configured as 10.49.32.12 and the configuration mode as the dynamic balance mode as an example, then it can be determined according to the prompt as shown in Figure 7 that all the servers to be configured are completely configured, and a configuration log as shown in Figure 8 is generated.
[0073] Step 212, at a preset time point after the processor is configured, use a detection attachment to detect the configuration result of the server to be configured.
[0074] In some embodiments, after the processor of the server to be configured is configured, the server to be configured will be restarted. Therefore, to avoid the server to be configured being restarted when detecting the processor, it is necessary to detect at a preset time point after the processor is configured. The present disclosure does not limit the preset time point. For example, it can be 10 minutes, 12 minutes, etc. after the configuration is completed.
[0075] In some embodiments, the command "python.exe check.py" can be run to call the detection attachment to detect the configuration result of the processor, where check.py represents the detection attachment.
[0076] In some embodiments, after the detection of the processor is completed, the corresponding BIOS options can be automatically exported according to the preset export options and export modes, and the options not involved will not be exported to facilitate the inspection of the configuration result.
[0077] Furthermore, the detection attachment can export the execution log (for example, a log named bios_check_time.log) and the inspection items (where the exported inspection items can be in excel format and named bios_check_time.xlsx; the format can be that the IP of each BMC occupies one line, and the cell adaptability is automatically set to be able to completely display the name of the setting item). This facilitates the quick verification of the execution result. The exported excel table is shown as follows Figure 9 shown.
[0078] In summary, the server configuration method proposed according to the present disclosure includes: determining whether there is network connectivity between the execution server and the server to be configured based on a first operation command; determining whether the remote management control protocol port of the server to be configured is open based on a second operation command; when there is network connectivity between the execution server and the server to be configured and the remote management control protocol port of the server to be configured is open, determining a communication connection between the server to be configured and the execution server; obtaining a preset attachment file in a first file path; obtaining an identity parameter set of the server to be configured; based on a third operation command, calling a configuration attachment to select a configuration mode of a processor; writing the identity parameter set into a network address attachment in a preset format to obtain a network address update attachment; determining a network address of the BMC of the server to be configured based on the network address update attachment; determining a configuration option corresponding to the configuration mode in the configuration attachment based on the configuration mode; configuring the processor by using the configuration option based on the network address of the BMC of the server to be configured; when the configuration of the processor is completed, generating a configuration log and exporting the directory location of the preset attachment file in the execution server; at a preset time point after the configuration of the processor is completed, using a detection attachment to detect the configuration result of the server to be configured. The method of the present disclosure enables the execution server to obtain the correspondence between the configuration mode and the configuration option, as well as the BMC network address of the server to be configured through the preset attachment file, so that the execution server can determine the network location of the server to be processed based on the BMC network address and determine the setting of the configuration option for the server to be processed according to the correspondence between the configuration mode and the configuration option, thereby realizing the configuration of the server to be configured by the execution server, without the need for manual configuration operations and verification for each server to be configured, improving the configuration efficiency of the server to be configured and reducing the server delivery time.
[0079] The following is an exemplary description of the present disclosure: 1. Through an interactive method, the present application enables an operator to select a performance mode of the CPU to be configured through an interface, where the performance mode includes three options: dynamic balance, locked standard frequency, and locked overclocking.
[0080] Among them, for dynamic balance, three options need to be set under the default Basic Input / Output System (BIOS), namely, turning off the mwait option, setting the cstates option to disabled, and turning on the Pstates option. Further, the definition of the MapID corresponding to the mwait option is: "ProcessorMwait": "Disabled"; the definition of the MapID corresponding to the cstates option is: "PackageCstateReport": "C0 / C1 state", and the definition of the MapID corresponding to the Pstates option is: "ProcessorEist": "Disabled".
[0081] Among them, for locked reference frequency, two options need to be set under the default BIOS, that is, turning off the Pstates option on the premise that the PowerProfile option is set to the custom policy. Further, the definition of the MapID corresponding to the PowerProfile option is "PowerProfile": "Custom"; the definition of the MapID corresponding to the Pstates option is "ProcessorEist": "Disabled".
[0082] Among them, for locked overclocking, three options need to be set under the default BIOS, that is, on the premise that the PowerProfile option is set to the custom policy, setting the BootPState option to maximum performance and turning on the static turbo option. Further, the definition of the MapID corresponding to the PowerProfile option is: "PowerProfile": "Custom"; the definition of the MapID corresponding to the BootPState option is "BootPState": "Max Performance", and the definition of the MapID corresponding to the static turbo option is "TurboModeEn": "Enabled".
[0083] Among them, the execution server can batch modify the central processing unit of the server to be configured through out-of-band calls to the Redfish interface, and the above settings sort the linkage items between the options, avoiding configuration failures caused by the linkage relationship (sequence) between the options; and the performance mode can be selected according to user requirements.
[0084] 2. This application optimizes the linkage relationship between performance mode configuration options, and sets the priority of linkage items in the script (for example, in the locked standard frequency mode, the option is set to: when the PowerProfile option is set to the custom policy, the Pstates option is turned off), ensuring that execution failures will not occur due to the linkage between options and the sequence of configuration.
[0085] 3. This application can also export the operation logs (i.e., the above-mentioned configuration logs). The operation logs of each server will be recorded in the exported file, and in the log file, the operation logs corresponding to each server will be exported according to the information of the corresponding IP, so that the cause of failure of failed operations can be quickly located.
[0086] 4. This application also has a verification mechanism. After the configuration is completed, executing the check script can export the current configuration options of each server and export them in an excel table; the format of the table can be that each IP occupies one line to confirm the correctness of the current configuration in real time.
[0087] The following are the embodiments shown in the present disclosure. It should be understood that the following embodiments can be implemented in combination with the above embodiments or separately implemented, and the present disclosure does not limit this. Embodiment
[0088] The following embodiments can be applied to the batch configuration of the CPU performance mode of x86 architecture servers. The specific steps are as follows: 1. First, the servers to be configured need to be connected to the out-of-band network, obtain the BMC IP of the servers to be configured, as well as the BMC username and BMC password (the usernames and passwords of most servers with batch configuration requirements are the same. Here, the usernames and passwords are written into the script internally, and the corresponding username and password parameters can be modified according to different sites. Since variables for the username and password are defined, only the corresponding parameters of the header variables need to be modified, reducing the amount of operations during configuration). Edit the obtained data in the attachment "ip.txt" (i.e., the above-mentioned IP address attachment), where each server to be configured occupies one line of data.
[0089] 2. Connect the in-band of the server for executing Python commands (i.e., the above-mentioned execution server) to the out-of-band network environment of the servers that need to be batch-operated, and automatically assign or manually set the in-band IP of this execution server to ensure that this in-band IP can be in the same network segment as the out-of-band IP of the servers that need to be batch-configured (i.e., the above-mentioned servers to be configured) and can communicate.
[0090] 3. First, check the network connectivity between the execution server and the servers to be configured. Specifically, the following two steps are used for confirmation: 3.1 Confirm the network connectivity through the ping command; 3.2 Confirm that the UDP port 623 of the server is open through the ipmitool command. As shown in the figure, confirm whether the port is open through the command return value.
[0091] 4. When the operating system of the server being executed is the Windows system, install Python under the Windows system. It is preferred to install the latest version. After the installation is complete, copy all the attached files to the path where python.exe (i.e., the Python software) is located. The attached files include "check.py" (i.e., the above-mentioned detection attachment), "config.py" (i.e., the above-mentioned configuration attachment), and "ip.txt".
[0092] 5. Execute the batch configuration. Fill in the information of the servers to be configured in the ip.txt file as required. The information of each server to be configured occupies one line to ensure that the information is filled in correctly.
[0093] 6. Execute the following command in the current directory: "python.exe config.py" to pull up the selection interface for the CPU performance mode; select the CPU mode to be set and select one of the following options as required: 1 - Dynamic Balance, 2 - Locked Base Frequency, 3 - Locked Overclocking; The following takes the selection of "1 - Dynamic Balance" as an example for illustration. After the selection, wait for the execution to complete, and an execution log will pop up. Multiple IPs will automatically traverse all servers; after the execution is complete, the execution log will be automatically exported to the directory where the current script is located and named by time.
[0094] 7. Check the execution result. After the configuration attachment (i.e., the above-mentioned configuration attachment) of the script to be configured is executed, wait for 10 minutes (the server restart takes 5 - 10 minutes). Execute the check script (i.e., the above-mentioned detection attachment) in the current directory, and run the command: "python.exe check.py". The check script also needs to select the export items to be checked. According to the selected export mode, the corresponding BIOS options will be automatically exported, and the options that are not involved will not be exported, which facilitates the inspection of the configuration result; the check script will export the execution log (named bios_check_time.log) and the check items (in excel format, named bios_check_time.xlsx; each IP occupies one line, and the cell adaptability is automatically set to be able to fully display the name of the setting item). This facilitates the quick verification of the execution result. The following is an example of the corresponding exported excel table: 8. The present invention is developed using the Python language, which can be compatible with the current mainstream Windows and Linux platforms, greatly improving the selectivity of the delivery environment and meeting the conditions for batch execution. When running the script (i.e., the above-mentioned preset attachment file), if it is prompted that the corresponding running script does not exist, the corresponding running script needs to be downloaded according to the prompt. Embodiment
[0095] The method of the present application involves the Python language and batch-configures the BIOS options corresponding to the server CPU mode through the written script.
[0096] To achieve the above object, the method of the present application is as Figure 10 shown and includes the following steps: 1. Configuration environment preparation: Install the latest version of Python on the operating host (i.e., the above-mentioned execution server).
[0097] 2. The in-band of the operating host and the out-of-band of the server to be configured are in the same network environment; the operating host connects to the in-band network, and the server to be configured connects to the out-of-band network.
[0098] 3. Power on and boot the server to be configured to ensure that the BMC of the server to be configured starts, and the operating host can obtain the IP address of the BMC.
[0099] 4. The operating host executes the ping and ipmitool commands to confirm the return value to determine whether the operating host and the server to be configured are communication-connected, that is, confirm whether the current network environment meets the operation requirements of batch configuration through the feedback value of the ping command and the ipmitool tool.
[0100] 5. Determine whether the feedback values of the ping command and the ipmitool tool are correct.
[0101] 6. When the feedback values of the ping command and the ipmitool tool are incorrect, check the network and reconfigure the network.
[0102] 7. When the feedback values of the ping command and the ipmitool tool are correct, execute the running configuration script "config.py" to configure the processor of the server to be configured.
[0103] 8. Wait for 10 minutes and execute the batch script check.py to check whether the BIOS options corresponding to the CPU mode are correct.
[0104] 9. According to the feedback of the batch script check.py, that is, the exported "bios_check._time.xlsx" file, judge whether the BIOS options corresponding to the CPU mode are correct.
[0105] 10. If the BIOS option for the CPU mode is incorrect, troubleshoot the problem according to the running log and re - execute the configuration of the server to be configured.
[0106] 11. If the BIOS option for the CPU mode is correct, determine that the configuration is successful and end the entire process.
[0107] To implement the server configuration method provided by the embodiments of the present disclosure, the embodiments of the present disclosure also provide a server configuration device, as Figure 11 shown. The server configuration device 1100 includes: A determination unit 1101, configured to determine whether there is a communication connection between the server to be configured and the execution server based on an operation command set. The execution server is used to configure the processor of the server to be configured; An acquisition unit 1102, configured to obtain a preset attachment file in a first file path when there is a communication connection between the server to be configured and the execution server. The first file path is the path corresponding to the first program software of the execution server. The preset attachment file includes at least one of the following: a detection attachment, a configuration attachment, and a network address attachment; A configuration unit 1103, configured to configure the processor of the server to be configured based on the preset attachment file.
[0108] In some embodiments, the acquisition unit 1102 is further configured to obtain an identity parameter set of the server to be configured. The identity parameter set includes at least one of the following: the network address of the baseboard management controller (BMC) of the server to be configured, the username of the BMC, and the password of the BMC. Among them, the server to be configured is connected to the out - of - band network of the network system, the execution server is connected to the in - band network of the network system, and the out - of - band network address of the server to be configured and the in - band network address of the execution server are in the same network segment.
[0109] In some embodiments, the determination unit 1101 is further configured to determine whether there is network connectivity between the execution server and the server to be configured based on a first operation command; determine whether the remote management control protocol port of the server to be configured is open based on a second operation command; when there is network connectivity between the execution server and the server to be configured and the remote management control protocol port of the server to be configured is open, determine that there is a communication connection between the server to be configured and the execution server.
[0110] In some embodiments, the configuration unit 1103 is further configured to, based on a third operation command, call a configuration attachment to select a configuration mode of the processor, where the configuration mode includes at least one of the following: dynamic balance mode, locked standard frequency mode, and locked overclocking mode; write the identity parameter set into the network address attachment in a preset format to obtain a network address update attachment; determine the network address of the BMC of the server to be configured based on the network address update attachment; determine the configuration options corresponding to the configuration mode in the configuration attachment based on the configuration mode; and configure the processor by using the configuration options based on the network address of the BMC of the server to be configured.
[0111] In some embodiments, the configuration unit 1103 is further configured to, when the configuration mode is the dynamic balance mode, determine that the configuration options are: turn off the wait state option, invalidate the first state option, and turn on the second state option; when the configuration mode is the locked standard frequency mode, determine that the configuration options are: turn off the second state option on the premise that the power configuration option is set to custom; when the configuration mode is the locked overclocking mode, determine that the configuration options are: set the third state option to a preset value and turn on the static turbo option on the premise that the power configuration option is set to custom.
[0112] In some embodiments, the configuration unit 1103 is further configured to, when the configuration of the processor is completed, generate a configuration log and export the directory location of the preset attachment file in the execution server; at a preset time point after the configuration of the processor is completed, use the detection attachment to detect the configuration result of the server to be configured.
[0113] In summary, the server configuration device proposed according to the present disclosure includes: a determination unit configured to determine whether there is a communication connection between the server to be configured and the execution server based on an operation command set, where the execution server is used to configure the processor of the server to be configured; an acquisition unit configured to, when there is a communication connection between the server to be configured and the execution server, acquire a preset attachment file in a first file path, where the first file path is the path corresponding to the first program software of the execution server, and the preset attachment file includes at least one of the following: a detection attachment, a configuration attachment, and a network address attachment; and a configuration unit configured to configure the processor of the server to be configured based on the preset attachment file. The device of the present disclosure enables the execution server to obtain the correspondence between the configuration mode and the configuration options, as well as the BMC network address of the server to be configured through the preset attachment file, so that the execution server can determine the network location of the server to be processed based on the BMC network address, and determine the setting of the configuration options for the server to be processed according to the correspondence between the configuration mode and the configuration options, thereby realizing the configuration of the server to be configured by the execution server, without the need for manual configuration operations and verification for each server to be configured, improving the configuration efficiency of the server to be configured and shortening the server delivery time.
[0114] It should be noted that when the server configuration device provided in the above embodiments performs server configuration, only the division of the above program modules is used as an example. In actual applications, the above processing can be allocated to different program modules according to needs, that is, the internal structure of the server configuration device is divided into different program modules to complete all or part of the above-described processing. In addition, the server configuration device provided in the above embodiments and the server configuration method embodiments provided in the present disclosure belong to the same concept. For the specific implementation process, please refer to the method embodiments and will not be elaborated here.
[0115] Figure 12 FIG. is a schematic diagram of the hardware composition structure of the electronic device provided in the embodiments of the present disclosure. As Figure 12 shown, the electronic device 1200 includes at least one processor 1202; and a memory 1201 communicatively connected to the at least one processor 1202; wherein, the memory 1201 stores instructions executable by the at least one processor 1202, and the instructions are executed by the at least one processor 1202 to implement the steps of the server configuration method described in the embodiments of the present disclosure.
[0116] Optionally, the electronic device may specifically be the server configuration device of the embodiments of the present application, and the electronic device can implement the corresponding processes implemented by the server configuration device in the various methods of the embodiments of the present application. For the sake of brevity, it will not be elaborated here.
[0117] It can be understood that the electronic device further includes a communication interface 1203. Each component in the electronic device is coupled together through a bus system 1204. It can be understood that the bus system 1204 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 1204 further includes a power bus, a control bus, and a status signal bus. However, for the sake of clear illustration, in Figure 12 all the various buses are labeled as the bus system 1204.
[0118] It can be understood that the memory 1201 can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM, Read Only Memory), a programmable read-only memory (PROM, Programmable Read-Only Memory), an erasable programmable read-only memory (EPROM, Erasable Programmable Read-Only Memory), an electrically erasable programmable read-only memory (EEPROM, Electrically Erasable Programmable Read-Only Memory), a ferromagnetic random access memory (FRAM, ferromagnetic random access memory), a flash memory (Flash Memory), a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM, Compact Disc Read-Only Memory); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM, Random Access Memory), which is used as an external cache. This method is illustrated by way of example but not limitation, and many forms of RAM are available, such as a static random access memory (SRAM, Static Random Access Memory), a synchronous static random access memory (SSRAM, Synchronous Static Random Access Memory), a dynamic random access memory (DRAM, Dynamic Random Access Memory), a synchronous dynamic random access memory (SDRAM, Synchronous Dynamic Random Access Memory), a double data rate synchronous dynamic random access memory (DDR SDRAM, Double Data Rate Synchronous Dynamic Random Access Memory), an enhanced synchronous dynamic random access memory (ESDRAM, Enhanced Synchronous Dynamic Random Access Memory), a sync link dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), a direct rambus random access memory (DRRAM, Direct Rambus Random Access Memory).The memory 1201 described in the embodiments of the present invention is intended to include, but is not limited to, these and any other suitable types of memories.
[0119] The method disclosed in the above embodiments of the present disclosure can be applied to the processor 1202 or implemented by the processor 1202. The processor 1202 has the ability to process signals. In the implementation process, each step of the above method can be completed by the integrated logic circuit in the hardware of the processor 1202 or the command in the form of software. The above processor 1202 can be a general-purpose processor, DSP, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor 1202 can implement or execute each method, step, and logic block diagram disclosed in the embodiments of the present invention. The general-purpose processor can be a microprocessor or any conventional processor, etc. Combining the steps of the method disclosed in the embodiments of the present invention can be directly embodied as being executed and completed by the hardware decoding processor, or executed and completed by the combination of the hardware and software modules in the decoding processor. The software module can be located in the storage medium, and this storage medium is located in the memory 1201. The processor 1202 reads the information in the memory 1201 and combines its hardware to complete the steps of the foregoing method.
[0120] In an exemplary embodiment, the electronic device can be implemented by one or more application-specific integrated circuits (ASICs, Application Specific Integrated Circuits), DSPs, programmable logic devices (PLDs, Programmable Logic Devices), complex programmable logic devices (CPLDs, Complex Programmable Logic Devices), FPGAs, general-purpose processors, controllers, MCUs, microprocessors, or other electronic components, and is used to execute the foregoing method.
[0121] The embodiments of the present disclosure also provide a non-transitory computer-readable storage medium storing computer commands, and the computer commands are used to cause the computer to execute the steps of the server configuration method described in the embodiments of the present disclosure when executed.
[0122] The embodiments of the present disclosure also provide a computer program product, including a computer program, and the computer program implements the steps of the server configuration method described in the embodiments of the present disclosure when executed by a processor.
[0123] Optionally, the computer-readable storage medium can be applied to the server configuration device in the embodiments of the present application, and the computer commands cause the computer to execute the corresponding processes implemented by the server configuration device in each method of the embodiments of the present application. For the sake of brevity, it will not be elaborated here.
[0124] In several embodiments provided by the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined, or can be integrated into another system, or some features can be ignored, or not executed. In addition, the couplings between the components shown or discussed, or direct couplings, or communication connections can be through some interfaces. The indirect couplings or communication connections of devices or units can be electrical, mechanical, or other forms.
[0125] The units described above as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0126] In addition, each functional unit in the embodiments of the present invention can be all integrated in a processing unit, or each unit can be separately used as a unit, or two or more units can be integrated in a unit. The above-mentioned integrated units can be implemented in the form of hardware, or in the form of hardware plus software functional units.
[0127] Those of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by hardware related to program commands. The foregoing program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps including the above method embodiments. The foregoing storage medium includes various media that can store program codes, such as removable storage devices, ROM, RAM, magnetic disks, or optical discs.
[0128] Alternatively, if the above-mentioned integrated units of the present invention are implemented in the form of software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiments of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several commands to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in the embodiments of the present invention. The foregoing storage medium includes various media that can store program codes, such as removable storage devices, ROM, RAM, magnetic disks, or optical discs.
[0129] As described above, it is only the specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of changes or substitutions, which should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the said claims.
Claims
1. A server configuration method, characterized in that: The method comprises: Based on the operation command set, determining whether the server to be configured and the execution server are in communication connection, the execution server being used to configure the processor of the server to be configured; When the server to be configured is in communication connection with the execution server, a preset attachment file in a first file path is obtained, where the first file path is a path corresponding to the first program software of the execution server, and the preset attachment file includes at least one of the following: a detection attachment, a configuration attachment, and a network address attachment; Based on the preset attachment file, the processor of the server to be configured is configured.
2. The method according to claim 1, characterized in that The method further comprises: Acquire the identity parameter set of the server to be configured, the identity parameter set including at least one of the following: the network address of the baseboard management controller BMC of the server to be configured, the user name of the BMC and the password of the BMC, The server to be configured is connected to the out-of-band network of the network system, the execution server is connected to the in-band network of the network system, and the out-of-band network address of the server to be configured and the in-band network address of the execution server are located in the same network segment.
3. The method according to claim 1, characterized in that The determining, based on the operation command set, whether the server to be configured and the execution server are in communication connection includes: Based on the first operation command, determining whether the execution server and the server to be configured are connected to each other through a network; Based on the second operation command, determining whether the remote management control protocol port of the server to be configured is enabled; When the execution server and the server to be configured are connected through a network, and the remote management control protocol port of the server to be configured is enabled, it is determined that the server to be configured and the execution server are in communication connection.
4. The method according to claim 2, characterized in that: The configuring the processor of the server to be configured based on the preset attachment file includes: Based on the third operation command, calling the configuration accessory to select a configuration mode of the processor, the configuration mode including at least one of the following: a dynamic balance mode, a locked standard frequency mode, and a locked overclocking mode; Writing the identity parameter set into the network address attachment in a preset format to obtain a network address update attachment; Based on the network address update attachment, determine the network address of the BMC of the server to be configured; Based on the configuration mode, determining a configuration option in the configuration attachment corresponding to the configuration mode; The processor is configured based on the network address of the BMC of the server to be configured and using the configuration options.
5. The method according to claim 4, characterized in that The determining, based on the configuration mode, a configuration option in the configuration attachment corresponding to the configuration mode comprises: When the configuration mode is the dynamic balance mode, determining the configuration options is: turning off the waiting state option, invalidating the first state option, and turning on the second state option; When the configuration mode is the locked standard frequency mode, determining the configuration option is: under the premise that the power configuration option is set to custom, turning off the second state option; When the configuration mode is the locked overclocking mode, the configuration option is determined as follows: on the premise that the power configuration option is set to custom, the third state option is set to a preset value, and a static turbo option is turned on.
6. The method according to claim 1, characterized in that The method further comprises: When the processor completes the configuration, a configuration log is generated, and the directory location of the preset attachment file in the execution server is exported; At a preset time point after the processor completes configuration, the configuration result of the server to be configured is detected using the detection attachment.
7. A server configuration device, characterized in that: include: A determination unit, configured to determine whether a server to be configured and an execution server are in communication connection based on an operation command set, wherein the execution server is configured to configure a processor of the server to be configured; an acquisition unit, configured to acquire a preset attachment file in a first file path when the server to be configured is in communication connection with the execution server, wherein the first file path is a path corresponding to the first program software of the execution server, and the preset attachment file includes at least one of the following: a detection attachment, a configuration attachment, and a network address attachment; A configuration unit is used to configure the processor of the server to be configured based on the preset attachment file.
8. An electronic device, characterized in that: include: a processor and a memory for storing a computer program capable of being executed on the processor, Wherein, when the processor is used to run the computer program, it executes the server configuration method according to any one of claims 1-6.
9. A non-transitory computer-readable storage medium storing computer commands, characterized in that: The computer command is used to enable the computer to execute the server configuration method according to any one of claims 1 to 6.
10. A computer program product, characterized in that The invention comprises a computer program, which implements the server configuration method according to any one of claims 1 to 6 when being executed by a processor.
Citation Information
Cited By
Password management method, computer equipment, readable storage medium and program product
CN120387159A
Password management method, computer device, readable storage medium and program product
CN120387159B