Operating system recovery method, server, storage medium and program product
By integrating the installation environment in the server BMC, automating detection and recovery of the operating system, the problem of inefficient operating system recovery in the existing technology is solved, and fast and convenient operating system recovery is achieved.
Patent Information
- Application Number
- CN202411086984.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-11-26
AI Technical Summary
In the prior art, the recovery of the server operating system requires professional and technical personnel to operate on the spot, which takes a long time and is inefficient, and lacks a simple, automated and efficient recovery solution.
By integrating the installation environment in the server's BMC, the processor restart will be automatically triggered when the operating system failure or crash is detected by using the BMC, and interact with the BMC through the BIOS to load the operating system's installation configuration files and boot files, and execute the operating system boot program , realize automatic recovery of the operating system.
It realizes simple, automated and efficient recovery of the operating system, reduces manual intervention, improves recovery efficiency, and supports diskless startup, saving costs and time.
Smart Images

Figure CN119025336A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of server operation and maintenance technology, and in particular to an operating system recovery method, server, storage medium and program product. Background Art
[0002] During the operation of the server, the server's operating system (OS) may fail or crash due to various reasons, causing the server to fail to work properly. Therefore, the operating system needs to be restored.
[0003] In the related art, restoring the operating system usually requires professional technicians to perform on-site operations, which is time-consuming, error-prone, and inefficient. Therefore, developing a simple, automated, and efficient operating system recovery solution is crucial to improving server reliability and operation and maintenance efficiency. Summary of the invention
[0004] The present application provides an operating system recovery method, a server, a storage medium and a program product to achieve a simple, automated and efficient operating system recovery effect.
[0005] In a first aspect, the present application provides an operating system recovery method, which is applied to a basic input output system (BIOS) in a server, wherein a baseboard management controller (BMC) of the server is integrated with an installation environment, and the operating system recovery method comprises:
[0006] The BIOS responds to the startup instruction, obtains the startup mode, and loads the installation configuration file corresponding to the operating system obtained from the BMC and the operating system boot file according to the startup mode. The startup instruction is that the BMC triggers the server processor to restart when it detects that the operating system needs to be restarted, where the processor restart includes starting the BIOS;
[0007] Based on the loaded installation configuration file and the operating system boot file, the BIOS executes the operating system boot program in the operating system boot file to restore the operating system of the server.
[0008] In a possible implementation, the BIOS obtains the installation configuration file and the operating system boot file corresponding to the operating system from the BMC, including: through a physical channel between the processor and the BMC, applying an Ethernet data transmission method, the BIOS obtains the installation configuration file and the operating system boot file corresponding to the operating system from the BMC; and / or, through a physical channel between the processor and the BMC, applying a data bidirectional communication copy method, the BIOS obtains the installation configuration file and the operating system boot file corresponding to the operating system from the BMC.
[0009] In a possible implementation, the above-mentioned loading of the installation configuration file corresponding to the operating system and the operating system boot file obtained from the BMC according to the startup mode includes:
[0010] If the boot mode is diskless boot mode, BIOS obtains the installation configuration file and operating system boot file corresponding to the operating system from BMC and writes them into the memory;
[0011] If the boot mode is hard disk boot mode, the BIOS obtains the installation configuration file and operating system boot file corresponding to the operating system from the BMC and writes them to the hard disk.
[0012] In a possible implementation, the condition that the operating system needs to be restarted includes at least one of the following:
[0013] BMC detected an operating system failure;
[0014] The BMC detects an operating system crash;
[0015] BMC detected an operating system update.
[0016] In a possible implementation, the installation environment is integrated into the BMC in the following manner:
[0017] Upload the operating system image and the installation system program corresponding to the operating system through the out-of-band management interface of the BMC to configure the installation environment; or upload the operating system image and the installation system program locally through the physical interface of the BMC to configure the installation environment;
[0018] The operating system image includes the operating system boot file, and the installed system program includes the installed configuration file.
[0019] In a possible implementation, the BMC is further used to: before triggering the restart of the processor of the server, determine, based on user input, that the installation mode is a self-recovery mode, where the installation mode includes a manual installation mode and a self-recovery mode.
[0020] In a possible implementation manner, the BMC is further used to: implement indirect management and control of the above startup mode by modifying setting options in the BIOS.
[0021] In a second aspect, the present application provides an operating system recovery device, which is applied to a BIOS in a server, wherein a BMC of the server is integrated with an installation environment, and the operating system recovery device comprises:
[0022] A loading module is used to respond to a startup instruction, obtain a startup mode, and load an installation configuration file and an operating system boot file corresponding to the operating system obtained from the BMC according to the startup mode. The startup instruction is that the BMC triggers a processor restart of the server when it detects that the operating system needs to be restarted, wherein the processor restart includes starting the BIOS;
[0023] The recovery module is used to execute the operating system boot program in the operating system boot file based on the loaded installation configuration file and the operating system boot file to recover the operating system of the server.
[0024] In a third aspect, the present application provides a server, wherein a BMC of the server is integrated with an installation environment;
[0025] The BMC is used to respond to the detection that the operating system needs to be restarted, triggering the server's processor to restart, wherein the CPU processor includes the BIOS that starts the server;
[0026] BIOS is used to obtain the startup mode and load the installation configuration file and the operating system boot file corresponding to the operating system obtained from the BMC according to the startup mode; based on the loaded installation configuration file and the operating system boot file, the operating system boot program in the operating system boot file is executed to restore the server's operating system.
[0027] In one possible implementation, the BIOS is specifically used to: obtain an installation configuration file and an operating system boot file corresponding to the operating system from the BMC through a physical channel between the processor and the BMC using an Ethernet data transmission method; and / or obtain an installation configuration file and an operating system boot file corresponding to the operating system from the BMC using a two-way data communication copy method through a physical channel between the processor and the BMC.
[0028] In one possible implementation, the BIOS is also used to: when the boot mode is a diskless boot mode, the BMC obtains the installation configuration file and the operating system boot file corresponding to the operating system, and writes them into the memory; when the boot mode is a hard disk boot mode, the BMC obtains the installation configuration file and the operating system boot file corresponding to the operating system, and writes them into the hard disk.
[0029] In a possible implementation, the condition that the operating system needs to be restarted includes at least one of the following:
[0030] BMC detected an operating system failure;
[0031] BMC detected an operating system crash;
[0032] BMC detected an operating system update.
[0033] In a possible implementation, the installation environment is integrated into the BMC in the following manner:
[0034] Upload the operating system image and the installation system program corresponding to the operating system through the out-of-band management interface of the BMC to configure the installation environment; or upload the operating system image and the installation system program locally through the physical interface of the BMC to configure the installation environment;
[0035] The operating system image includes the operating system boot file, and the installed system program includes the installed configuration file.
[0036] In a possible implementation, the BMC is further used to: before triggering the restart of the processor of the server, determine, based on user input, that the installation mode is a self-recovery mode, where the installation mode includes a manual installation mode and a self-recovery mode.
[0037] In a possible implementation manner, the BMC is further used to: implement indirect management and control of the above startup mode by modifying setting options in the BIOS.
[0038] In a fourth aspect, the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed, they are used to implement the above first aspect and / or various possible implementations of the first aspect.
[0039] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed, implements the above first aspect and / or various possible implementations of the first aspect.
[0040] The operating system recovery method, server, storage medium and program product provided by the present application integrate an installation environment in the BMC of the server, detect through the BMC response that the server's operating system needs to be restarted, and automatically trigger the server's processor restart. This process does not require manual operation, saves time, and improves the efficiency of operating system recovery. Among them, the processor restart includes starting the BIOS. After the BIOS is started, the startup mode of the server's operating system is obtained, and the installation configuration file and the operating system boot file corresponding to the operating system obtained from the BMC are loaded according to the startup mode. The in-band boot to the BMC installation environment is automatically installed through the interaction between the BIOS and the BMC. After that, the BIOS executes the operating system boot program in the operating system boot file based on the loaded installation configuration file and operating system boot file to restore the server's operating system. The whole process does not require manual intervention, and can achieve the effect of simple, automatic and efficient operating system recovery. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0042] Figure 1 A schematic diagram of a scenario of an operating system recovery method provided in an embodiment of the present application;
[0043] Figure 2 A schematic diagram of a process flow of an operating system recovery method provided in an embodiment of the present application;
[0044] Figure 3 Another schematic diagram of the operating system recovery method provided in the embodiment of the present application;
[0045] Figure 4 A schematic diagram of the relationship between the startup mode, installation mode and effectiveness mode provided in the embodiment of the present application;
[0046] Figure 5 A schematic diagram of a structure of an operating system recovery method provided in an embodiment of the present application;
[0047] Figure 6 A schematic diagram of the structure of a server provided in an embodiment of the present application.
[0048] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application. The exemplary embodiments will be described in detail here, and examples thereof are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements.
[0050] First, the terms involved in this application are explained:
[0051] An operating system is system software that manages computer hardware and software resources, provides an operating environment for computer programs, and provides some basic services so that applications can run effectively;
[0052] BMC is a dedicated microcontroller embedded in the server motherboard, which is used to manage and monitor the status of server hardware. BMC usually runs independently of the main system processor and operating system, providing a management method independent of the main system. Even if the server's operating system crashes or the server is shut down, BMC can still work;
[0053] BIOS is a firmware that is embedded in the read-only memory (ROM) or flash memory chip on the computer motherboard. It runs first when the computer starts up, performs hardware initialization and is responsible for guiding the operating system so that it can interact with the hardware.
[0054] The processor is the core component of the computer, responsible for executing program instructions and processing data;
[0055] The Power Management Unit (PMU) is an important component in a computer or electronic device that manages and optimizes power usage. It regulates power distribution, ensures that each hardware component receives the appropriate amount of power, and reduces energy consumption by controlling the device to enter a low-power state.
[0056] The purpose of this application is to provide an operating system installation solution for a server based on a BMC integrated installation environment, simplifying the automatic installation operation of the server. The BMC can use this solution in combination with automatic detection of operating system failures, and can achieve operating system installation and fault self-recovery only through in-band booting and diskless startup, thereby reducing manual intervention and improving operating system recovery efficiency.
[0057] Among them, the installation environment integrated by BMC integrates a service program similar to the Preboot eXecution Environment (PXE). Through multiple interactions with BMC, BIOS provides the file information required for installation to BIOS.
[0058] Specifically, the operating system recovery solution provided by the present application has a built-in installation system in the BMC, which manages the operating system recovery process and provides users with clear step-by-step guidance and concise installation options; the BMC is used to detect the running status of the operating system, and the operating system restart is automatically executed when the restart conditions are met, thereby achieving the effect of simply, automatically and efficiently recovering the operating system.
[0059] For example, the conditions for the operating system to restart include at least one of the following: BMC detects operating system failure, BMC detects operating system crash, BMC detects operating system update, etc. This application mainly uses operating system failure or self-recovery after crash as an example for explanation.
[0060] Figure 1 A schematic diagram of a scenario of the operating system recovery method provided in an embodiment of the present application. Figure 1 As shown, the specific application scenarios of the present application include: BMC 11, storage device 12, CPU 13 and user 14.
[0061] in:
[0062] BMC 11 integrates the installation system and the corresponding configuration files; storage devices 12, such as non-volatile storage devices such as Secure Digital Card (SD) and embedded Multi-Media Card (eMMC), and Universal Flash Storage (UFS), are used to store the operating system image to be installed and the required configuration files; the startup of CPU 13 includes BIOS startup, and BIOS interacts with BMC during startup to perform operations such as operating system installation and diskless startup; users 14 can upload operating system images through the out-of-band management interface of BMC and manage tasks such as automatic installation and diskless startup.
[0063] Figure 1 In the description, a processor is taken as a central processing unit (CPU) as an example.
[0064] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0065] Figure 2 A flowchart of an operating system recovery method provided in an embodiment of the present application. An embodiment of the present application provides an operating system recovery method applied to a server, which is applied to the BIOS in the server, and the BMC of the server integrates the installation environment. Figure 2 As shown, the operating system recovery method includes:
[0066] S201. BIOS responds to a startup instruction and obtains a startup mode. The startup instruction is for the BMC to trigger a processor restart of the server when it detects that the operating system needs to be restarted, wherein the processor restart includes starting the BIOS.
[0067] Among them, the BMC detects whether the operating system needs to be restarted, and in response to detecting that the operating system needs to be restarted, triggers the server's processor to restart. Optionally, the BMC detects the server's operating system status, and the operating system status reflects the overall operating status and configuration of the operating system. By monitoring and analyzing the operating system status, it can be identified whether the operating system is abnormal or crashed. Afterwards, the BMC responds to detecting that the operating system needs to be restarted and automatically triggers the server's processor to restart, reducing manual intervention and improving recovery efficiency.
[0068] Optionally, during the detection process, BMC collects system information, such as CPU utilization, memory usage, disk space, etc., and generates a detailed system status log. BMC analyzes the collected system information and compares it with the preset operating system alarm threshold. When the operating system status meets or exceeds the set system alarm threshold, it triggers an alarm and restarts, and records related events in the system log to facilitate fault analysis and system maintenance.
[0069] Optionally, the BMC triggers a processor restart of the server, which may include: the BMC communicates with the BIOS to issue a restart instruction for the CPU; the BIOS communicates with the PMU through the system bus to control and manage the power supply of the CPU and the system, and executes the CPU restart.
[0070] During the CPU restart process, the CPU stops the current operation, clears its internal state, and restarts to execute instructions starting from a predefined address, which are usually stored in the BIOS to start the BIOS.
[0071] As the first object to be started, BIOS begins to check and initialize all hardware devices connected to the motherboard, such as memory, graphics card, hard disk, etc., to ensure that key hardware components are working properly.
[0072] Boot mode refers to the specific method or path used during the boot process to load and run the operating system. Common boot modes include diskless boot and hard disk boot. Boot mode includes boot order; boot order is the process of checking bootable devices in a predetermined order during the boot process to find and load the operating system. The boot order is managed by the BIOS and can be configured through the BIOS setup interface.
[0073] For example, when BIOS obtains the boot mode, BIOS first reads the boot settings stored in BIOS to obtain the boot mode and boot sequence of the operating system. According to the preset boot sequence, each bootable device is checked in turn until a bootable operating system is found.
[0074] S202: BIOS loads the installation configuration file and the operating system boot file corresponding to the operating system obtained from the BMC according to the startup mode.
[0075] In the embodiment of the present application, the BIOS obtains the installation configuration file and the operating system boot file corresponding to the operating system from the storage medium of the BMC, and automatically installs the system by in-band booting to the BMC installation environment through interaction between the BIOS and the BMC.
[0076] The installation configuration file is a file used to define and control the operating system installation process, and is used to instruct the installer on how to perform the operating system installation. The installation configuration file is often used to automate and customize the installation process to reduce manual intervention. The operating system boot file is a key file used to start the operating system. It usually contains the operating system boot program and related configuration information, and is responsible for loading the operating system kernel and initializing the operating system.
[0077] In one implementation, the BIOS communicates with the installation system in the BMC through a communication interface, and the BIOS sends a request to the installation system, requesting access to the storage space in the BMC to obtain the installation configuration file and the operating system boot file corresponding to the operating system. After receiving the request from the BIOS, the installation system reads the installation configuration file and the operating system boot file from the storage medium of the BMC. Afterwards, the installation system transmits the installation configuration file and the operating system boot file to the BIOS through the communication interface.
[0078] S203. The BIOS executes the operating system boot program in the operating system boot file based on the loaded installation configuration file and the operating system boot file to restore the operating system of the server.
[0079] Based on the loaded installation configuration file and operating system boot file, the BIOS executes the operating system boot program in the operating system boot file and transfers the control right to the operating system boot program.
[0080] The OS bootloader is a key software component used to load the OS kernel and transfer control to the OS during the server startup process. The OS bootloader is responsible for further loading the OS kernel. Once the OS kernel is loaded into memory, the OS bootloader transfers control to the OS. The OS begins its initialization process, including loading more drivers, starting system services, etc., and finally presents an operational graphical interface or command line interface to the user.
[0081] The operating system recovery method provided in the embodiment of the present application integrates the installation environment in the BMC of the server, detects through the BMC response that the operating system of the server needs to be restarted, and automatically triggers the restart of the processor of the server. This process does not require manual operation, saves time, and improves the efficiency of operating system recovery. Among them, the processor restart includes starting the BIOS. After the BIOS is started, the startup mode of the server's operating system is obtained, and the installation configuration file and the operating system boot file corresponding to the operating system obtained from the BMC are loaded according to the startup mode. The in-band boot to the BMC installation environment is automatically installed through the interaction between the BIOS and the BMC. Afterwards, the BIOS executes the operating system boot program in the operating system boot file based on the installation configuration file and the operating system boot file loaded in the memory to restore the server's operating system. The whole process does not require manual intervention, and can achieve the effect of simple, automatic and efficient recovery of the operating system.
[0082] On the basis of the above embodiment, optionally, the above BIOS obtains the installation configuration file and the operating system boot file corresponding to the operating system from the BMC, which may include: through the physical channel between the processor and the BMC, applying the Ethernet data transmission method, the BIOS obtains the installation configuration file and the operating system boot file corresponding to the operating system from the BMC; and / or, through the physical channel between the processor and the BMC, applying the data two-way communication copy method, the BIOS obtains the installation configuration file and the operating system boot file corresponding to the operating system from the BMC.
[0083] For example, Ethernet data transmission methods include but are not limited to Ethernet data transmission through Universal Serial Bus (USB), Peripheral Component Interconnect express (PCIe), Reduced Gigabit Media Independent Interface (RGMII) or port physical layer (Physical, PHY). Under this transmission mode, BMC does not need to provide a Dynamic Host Configuration Protocol (DHCP) server, and BMC and BIOS are constrained to a fixed Internet Protocol (IP). The BIOS core program can reuse the traditional PXE boot to obtain the installation configuration file and operating system file information from the BMC.
[0084] In addition, the data bidirectional communication copy may include bidirectional communication copy of data through a USB interface or a PCIe interface, etc. The BIOS loads the installation file copied from the BMC by implementing a new startup program and completes the installation action.
[0085] It should be noted that the above data transmission method is only an example, and there may be many other methods, which are not limited in this application.
[0086] The embodiments of the present application provide a variety of data transmission methods for data transmission between BIOS and BMC. Through the physical channel between the processor and BMC, different data transmission means in the network environment and the local environment are provided, so as to better combine the actual scene and improve the efficiency of operating system recovery. In addition, the data transmission means in the local environment does not rely on the external network environment, and can also realize the offline diskless boot of a single machine.
[0087] Furthermore, the above-mentioned loading of the installation configuration file and the operating system boot file corresponding to the operating system obtained from the BMC according to the startup mode may include:
[0088] If the boot mode is diskless boot mode, BIOS obtains the installation configuration file and operating system boot file corresponding to the operating system from BMC and writes them into the memory;
[0089] If the boot mode is hard disk boot mode, the BIOS obtains the installation configuration file and operating system boot file corresponding to the operating system from the BMC and writes them to the hard disk.
[0090] That is to say, the boot mode supports hard disk boot mode and diskless boot mode. Optionally, for normal business systems, the hard disk boot mode is used by default; for scenarios without hard disks, users can select diskless boot mode. During the boot process, the processor loads the operating system image in the BMC storage device to the memory to achieve diskless boot.
[0091] Taking the diskless boot mode as an example, the bootable device is the storage medium in the BMC. The BIOS obtains the installation configuration file and the operating system boot file corresponding to the operating system from the storage medium of the BMC. In this diskless boot mode, the BIOS interacts with the BMC and automatically installs the machine by booting in-band to the BMC installation environment. This can reduce the dependence on external devices (such as a USB flash drive or an external PXE server, etc.) and save costs.
[0092] An embodiment of the present application provides an operating system recovery method based on a startup mode, which achieves a fast and convenient way to restore or install the operating system effect by writing the installation configuration file of the operating system to be restored and the operating system boot file to a hard disk or memory, and loading and running the operating system from the hard disk or memory.
[0093] Figure 3 Another flowchart of the operating system recovery method provided in the embodiment of the present application is shown in FIG. Figure 3 As shown, the operating system recovery method may include:
[0094] S301 , uploading the operating system image to be installed to the BMC.
[0095] The user uploads the operating system image to be installed or restored to the storage device of the BMC.
[0096] This step may specifically include: uploading the operating system image and the installation system program corresponding to the operating system through the out-of-band management interface of the BMC; or uploading the operating system image and the installation system locally through the physical interface of the BMC. The operating system image includes the operating system boot file, and the installation system program includes the installation configuration file.
[0097] The out-of-band management interface is an interface on the server hardware that is independent of the main data communication path. It is used to remotely manage and monitor the server, even if the operating system is not started. The physical interface of the BMC is directly physically connected to the BMC to achieve local management and monitoring functions. The physical interface of the BMC includes serial interfaces, USB and other interfaces, through which server command queries, data communication and other functions can be realized in the installed environment.
[0098] For example, the out-of-band management interface is, for example, the Intelligent Platform Management Interface (IPMI), KVM over IP or Redfish interface, etc. KVM OVER IP is also called IP KVM, i.e., a KVM switch with remote management function. KVM is the abbreviation of Keyboard, Video, Mouse, which is a set of keyboard, monitor and mouse to control multiple computers.
[0099] Optionally, the installation environment can be integrated into the BMC in the following ways: upload the operating system image and installation system program corresponding to the operating system through the out-of-band management interface of the BMC to configure the installation environment; or, upload the operating system image and installation system program locally through the physical interface of the BMC to configure the installation environment. In the management interface of the BMC, the installation system file is uploaded to the BMC; then, the installation system is installed, and the operating system image file and the installation system program are uploaded to the BMC; finally, the path of the operating system image is specified to configure the installation environment.
[0100] S302, select installation mode.
[0101] The user selects the installation mode through the BMC. The installation modes include manual installation mode and self-recovery mode. The BMC installation mode provides one-time or permanent effect, and the user can choose according to the application scenario. For the permanent effect mode, the user does not need to intervene later, and the corresponding operation is completed automatically.
[0102] For the relationship between startup mode, installation mode and effectiveness mode, please refer to Figure 4 :
[0103] For scenarios with particularly high requirements for timeliness of maintenance, users can choose the self-recovery mode. BMC provides typical fault scenarios for users to choose from. For example, when BMC detects a corresponding fault signal, it collects relevant fault logs and automatically triggers the operating system recovery process.
[0104] In the scenario where the operating system needs to be booted from the hard disk after installation, users can choose the manual installation mode.
[0105] For manual installation mode, the installation mode selection only needs to be made once. When the operating system is installed, the processor automatically boots from the hard disk without repeated installation.
[0106] For scenarios without a hard disk, users can select diskless boot mode, and can choose to take effect once or permanently. For the permanent mode, the processor loads the operating system image from the BMC for booting each time it restarts.
[0107] The self-recovery mode supports permanent effect, so that every time a system failure occurs, the system can be automatically restored without the intervention of operation and maintenance personnel.
[0108] Therefore, before triggering the restart of the processor of the server, the BMC can also be used to: determine that the installation mode is the self-recovery mode according to the user input.
[0109] S303, set the setting options in BIOS.
[0110] The BMC implements indirect management and control of the boot mode by modifying the setting options in the BIOS. For example, the setting options may be specifically BIOS BOOT OPTION. In this step, the BMC sets the BIOS BOOTOPTION according to the installation mode.
[0111] BIOS BOOT OPTION is a boot item in BIOS, which allows users to select the device that is recognized first when the system starts, such as hard disk, CD-ROM drive or USB device. Boot mode refers to the specific method used when the system starts, including two main modes: hard disk boot and diskless boot.
[0112] S304: Triggering a processor restart.
[0113] The user can directly restart the processor, or the BMC can automatically trigger a processor restart based on the installation mode.
[0114] The BMC detects the operating system status and determines whether the server operating system needs to be restarted. The execution process of this step is described in S201 and will not be repeated here.
[0115] S305: BIOS obtains a startup mode, and obtains an installation configuration file and an operating system boot file from the BMC.
[0116] The execution process of this step is similar to that described in S201 and will not be repeated here.
[0117] S306. BIOS is loaded according to the startup mode.
[0118] For example, if the boot mode is a diskless boot mode, the installation configuration file and the operating system boot file obtained from the BMC are loaded into the memory, such as the CPU RAM.
[0119] Alternatively, if the boot mode is the hard disk boot mode, the installation configuration file and operating system boot file obtained from the BMC are loaded into the hard disk.
[0120] S307: BIOS executes the operating system boot program, starts the operating system or executes other predefined operations according to the configuration in the operating system boot program.
[0121] Based on the loaded installation configuration file and the operating system boot file, the operating system boot program in the operating system boot file is executed to restore the operating system of the server.
[0122] S308, the operating system installation and booting are completed.
[0123] For manual installation mode and self-recovery mode, OS installation is complete. For diskless boot mode, OS booting is complete.
[0124] The operating system recovery method provided in the embodiment of the present application has at least the following advantages:
[0125] Installation automation: The BMC integrated installation environment simplifies the single-machine installation operation and realizes the automatic recovery of the server operating system without the need for on-site operation by professional technicians.
[0126] High efficiency: The process from operating system failure to BMC self-recovery is automated, shortening the operating system recovery time;
[0127] Cost saving: diskless boot is possible even without external network, saving hard disks;
[0128] Flexible configuration: BMC supports batch deployment, and can be flexibly configured, updated operating system, and managed according to actual needs;
[0129] Safe and reliable: Data transmission is supported by the server's own hardware and does not require external environment deployment, ensuring safe and reliable data transmission.
[0130] Easy to maintain: From operating system failure to automatic recovery, BMC can record detailed logs to facilitate fault analysis and system maintenance.
[0131] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0132] Figure 5 A schematic diagram of a structure of an operating system recovery device provided in an embodiment of the present application. An embodiment of the present application provides an operating system recovery device, which is applied to a BIOS in a server, and the BMC of the server is integrated with an installation environment. Figure 5 As shown, the operating system recovery device 50 provided in the embodiment of the present application includes:
[0133] The loading module 51 is used to respond to the startup instruction, obtain the startup mode, and load the installation configuration file and the operating system boot file corresponding to the operating system obtained from the BMC according to the startup mode. The startup instruction is that the BMC triggers the server processor to restart when it detects that the operating system needs to be restarted, wherein the processor restart includes starting the BIOS;
[0134] The recovery module 52 is used to execute the operating system boot program in the operating system boot file based on the loaded installation configuration file and the operating system boot file to recover the operating system of the server.
[0135] Optionally, the loading module 51 is specifically used to: obtain the installation configuration file and the operating system boot file corresponding to the operating system from the BMC through the physical channel between the processor and the BMC using an Ethernet data transmission method; and / or obtain the installation configuration file and the operating system boot file corresponding to the operating system from the BMC through the physical channel between the processor and the BMC using a two-way data communication copy method.
[0136] Optionally, the loading module 51 is also used to: when the startup mode is a diskless startup mode, obtain the installation configuration file and the operating system boot file corresponding to the operating system, and write them into the memory; when the startup mode is a hard disk startup mode, obtain the installation configuration file and the operating system boot file corresponding to the operating system from the BMC, and write them into the hard disk.
[0137] Optionally, the condition that the operating system needs to be restarted includes at least one of the following:
[0138] BMC detected an operating system failure;
[0139] BMC detected an operating system crash;
[0140] BMC detected an operating system update.
[0141] Optionally, integrate the installation environment into the BMC in the following ways:
[0142] Upload the operating system image and the installation system program corresponding to the operating system through the out-of-band management interface of the BMC to configure the installation environment; or upload the operating system image and the installation system program locally through the physical interface of the BMC to configure the installation environment;
[0143] The operating system image includes the operating system boot file, and the installed system program includes the installed configuration file.
[0144] Optionally, the BMC is further used to: before triggering the restart of the processor of the server, determine, according to user input, that the installation mode is a self-recovery mode, where the installation mode includes a manual installation mode and a self-recovery mode.
[0145] Optionally, the BMC is further used to: implement indirect management and control of the above boot mode by modifying a setting option in the BIOS, wherein the setting option may specifically be a BIOS BOOT OPTION.
[0146] The operating system recovery device provided in the embodiment of the present application can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and the embodiment of the present application will not be described in detail here.
[0147] Figure 6 A schematic diagram of a structure of a server provided in an embodiment of the present application. An embodiment of the present application provides a server, in which a BMC of the server is integrated with an installation environment. Figure 6 As shown, the server 60 provided in the embodiment of the present application includes:
[0148] BMC 61, used to detect whether the operating system of the server needs to be restarted; in response to detecting that the operating system needs to be restarted, triggering the server processor 62 to restart, wherein the processor restart includes starting the server BIOS 63;
[0149] BIOS 63 is used to check the boot settings to obtain the boot mode, and load the installation configuration file and operating system boot file corresponding to the operating system obtained from the BMC according to the boot mode; based on the loaded installation configuration file and operating system boot file, execute the operating system boot program in the operating system boot file to restore the server's operating system.
[0150] In one possible implementation, BIOS 63 is specifically used to: obtain the installation configuration file and the operating system boot file corresponding to the operating system from BMC 61 through the physical channel between the processor 62 and BMC 61 by applying an Ethernet data transmission method; and / or obtain the installation configuration file and the operating system boot file corresponding to the operating system from BMC 61 through the physical channel between the processor 62 and BMC 61 by applying a two-way data communication copy method.
[0151] In one possible implementation, BIOS 63 is also used to: when the boot mode is a diskless boot mode, BMC 61 obtains the installation configuration file and the operating system boot file corresponding to the operating system, and writes them into the memory; when the boot mode is a hard disk boot mode, obtains the installation configuration file and the operating system boot file corresponding to the operating system from BMC 61, and writes them into the hard disk.
[0152] In a possible implementation, the condition that the operating system needs to be restarted includes at least one of the following:
[0153] BMC detected an operating system failure;
[0154] The BMC detects an operating system crash;
[0155] BMC detected an operating system update.
[0156] In a possible implementation, the installation environment is integrated into the BMC in the following manner:
[0157] Upload the operating system image and the installation system program corresponding to the operating system through the out-of-band management interface of the BMC to configure the installation environment; or upload the operating system image and the installation system program locally through the physical interface of the BMC to configure the installation environment;
[0158] The operating system image includes the operating system boot file, and the installed system program includes the installed configuration file.
[0159] In a possible implementation, the BMC 61 is further configured to: before triggering the restart of the server processor, determine, according to user input, that the installation mode is a self-recovery mode, where the installation mode includes a manual installation mode and a self-recovery mode.
[0160] In a possible implementation, the BMC 61 is further used to: implement indirect management and control of the above boot mode by modifying a setting option in the BIOS, wherein the setting option may specifically be a BIOS BOOT OPTION.
[0161] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. The general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc. The steps of the method disclosed in the invention may be directly embodied as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0162] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-volatile Memory, NVM), such as at least one disk memory.
[0163] An embodiment of the present application also provides a computer program product, including a computer program, which implements the above method when executed.
[0164] An embodiment of the present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed, the above method is implemented.
[0165] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0166] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.
[0167] The division of units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.
[0168] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0169] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0170] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0171] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0172] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art not disclosed by the present invention, are not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. An operating system recovery method, characterized in that: The basic input and output system BIOS is applied to the server, and the installation environment is integrated in the baseboard management controller BMC of the server. The operating system recovery method includes: The BIOS responds to the startup instruction, obtains the startup mode, and loads the installation configuration file corresponding to the operating system obtained from the BMC and the operating system boot file according to the startup mode, wherein the startup instruction is that the BMC triggers the processor of the server to restart when detecting that the operating system needs to be restarted, wherein the processor restart includes starting the BIOS; The BIOS executes the operating system boot program in the operating system boot file based on the loaded installation configuration file and the operating system boot file to restore the operating system of the server.
2. The operating system recovery method according to claim 1, characterized in that: The BIOS obtains an installation configuration file and an operating system boot file corresponding to the operating system from the BMC, including: The BIOS obtains the installation configuration file and the operating system boot file corresponding to the operating system from the BMC through the physical channel between the processor and the BMC using the Ethernet data transmission method; And / or, the BIOS obtains the installation configuration file and the operating system boot file corresponding to the operating system from the BMC by applying a data bidirectional communication copy method through a physical channel between the processor and the BMC.
3. The operating system recovery method according to claim 1 or 2, characterized in that: The step of loading the installation configuration file and the operating system boot file corresponding to the operating system obtained from the BMC according to the startup mode includes: If the boot mode is a diskless boot mode, the BIOS obtains an installation configuration file and an operating system boot file corresponding to the operating system from the BMC, and writes them into the memory; If the boot mode is the hard disk boot mode, the BIOS obtains the installation configuration file and the operating system boot file corresponding to the operating system from the BMC, and writes them into the hard disk.
4. The operating system recovery method according to claim 1 or 2, characterized in that: The operating system needs to be restarted if at least one of the following conditions is met: The BMC detects an operating system failure; The BMC detects that the operating system crashes; The BMC detects an operating system update.
5. The operating system recovery method according to claim 1 or 2, characterized in that: Integrate the installation environment into the BMC in the following ways: Upload the operating system image and the installation system program corresponding to the operating system through the out-of-band management interface of the BMC to configure the installation environment; or upload the operating system image and the installation system program locally through the physical interface of the BMC to configure the installation environment; The operating system image includes the operating system boot file, and the installed system program includes the installed configuration file.
6. The operating system recovery method according to claim 1 or 2, characterized in that: The BMC is further used to: before triggering the restart of the processor of the server, determine, according to user input, that the installation mode is a self-recovery mode, wherein the installation mode includes a manual installation mode and a self-recovery mode.
7. The operating system recovery method according to claim 1 or 2, characterized in that: The BMC is also used to: implement indirect management and control of the startup mode by modifying the setting options in the BIOS.
8. An operating system recovery device, characterized in that: The basic input and output system BIOS is applied to the server, and the installation environment is integrated in the baseboard management controller BMC of the server. The operating system recovery device includes: A loading module, used to respond to a startup instruction, obtain a startup mode, and load an installation configuration file and an operating system boot file corresponding to the operating system obtained from the BMC according to the startup mode, wherein the startup instruction is that the BMC triggers a processor restart of the server when detecting that the operating system needs to be restarted, wherein the processor restart includes starting the BIOS; The recovery module is used to execute the operating system boot program in the operating system boot file based on the loaded installation configuration file and the operating system boot file to recover the operating system of the server.
9. A server, characterized in that: The server's baseboard management controller BMC integrates the installation environment; The BMC is configured to trigger a processor restart of the server in response to detecting that the operating system needs to be restarted, wherein the processor restart includes starting a basic input / output system BIOS of the server; The BIOS is used to obtain a startup mode, and load an installation configuration file and an operating system boot file corresponding to the operating system obtained from the BMC according to the startup mode; based on the loaded installation configuration file and the operating system boot file, execute the operating system boot program in the operating system boot file to restore the operating system of the server.
10. A computer-readable storage medium / computer program product, characterized in that: The computer-readable storage medium stores computer-executable instructions, which, when executed, are used to implement the operating system recovery method according to any one of claims 1 to 7; And / or, the computer program product includes a computer program, and when the computer program is executed, the operating system recovery method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Restart control method and device of server processor, storage medium and electronic equipment
CN120780542A
