Server control methods and devices, storage media and electronic devices
By automatically sending allocation instructions to the baseboard management controller through server control scripts, the problem of low efficiency in static IP configuration of servers is solved, and efficient static IP configuration and automated test preparation are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-15
- Publication Date
- 2026-04-07
AI Technical Summary
In existing technologies, configuring static IP addresses for servers is inefficient, requiring manual intervention during automated testing, which can easily lead to configuration errors and reduce control efficiency.
The server control script automatically sends allocation instructions to the baseboard management controller, receives and applies static Internet Protocol information, and realizes automatic server configuration.
Without manual intervention, it achieves efficient and automatic configuration of static IP addresses for servers, improving configuration efficiency and ease of test preparation.
Smart Images

Figure CN116633989B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computers, and more specifically, to a server control method and apparatus, storage medium, and electronic device. Background Technology
[0002] With the development of modern networks, more and more devices need to connect to the network and require a unique IP address (Internet Protocol Address) for communication. In many cases, using dynamic IPs is feasible, but in certain scenarios, it is necessary to configure static IPs for servers. For example, in a laboratory setting with multiple servers that need to perform automated testing simultaneously, each server needs to be configured with a fixed static IP address. Static IP addresses are essential to avoid the need to log in to the server to query and set the IP address before each automated test.
[0003] Currently, it is necessary to manually log in to the static IP configuration interface of each server, set a unique static IP for each server, and then control the server to apply the static IP after the configuration is completed. In this process, the workload of configuring numerous servers is enormous. At the same time, the configuration process cannot produce duplicate or incorrect static IPs, otherwise subsequent automated testing will fail, and troubleshooting will consume a lot of time. It is evident that the above-mentioned potential problems will greatly reduce the control efficiency of the server.
[0004] There is still no effective solution to the problem of low efficiency in configuring static Internet Protocol information during the server control process in related technologies. Summary of the Invention
[0005] This application provides a server control method and apparatus, storage medium and electronic device to at least solve the problem of low efficiency in configuring static Internet Protocol information during the server control process in related technologies.
[0006] According to one embodiment of the present application, a server control method is provided, including:
[0007] The system responds to a received target execution command, wherein the target execution command instructs the server control script to configure static Internet Protocol (IP) information for the target server, and the static IP information is used to construct a test environment for performing target tests on the target server.
[0008] Send a target allocation instruction to the baseboard management controller connected to the target server, wherein the target allocation instruction is used to instruct the baseboard management controller to allocate static Internet Protocol information to the target server;
[0009] Receive the target static Internet Protocol information returned by the baseboard management controller in response to the target allocation instruction;
[0010] A configuration operation is performed on the target server using the target static Internet Protocol information, wherein the configuration operation is used to configure the target server to allow the use of the target static Internet Protocol information.
[0011] Optionally, sending the target allocation instruction to the baseboard management controller connected to the target server includes:
[0012] Generate the target allocation instruction;
[0013] The operating system controlling the target server sends the target allocation command to the baseboard management controller through the target connection established between the target server and the baseboard management controller via a connection tool.
[0014] Optionally, the operating system controlling the target server sends the target allocation command to the baseboard management controller through a target connection established between the target server and the baseboard management controller via a connection tool, including:
[0015] The operating system is controlled to call the intelligent platform management interface deployed on the target server, wherein the target connection is a connection between the intelligent platform management interface and the baseboard management controller established through the intelligent platform management tool, and the connection tool includes the intelligent platform management tool;
[0016] The target allocation instruction is sent to the baseboard management controller through the intelligent platform management interface.
[0017] Optionally, generating the target allocation instruction includes:
[0018] Generate an initial allocation instruction to instruct the baseboard management controller to allocate static Internet Protocol information to the server as the target allocation instruction; or...
[0019] Generate an initial allocation instruction to instruct the baseboard management controller to allocate static Internet Protocol information to the server; add the target server identifier of the target server to the initial allocation instruction to obtain the target allocation instruction.
[0020] Optionally, receiving the target static Internet Protocol information returned by the baseboard management controller in response to the target allocation instruction includes:
[0021] When the initial allocation instruction for instructing the baseboard management controller to allocate static Internet Protocol (IP) information to the server is generated as the target allocation instruction, the static IP information table returned by the baseboard management controller in response to the target allocation instruction is received, wherein the static IP information table records server identifiers and static IP information with corresponding relationships.
[0022] The static Internet Protocol information corresponding to the target server identifier of the target server is retrieved from the static Internet Protocol information table and used as the target static Internet Protocol information.
[0023] Optionally, performing configuration operations on the target server using the target static Internet Protocol information includes:
[0024] Invoke the network settings tool deployed on the target server, wherein the network settings tool is used to display multiple configuration locations of the static Internet Protocol information of the target server;
[0025] The target static Internet Protocol identifier corresponding to the target configuration location is found from the plurality of static Internet Protocol identifiers included in the target static Internet Protocol information, wherein the plurality of configuration locations includes the target configuration location;
[0026] Add the target static Internet Protocol identifier to the target configuration location.
[0027] Optionally, the target execution instruction received in the response includes one of the following:
[0028] The system receives a target configuration request sent by the baseboard management controller as the target execution instruction, wherein the target configuration request is used to request the configuration of static Internet Protocol information for the target server; and executes in response to the target configuration request.
[0029] The target server's operating system receives a running task carrying the server control script sent by the baseboard management controller as the target running instruction; and responds by running the running task on the operating system.
[0030] According to another embodiment of the present application, a server control device is also provided, comprising:
[0031] A response module is used to respond to a received target execution command, wherein the target execution command is used to instruct the server control script to configure static Internet Protocol (IP) information for the target server, and the static IP information is used to construct a test environment for performing target tests on the target server;
[0032] The sending module is used to send a target allocation instruction to the baseboard management controller connected to the target server, wherein the target allocation instruction is used to instruct the baseboard management controller to allocate static Internet Protocol information to the target server;
[0033] The receiving module is configured to receive target static Internet Protocol information returned by the baseboard management controller in response to the target allocation instruction;
[0034] An execution module is configured to perform a configuration operation on the target server using the target static Internet Protocol information, wherein the configuration operation is configured to allow the target server to use the target static Internet Protocol information.
[0035] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer program, and the computer program is configured to execute the control method of the server described above when it is run.
[0036] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the server control method described above through the computer program.
[0037] In this embodiment, the server control script controls the server using the following method: First, the server control script responds to a received target execution command, which instructs the script to configure static Internet Protocol (IP) information for the target server. This static IP information is used to construct a test environment for performing target tests on the target server. Then, the script sends a target allocation command to the baseboard management controller (BMDC) connected to the target server, instructing the BMDC to allocate static IP information to the target server, and receives the target static IP information returned by the BMDC in response to the target allocation command. Finally, the target static IP information is used to perform a configuration operation on the target server, which configures the target server to allow the use of the target static IP information. This server control process requires no human intervention and can be entirely controlled by the server control script, automatically configuring the target server to allow the use of the target static IP information. This technical solution solves the problem of low efficiency in configuring static IP information during server control in related technologies, achieving the technical effect of improving the efficiency of static IP information configuration during server control. Attached Figure Description
[0038] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0039] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0040] Figure 1 This is a schematic diagram of the hardware environment for a server control method according to an embodiment of this application;
[0041] Figure 2 This is a flowchart of a server control method according to an embodiment of this application;
[0042] Figure 3 This is an interaction diagram of a server control method according to an embodiment of this application;
[0043] Figure 4 This is a schematic diagram of a target allocation instruction sending method according to an embodiment of this application;
[0044] Figure 5 This is a schematic diagram of a static Internet Protocol information table according to an embodiment of this application;
[0045] Figure 6 This is a schematic diagram of a network setup tool according to an embodiment of this application;
[0046] Figure 7 This is a schematic diagram of a server control flow according to an embodiment of this application;
[0047] Figure 8 This is a schematic diagram of a target static Internet Protocol information configuration device according to an embodiment of this application;
[0048] Figure 9 This is a structural block diagram of a server control device according to an embodiment of this application. Detailed Implementation
[0049] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0050] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0051] The methods and embodiments provided in this application can be executed on a computer terminal, device terminal, or similar computing device. Taking running on a computer terminal as an example, Figure 1 This is a schematic diagram of the hardware environment for a server control method according to an embodiment of this application. Figure 1 As shown, a computer terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. In one exemplary embodiment, the computer terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the computer terminal described above. For example, the computer terminal may also include components that are more complex than those described above. Figure 1 The more or fewer components shown, or having the same Figure 1 Equivalent functions or ratios shown Figure 1 The functions shown have more different configurations.
[0052] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the server control method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, thereby implementing the aforementioned method. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to a computer terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0053] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider for the computer terminal. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0054] The terms used in the embodiments of this application are explained as follows:
[0055] IP: Internet Protocol Address. The Internet Protocol address is a unified address format provided by the IP protocol. It assigns a logical address to every network and every host on the Internet to mask the differences in physical addresses.
[0056] Dynamic IP / Static IP: The main difference between static IP and dynamic IP is that a static IP address is a fixed address assigned to a device, while a dynamic IP address is an address automatically assigned to a device by a DHCP server. Static Internet Protocol information includes static IP addresses.
[0057] DHCP, Dynamic Host Configuration Protocol;
[0058] DNS, Domain Name System;
[0059] BMC: Baseboard Management Controller.
[0060] This embodiment provides a server control method, applied to the aforementioned computer terminal. Figure 2 This is a flowchart of a server control method according to an embodiment of this application, such as... Figure 2 As shown, this process is applied to server control scripts and includes the following steps:
[0061] Step S202: Respond to the received target execution instruction, wherein the target execution instruction is used to instruct the server control script to configure static Internet Protocol information for the target server, and the static Internet Protocol information is used to construct a test environment for performing target tests on the target server;
[0062] Step S204: Send a target allocation instruction to the baseboard management controller connected to the target server, wherein the target allocation instruction is used to instruct the baseboard management controller to allocate static Internet Protocol information to the target server;
[0063] Step S206: Receive target static Internet Protocol information returned by the baseboard management controller in response to the target allocation instruction;
[0064] Step S208: Perform a configuration operation on the target server using the target static Internet Protocol information, wherein the configuration operation is used to configure the target server to allow the use of the target static Internet Protocol information.
[0065] Through the above steps, the server control script controls the server as follows: First, the server control script responds to the received target execution command, which instructs the server control script to configure static Internet Protocol (IP) information for the target server. This static IP information is used to construct the test environment for performing the target test on the target server. Then, it sends a target allocation command to the baseboard management controller connected to the target server, instructing the baseboard management controller to allocate static IP information to the target server, and receives the target static IP information returned by the baseboard management controller in response to the target allocation command. Finally, it uses the target static IP information to perform a configuration operation on the target server, which configures the target server to allow the use of the target static IP information. This server control process requires no human intervention and can be entirely controlled by the server control script, automatically configuring the target server to allow the use of the target static IP information. This technical solution solves the problem of low efficiency in configuring static IP information during server control in related technologies, achieving the technical effect of improving the efficiency of static IP information configuration during server control.
[0066] In the technical solution provided in step S202 above, it is mentioned above that in certain scenarios, it is necessary to configure a static IP for the server. For example, if there are multiple servers in a laboratory that need to be automated tested at the same time, then it is necessary to configure a fixed static IP for each of the multiple servers. At this time, the static IP address is necessary. It is possible, but not limited to, to use any one of the multiple servers to be automated tested as the target server to be tested. The target server needs static Internet Protocol information to provide the test environment for the target test.
[0067] Optionally, in this embodiment, static Internet Protocol information may include, but is not limited to, parameters such as the static IP address, subnet mask, gateway, and DNS server corresponding to the server. The content covered by static Internet Protocol information is not limited here. Any parameter or information that can provide a test environment for the target test can be used as static Internet Protocol information.
[0068] Optionally, in this embodiment, the server control script may be, but is not limited to, pre-created on the baseboard management controller. Figure 3 This is an interaction diagram of a server control method according to an embodiment of this application, such as... Figure 3 As shown, the server script runs upon receiving a target execution instruction. This instruction directs the server control script to configure static Internet Protocol (IP) information for the target server. The static IP information is used to construct a test environment for performing target tests on the target server, generate a target allocation instruction, and send this instruction to the baseboard management controller corresponding to the target server. The baseboard management controller allocates static IP information to the target server and returns the generated target static IP information to the server control script. The server control script then performs a configuration operation on the target server based on the returned target static IP information. This configuration operation configures the target server to allow the use of the target static IP information.
[0069] In one exemplary embodiment, the response to the received target execution instruction may be, but is not limited to, one of the following methods: receiving a target configuration request sent by the baseboard management controller as the target execution instruction, wherein the target configuration request is used to request the configuration of static Internet Protocol information for the target server; executing in response to the target configuration request; receiving a execution task carrying the server control script sent by the baseboard management controller as the target execution instruction through the operating system of the target server; and running the execution task on the operating system in response to the execution task.
[0070] Optionally, in this embodiment, the execution of the server control script can be triggered, but is not limited to, by a target execution instruction, which can be, but is not limited to, the following instructions:
[0071] 1) The target operation command is sent directly by the baseboard management controller. The target configuration request sent by the baseboard management controller is used as the target operation command. That is, when the baseboard management controller sends a target configuration request to request the configuration of static Internet Protocol information for the target server, the target configuration request can be used as the target operation command.
[0072] 2) The baseboard management controller sends a running task carrying the server control script to the operating system of the target server, and then uses the running task as the target running instruction, while the server control script runs on the operating system of the target server.
[0073] The two response methods described above for receiving target execution instructions provide more options for the response methods of server control scripts, making the deployment and execution methods of server control scripts more diverse.
[0074] In the technical solution provided in step S204 above, it is mentioned above that in certain scenarios, it is necessary to configure static IPs for servers. For example, if there are multiple servers in a laboratory that need to be automated for testing simultaneously, then it is necessary to configure a fixed static IP for each of the multiple servers. In this case, a static IP address is required. It is possible, but not limited to, using any one of the multiple servers to be automated for testing as the target server to be tested. The target server needs static Internet Protocol (IP) information to provide a testing environment for the target test. It is possible, but not limited to, allocating static IP information to the target server through a baseboard management controller. It can be understood that each of the M target servers corresponds to a baseboard management controller that allocates static IP information to it. Of course, there can be multiple baseboard management controllers or just one baseboard management controller. Static IP information can be allocated to each of the multiple target servers through one baseboard management controller.
[0075] Optionally, in this embodiment, the following describes an optional method for the baseboard management controller to allocate static Internet Protocol information to each of the multiple target servers:
[0076] The baseboard management controller can receive the target server identifier of the target server and store the target server identifier (in this application, the device identifier can be understood as, but is not limited to, the server identifier or server ID, used to represent the unique identity information of the server) in a first storage space within the baseboard management controller; when the first storage space meets the target triggering condition, static Internet Protocol (IP) information for the target address quantity is generated in a second storage space within the baseboard management controller according to the number of target identifiers of the device identifiers stored in the first storage space, wherein the number of target addresses is greater than or equal to the number of target identifiers; the device identifiers of the target identifier quantity are paired with the static IP information for the target address quantity to obtain corresponding static IP information and device identifiers; the target static IP information corresponding to the target server identifier is retrieved from the corresponding IP addresses and device identifiers.
[0077] Optionally, pairing the device identifiers of the target number of identifiers with the static Internet Protocol information of the target number of addresses may include the following steps:
[0078] 1) Randomly select an unpaired device identifier from the target number of device identifiers as the device identifier to be paired, and randomly select an unpaired static Internet Protocol (IP) information from the target number of static Internet Protocol (IP) information as the static Internet Protocol (IP) information to be paired;
[0079] 2) Perform a pairing operation between the device identifier to be paired and the static Internet Protocol information to be paired, to obtain a set of static Internet Protocol information and device identifiers with corresponding relationships;
[0080] 3) Update the pairing status of the device identifier and static Internet Protocol information of the device that has completed the pairing operation to "paired";
[0081] 4) Repeat the above steps until the number of device identifiers with an unpaired pairing status among the target number of device identifiers is 0.
[0082] Optionally, when the first storage space meets the target triggering condition, generating static Internet Protocol information for the target number of addresses in the second storage space within the baseboard management controller based on the number of target identifiers of device identifiers stored in the first storage space may include one of the following:
[0083] 1) If the number of device identifiers in the first storage space is greater than or equal to the target number threshold, static Internet Protocol (IP) information for the target number of addresses is generated in the second storage space within the baseboard management controller based on the target number of device identifiers stored in the first storage space; or
[0084] 2) If the storage time of the first device identifier stored in the first storage space is greater than or equal to the target time threshold, static Internet Protocol information of the target address number is generated in the second storage space in the baseboard management controller according to the target number of device identifiers stored in the first storage space.
[0085] In one exemplary embodiment, a target allocation instruction may be sent to the baseboard management controller to which the target server is connected, but not limited to, by: generating the target allocation instruction; and controlling the operating system of the target server to send the target allocation instruction to the baseboard management controller through a target connection established between the target server and the baseboard management controller via a connection tool.
[0086] Optionally, in this embodiment, Figure 4This is a schematic diagram of a target allocation instruction sending method according to an embodiment of this application, as shown below. Figure 4 As shown, a connection tool is deployed on the target server. This connection tool is used to establish a target connection between the baseboard management controller and the target server. The target server and the baseboard management controller can interact and transmit information through this target connection. The target allocation command is sent to the baseboard management controller in the following way: first, the target allocation command is sent to the operating system of the target server, and then the operating system calls the target connection established by the connection tool to send the target allocation command to the baseboard management controller.
[0087] In one exemplary embodiment, the operating system of the target server may be controlled to send the target allocation instruction to the baseboard management controller through a target connection established between the target server and the baseboard management controller via a connection tool in the following manner: controlling the operating system to call the intelligent platform management interface deployed on the target server, wherein the target connection is a connection between the intelligent platform management interface and the baseboard management controller established via the intelligent platform management tool, and the connection tool includes the intelligent platform management tool; and sending the target allocation instruction to the baseboard management controller through the intelligent platform management interface.
[0088] Optionally, in this embodiment, the process of establishing a connection between the intelligent platform management interface and the baseboard management controller through the intelligent platform management tool, i.e., the IPMI (Intelligent Platform Management Interface) tool, such as the IPMI tool or Free IPMI, can be, but is not limited to, as follows: in the BMC web interface, find the relevant options such as "IPMI-over-LAN" or "remote control", enable the IPMI-over-LAN function, so that the BMC can communicate with the operating system, and then control the operating system to call the intelligent platform management interface deployed on the target server, and send the target allocation instruction to the baseboard management controller through the intelligent platform management interface.
[0089] In one exemplary embodiment, the target allocation instruction may be generated, but is not limited to, by: generating an initial allocation instruction for instructing the baseboard management controller to allocate static Internet Protocol (IP) information to the server as the target allocation instruction; or, generating an initial allocation instruction for instructing the baseboard management controller to allocate static IP information to the server; adding the target server identifier of the target server to the initial allocation instruction to obtain the target allocation instruction.
[0090] Optionally, in this embodiment, the target allocation instruction is used to instruct the baseboard management controller to allocate static Internet Protocol (IP) information to the target server. Therefore, the server control script can directly generate an initial allocation instruction to instruct the baseboard management controller to allocate IP information to the server as the target allocation instruction. The server identifier can be, but is not limited to, sent spontaneously by the target server to the baseboard management controller. Alternatively, the server control script can generate an initial allocation instruction to instruct the baseboard management controller to allocate IP information to the server, and add the server identifier of the target server that needs to be configured with IP information to the initial allocation instruction to obtain the target allocation instruction. That is, upon receiving the target allocation instruction, the baseboard management controller can determine which servers need to be configured with IP information.
[0091] In the technical solution provided in step S206 above, the substrate management controller responds to the target allocation instruction, allocates the corresponding target static Internet Protocol information to the target server, and returns the target static Internet Protocol information to the server control script.
[0092] In one exemplary embodiment, the target static Internet Protocol (IP) information returned by the baseboard management controller in response to the target allocation instruction may be received in the following manner, but is not limited to: when an initial allocation instruction is generated to instruct the baseboard management controller to allocate static IP information to a server as the target allocation instruction, a static IP information table returned by the baseboard management controller in response to the target allocation instruction is received, wherein the static IP information table records server identifiers and static IP information with corresponding relationships; the static IP information corresponding to the target server identifier of the target server is retrieved from the static IP information table as the target static IP information.
[0093] Optionally, in this embodiment, Figure 5 This is a schematic diagram of a static Internet Protocol information table according to an embodiment of this application, such as... Figure 5 As shown, the baseboard management controller can return a static Internet Protocol (IP) information table to the server control script. This table records corresponding server identifiers and static IP information. For example, server identifier 1 corresponds to static IP information 1, server identifier 2 corresponds to static IP information 2, and server identifier 3 corresponds to static IP information 3. The static IP information corresponding to the target server identifier of the target server is retrieved from the static IP information table and used as the target static IP information. For example, if the target server identifier of the target server is server identifier 1, then static IP information 1 is retrieved from the static IP information table and used as the target static IP information.
[0094] In the technical solution provided in step S208 above, after receiving the target static Internet Protocol information, the server control script can perform a configuration operation on the target server according to the target static Internet Protocol information, so that the target server is configured to allow the use of the target static Internet Protocol information.
[0095] In one exemplary embodiment, configuration operations on the target server can be performed using the target static Internet Protocol (IP) information in the following ways, but not limited to: invoking a network settings tool deployed on the target server, wherein the network settings tool is used to display multiple configuration locations of the target server's static IP information; searching for a target static IP identifier corresponding to the target configuration location from multiple static IP identifiers included in the target static IP information, wherein the multiple configuration locations include the target configuration location; and adding the target static IP identifier to the target configuration location.
[0096] Optionally, in this embodiment, Figure 6 This is a schematic diagram of a network setup tool according to an embodiment of this application, such as... Figure 6 As shown, after receiving the target static Internet Protocol (IP) information, the server control script calls the network settings tool deployed on the target server. The network settings tool displays "Configuration Location - Static IP Information," which shows multiple configuration locations of the target server's static IP information. For example, configuration location 1 corresponds to static IP identifier 1, configuration location 2 corresponds to static IP identifier 2, and configuration location 3 corresponds to static IP identifier 3. The script searches for the target static IP identifier corresponding to the target configuration location from the multiple static IP identifiers included in the target static IP information. For example, if the target static IP information includes static IP identifier 1 and static IP identifier 2, the found target configuration locations are configuration location 1 and configuration location 2, respectively. Then, static IP identifier 1 is added to configuration location 1, and static IP identifier 2 is added to configuration location 2.
[0097] Optionally, in this embodiment, the static Internet Protocol information may include, but is not limited to, parameters such as the static IP address, subnet mask, gateway, and DNS server corresponding to the server, and each of the above parameters can be understood as a static Internet Protocol identifier.
[0098] To better understand the control process of the server described above, the control flow of the server will be further described below in conjunction with optional embodiments, but this is not intended to limit the technical solutions of the embodiments of this application.
[0099] This embodiment provides a server control method. Figure 7 This is a schematic diagram of the control flow of a server according to an embodiment of this application, such as... Figure 7 As shown, the main steps include the following:
[0100] Step 1: Generate target static Internet Protocol (IP) information. Create a user server control script on the BMC to set the target static IP information, including parameters such as static IP address, subnet mask, gateway, and DNS server. Then, click the "Save" or "Apply" button to save these parameters to the BMC.
[0101] Step 2: Establish communication between the server and the baseboard management controller. In the BMC web interface, locate the relevant option such as "IPMI-over-LAN" or "Remote Control" and enable the IPMI-over-LAN function to allow the BMC (Baseboard Management Controller) to communicate with the operating system. Install IPMI tools, such as IPMI tool or Free IPMI, on the target server's operating system so that the operating system can communicate with the BMC.
[0102] Step 3: Assign static Internet Protocol (IP) information to the servers. Create a server group on the BMC (corresponding to the first storage space mentioned above) and add the server identifiers of the servers whose static IP information needs to be configured to this group. Create a task on the BMC, adding the IP address pool (corresponding to the second storage space mentioned above), server control script, server group, and other information to the task. Upload the server control script for batch configuring static IP information to the operating system and run it. The server control script automatically reads the static IP information stored in the BMC and applies it to the operating system. The server control script uses the IPMI tool to obtain the static IP information stored in the BMC. Use the IPMI tool to connect to the BMC and retrieve the static IP information stored therein.
[0103] Step 4: The server control script applies static Internet Protocol (IP) information. It batch-sets IP information in the operating system based on the server group information. Using the network configuration tools in each operating system, the static IP information stored in the BMC is applied to each operating system, thus achieving the function of automatically setting static IP information in batches.
[0104] This embodiment provides a server control method. Figure 8 This is a schematic diagram of a target static Internet Protocol information configuration device according to an embodiment of this application, such as... Figure 8 As shown, it mainly includes the following parts:
[0105] 1. IP Address Pool Management Module: Used to manage IP address pools, including operations such as creating, modifying, and deleting IP address pools.
[0106] 2. Server Control Script Management Module: Used to manage server control scripts, including operations such as creating, modifying, and deleting scripts.
[0107] 3. Server Group Management Module: Used to manage server groups, including operations such as creating, modifying, and deleting server groups.
[0108] 4. Task Management Module: Used to manage tasks, including creating, modifying, and deleting tasks.
[0109] 5. Execution Module: Used to execute tasks and automatically set static Internet Protocol information for the server.
[0110] Includes the following tasks:
[0111] 1) Install IPMI tools in the operating system. Install IPMI tools, such as IPMI tool or Free IPMI, in the operating system so that the operating system can communicate with the BMC.
[0112] 2) Use the IPMI tool to obtain static Internet Protocol (IP) information stored in the BMC. Connect to the BMC using the IPMI tool, and then use commands to obtain the static IP information stored in the BMC.
[0113] 3) Configure static Internet Protocol (IP) information in the operating system. Use the network configuration tools in the operating system to apply the static IP information stored in the BMC to the operating system, thereby enabling the automatic configuration of static IP information.
[0114] It is worth noting that this application provides a server control method that enables the automatic batch configuration of static Internet Protocol (IP) information (e.g., static IP addresses) for a large number of servers, improving management efficiency. This method utilizes IP address pools, server control scripts, and other methods to flexibly configure static IP addresses. The task management module allows for convenient task management, including creating, modifying, and deleting tasks. The execution module can automatically configure static IP addresses for servers without manual intervention.
[0115] This application provides a server control method that enables batch automatic configuration of static Internet Protocol (IP) information through the BMC WEB management system. It automatically identifies servers, and BMC WEB can automatically configure them based on their model and configuration information. It supports batch operations, allowing simultaneous configuration of static IP addresses for multiple servers, and offers the following advantages:
[0116] 1. Automation: The BMC WEB management system can automatically set static IP addresses in batches, greatly reducing the workload of manual setup.
[0117] 2. Precision: When setting static Internet Protocol information, parameters such as IP address, subnet mask, and gateway can be precisely controlled to ensure the stability and security of network communication.
[0118] 3. High efficiency: The BMC WEB management system allows for the simultaneous configuration of static Internet Protocol (IP) information on multiple servers, improving configuration efficiency.
[0119] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.
[0120] Figure 9 This is a structural block diagram of a server control device according to an embodiment of this application; as shown below. Figure 9 As shown, it includes:
[0121] The response module 902 is used to respond to the received target execution command, wherein the target execution command is used to instruct the server control script to configure static Internet Protocol information for the target server, and the static Internet Protocol information is used to construct a test environment for performing target tests on the target server;
[0122] The sending module 904 is used to send a target allocation instruction to the baseboard management controller to which the target server is connected, wherein the target allocation instruction is used to instruct the baseboard management controller to allocate static Internet Protocol information to the target server;
[0123] The receiving module 906 is used to receive target static Internet Protocol information returned by the baseboard management controller in response to the target allocation instruction;
[0124] The execution module 908 is configured to perform a configuration operation on the target server using the target static Internet Protocol information, wherein the configuration operation is configured to allow the target server to use the target static Internet Protocol information.
[0125] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.
[0126] Through the above embodiments, the server control script controls the server using the following method: First, the server control script responds to a received target execution command, which instructs the server control script to configure static Internet Protocol (IP) information for the target server. This static IP information is used to construct a test environment for performing target tests on the target server. Then, the script sends a target allocation command to the baseboard management controller connected to the target server, instructing the baseboard management controller to allocate static IP information to the target server, and receives the target static IP information returned by the baseboard management controller in response to the target allocation command. Finally, the target static IP information is used to perform a configuration operation on the target server, which configures the target server to allow the use of the target static IP information. The above server control process requires no human intervention and can be controlled entirely by the server control script, automatically configuring the target server to allow the use of the target static IP information. This technical solution solves the problem of low efficiency in configuring static IP information during server control in related technologies, achieving the technical effect of improving the efficiency of static IP information configuration during server control.
[0127] In one exemplary embodiment, the sending module includes:
[0128] A generation unit is used to generate the target allocation instruction;
[0129] The control unit is used to control the operating system of the target server to send the target allocation command to the baseboard management controller through the target connection established between the target server and the baseboard management controller by the connection tool.
[0130] In one exemplary embodiment, the control unit is further configured to:
[0131] The operating system is controlled to call the intelligent platform management interface deployed on the target server, wherein the target connection is a connection between the intelligent platform management interface and the baseboard management controller established through the intelligent platform management tool, and the connection tool includes the intelligent platform management tool;
[0132] The target allocation instruction is sent to the baseboard management controller through the intelligent platform management interface.
[0133] In one exemplary embodiment, the generating unit is further configured to:
[0134] Generate an initial allocation instruction to instruct the baseboard management controller to allocate static Internet Protocol information to the server as the target allocation instruction; or...
[0135] Generate an initial allocation instruction to instruct the baseboard management controller to allocate static Internet Protocol information to the server; add the target server identifier of the target server to the initial allocation instruction to obtain the target allocation instruction.
[0136] In one exemplary embodiment, the receiving module includes:
[0137] The first receiving unit is configured to receive a static Internet Protocol (IP) information table returned by the baseboard management controller in response to the target allocation instruction when the initial allocation instruction for instructing the baseboard management controller to allocate static Internet Protocol information to the server is generated as the target allocation instruction. The static IP information table records server identifiers and static IP information with corresponding relationships.
[0138] The first lookup unit is used to look up the static Internet Protocol information corresponding to the target server identifier of the target server from the static Internet Protocol information table as the target static Internet Protocol information.
[0139] In one exemplary embodiment, the execution module includes:
[0140] The calling unit is used to call the network settings tool deployed on the target server, wherein the network settings tool is used to display multiple configuration locations of the static Internet Protocol information of the target server;
[0141] The second search unit is used to search for the target static Internet Protocol (IP) identifier corresponding to the target configuration location from among the plurality of static IP identifiers included in the target static Internet Protocol (IP) information, wherein the plurality of configuration locations includes the target configuration location;
[0142] Add the target static Internet Protocol identifier to the target configuration location.
[0143] In one exemplary embodiment, the response module includes one of the following:
[0144] The second receiving unit is configured to receive a target configuration request sent by the baseboard management controller as the target operation instruction, wherein the target configuration request is used to request the configuration of static Internet Protocol information for the target server; and to run in response to the target configuration request.
[0145] The third receiving unit is configured to receive, via the operating system of the target server, a running task carrying the server control script sent by the baseboard management controller as the target running instruction; and respond to the running task by running it on the operating system.
[0146] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when run.
[0147] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0148] Embodiments of this application also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0149] In one exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0150] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.
[0151] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.
[0152] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the principles of this application should be included within the protection scope of this application.
Claims
1. A method for controlling a server, characterized in that, The method, applied to server control scripts, includes: The system responds to a received target execution command, wherein the target execution command instructs the server control script to configure static Internet Protocol (IP) information for the target server, and the static IP information is used to construct a test environment for performing target tests on the target server. Send a target allocation instruction to the baseboard management controller connected to the target server, wherein the target allocation instruction is used to instruct the baseboard management controller to allocate static Internet Protocol information to the target server; Receive the target static Internet Protocol information returned by the baseboard management controller in response to the target allocation instruction; A configuration operation is performed on the target server using the target static Internet Protocol information, wherein the configuration operation is used to configure the target server to allow the use of the target static Internet Protocol information; The step of receiving the target static Internet Protocol (IP) information returned by the baseboard management controller in response to the target allocation instruction includes: when generating an initial allocation instruction to instruct the baseboard management controller to allocate static IP information to a server as the target allocation instruction, receiving a static IP information table returned by the baseboard management controller in response to the target allocation instruction, wherein the static IP information table records server identifiers and static IP information with corresponding relationships; and searching the static IP information corresponding to the target server identifier of the target server in the static IP information table as the target static IP information. The baseboard management controller obtains corresponding server identifiers and static Internet Protocol (IP) information through the following steps: receiving server identifiers; storing server identifiers in a first storage space of the baseboard management controller; when the first storage space meets the target triggering conditions, generating a target number of static IP information for a target number of addresses in a second storage space within the baseboard management controller based on the target number of server identifiers stored in the first storage space, wherein the target number of addresses is greater than or equal to the target number of identifiers; pairing the server identifiers of the target number of identifiers with the static IP information of the target number of addresses to obtain corresponding static IP information and server identifiers.
2. The method according to claim 1, characterized in that, Sending the target allocation instruction to the baseboard management controller connected to the target server includes: Generate the target allocation instruction; The operating system controlling the target server sends the target allocation command to the baseboard management controller through the target connection established between the target server and the baseboard management controller via a connection tool.
3. The method according to claim 2, characterized in that, The operating system controlling the target server sends the target allocation command to the baseboard management controller through a target connection established between the target server and the baseboard management controller via a connection tool, including: The operating system is controlled to call the intelligent platform management interface deployed on the target server, wherein the target connection is a connection between the intelligent platform management interface and the baseboard management controller established through the intelligent platform management tool, and the connection tool includes the intelligent platform management tool; The target allocation instruction is sent to the baseboard management controller through the intelligent platform management interface.
4. The method according to claim 2, characterized in that, The generation of the target allocation instruction includes: Generate the initial allocation instruction used to instruct the baseboard management controller to allocate static Internet Protocol information to the server as the target allocation instruction; or... Generate an initial allocation instruction to instruct the baseboard management controller to allocate static Internet Protocol information to the server; add the target server identifier of the target server to the initial allocation instruction to obtain the target allocation instruction.
5. The method according to claim 1, characterized in that, The step of performing configuration operations on the target server using the target static Internet Protocol information includes: Invoke the network settings tool deployed on the target server, wherein the network settings tool is used to display multiple configuration locations of the static Internet Protocol information of the target server; The target static Internet Protocol identifier corresponding to the target configuration location is found from the plurality of static Internet Protocol identifiers included in the target static Internet Protocol information, wherein the plurality of configuration locations includes the target configuration location; Add the target static Internet Protocol identifier to the target configuration location.
6. The method according to claim 1, characterized in that, The target execution instruction received in the response includes one of the following: The system receives a target configuration request sent by the baseboard management controller as the target execution instruction, wherein the target configuration request is used to request the configuration of static Internet Protocol information for the target server; and executes in response to the target configuration request. The target server's operating system receives a running task carrying the server control script sent by the baseboard management controller as the target running instruction; and responds by running the running task on the operating system.
7. A server control device, characterized in that, include: A response module is used to respond to a received target execution command, wherein the target execution command is used to instruct the server control script to configure static Internet Protocol information for the target server, and the static Internet Protocol information is used to construct a test environment for performing target tests on the target server; The sending module is used to send a target allocation instruction to the baseboard management controller connected to the target server, wherein the target allocation instruction is used to instruct the baseboard management controller to allocate static Internet Protocol information to the target server; The receiving module is configured to receive target static Internet Protocol information returned by the baseboard management controller in response to the target allocation instruction; An execution module is configured to perform a configuration operation on the target server using the target static Internet Protocol information, wherein the configuration operation is configured to allow the target server to use the target static Internet Protocol information; The receiving module includes: a first receiving unit, configured to receive a static Internet Protocol (IP) information table returned by the baseboard management controller in response to the target allocation instruction when an initial allocation instruction is generated to instruct the baseboard management controller to allocate static IP information to a server as the target allocation instruction, wherein the static IP information table records server identifiers and static IP information with corresponding relationships; and a first searching unit, configured to search the static IP information table for the static IP information corresponding to the target server identifier of the target server as the target static IP information. The baseboard management controller obtains corresponding server identifiers and static Internet Protocol (IP) information through the following steps: receiving server identifiers; storing server identifiers in a first storage space of the baseboard management controller; when the first storage space meets the target triggering conditions, generating a target number of static IP information for a target number of addresses in a second storage space within the baseboard management controller based on the target number of server identifiers stored in the first storage space, wherein the target number of addresses is greater than or equal to the target number of identifiers; pairing the server identifiers of the target number of identifiers with the static IP information of the target number of addresses to obtain corresponding static IP information and server identifiers.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed, performs the method of any one of claims 1 to 6.
9. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method of any one of claims 1 to 6 through the computer program.
Citation Information
Patent Citations
Static IP configuration method, device and equipment and readable storage medium
CN108810192A
Network service establishment method and device, electronic equipment and storage medium
CN115913999A