Method for restarting server
By detecting and storing automatic restart instructions in the server using independent storage areas that are not affected by firmware refresh, the problem of manual restart after the firmware refresh of the substrate management controller is solved, and the automatic restart of the server is realized, which improves stability and security and has extensive compatibility.
Patent Information
- Application Number
- CN202510596417.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-09
- Publication Date
- 2025-08-19
AI Technical Summary
In the prior art, the board management controller firmware needs to be manually restarted after refreshing, which increases the workload, and the configuration update may not take effect due to unexpected power failure, affecting the stability and security of the server, and at the same time, relying on a specific operating system or hardware platform leads to poor compatibility.
Detect independent storage areas associated with the server that are not affected by firmware refresh, store automatic restart instructions, and control server restart when conditions are met, avoid relying on specific operating systems or hardware platforms, and ensure information persistence and reliability.
It realizes automatic restart of the server after refreshing the substrate management controller, reduces workload, improves the stability and security of the server, and has broad compatibility and application prospects.
Smart Images

Figure CN120508324A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of server hardware management, and in particular to a method for restarting a server. Background Art
[0002] In related technologies, server restart can be divided into two actions: shutdown and startup. These two actions are performed by the baseboard management controller. For servers whose baseboard management controller cannot perform the startup action, the administrator manually restarts the server to apply the new configuration; or when the server is in the shutdown state, after receiving the baseboard management controller refresh command, the basic input and output system files can be updated online, and a power-off command can be sent to the complex programmable logic device to control the power-off.
[0003] However, in related technologies, after the baseboard management controller firmware is updated, a manual reboot is generally required. This not only increases workload but can also cause configuration updates to fail to take effect due to unexpected power outages and reboots, impacting server stability and security. Furthermore, some automatic reboot solutions may rely on specific operating systems or hardware platforms, creating compatibility issues and requiring urgent improvement. Summary of the Invention
[0004] This application provides a server restart method that at least addresses the related art issue of requiring a manual restart after the baseboard management controller firmware is updated, which increases workload and can lead to configuration updates not taking effect due to unexpected power outages and restarts, impacting server stability and security. Furthermore, the dependence on a specific operating system or hardware platform can lead to poor compatibility.
[0005] The present application provides a server restart method, comprising the following steps: detecting at least one independent storage area associated with the server that is not affected by firmware refresh; when at least one firmware in the server completes firmware refresh, storing an automatic restart instruction of the server in the at least one independent storage area, and determining whether the server meets a preset restart condition; if the server meets the preset restart condition, loading the automatic restart instruction from the at least one independent storage area, and controlling the server to restart in response to the automatic restart instruction.
[0006] Optionally, in one embodiment of the present application, before storing the automatic restart instruction of the server in the at least one independent storage area, it also includes: obtaining firmware information of the at least one firmware; determining the firmware status of the at least one firmware based on the firmware information; when the firmware status of the at least one firmware changes, allowing the automatic restart instruction to be stored in the at least one independent storage area.
[0007] Optionally, in one embodiment of the present application, storing the automatic restart instruction of the server in the at least one independent storage area includes: obtaining actual application information of the server; using the actual application information to determine the actual number of the at least one independent storage area; and based on the actual number, storing the automatic restart instruction of the server in at least one independent storage area corresponding to the actual number.
[0008] Optionally, in one embodiment of the present application, before loading the automatic restart instruction from the at least one independent storage area, it also includes: determining whether the actual number is greater than a preset threshold; if the actual number is greater than the preset threshold, dividing the at least one independent storage area into a main storage area and a backup storage area; if the actual number is less than or equal to the preset threshold, dividing the at least one independent storage area into the main storage area.
[0009] Optionally, in one embodiment of the present application, the loading of the automatic restart instruction from the at least one independent storage area and the controlling of the server restart in response to the automatic restart instruction include: when there is a backup storage area in the at least one independent storage area, determining whether the main storage area has completed the loading of the automatic restart instruction; if the main storage area has not completed the loading of the automatic restart instruction, loading the automatic restart instruction from the backup storage area and controlling the server restart in response to the automatic restart instruction; if the main storage area has completed the loading of the automatic restart instruction, controlling the server restart in response to the automatic restart instruction.
[0010] Optionally, in one embodiment of the present application, loading the automatic restart instruction from the at least one independent storage area and controlling the server to restart in response to the automatic restart instruction includes: determining whether the at least one independent storage area has completed the loading of the automatic restart instruction; if the at least one independent storage area has not completed the loading of the automatic restart instruction, performing alarm maintenance until the at least one independent storage area completes the loading of the automatic restart instruction, and controlling the server to restart in response to the automatic restart instruction; if the at least one independent storage area completes the loading of the automatic restart instruction, controlling the server to restart in response to the automatic restart instruction.
[0011] Optionally, in one embodiment of the present application, before the at least one independent storage area completes the loading of the automatic restart instruction, it also includes: judging whether the automatic restart time of the server is greater than the preset time, and / or whether the number of refreshes of the firmware in the server is greater than the preset number; if the automatic restart time is greater than the preset time, it is determined that the at least one independent storage area has not completed the loading of the automatic restart instruction; if the number of refreshes is greater than the preset number, it is determined that the at least one independent storage area has not completed the loading of the automatic restart instruction; if the automatic restart time is less than or equal to the preset time, and the number of refreshes is less than or equal to the preset number, it is determined that the at least one independent storage area has completed the loading of the automatic restart instruction.
[0012] Optionally, in one embodiment of the present application, it also includes: determining whether the restart is completed; if the restart is completed, clearing the automatic restart instruction in the at least one independent storage area; if the restart is not completed, continuing to control the server restart until the restart is completed.
[0013] The present application also provides a server restart device, comprising: a detection module, used to detect at least one independent storage area associated with the server that is not affected by firmware refresh; a first judgment module, used to store the automatic restart instruction of the server in the at least one independent storage area after at least one firmware in the server completes firmware refresh, and judge whether the server meets the preset restart condition; a restart module, used to load the automatic restart instruction from the at least one independent storage area when the at least one firmware completes firmware refresh and the server meets the preset restart condition, and control the server to restart in response to the automatic restart instruction.
[0014] Optionally, in one embodiment of the present application, it also includes: an acquisition module for acquiring firmware information of the at least one firmware before storing the automatic restart instruction of the server in the at least one independent storage area; a determination module for determining the firmware status of the at least one firmware based on the firmware information; and a storage module for allowing the automatic restart instruction to be stored in the at least one independent storage area when the firmware status of the at least one firmware changes.
[0015] Optionally, in one embodiment of the present application, the first judgment module includes: an acquisition unit for acquiring actual application information of the server; a determination unit for determining the actual number of the at least one independent storage area using the actual application information; and a storage unit for storing the automatic restart instruction of the server in at least one independent storage area corresponding to the actual number based on the actual number.
[0016] Optionally, in one embodiment of the present application, it further includes: a second judgment module, used to judge whether the actual number is greater than a preset threshold before loading the automatic restart instruction from the at least one independent storage area; a first division module, used to divide the at least one independent storage area into a main storage area and a backup storage area when there is a backup storage area in the at least one independent storage area; a second division module, used to divide the at least one independent storage area into the main storage area when the actual number is less than or equal to the preset threshold.
[0017] Optionally, in one embodiment of the present application, the restart module includes: a first judgment unit, used to judge whether the main storage area has completed the loading of the automatic restart instruction when there is a backup storage area in the at least one independent storage area; a first response unit, used to load the automatic restart instruction from the backup storage area when the main storage area has not completed the loading of the automatic restart instruction, and control the server to restart in response to the automatic restart instruction; a second response unit, used to control the server to restart in response to the automatic restart instruction when the main storage area completes the loading of the automatic restart instruction.
[0018] Optionally, in one embodiment of the present application, the restart module includes: a second judgment unit, used to judge whether the at least one independent storage area has completed the loading of the automatic restart instruction; a first restart unit, used to perform alarm maintenance when the at least one independent storage area has not completed the loading of the automatic restart instruction, until the at least one independent storage area completes the loading of the automatic restart instruction, and controls the server to restart in response to the automatic restart instruction; a second restart unit, used to control the server to restart in response to the automatic restart instruction when the at least one independent storage area completes the loading of the automatic restart instruction.
[0019] Optionally, in one embodiment of the present application, it also includes: a third judgment module, used to judge whether the automatic restart time of the server is greater than the preset time, and / or whether the number of refreshes of the firmware in the server is greater than the preset number before the at least one independent storage area completes the loading of the automatic restart instruction; a first judgment module, used to judge that the at least one independent storage area has not completed the loading of the automatic restart instruction when the automatic restart time is greater than the preset time; a second judgment module, used to judge that the at least one independent storage area has not completed the loading of the automatic restart instruction when the number of refreshes is greater than the preset number; a third judgment module, used to judge that the at least one independent storage area has completed the loading of the automatic restart instruction when the automatic restart time is less than or equal to the preset time, and the number of refreshes is less than or equal to the preset number.
[0020] Optionally, in one embodiment of the present application, it also includes: a fourth judgment module, used to determine whether the restart is completed; a clearing module, used to clear the automatic restart instruction in the at least one independent storage area when the restart is completed; and a control module, used to continue to control the server restart when the restart is not completed until the restart is completed.
[0021] The present application also provides a server, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned server restart methods when executing the computer program.
[0022] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned server restart methods are implemented.
[0023] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned server restart methods when executed by a processor.
[0024] Through the present application, at least one independent storage area associated with the server that is not affected by the firmware refresh can be detected first, and then when the firmware refresh is completed, the automatic restart instruction is stored in at least one independent storage area, and it is determined whether the server meets certain restart conditions. When the certain restart conditions are met, the automatic restart instruction is loaded from at least one independent storage area, and the server restart is controlled in response to the automatic restart instruction. Therefore, it can solve the problem of manual restart after the baseboard management controller firmware is refreshed, which increases the workload, and may also cause the configuration update to fail to take effect due to an unexpected power outage and restart, affecting the stability and security of the server. In addition, due to the dependence on a specific operating system or hardware platform, the technical problem of poor compatibility is achieved, which is not dependent on a specific operating system or hardware platform and has wide compatibility. The automatic restart instruction is loaded into an independent storage area that is not affected by the firmware refresh, ensuring the persistence and reliability of the information, realizing the automatic restart of the server after the baseboard management controller is refreshed, reducing the workload, and having broad application prospects and value in the field of server hardware management and firmware development, and can significantly improve the technical effect of the stability and security of the server. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0026] Figure 1 A block diagram illustrating a server restart when a board type is identified using a virtual ID (Identifier) method according to an embodiment of the present application;
[0027] Figure 2 A flowchart of a server restart method provided in an embodiment of the present application;
[0028] Figure 3 This is a flowchart of the working principle of the server restart method provided according to one embodiment of the present application;
[0029] Figure 4 This is a block diagram of a server restart device provided according to an embodiment of the present application.
[0030] Reference numerals:
[0031] Among them, 101-central processing unit, 102-power button, 103-mainboard complex programmable logic device, 104-field replaceable unit; 10-server restart device; 100-detection module, 200-first judgment module, 300-restart module. DETAILED DESCRIPTION
[0032] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0033] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0034] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0035] In conjunction with the specific application environment architecture or specific hardware architecture on which the execution of the server restart method depends, the specific application environment architecture or specific hardware architecture is described here.
[0036] Combine Figure 1 As shown, when the embodiment of the present application can identify the board type by the virtual ID method, it can be identified according to the current dual-channel existing hardware structure, wherein the hardware structure includes a central processing unit (CPU) 101, a power button (PWR BTN) 102, a main board complex programmable logic device (MB CPLD) 103 and a field replaceable unit (FRU) 104.
[0037] Among them, the embodiment of the present application, by combing through the current dual-channel existing hardware structure, finds that the field replaceable unit 104 hanging under the mainboard complex programmable logic device 103 can use the baseboard management controller to write "whether to start up" into the field replaceable unit 104, and then the mainboard complex programmable logic device 103 reads the field replaceable unit 104 and actively starts up. Specifically, the embodiment of the present application can trigger the status recording process when the system starts up, and detect the refresh status through the baseboard management controller interface, such as sending an IPMI command to obtain the firmware version and refresh status flag, and detecting whether there is a pending configuration that needs to be restarted through the baseboard management controller interface or IPMI command, and then converting these two states into the format required for storage of the field replaceable unit 104, and writing them to the specified location of the field replaceable unit 104. By reading the written data, verification is performed to confirm that the write is successful, and error judgment and processing are performed.
[0038] An embodiment of the present application provides a server restart method, and the method is described in detail in conjunction with the execution process of the server restart method.
[0039] Specifically, Figure 2 The present invention provides a flowchart of a server restart method according to an embodiment of the present application.
[0040] like Figure 2 As shown, the server restart method includes the following steps:
[0041] In step S201 , at least one independent storage area associated with a server that is not affected by firmware updating is detected.
[0042] It is understandable that the platform firmware elastic machine of the embodiment of the present application may not be able to restart automatically after the firmware refresh is completed, wherein the firmware refresh may include but is not limited to baseboard management controller / protection mode / basic input and output system refresh, etc., and this application does not make specific restrictions.
[0043] In the embodiment of the present application, the restart can be split into two actions: shutdown and startup. These two actions are performed by the baseboard management controller. After the firmware refresh is completed and the restart is performed, the protection mode will actively pull the reset signal of the baseboard management controller / CPU according to the platform firmware elastic process, verify the firmware data of the baseboard management controller / BIOS, and release the reset signal of the baseboard management controller / CPU after the verification is completed. Because the protection mode actively pulls the reset signal of the baseboard management controller, the baseboard management controller is reset and cannot execute the startup action during the restart, which in turn causes the computer to fail to boot.
[0044] Therefore, in order to solve the problem that the automatic restart of the server is not affected by the firmware refresh, the embodiment of the present application can first detect whether there is at least one independent storage area on the server that is not affected by the firmware refresh, and then store the automatic restart instruction of the server in at least one independent storage area to eliminate the problem that the server cannot automatically restart after the firmware refresh is completed.
[0045] In addition, it should be noted that in the embodiments of the present application, the independent storage area may include but is not limited to unoccupied electrically erasable programmable read-only memory, flash memory partition, non-volatile random access memory, field replaceable unit or external storage chip, etc., and this application does not impose specific restrictions.
[0046] The independent storage area of the embodiment of the present application is not affected by erasure or overwriting of the firmware refresh, ensuring that key status information will not be lost during power outage or refresh. Even if the firmware upgrade fails or is interrupted (such as power outage, verification error, etc., which are not specifically limited in this application), the boot state can still be accurately restored to avoid the system falling into uncertain behavior due to state loss. It is also very practical for some automatic restart solutions that may rely on specific operating systems or hardware platforms. It is particularly suitable for embedded systems and server devices that require high reliability, automated operation and maintenance, or remote management, and can significantly improve the robustness and user experience of the system firmware update process.
[0047] For example, combined Figure 1 As shown, when the embodiment of the present application identifies the board type through the virtual ID method, based on the current dual-channel existing hardware structure, it is found that the field replaceable unit hanging under the complex programmable logic device of the mainboard can be used.
[0048] Optionally, in one embodiment of the present application, before storing the automatic restart instruction of the server in at least one independent storage area, it also includes: obtaining firmware information of at least one firmware; determining the firmware status of at least one firmware based on the firmware information; when the firmware status of at least one firmware changes, allowing the automatic restart instruction to be stored in at least one independent storage area.
[0049] It can be understood that the embodiment of the present application can also obtain firmware information of at least one firmware before storing the automatic restart instruction storage instruction of the server in at least one independent storage area, wherein the firmware may include but is not limited to a basic input and output system, a unified extensible firmware interface, a baseboard management controller, an independent disk redundant array controller firmware, a network card firmware, etc., and the present application does not impose specific restrictions. The firmware information may include but is not limited to a firmware version, a checksum, a release date, etc., and the present application does not impose specific restrictions.
[0050] Furthermore, in the embodiment of the present application, the firmware status can be understood as whether it is the normal state of the latest version, and the state in which the firmware is used normally and updated from the original version to the latest version is determined as a change in the firmware status of the firmware.
[0051] As a possible implementation method, the embodiment of the present application can obtain the firmware information of all firmware in the server, and then determine the firmware status of the firmware based on the firmware information, and when the firmware status changes, allow the automatic restart instruction to be stored in at least one independent storage area.
[0052] For example, combined Figure 1 As shown, the embodiment of the present application can ensure that the server communicates with the baseboard management controller by checking the connection status of the baseboard management controller, and regularly detect the status of the baseboard management controller firmware by creating a timed task. For example, the baseboard management controller firmware version or refresh status flag can be obtained by executing an IPMI (Intelligent Platform Management Interface) command, and this application does not impose specific restrictions. Then, the current firmware version is compared with the expected updated firmware version to see if they are consistent. If they are consistent, it is marked as refresh completed; if they are inconsistent, it is marked as refresh incomplete. In addition, the embodiment of the present application can also detect whether there is a pending configuration that needs to be restarted through the baseboard management controller interface or IPMI command, and then when the firmware status changes, it allows the automatic restart instruction to be stored in an independent storage area.
[0053] In the embodiment of the present application, in the server startup process, an appropriate stage (such as when the baseboard management controller is initialized or before the operating system is started) is selected to trigger status detection.
[0054] The embodiments of the present application can trigger the automatic restart instruction storage action by real-time monitoring of firmware status changes, thereby improving the system reliability and thermal recovery capabilities, and keeping the restart instruction persistent when the system crashes.
[0055] In step S202, after at least one firmware in the server completes the firmware refresh, the automatic restart instruction of the server is stored in at least one independent storage area, and it is determined whether the server meets the preset restart condition.
[0056] It can be understood that in order to solve the problem that the server cannot automatically restart after the firmware is refreshed, the embodiment of the present application can store the automatic restart instruction of the server in at least one independent storage area after the firmware is refreshed, and then when the server is started next time, it is determined whether the server will automatically restart based on the automatic restart instruction stored in the independent storage area.
[0057] In some embodiments, after completing the firmware update, embodiments of the present application can store the server's automatic restart instruction in at least one independent storage area and determine whether the server meets certain restart conditions. The certain restart conditions can be set by those skilled in the art based on actual circumstances and are not specifically limited by this application.
[0058] For example, in an embodiment of the present application, after the baseboard management controller is refreshed, the server's automatic restart instructions (such as whether the baseboard management controller refresh is complete, whether a restart is required to apply the new configuration, etc., which are not specifically limited in this application) can be stored in the field replaceable unit. When the server is started next time, the automatic restart instructions in the field replaceable unit will be read first. If it is detected that the server meets certain restart conditions (such as the baseboard management controller refresh is complete and a restart is required to apply the new configuration, which are not specifically limited in this application), the server restart operation will be automatically executed.
[0059] Further, combined with Figure 1 As shown, in an embodiment of the present application, during or after a baseboard management controller refresh, the baseboard management controller refresh status and whether there is a pending configuration that requires a restart can be converted into a format required for field replaceable unit storage, and the status can be written to a specified location of the field replaceable unit using IPMI or other tools. When the server starts, the automatic restart instruction in the field replaceable unit is first read. If it is detected that the server meets certain restart conditions (such as the above-mentioned "baseboard management controller has been refreshed and requires a restart"), the server restart operation is automatically executed. The field replaceable unit information is usually stored in the server's electrically erasable programmable read-only memory and is read and written using tools such as IPMI.
[0060] It should be noted that the embodiment of the present application writes the automatic restart instruction of the server into the field replaceable unit of the motherboard, and the write location can be determined. For example, the available storage location and size in the field replaceable unit of the motherboard can be confirmed with the hardware team, and then the write location can be customized. It should be noted that the write-prohibited area, such as 0x00-0x3F reserved by the manufacturer, is excluded. The specific setting can be made by technicians in this field according to the actual situation, and this application does not impose specific restrictions. For example, a schematic table of IPMI write commands is shown in Table 1, wherein Table 1 is a schematic table of PMI write commands provided according to an embodiment of the present application.
[0061] Table 1
[0062] Starting address length use Access Rights 0x60 16B Update status area Baseboard Management Controller Exclusive 0x70 16B Status backup area Baseboard Management Controller Exclusive
[0063] Furthermore, the embodiment of the present application can use IPMI instructions to confirm whether the written value is correct and detect whether the current firmware version of the baseboard management controller is consistent with the expected updated firmware version.
[0064] In this embodiment of the present application, if the current BMC version is consistent with the expected version, the status area is updated and written with 01, indicating that the server needs to be restarted. At the same time, the backup area status is updated. After the shutdown and restart, the complex programmable logic device will restart according to the status value 01 at 0x60 of the field replaceable unit, rather than judging whether to execute the server power-on operation based on the reset signal of the BMC. If 0x60 is empty, the status backup area reads the response data to update the status.
[0065] Optionally, in one embodiment of the present application, the automatic restart instruction of the server is stored in at least one independent storage area, including: obtaining actual application information of the server; determining the actual number of at least one independent storage area using the actual application information; and based on the actual number, storing the automatic restart instruction of the server in at least one independent storage area corresponding to the actual number.
[0066] It can be understood that in the embodiments of the present application, the actual application information may include but is not limited to the automatic restart requirements of the server, firmware refresh information, the automatic restart success rate of the server after the firmware refresh, etc., and this application does not impose specific restrictions.
[0067] In some embodiments, the embodiments of the present application can determine the actual number of independent storage areas based on the actual application information of the server, and then store the automatic restart instruction of the server in at least one independent storage area corresponding to the actual number.
[0068] For example, in an embodiment of the present application, the automatic restart success rate of the server after the firmware is refreshed is low, such as 70%. The actual number of independent storage areas can be set to 2, and the automatic restart instructions of the server can be stored in independent storage area 1 and independent storage area 2 respectively.
[0069] The embodiment of the present application can dynamically adjust the actual number of independent storage areas by analyzing the application information of the server, thereby realizing dynamic resource optimization.
[0070] Optionally, in one embodiment of the present application, before loading the automatic restart instruction from at least one independent storage area, it also includes: determining whether the actual number is greater than a preset threshold; if the actual number is greater than the preset threshold, dividing at least one independent storage area into a main storage area and a backup storage area; if the actual number is less than or equal to the preset threshold, dividing at least one independent storage area into a main storage area.
[0071] In some embodiments, the embodiments of the present application can divide the independent storage area into a primary storage area and a backup storage area when the actual number is greater than a certain threshold. The certain threshold can be set by those skilled in the art based on actual conditions and is not specifically limited by this application.
[0072] In some embodiments, the embodiments of the present application may divide the independent storage area into the main storage area when the actual number is less than or equal to a certain threshold.
[0073] Illustratively, when processing a read or write failure of a field replaceable unit and the actual number of the field replaceable units is greater than 1, the embodiment of the present application may divide the independent storage area into a primary field replaceable unit area and a backup field replaceable unit area.
[0074] In the embodiment of the present application, when the actual number is greater than a certain threshold, the independent storage area is automatically split into the main storage area and the backup storage area. When the actual number is less than or equal to a certain threshold, it is merged into the main storage area, dynamically adapting the load to avoid resource waste and improve resource utilization efficiency. The main and backup area collaborative mechanism realizes fault isolation and rapid recovery.
[0075] Optionally, in one embodiment of the present application, before at least one independent storage area completes the loading of the automatic restart instruction, it also includes: judging whether the automatic restart time of the server is greater than a preset time, and / or whether the number of refreshes of the firmware in the server is greater than a preset number; if the automatic restart time is greater than the preset time, it is determined that at least one independent storage area has not completed the loading of the automatic restart instruction; if the number of refreshes is greater than the preset number, it is determined that at least one independent storage area has not completed the loading of the automatic restart instruction; if the automatic restart time is less than or equal to the preset time, and the number of refreshes is less than or equal to the preset number, it is determined that at least one independent storage area has completed the loading of the automatic restart instruction.
[0076] It can be understood that, before at least one independent storage area completes the loading of the automatic restart instruction, the embodiment of the present application can determine whether the automatic restart time of the server is greater than a certain time, and / or whether the number of refreshes of the firmware in the server is greater than a certain number, wherein the certain time and the certain number of times can be set by technicians in this field according to actual conditions, and this application does not impose specific restrictions.
[0077] In some embodiments, when the automatic restart time is greater than a certain time, the embodiments of the present application determine that the independent storage area has not completed the loading of the automatic restart instruction.
[0078] In some embodiments, when the number of refreshes is greater than a certain number, the embodiments of the present application determine that the independent storage area has not completed the loading of the automatic restart instruction.
[0079] In some embodiments, the embodiments of the present application determine that the independent storage area completes loading of the automatic restart instruction when the automatic restart time is less than or equal to a certain time and the number of refresh times is less than or equal to a certain number.
[0080] Exemplarily, in an embodiment of the present application, when the automatic restart time is greater than 30 minutes or the baseboard management controller is refreshed more than 3 times, it is determined that the independent storage area has not completed the loading of the automatic restart instruction; when the automatic restart time of the server is completed within 20 minutes and the baseboard management controller is refreshed 1 time, it is determined that the independent storage area has completed the loading of the automatic restart instruction.
[0081] The embodiments of the present application can ensure the integrity of restart instructions through multiple dimensions, avoid instruction failures caused by timeouts, identify hardware failures in instruction storage, and significantly reduce operation and maintenance complexity and resource costs while improving system robustness.
[0082] In step S203, if the server meets the preset restart condition, an automatic restart instruction is loaded from at least one independent storage area, and the server is controlled to restart in response to the automatic restart instruction.
[0083] In some embodiments, the embodiments of the present application can load an automatic restart instruction from at least one independent storage area when the server meets certain restart conditions, and respond to the automatic restart instruction to control the server to restart.
[0084] For example, when the server of the embodiment of the present application starts, the automatic restart instruction in the field replaceable unit is first read. If it is detected that the server meets certain restart conditions (such as "the baseboard management controller has been refreshed and needs to be restarted"), the server restart operation is automatically executed.
[0085] Optionally, in one embodiment of the present application, an automatic restart instruction is loaded from at least one independent storage area, and the server is controlled to restart in response to the automatic restart instruction, including: when there is a backup storage area in at least one independent storage area, determining whether the main storage area has completed the loading of the automatic restart instruction; if the main storage area has not completed the loading of the automatic restart instruction, loading the automatic restart instruction from the backup storage area, and controlling the server to restart in response to the automatic restart instruction; if the main storage area has completed the loading of the automatic restart instruction, controlling the server to restart in response to the automatic restart instruction.
[0086] It can be understood that in the embodiment of the present application, when there is a backup storage area in at least one independent storage area, each write updates the main storage area and the backup storage area at the same time, and the main storage area is given priority during reading. If it fails, the backup storage area is switched. If writing to both the main storage area and the backup storage area fails at the same time, retries are made and logs are recorded, and the next upgrade is automatically entered.
[0087] As a possible implementation method, when there is a backup storage area in at least one independent storage area, an embodiment of the present application can first determine whether the main storage area has completed the loading of the automatic restart instruction, and when the main storage area fails to load the automatic restart instruction, load the automatic restart instruction from the backup storage area, and respond to the automatic restart instruction to control the server to restart; when the main storage area successfully loads the automatic restart instruction, respond to the automatic restart instruction to control the server to restart.
[0088] For example, the independent storage area in the embodiment of the present application is divided into a main field replaceable unit area and a backup field replaceable unit area. Each write simultaneously updates the main field replaceable unit area and the backup field replaceable unit area. When reading, the main field replaceable unit area is given priority. If it fails, the backup field replaceable unit area is switched. If writing fails in both the main field replaceable unit area and the backup field replaceable unit area, the program retries and records the log, and automatically enters the next upgrade.
[0089] The embodiments of the present application can improve system availability by seamlessly switching backup area instructions when the primary area fails, support dynamic interchange of primary and backup area roles, and avoid long-term degradation due to single area failure.
[0090] Optionally, in one embodiment of the present application, an automatic restart instruction is loaded from at least one independent storage area, and the server is controlled to restart in response to the automatic restart instruction, including: determining whether at least one independent storage area has completed the loading of the automatic restart instruction; if at least one independent storage area has not completed the loading of the automatic restart instruction, performing alarm maintenance until at least one independent storage area completes the loading of the automatic restart instruction, and controlling the server to restart in response to the automatic restart instruction; if at least one independent storage area completes the loading of the automatic restart instruction, controlling the server to restart in response to the automatic restart instruction.
[0091] In some embodiments, the embodiments of the present application can perform alarm maintenance when at least one independent storage area has not completed the loading of the automatic restart instruction until at least one independent storage area completes the loading of the automatic restart instruction, and control the server to restart in response to the automatic restart instruction.
[0092] In some embodiments, the embodiments of the present application can control the server to restart in response to the automatic restart instruction when at least one independent storage area completes loading of the automatic restart instruction.
[0093] For example, the embodiment of the present application can establish a version rollback protocol. If the write fails, it will retry and record the log, automatically enter the next restart, and if the restart fails more than three times, restore the configuration at the time of the last normal startup. If the rollback fails, the automatic startup is disabled, and an alarm is issued with the LED light, indicating that there may be a hardware failure and recommending repair. Among them, Table 2 is an LED light warning table provided according to an embodiment of the present application. The embodiment of the present application can achieve dynamic monitoring and accurate alarms through loading progress.
[0094] Table 2
[0095]
[0096]
[0097] Optionally, in one embodiment of the present application, it also includes: determining whether the restart is completed; if the restart is completed, clearing the automatic restart instruction in at least one independent storage area; if the restart is not completed, continuing to control the server restart until the restart is completed.
[0098] In some embodiments, the embodiments of the present application can clear the automatic restart instructions in the independent storage area when the restart is completed. When the restart is not completed, continue to control the server restart until the restart is completed, and then clear the automatic restart instructions in the independent storage area.
[0099] Illustratively, the embodiment of the present application may clear the automatic restart instruction in the field replaceable unit after restart to avoid an infinite restart loop.
[0100] In the embodiment of the present application, instructions are automatically cleared after a successful restart, achieving zero-risk management of instruction residues, and retries are performed when the restart fails to avoid resource contention.
[0101] The following combination Figure 3 As shown, the working principle of the server restart method proposed in the embodiment of the present application is introduced with an embodiment.
[0102] in, Figure 3 The present invention is a flowchart illustrating the working principle of a server restart method provided according to an embodiment of the present application.
[0103] Step S301: refresh the baseboard management controller.
[0104] Step S302: Determine whether the automatic restart instruction has been loaded into the storage area.
[0105] In this embodiment of the present application, after the automatic restart instruction is loaded, step S303 is executed, otherwise, step S306 is executed.
[0106] Step S303: Determine whether the server is restarted.
[0107] In this embodiment of the present application, when the server is restarted, step S304 is executed, otherwise, step S305 is executed.
[0108] Step S304: Restart.
[0109] Step S305: Wait for the next instruction.
[0110] Step S306: Entering the next BMC refresh.
[0111] Step S307: Determine whether the number of refresh times is greater than three times.
[0112] In this embodiment of the present application, when the number of refreshes is greater than three, step S308 is executed; otherwise, step S303 is executed.
[0113] Step S308: Produce LED alarm and perform maintenance.
[0114] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.
[0115] According to the server restart method proposed in the embodiment of the present application, at least one independent storage area associated with the server that is not affected by the firmware refresh can be detected first, and then when the firmware refresh is completed, the automatic restart instruction is stored in at least one independent storage area, and it is determined whether the server meets certain restart conditions. When the certain restart conditions are met, the automatic restart instruction is loaded from at least one independent storage area, and the server restart is controlled in response to the automatic restart instruction. Therefore, it can solve the problem that when the baseboard management controller firmware is refreshed, manual restart is required, which increases the workload, and the configuration update may not take effect due to an unexpected power failure and restart, affecting the stability and security of the server. In addition, due to the dependence on a specific operating system or hardware platform, the technical problem of poor compatibility is achieved, which is not dependent on a specific operating system or hardware platform and has wide compatibility. The automatic restart instruction is loaded into an independent storage area that is not affected by the firmware refresh, ensuring the persistence and reliability of the information, realizing the automatic restart of the server after the baseboard management controller is refreshed, reducing the workload, and having broad application prospects and value in the field of server hardware management and firmware development, and can significantly improve the technical effect of the stability and security of the server.
[0116] An embodiment of the present application also provides a server restart device.
[0117] Figure 4This is a block diagram of a server restart device provided according to an embodiment of the present application.
[0118] like Figure 4 As shown, the server restart device 10 includes: a detection module 100 , a first judgment module 200 and a restart module 300 .
[0119] The detection module 100 is used to detect at least one independent storage area associated with the server that is not affected by the firmware refresh.
[0120] The first judgment module 200 is configured to store the automatic restart instruction of the server in at least one independent storage area after at least one firmware in the server completes the firmware refresh, and to judge whether the server meets the preset restart condition.
[0121] The restart module 300 is configured to load an automatic restart instruction from at least one independent storage area when the server meets a preset restart condition, and control the server to restart in response to the automatic restart instruction.
[0122] Optionally, in one embodiment of the present application, it further includes: an acquisition module, a determination module and a storage module.
[0123] The acquisition module is configured to acquire firmware information of at least one firmware before storing the automatic restart instruction of the server in at least one independent storage area.
[0124] The determination module is configured to determine a firmware status of at least one firmware based on the firmware information.
[0125] The storage module is configured to allow the automatic restart instruction to be stored in at least one independent storage area when a firmware state of at least one firmware changes.
[0126] Optionally, in one embodiment of the present application, the first judgment module 200 includes: an acquisition unit, a determination unit, and a storage unit.
[0127] The acquiring unit is used to acquire actual application information of the server.
[0128] The determining unit is configured to determine the actual number of the at least one independent storage area by using the actual application information.
[0129] The storage unit is configured to store the automatic restart instruction of the server in at least one independent storage area corresponding to the actual number based on the actual number.
[0130] Optionally, in one embodiment of the present application, it further includes: a second judgment module, a first division module and a second division module.
[0131] The second judgment module is configured to judge whether the actual number is greater than a preset threshold before loading the automatic restart instruction from the at least one independent storage area.
[0132] The first division module is configured to divide the at least one independent storage area into a main storage area and a backup storage area when a backup storage area exists in the at least one independent storage area.
[0133] The second division module is configured to divide at least one independent storage area into a main storage area when the actual number is less than or equal to a preset threshold.
[0134] Optionally, in one embodiment of the present application, the restart module 300 includes: a first judgment unit, a first response unit, and a second response unit.
[0135] The first judgment unit is configured to judge whether the main storage area has completed loading of the automatic restart instruction when there is a backup storage area in at least one independent storage area.
[0136] The first responding unit is configured to load the automatic restart instruction from the backup storage area when the primary storage area has not completed loading the automatic restart instruction, and control the server to restart in response to the automatic restart instruction.
[0137] The second responding unit is configured to control the server to restart in response to the automatic restart instruction when the main storage area completes loading of the automatic restart instruction.
[0138] Optionally, in one embodiment of the present application, the restart module 300 includes: a second judgment unit, a first restart unit and a second restart unit.
[0139] The second judgment unit is configured to judge whether at least one independent storage area has completed loading of the automatic restart instruction.
[0140] The first restart unit is used to perform alarm maintenance when at least one independent storage area has not completed loading of the automatic restart instruction until at least one independent storage area completes loading of the automatic restart instruction, and control the server to restart in response to the automatic restart instruction.
[0141] The second restart unit is configured to control the server to restart in response to the automatic restart instruction when the at least one independent storage area completes loading of the automatic restart instruction.
[0142] Optionally, in one embodiment of the present application, it further includes: a third determination module, a first determination module, a second determination module and a third determination module.
[0143] Among them, the third judgment module is used to judge whether the automatic restart time of the server is greater than the preset time and / or whether the number of refresh times of the firmware in the server is greater than the preset number before at least one independent storage area completes loading of the automatic restart instruction.
[0144] The first determination module is configured to determine that loading of the automatic restart instruction has not been completed in at least one independent storage area when the automatic restart time is greater than a preset time.
[0145] The second determination module is configured to determine that at least one independent storage area has not completed loading of the automatic restart instruction when the refresh number is greater than a preset number.
[0146] The third determination module is configured to determine that at least one independent storage area has completed loading of the automatic restart instruction when the automatic restart time is less than or equal to the preset time and the refresh number is less than or equal to the preset number.
[0147] Optionally, in one embodiment of the present application, it further includes: a fourth judgment module, a clearing module and a control module.
[0148] The fourth judgment module is used to judge whether the restart is completed.
[0149] The clearing module is used to clear the automatic restart instruction in at least one independent storage area when the restart is completed.
[0150] The control module is used to continue controlling the server restart until the restart is completed when the restart is not completed.
[0151] For the description of the features in the embodiment corresponding to the server restart device, please refer to the relevant description of the embodiment corresponding to the server restart method, which will not be repeated here.
[0152] According to the server restart device proposed in the embodiment of the present application, it can first detect at least one independent storage area associated with the server that is not affected by the firmware refresh, and then when the firmware refresh is completed, the automatic restart instruction is stored in at least one independent storage area, and it is determined whether the server meets certain restart conditions. When the certain restart conditions are met, the automatic restart instruction is loaded from at least one independent storage area, and the server restart is controlled in response to the automatic restart instruction. Therefore, it can solve the problem that when the baseboard management controller firmware is refreshed, manual restart is required, which increases the workload, and the configuration update may not take effect due to an unexpected power failure and restart, affecting the stability and security of the server. In addition, due to the dependence on a specific operating system or hardware platform, the technical problem of poor compatibility is achieved, which is not dependent on a specific operating system or hardware platform and has wide compatibility. The automatic restart instruction is loaded into an independent storage area that is not affected by the firmware refresh, ensuring the persistence and reliability of the information, realizing the automatic restart of the server after the baseboard management controller is refreshed, reducing the workload, and having broad application prospects and value in the field of server hardware management and firmware development, and can significantly improve the technical effect of the stability and security of the server.
[0153] An embodiment of the present application further provides a server, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any of the above-mentioned server restart method embodiments.
[0154] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps of any of the above-mentioned server restart method embodiments when running.
[0155] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0156] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of any of the above-mentioned server restart method embodiments are implemented.
[0157] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the above-mentioned server restart method embodiments are implemented.
[0158] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0159] The above is a detailed introduction to a server restart method provided by this application. This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of this application, several improvements and modifications can be made to this application, and these improvements and modifications also fall within the scope of protection of the claims of this application.
Claims
1. A method for restarting a server, characterized in that: The following steps are involved: detecting at least one independent storage area associated with the server that is not affected by the firmware flash; When at least one firmware in the server completes firmware updating, storing the automatic restart instruction of the server in the at least one independent storage area, and determining whether the server meets a preset restart condition; If the server meets the preset restart condition, the automatic restart instruction is loaded from the at least one independent storage area, and the server is controlled to restart in response to the automatic restart instruction.
2. The method according to claim 1, characterized in that Before storing the automatic restart instruction of the server in the at least one independent storage area, the method further includes: Acquiring firmware information of the at least one firmware; determining a firmware status of the at least one firmware based on the firmware information; When the firmware state of the at least one firmware changes, the automatic restart instruction is allowed to be stored in the at least one independent storage area.
3. The method according to claim 1, characterized in that The storing the automatic restart instruction of the server in the at least one independent storage area includes: Acquiring actual application information of the server; determining an actual number of the at least one independent storage area using the actual application information; Based on the actual number, the automatic restart instruction of the server is stored in at least one independent storage area corresponding to the actual number.
4. The method according to claim 3, characterized in that Before loading the automatic restart instruction from the at least one independent storage area, the method further includes: Determining whether the actual number is greater than a preset threshold; If the actual number is greater than the preset threshold, dividing the at least one independent storage area into a primary storage area and a backup storage area; If the actual number is less than or equal to the preset threshold, the at least one independent storage area is divided into the main storage area.
5. The method according to claim 4, characterized in that The step of loading the automatic restart instruction from the at least one independent storage area and controlling the server to restart in response to the automatic restart instruction includes: When a backup storage area exists in the at least one independent storage area, determining whether the main storage area has completed loading of the automatic restart instruction; If the primary storage area has not completed loading the automatic restart instruction, loading the automatic restart instruction from the backup storage area, and controlling the server to restart in response to the automatic restart instruction; If the main storage area completes loading of the automatic restart instruction, the server is controlled to restart in response to the automatic restart instruction.
6. The method according to claim 1, characterized in that The step of loading the automatic restart instruction from the at least one independent storage area and controlling the server to restart in response to the automatic restart instruction includes: determining whether the at least one independent storage area has completed loading of the automatic restart instruction; If the at least one independent storage area has not completed loading the automatic restart instruction, performing an alarm maintenance until the at least one independent storage area completes loading the automatic restart instruction, and controlling the server to restart in response to the automatic restart instruction; If the at least one independent storage area completes loading of the automatic restart instruction, the server is controlled to restart in response to the automatic restart instruction.
7. The method according to claim 6, characterized in that Before the at least one independent storage area completes loading of the automatic restart instruction, the method further includes: Determining whether the automatic restart time of the server is greater than a preset time, and / or whether the number of refreshes of the firmware in the server is greater than a preset number; If the automatic restart time is greater than the preset time, determining that the at least one independent storage area has not completed loading the automatic restart instruction; If the refresh number is greater than the preset number, determining that the at least one independent storage area has not completed loading of the automatic restart instruction; If the automatic restart time is less than or equal to the preset time, and the refresh times are less than or equal to the preset times, it is determined that the at least one independent storage area completes loading of the automatic restart instruction.
8. The method according to claim 1, characterized in that Also includes: Determining whether the restart is completed; If the restart is completed, clearing the automatic restart instruction in the at least one independent storage area; If the restart is not completed, continue to control the server to restart until the restart is completed.
9. A server, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the server restart method according to any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the server restart method according to any one of claims 1 to 8.
Citation Information
Cited By
Server firmware recovery control method, storage medium and program product
CN120723321A
Method for controlling server firmware recovery, storage medium, and program product
CN120723321B