Method, computing device and communication system for installing operating system based on PXE
By optimizing the OpROM loading logic, priority is given to loading network cards communicating with network access devices, and determining the IP acquisition status through out-of-band management and in-band polling, the problem of PXE installation failure caused by insufficient OpROM of the network card is solved, which improves the installation success rate and reduces resource consumption and maintenance costs.
Patent Information
- Application Number
- CN202211168666.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-24
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2042-09-24
AI Technical Summary
In traditional BIOS boot mode, insufficient OpROM address space of the network card leads to the failure of PXE to install the operating system, reducing the installation success rate.
By optimizing the OpROM loading logic, priority is given to loading the OpROM of the network card that is connected to the network access device, and through out-of-band management and in-band polling, whether the network card can obtain IP normally, free up the address space to load other network cards that can obtain IP normally, and realize the adaptive allocation of the network card OpROM.
It improves the success rate of PXE installation operating system, reduces resource consumption and maintenance costs, and does not affect existing services, achieving a safe and reliable installation process.
Smart Images

Figure CN115576613B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method for installing an operating system based on PXE, a computing device, and a communication system. Background Art
[0002] Preboot execute environment (PXE) technology operates in a client / server network model, supporting network booting of operating systems. During the boot process, the server assigns an IP address to the client and then uses TFTP (trivial file transfer protocol) or MTFTP (multicasttrivial file transfer protocol) to download the software package to memory for execution, completing basic client software setup and operating system installation. PXE can boot a variety of operating systems, including Windows and Linux.
[0003] When the basic input / output system (BIOS) is in Legacy boot mode, it allocates 128KB of address space for the firmware (option ROM, OpROM) of peripheral devices to be loaded. Peripheral devices include network cards. However, when initializing devices, the BIOS generally calls and executes them in the order in which they are scanned, allocating address space to each of them. If this address space is exhausted, the OpROMs of one or more devices, including the network card, cannot be loaded. Because Preinstalled XenServer (PXE) uses a network interface to boot a computer, if the network card cannot be loaded, the PXE installation fails, resulting in a low success rate for operating system installation. Summary of the Invention
[0004] The embodiments of the present application provide a method, computing device, and communication system for installing an operating system based on PXE, which reduces resource consumption, lowers maintenance costs, and improves the installation success rate.
[0005] To this end, the embodiments of the present application adopt the following technical solutions:
[0006] In a first aspect, an embodiment of the present application provides a method for installing an operating system based on PXE, the method comprising: determining to install an operating system in a traditional boot mode, allocating a total address space, the total address space being the total address space that can be occupied by the OpROMs of the peripheral devices to be loaded, the peripheral devices including network card devices and non-network card devices, and the network card devices including at least one network card; when determining to prioritize allocating address space for the OpROM of the at least one network card when starting from PXE, determining the presence of at least one first network card, the first network card including a network card communicatively connected to a network access device, the network access device being used to establish a communication connection with a PXE server; allocating at least part of the address space in the total address space to at least part of the network cards in the at least one first network card, so as to load the OpROMs of the at least part of the network cards respectively within the allocated address space; determining a second network card and installing the operating system through the second network card, the second network card including a network card among the at least part of the network cards that can obtain the Internet Protocol IP sent by the PXE server.
[0007] The method for installing an operating system based on PXE in the embodiment of the present application improves the success rate of PXE installation of an operating system by optimizing the OpROM loading logic. Specifically, the OpROM loading order can be optimized through the BIOS code first, with the network card OpROM being loaded first. Then, the scenario where OpROM is insufficient even when only the network card OpROM is loaded (i.e., the scenario where OpROM is insufficient for multiple network cards) is further optimized. Among them, the network card connection status is obtained through out-of-band management, and only the network card OpROM connected to the network is loaded. Then, it can be determined whether the network card connected to the network can obtain an IP normally through an in-band polling method. If the IP cannot be obtained normally, the network card can be uninstalled to free up address space for loading other network cards that can obtain an IP normally, thereby solving the problem of PXE installation failure caused by the inability to load the network card OpROM. That is, through the in-band and out-of-band combination logic, the problem of OpROM deficiency is solved under the premise of safety, reliability, low resource consumption, and low maintenance cost, thereby improving the success rate of operating system installation.
[0008] In one possible implementation, determining the presence of at least one first network card includes: detecting a switch state of a connection indicator light of the network card, the switch state of the connection indicator light including an on state and an off state, wherein in the on state, the network card is in communication connection with the network access device; and in the off state, the network card is not in communication connection with the network access device; if the switch state of the connection indicator light of the network card is the on state, determining that the network card is the first network card; or obtaining a value of a register of the network card, the value of the register including a first value and a second value, the first value being used to indicate that the network card is in communication connection with the network access device, and the second value being used to indicate that the network card is not in communication connection with the network access device; if the value of the register is the first value, determining that the network card is the first network card. That is, in this implementation, whether the network card is in communication connection with the network access device, i.e., whether the network card is connected to the network, can be determined by detecting the switch state of the connection indicator light of the network card; or whether the network card is in communication connection with the network access device, i.e., whether the network card is connected to the network, can be determined by the value of the register.
[0009] In one possible implementation, determining the presence of at least one first network card includes: sequentially testing the at least one network card until the presence of the first network card is determined; or sequentially testing the at least one network card to determine the presence of the first network card among the at least one network card. That is, in this implementation, when sequentially testing the network cards, upon detecting a first network card, subsequent network cards may be discontinued and subsequent steps may be performed, such as determining whether the address space (i.e., resource requirement) required by the OpROM of the first network card is less than the size of the total address space. If the determination result is yes, at least a portion of the address space in the total address space is allocated to the network card to load the OpROM of the first network card. Alternatively, all network cards may be tested first, and the first network card among all the network cards is detected. In this case, if the total address space required by one or more network cards connected to the network (i.e., the first network card) is less than the size of the total address space, the one or more network cards may be loaded.
[0010] In one possible implementation, the method further includes: unloading the OpROMs of the network cards, except the second network card, from the allocated address space. That is, in this implementation, if a network card with an OpROM loaded cannot correctly obtain an IP address, the OpROMs of the network card or cards can be unloaded to free up address space for installing other devices.
[0011] In one possible implementation, the method further includes: before determining the existence of at least one first network card, determining that the total amount of address space required by the OpROM of the at least one network card is greater than the size of the total address space; and / or, allocating at least part of the address space in the total address space to at least part of the at least one first network card, including: for each first network card, when determining that the size of the address space required by the OpROM of the first network card is less than the size of the total address space, allocating at least part of the address space in the total address space to the first network card. That is, in this implementation, it is possible to first determine whether the total amount of address space required by the OpROM of at least one network card is greater than the size of the total address space. If the determination result is yes, it is then determined whether the first network card exists. If the determination result is no, address space can be allocated to the OpROM of at least one network card. In addition, if the address space required by the first network card is greater than the total address space, there is no need to load the first network card, that is, there is no need to allocate address space to the network card.
[0012] In one possible implementation, the method further includes determining that the total address space required by the OpROM of the at least one network card is less than the size of the total address space, and allocating at least a portion of the total address space to the at least one network card, so that the OpROM of the at least one network card can be loaded within the allocated address space. That is, in this implementation, to improve installation speed and ensure installation success, the at least one network card can be loaded even if the total address space required by the OpROM of the at least one network card is less than the size of the total address space.
[0013] In one possible implementation, the determining of prioritizing allocation of address space to the OpROM of the at least one network card when booting from PXE includes: determining the sum of the address space requirements of the OpROMs of the peripheral devices to be loaded; and when the sum of the address space requirements of the OpROMs of the peripheral devices to be loaded is greater than the size of the total address space, prioritizing allocation of address space to the OpROM of the at least one network card.
[0014] In a possible implementation, the method further includes: if it is determined that the first network card or the second network card does not exist, then the PXE-based installation of the operating system fails.
[0015] In a second aspect, an embodiment of the present application provides a method for installing an operating system based on PXE, which is applied to an out-of-band controller or a BMC system, the method comprising: receiving a first message sent by a basic input / output system, the first message being used to instruct the basic input / output system to prioritize allocating address space to the OpROM of at least one network card when starting from PXE in a traditional boot mode; determining that there is at least one first network card, the first network card including a network card communicatively connected to a network access device, the network access device being used to establish a communication connection with a PXE server; sending a second message to the basic input / output system, the second message including identification information of each of the at least one first network card, the identification information being used to uniquely identify the first network card, the second message being used to enable the basic input / output system to allocate at least part of the address space in the total address space to at least part of the network cards of the at least one first network card corresponding to the identification information, so as to load the OpROMs of the at least part of the network cards respectively within the allocated address space, and then installing the operating system through the second network card of the at least part of the network cards, the second network card including the network card of the at least part of the network cards that can obtain the Internet Protocol IP sent by the PXE server.
[0016] In one possible implementation, determining the existence of at least one first network card includes: detecting the switch state of the connection indicator light of the network card, the switch state of the connection indicator light includes an on state and an off state, in the on state, the network card and the network access device are communicatively connected; in the off state, the network card and the network access device are not communicatively connected; if the switch state of the connection indicator light of the network card is the on state, determining that the network card is the first network card; or, obtaining the value of the register of the network card, the value of the register includes a first value and a second value, the first value is used to indicate that the network card and the network access device are communicatively connected, and the second value is used to indicate that the network card and the network access device are not communicatively connected; if the value of the register is the first value, determining that the network card is the first network card.
[0017] In a possible implementation, determining the existence of at least one first network card includes: detecting the at least one network card in sequence until the existence of the first network card is determined; or detecting the at least one network card in sequence to determine the existence of the first network card among the at least one network card.
[0018] In a third aspect, an embodiment of the present application provides a method for installing an operating system based on PXE, which is applied to a processor or a basic input and output system BIOS, the method comprising: determining to install an operating system in a traditional boot mode, allocating a total address space, the total address space being the total address space that can be occupied by the OpROMs of the peripheral devices to be loaded, the peripheral devices including network card devices and non-network card devices, the network card devices including at least one network card; determining to give priority to allocating address space to the OpROM of the at least one network card when starting from PXE, sending a first message to an out-of-band controller or a BMC system, the first message being used to instruct the basic input and output system to give priority to allocating address space to the OpROM of the at least one network card when starting from PXE in the traditional boot mode. receiving a second message sent by the out-of-band controller or the BMC system, the second message including identification information of each of the at least one first network card, the identification information being used to uniquely identify the first network card, the first network card including a network card communicatively connected to a network access device, the network access device being used to establish a communication connection with a PXE server; allocating at least part of the address space in the total address space to at least part of the at least one first network card corresponding to the identification information, so as to load the OpROMs of the at least part of the network cards respectively within the allocated address space; determining a second network card and installing an operating system through the second network card, the second network card including a network card among the at least part of the network cards that can obtain the Internet Protocol IP sent by the PXE server.
[0019] In a possible implementation, the method further includes: unloading the OpROMs of the network cards other than the second network card among the at least some of the network cards from the allocated address space.
[0020] In one possible implementation, the method further includes: before determining the existence of at least one first network card, determining that the total amount of address space required by the OpROM of the at least one network card is greater than the size of the total address space; and / or allocating at least part of the address space in the total address space to at least part of the at least one first network card, including: for each first network card, if it is determined that the size of the address space required by the OpROM of the first network card is less than the size of the total address space, allocating at least part of the address space in the total address space to the first network card.
[0021] In one possible implementation, the method further includes: determining that the total amount of address space required by the OpROM of the at least one network card is smaller than the size of the total address space, and allocating at least part of the address space in the total address space to the at least one network card so as to load the OpROM of the at least one network card respectively within the allocated address space.
[0022] In one possible implementation, the determining of prioritizing allocation of address space to the OpROM of the at least one network card when booting from PXE includes: determining the sum of the address space requirements of the OpROMs of the peripheral devices to be loaded; and when it is determined that the sum of the address space requirements of the OpROMs of the peripheral devices to be loaded is greater than the size of the total address space, prioritizing allocation of address space to the OpROM of the at least one network card.
[0023] In a fourth aspect, an embodiment of the present application provides a computing device, comprising: at least one memory for storing programs; and at least one processor for executing the programs stored in the memory. When the program stored in the memory is executed, the processor is used to execute the method provided in the first aspect above.
[0024] In a fifth aspect, an embodiment of the present application provides a computing device, comprising: a first memory for storing a BMC program; an out-of-band controller for executing the program stored in the first memory, and when the program stored in the first memory is executed, the out-of-band controller is used to execute the method provided in the second aspect; and / or, a second memory for storing a basic input and output system BIOS program; a processor for executing the program stored in the second memory, and when the program stored in the second memory is executed, the processor is used to execute the method provided in the third aspect.
[0025] In a sixth aspect, an embodiment of the present application provides a communication system, which includes: a PXE server and a network access device; and at least one computing device provided in the fourth or fifth aspect above, wherein the computing device is communicatively connected to the PXE server through the network access device.
[0026] In a seventh aspect, an embodiment of the present application provides a computer storage medium, in which instructions are stored. When the instructions are executed on a computer, the computer executes the method provided in the first, second or third aspect above.
[0027] In an eighth aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the method provided in the first, second or third aspect above.
[0028] Other features and advantages of the present invention will be described in detail in the following specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The following is a brief introduction to the drawings required for describing the embodiments or prior art.
[0030] Figure 1 A schematic diagram of an application scenario provided in an embodiment of the present application;
[0031] Figure 2 A specific flow chart of an operating system installation based on PXE provided in an embodiment of the present application;
[0032] Figure 3 A specific flow chart of sequentially detecting network cards provided in an embodiment of the present application;
[0033] Figure 4 A flowchart of a method for installing an operating system based on PXE provided in an embodiment of the present application;
[0034] Figure 5 A specific process diagram for obtaining the connection status of a network card provided in an embodiment of the present application;
[0035] Figure 6 A specific process diagram for obtaining the connection status of a network card provided in another embodiment of the present application;
[0036] Figure 7 A specific process diagram of sequentially detecting network cards provided in an embodiment of the present application;
[0037] Figure 8 A flowchart of another method for installing an operating system based on PXE provided in an embodiment of the present application. DETAILED DESCRIPTION
[0038] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of this specification, rather than all the embodiments.
[0039] In the description of this specification, "one embodiment" or "some embodiments" means that one or more embodiments of this specification include a particular feature, structure, or characteristic described in conjunction with the embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in other embodiments," etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized.
[0040] In the description of this specification, unless otherwise specified, " / " means or. For example, A / B can mean A or B. "And / or" in this document is simply a description of the association relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of this application, "plurality" means two or more than two.
[0041] In the description of this specification, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of technical features indicated. Therefore, a feature specified as "first" or "second" may explicitly or implicitly include one or more of such features. The terms "including," "comprising," "having," and their variations all mean "including but not limited to," unless otherwise specifically emphasized.
[0042] The following is a detailed introduction to the abbreviations and key terms used in the embodiments of this application:
[0043] OpROM is the firmware that BIOS runs during platform initialization.
[0044] PCIe, PCI express, abbreviated as PCIe, is an important branch of the computer bus. It uses the existing PCI programming concepts and signal standards, and builds a higher-speed serial communication system standard. Currently, this standard is developed and maintained by the PCI-SIG organization. PCIe is only used for internal interconnection.
[0045] Out-of-band management refers to the use of independent management channels for device maintenance. It allows system administrators to remotely monitor and manage servers, routers, network switches, and other network devices.
[0046] In-band management, as opposed to out-of-band management, refers to managing devices using regular data channels such as Ethernet channels and PCIe channels.
[0047] The preboot execute environment (PXE) provides a mechanism for booting a computer using a network interface. This mechanism allows the computer to boot without relying on a local data storage device (such as a hard disk) or a locally installed operating system.
[0048] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of the present application. Figure 1As shown, the server on which the operating system is to be installed may include an in-band system and out-of-band management (BMC). The in-band system may include a CPU, memory, hard disk, network card, etc. The server on which the operating system is to be installed (including a PXE client) can communicate with a PXE server (i.e., a PXE server) via a network access device such as a switch. The server then downloads the files required to install the operating system from the PXE server over the network. The server then loads the kernel and file system from the PXE server using TFTP (trivial file transfer protocol) or MTFTP (multicast trivial file transfer protocol) for installation.
[0049] The process of establishing a communication connection between the PXE client and the PXE server is as follows: When the basic input output system (BIOS) on the server where the operating system is to be installed is in the legacy boot mode, the BIOS allocates 128KB of address space to the OpROM of the peripheral device to be loaded. When initializing the device, the BIOS allocates a portion of the address space from the 128KB address space to the scanned device in sequence according to the device scanning order. When the 128KB address space is exhausted, the OpROM of one or more devices can no longer be loaded. For example, when using a network PCIe card to install the operating system through PXE, if the OpROM space is insufficient when the network card device is scanned, sufficient address space cannot be allocated to the network PCIe card, and the OpROM of the network PCIe card cannot be loaded, that is, the network PCIe card cannot be initialized normally, and the PXE-based installation of the operating system fails, resulting in a low success rate for the operating system.
[0050] Specifically, the BIOS generally sets the order for loading the peripheral device OpROMs to be:
[0051] VGA interface → SOL → RAID card → PCH direct-out onboard network card → PCIe standard card → SoftRAID → other I / O cards.
[0052] The above terms are explained as follows:
[0053] VGA, video graphics array, is a computer display standard using analog signals proposed by IBM in 1987.
[0054] SOL, serial over LAN, is a mechanism that enables the serial port input and output of a managed system to be redirected over IP.
[0055] RAID, redundant array of independent disks, uses virtualized storage technology to combine multiple hard disks into one or more hard disk array groups to improve performance or reliability, or both.
[0056] PCH, platform controller hub, is a series of chipsets launched by Intel since 2008, replacing the previous I / O path controller (I / O controller hub, abbreviated as ICH).
[0057] I / O, Input / Output, input / output.
[0058] It can be seen that the OpROMs for network-related PCH direct-out onboard network cards and standard PCIe cards are loaded later in the order. By default, all device OpROMs are enabled in the BIOS. Therefore, according to the above OpROM loading order, the OpROMs of network-related devices may not load, ultimately causing the PXE installation to fail. When this problem occurs, it can usually be resolved by manually removing unused devices or disabling them in the BIOS options configuration menu, but this is extremely difficult to maintain.
[0059] In view of this, the embodiments of the present application provide a method, computing device and communication system for installing an operating system based on PXE. The method for installing an operating system based on PXE in the embodiments of the present application improves the success rate of installing an operating system based on PXE by optimizing the OpROM loading logic. Specifically, the OpROM loading order can be optimized by BIOS code first, and the network card OpROM is loaded first. Then, the scenario where OpROM is insufficient when only the network card OpROM is loaded (i.e., the scenario where OpROM is insufficient for multiple network cards) is further optimized. Among them, the network card connection status is obtained through out-of-band management, and only the OpROM of the network card connected to the network (i.e., the linkup network card) is loaded. Then, it is determined whether the connected network card can obtain the IP normally through in-band polling. If the IP cannot be obtained normally, the network card can be uninstalled to free up address space for loading other network cards that can obtain the IP normally. Thus, through in-band and out-of-band combination logic, the problem of failure of the system installation based on PXE caused by insufficient OpROM is solved under the premise of safety, reliability, low resource consumption and low maintenance cost, thereby improving the success rate of operating system installation. In addition, the solution of the embodiment of the present application is also applicable to other solutions for optimizing OpROM resource loading through out-of-band connection status, such as FC cards (fibre channel, optical fiber network cards).
[0060] Figure 2This is a specific flow chart of a PXE-based operating system installation provided in the embodiment of the present application. Figure 2 As shown, after the system starts, the BIOS obtains the first boot item currently set, and then determines whether it is Legacy PXE boot. If the judgment result is no, the boot continues; if the judgment result is yes, the device is enumerated to obtain the device OpROM resource requirement; then, it is determined whether the OpROM resource requirement exceeds 128KB. If it does not exceed 128KB, the boot continues. If it exceeds 128KB, the network card OpROM is loaded first; then, it is determined whether the OpROM resource requirements of all network cards exceed 128KB. If the judgment result is no, that is, it does not exceed 128KB, the OpROM of the network card is loaded to continue booting to install the operating system. If the judgment result is yes, that is, it exceeds 128KB, it is determined in turn whether the network card is connected and whether the IP can be obtained correctly. If the judgment result is yes, that is, there is a network card connected to the network (connected to the network access device) and can correctly obtain the IP, then the boot continues. If the judgment result is no, that is, there is no network card connected to the network and can correctly obtain the IP, then the PXE boot fails.
[0061] That is to say, in the solution of the embodiment of the present application, when the server is powered on and the system is started, it is first determined whether the first startup item is LegacyPXE startup. After confirming that it is LegacyPXE startup, the device OpROM resource demand is obtained according to the device scanning order. When the OpROM resource demand is greater than 128KB, the network card OpROM is loaded first. If only the network card OpROM is loaded and the OpROM resource demand is still greater than 128KB, the loading of OpROM resources is further optimized by confirming the network card connection status out-of-band and confirming whether the IP is normally allocated through in-band polling, so that only the network card that is connected and can obtain the IP can be truly loaded with OpROM. Therefore, through the adaptive OpROM loading order, the system installation is completed without manual intervention. Restoring the default after restarting will not affect the customer's existing configuration, thereby improving the success rate of PXE installation and making it easy to maintain.
[0062] Figure 3 This is a specific flow chart of detecting network cards in sequence provided by the embodiment of the present application. Figure 3As shown, first determine whether the OpROM resource requirements of all network cards exceed 128KB. If the determination result is no, continue booting. If the determination result is yes, determine whether the network cards are connected in turn. If the determination result is no, the OpROM resource requirements of the unconnected network cards are not allocated. Then, determine whether all network cards have completed polling. If the determination result is yes, the PXE boot fails. If the determination result is no, return to the step of determining whether the OpROM resource requirements of all network cards (excluding unconnected network cards, i.e., network cards not connected to the network / network cards not connected to the network access device) exceed 128KB. Wherein, if the result of determining in sequence whether the network card is connected is yes, then determine whether the OpROM resource requirement of the network card exceeds 128KB, if the result of determining in sequence is no, then load the OpROM of the currently connected network card, then determine whether the network card correctly obtains the IP address, if the result of determining in sequence is yes, then continue booting, if the result of determining in sequence is no, then unload the OpROM of the network card that failed to obtain the IP address, then determine whether all network cards have completed polling, if the result of determining in sequence is yes, then PXE boot fails, if the result of determining in sequence is no, i.e., there is a network card that has not completed polling, then determine whether the network card is connected (i.e., connected to the network) and whether to obtain the IP address according to the above steps. In addition, when the result of determining in sequence whether the OpROM resource requirement of the network card exceeds 128KB is yes, it is also determined whether all network cards have completed polling.
[0063] That is, first, the network card connection status is obtained through out-of-band management. Secondly, the in-band polling method is used to determine whether the connected network card can obtain the IP normally. Specifically, the network card devices are enumerated in sequence. For each network card device, the current network card connection status is first determined out-of-band. Only connected network cards will enter the in-band OPROM requirement size and whether the IP can be obtained. Network cards in the non-connected state do not load the OpROM; then, after determining that the OpROM resource requirements and normal IP acquisition of the network card in the connected state are met, the boot process continues and enters the PXE installation phase. If either the OpROM resource requirements or IP acquisition are not met, the OpROM of the network card will no longer be loaded, and the logic judgment will proceed to the next network card to continue the above operation. After polling all network cards according to the above operation, it is impossible to continue booting and enter the PXE phase, and the PXE boot is determined to have failed.
[0064] The method for installing an operating system based on PXE in the embodiment of the present application can automatically optimize the allocation of OpROM when the problem of insufficient OpROM occurs during the PXE installation of the operating system. This method is not perceived by the customer, thus reducing maintenance costs and improving the success rate of installation. Moreover, it is only effective when the operating system is installed using LegacyPXE, and will not affect existing services, making it more secure and reliable. Furthermore, by giving priority to determining the connection status of the network card, the resource consumption caused by polling all network cards is reduced, which is conducive to reducing costs. That is, the solution of the embodiment of the present application is mainly a logic controller that obtains the status of the network card in-band and out-of-band, and realizes the correct use of OpROM resources through logical control, so that the OpROM of the network card actually used for PXE startup is loaded first.
[0065] Next, based on the PXE-based operating system installation process described above, a method for installing an operating system based on PXE provided in an embodiment of the present application is introduced. It can be understood that this method is another way of expressing the PXE-based operating system installation process described above, and the two are combined. This method is proposed based on the PXE-based operating system installation process described above, and some or all of the content of this method can be found in the above description of the PXE-based operating system installation process.
[0066] Figure 4 This is a flowchart of a method for installing an operating system based on PXE provided in an embodiment of the present application. Figure 4 As shown, the method is applied to a computing device and may include the following steps:
[0067] S401, determine to install the operating system in the traditional boot mode, allocate a total address space, the total address space is the total address space that can be occupied by the OpROMs of the peripheral devices to be loaded, the peripheral devices include network card devices and non-network card devices, and the network card devices include at least one network card.
[0068] S402: Determine the sum of the address spaces required for the OpROMs of the peripheral devices to be loaded.
[0069] S403 , determining whether the sum of the address space requirements of the OpROMs of the peripheral devices to be loaded is greater than the size of the total address space.
[0070] S404: If the judgment result of S403 is no, continue to start.
[0071] S405: If the determination result of S403 is yes, preferentially allocate address space to the OpROM of at least one network card.
[0072] S406: When it is determined that address space is preferentially allocated to the OpROM of at least one network card when booting from PXE, determine whether there is at least one first network card, where the first network card includes a network card that is communicatively connected to a network access device, and the network access device is used to establish a communication connection with the PXE server.
[0073] Furthermore, before determining whether at least one first network card exists, it may be determined whether the total amount of address space required by the OpROM of the at least one network card is greater than the size of the total address space. If the determination result is yes, it is then determined whether at least one first network card exists. If the determination result is no, at least part of the address space in the total address space may be allocated to the at least one network card so that the OpROM of the at least one network card is loaded respectively within the allocated address space. Subsequently, a second network card is determined in the at least one network card and an operating system is installed through the second network card, where the second network card includes a network card capable of obtaining an Internet Protocol IP sent by a PXE server.
[0074] In addition, the network access device may be a switch or a router. Furthermore, the communication connection status between the network card and the network access device may be first obtained; then the network card whose communication connection status is connected may be determined as the first network card. Specifically, the method for determining the existence of at least one first network card may include, but is not limited to, the following two solutions:
[0075] Solution 1 - First check the switch status of the connection indicator of the network card. The switch status of the connection indicator includes on and off. In the on state, the network card is connected to the network access device; in the off state, the network card is not connected to the network access device; then, if the switch status of the connection indicator of the network card is on, it is determined that the network card is the first network card. Figure 5 Provide a detailed introduction.
[0076] Figure 5 This is a specific process diagram for obtaining the connection status of a network card provided in an embodiment of the present application. Figure 5 As shown, the PCH direct-output onboard network card obtains the network card connection status through the network card Link light / network card Link status indicator (i.e., connection indicator), which may include the following steps:
[0077] PCH detects the Link status of the network card and controls the Link light of the network card to light up or off accordingly. If the Link light is on, it means the network card is connected to the network; if the Link light is off, it means the network card is not connected to the network.
[0078] The CPLD detects changes in the status of the network card Link light and writes the corresponding status into the CPLD register for storage;
[0079] The BMC obtains the link status register value of the corresponding network card from the CPLD and reports it to the BIOS through the IPMI channel;
[0080] The BIOS obtains the network card connection status for subsequent use.
[0081] The terms are explained as follows:
[0082] GPIO, general purpose input output, general input and output port;
[0083] CPLD, complex programmable logic device, complex programmable logic device;
[0084] BMC, baseboard management controller, baseboard controller;
[0085] IPMI, intelligent platform management interface, intelligent platform management interface.
[0086] Solution 2 - First, obtain the value of the register of the network card. The value of the register includes a first value and a second value. The first value is used to indicate that the network card is connected to the network access device, and the second value is used to indicate that the network card is not connected to the network access device. Then, if the value of the register is the first value, the network card is determined to be the first network card. Figure 6 Provide a detailed introduction.
[0087] Figure 6 This is another specific process diagram for obtaining the connection status of the network card provided in the embodiment of the present application. Figure 6 As shown, the PCIe card needs to support the permission to read the Link Status Register value, which can include the following steps:
[0088] The BMC obtains the network card link status register value through the I2C channel and then reports it to the BIOS through the IPMI channel;
[0089] The BIOS obtains the network card connection status for subsequent use.
[0090] The terms are explained as follows:
[0091] I2C, inter-integrated circuit, is a serial communication bus that uses a multi-master-slave architecture to connect low-speed devices.
[0092] S407: If the judgment result of S406 is no, that is, it is determined that the first network card does not exist, the PXE-based installation of the operating system fails.
[0093] S408 , if the determination result of S406 is yes, allocate at least part of the total address space to at least part of the at least one first network card, so as to load the OpROMs of at least part of the network cards in the allocated address space.
[0094] Specifically, for each first network interface card, if it is determined that the address space required by the OpROM of the first network interface card is smaller than the total address space, at least a portion of the total address space is allocated to the first network interface card. In other words, if the address space required by the first network interface card is larger than 128 KB, no address space is allocated to the network interface card.
[0095] S409: Determine a second network card and install the operating system through the second network card, where the second network card includes at least some network cards that can obtain the Internet Protocol IP sent by the PXE server.
[0096] In addition, the OpROMs of at least some of the network cards except the second network card may be uninstalled from the allocated address space to release the address space for installing other devices.
[0097] Figure 7 This is a specific process diagram for sequentially detecting network cards provided by an embodiment of the present application. Figure 7 As shown, the BIOS enumeration order is network card 1, network card 2...network card N. Specifically, there are but not limited to the following two solutions:
[0098] Solution 1: Detect at least one network card in sequence until it is determined that the first network card exists.
[0099] For example, first check network card 1. If network card 1 is not connected to the network (i.e., not connected to the network access device), then check whether network card 2 is connected to the network. If network card 2 is connected to the network, then stop checking the subsequent network cards, and network card 2 will be the first network card. Next, it can be determined whether the OpROM resource requirement of network card 2 is greater than the size of the total address space. If the determination result is no, at least part of the address space in the total address space is allocated to network card 2 to load the OpROM of network card 2. Then, it is determined whether network card 2 correctly obtains the IP address. If network card 2 cannot correctly obtain the IP address, the OpROM of network card 2 is uninstalled to free up address space to load the OpROM of a network card that can correctly obtain the IP address. If network card 2 can correctly obtain the IP address, then the startup continues.
[0100] Solution 2: Detect at least one network card in sequence to determine the first network card among the at least one network card.
[0101] For example, suppose you need to check the connection status of network cards 1, 2, and 3. First, check network card 1. If network card 1 is connected to the network, then check network card 2. If network card 2 is not connected to the network, then check whether network card 3 is connected to the network. If network card 3 is connected to the network, network card 1 and network card 3 are the first network cards. Next, determine in sequence whether the OpROM resource requirements of the network cards connected to the network are greater than the size of the total address space. If the OpROM resource requirements are less than the size of the total address space, then load these network cards. Then, determine in sequence whether the loaded network cards can correctly obtain IP addresses. Unload the OpROMs of the network cards that cannot correctly obtain IP addresses to free up address space for loading the OpROMs of the network cards that can correctly obtain IP addresses.
[0102] That is, in solution 1, when detecting the connection status of network cards one by one, as long as one network card is detected to be connected to the network access device, it can be determined whether the network card needs to be loaded. In solution 2, multiple network cards need to be detected one by one, and all network cards connected to the network access device need to be detected before determining whether they need to be loaded.
[0103] That is to say, if it is determined that all network cards are abnormal, then PXE startup fails. Network card abnormalities include all network cards not being connected to the network access device, that is, the first network card does not exist; or, when all network cards have completed polling, the IP is not correctly obtained, that is, the second network card does not exist. If it is determined that there is a second network card, that is, at least one network card can correctly obtain the IP, then continue to install the operating system based on PXE. Because when the network card in the server where the operating system is to be installed is communicated with a network access device such as a switch, the network access device and the PXE server / PXE server may or may not be communicated, the network card can only correctly obtain the IP sent by the PXE server when the network access device and the PXE server / PXE server are communicated. Therefore, it is also necessary to determine whether the network card that has been connected to the network can correctly obtain the IP sent by the PXE server.
[0104] Based on the methods in the above embodiments, embodiments of the present application provide a computing device comprising a motherboard and a chip. The chip is integrated on the motherboard and includes at least one memory for storing programs and at least one processor for executing the programs stored in the memory. When the programs stored in the memory are executed, the processor is configured to execute the methods in the above embodiments. In embodiments of the present application, the computing device may be a network device such as a server or a host.
[0105] Figure 8 This is a flowchart of another method for installing an operating system based on PXE provided in an embodiment of the present application. Figure 8 As shown, the method for installing an operating system based on PXE includes the following steps:
[0106] S801: The processor or basic input / output system BIOS determines to install the operating system in traditional boot mode and allocates a total address space. The total address space is the total address space that can be occupied by the OpROMs of the peripheral devices to be loaded. The peripheral devices include network card devices and non-network card devices. The network card devices include at least one network card.
[0107] S802: The processor or the basic input / output system BIOS determines to preferentially allocate address space to the OpROM of at least one network card when starting from PXE.
[0108] Specifically, the sum of the address space requirements of the OpROMs of the peripheral devices to be loaded is first determined; then, if it is determined that the sum of the address space requirements of the OpROMs of the peripheral devices to be loaded is greater than the size of the total address space, address space is preferentially allocated to the OpROM of at least one network card.
[0109] S803: The processor or basic input / output system BIOS sends a first message to the out-of-band controller or BMC system, where the first message is used to instruct the basic input / output system to preferentially allocate address space to the OpROM of at least one network card when starting from PXE in traditional boot mode.
[0110] S804: The out-of-band controller or the BMC system determines that there is at least one first network card, where the first network card includes a network card that is communicatively connected to a network access device, and the network access device is used to establish a communication connection with the PXE server.
[0111] Two exemplary solutions for determining the existence of at least one first network card can be found in the related introduction at S406 .
[0112] In addition, the out-of-band controller is further configured to determine that the first network card does not exist in the network cards, and then send a third message to the BIOS. The BIOS determines that the PXE-based installation of the operating system fails according to the third message.
[0113] S805: The out-of-band controller or the BMC system sends a second message to the basic input / output system. The second message includes identification information of at least one first network card. The identification information is used to uniquely identify the first network card.
[0114] S806: The processor or BIOS allocates at least part of the address space in the total address space to at least part of the network cards in the at least one first network card corresponding to the identification information, so as to load the OpROMs of at least part of the network cards in the allocated address space.
[0115] S807: Determine a second network card and install the operating system through the second network card, where the second network card includes at least some network cards that can obtain the Internet Protocol IP sent by the PXE server.
[0116] That is, if the processor or BIOS determines that at least one first network card can correctly obtain an IP address, that is, if a second network card exists, the operating system will continue to be installed based on PXE. If the processor or BIOS determines that there is no second network card, the operating system installation based on PXE fails.
[0117] In addition, an embodiment of the present application further provides a computing device, which includes a first memory for storing a BMC program and an out-of-band controller for executing the program stored in the first memory. When the program stored in the first memory is executed, the out-of-band controller is used to execute the above-mentioned S801, S802, S803, S806 and S807. The computing device also includes a second memory for storing a basic input and output system BIOS program and a processor for executing the program stored in the second memory. When the program stored in the second memory is executed, the processor is used to execute the above-mentioned S804 and S805. In addition, the computing device may also include peripheral devices. The peripheral devices include network card devices and non-network card devices, and the network card devices include at least one network card.
[0118] Furthermore, an embodiment of the present application also provides a communication system, which includes a PXE server, a network access device, and at least one of the above-mentioned computing devices, and the computing device is communicatively connected to the PXE server through the network access device.
[0119] It is understood that the processor in the embodiments of the present application may be a central processing unit (CPU), or may be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. The general-purpose processor may be a microprocessor or any conventional processor.
[0120] The method steps in the embodiments of the present application can be implemented by hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC.
[0121] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted via a computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state drive (SSD)).
[0122] It will be understood that the various numerical numbers involved in the embodiments of the present application are merely distinctions for the convenience of description and are not intended to limit the scope of the embodiments of the present application.
Claims
1. A method for installing an operating system based on PXE, applied to a computing device, characterized in that: The method comprises: Determining to install the operating system in a traditional boot mode, allocating a total address space, where the total address space is the total address space that can be occupied by OpROMs of peripheral devices to be loaded, the peripheral devices including network card devices and non-network card devices, and the network card devices including at least one network card; In a case where it is determined that address space is preferentially allocated to the OpROM of the at least one network card when booting from PXE, determining that there is at least one first network card, the first network card includes a network card communicatively connected to a network access device, and the network access device is used to establish a communication connection with the PXE server; allocating at least a portion of the address space in the total address space to at least a portion of the network cards in the at least one first network card, so as to load the OpROMs of the at least a portion of the network cards respectively in the allocated address space; A second network card is determined and an operating system is installed through the second network card, where the second network card includes a network card among the at least some network cards that can obtain the Internet Protocol IP sent by the PXE server.
2. The method for installing an operating system based on PXE according to claim 1, wherein: The determining that there is at least one first network card includes: Detecting a switch state of a connection indicator light of the network card, wherein the switch state of the connection indicator light includes an on state and an off state. In the on state, the network card is in communication connection with the network access device; in the off state, the network card is not in communication connection with the network access device; If the switch state of the connection indicator light of the network card is the on state, it is determined that the network card is the first network card; or, Obtaining a value of a register of the network card, the value of the register including a first value and a second value, the first value being used to indicate that a communication connection is established between the network card and the network access device, and the second value being used to indicate that no communication connection is established between the network card and the network access device; If the value of the register is the first value, it is determined that the network card is the first network card.
3. The method for installing an operating system based on PXE according to claim 1 or 2, characterized in that: The determining that there is at least one first network card includes: sequentially detecting the at least one network card until it is determined that the first network card exists; or, The at least one network card is detected in sequence to determine the first network card that exists in the at least one network card.
4. The method for installing an operating system based on PXE according to any one of claims 1 to 3, characterized in that: The method further comprises: Unload the OpROMs of the network cards other than the second network card in the at least part of the network cards from the allocated address space.
5. The method for installing an operating system based on PXE according to any one of claims 1 to 4, characterized in that: The method further includes: before determining that at least one first network card exists, determining that the total amount of address space required by the OpROM of the at least one network card is greater than the size of the total address space; and / or, Allocating at least part of the address space in the total address space to at least part of the at least one first network card includes: for each first network card, when it is determined that the size of the address space required by the OpROM of the first network card is smaller than the size of the total address space, allocating at least part of the address space in the total address space to the first network card.
6. The method for installing an operating system based on PXE according to any one of claims 1 to 5, characterized in that: The determining to preferentially allocate address space to the OpROM of the at least one network card when starting from PXE includes: Determining the sum of the address space requirements of the OpROMs of the peripheral devices to be loaded; When the sum of the address space requirements of the OpROMs of the peripheral devices to be loaded is greater than the size of the total address space, the address space is preferentially allocated to the OpROM of the at least one network card.
7. A method for installing an operating system based on PXE, applied to an out-of-band controller or a BMC system, characterized in that: The method comprises: receiving a first message sent by a basic input / output system, wherein the first message is used to instruct the basic input / output system to prioritize allocating address space to an OpROM of at least one network card when starting from a PXE in a traditional boot mode; Determining that there is at least one first network card, where the first network card includes a network card communicatively connected to a network access device, and the network access device is used to establish a communication connection with a PXE server; A second message is sent to the basic input / output system, where the second message includes identification information of each of the at least one first network card, where the identification information is used to uniquely identify the first network card. The second message is used to cause the basic input / output system to allocate at least a portion of the address space in the total address space to at least a portion of the at least one first network card corresponding to the identification information, so that the OpROMs of the at least some of the network cards are loaded within the allocated address space, and an operating system is installed through a second network card among the at least some of the network cards, where the second network card includes a network card among the at least some of the network cards that can obtain the Internet Protocol IP address sent by the PXE server.
8. A method for installing an operating system based on PXE, applied to a processor or a basic input and output system BIOS, characterized in that: The method comprises: Determining to install the operating system in a traditional boot mode, allocating a total address space, where the total address space is the total address space that can be occupied by OpROMs of peripheral devices to be loaded, the peripheral devices including network card devices and non-network card devices, and the network card devices including at least one network card; Determining to prioritize allocating address space to the OpROM of the at least one network card when booting from PXE, and sending a first message to an out-of-band controller or a BMC system, the first message being used to instruct the basic input and output system to prioritize allocating address space to the OpROM of the at least one network card when booting from PXE in a legacy boot mode; receiving a second message sent by the out-of-band controller or the BMC system, the second message including identification information of each of the at least one first network card, the identification information being used to uniquely identify the first network card, the first network card including a network card communicatively connected to a network access device, the network access device being used to establish a communication connection with a PXE server; allocating at least a portion of the address space in the total address space to at least a portion of the network cards in the at least one first network card corresponding to the identification information, so as to load the OpROMs of the at least a portion of the network cards in the allocated address space respectively; A second network card is determined and an operating system is installed through the second network card, where the second network card includes a network card among the at least some network cards that can obtain the Internet Protocol IP sent by the PXE server.
9. A computing device, characterized in that include: at least one memory for storing a program; At least one processor is configured to execute the program stored in the memory. When the program stored in the memory is executed, the processor is configured to execute the method according to any one of claims 1 to 6.
10. A computing device, characterized in that include: A first memory, used for storing a BMC program; an out-of-band controller, configured to execute the program stored in the first memory, wherein when the program stored in the first memory is executed, the out-of-band controller is configured to execute the method according to claim 7; and / or, The second memory is used to store a basic input and output system BIOS program; A processor is configured to execute the program stored in the second memory. When the program stored in the second memory is executed, the processor is configured to execute the method according to claim 8.
11. A communication system, characterized in that: include: PXE server and network access equipment; At least one computing device according to claim 9 or 10, wherein the computing device is communicatively connected to the PXE server through the network access device.
Citation Information
Patent Citations
Method for realizing online update of network card configuration file by server
CN105045627A
Method and system for configuring BMC IP addresses of bare metal servers, medium and device
WO2022148291A1