Method for acquiring topological information of hard disk in server and server
By reading the slot identification set of the hard disk backplane and the second identification information of the hard disk, the corresponding relationship between the hard disk and the hard disk backplane is determined, which solves the problem of obtaining and displaying the hard disk topology information in the existing technology, and realizes the server management platform Intuitive and convenient display of hard disk topology information reduces management costs.
Patent Information
- Application Number
- CN202410748981.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2024-09-24
AI Technical Summary
Existing server management systems cannot effectively obtain and display hard disk topology information, resulting in a lack of correlation between the management of hard disks and hard disk backplanes, which increases the time and cost for managers to understand and master hard disk topology information.
By reading the slot identification set and the second identification information of the hard disk from the inherent memory of the hard disk backplane, the corresponding relationship between the hard disk and the hard disk backplane is determined, and the hard disk topology information is output, combined with the slot layout information, to intuitively display Hard drive connection and configuration.
It simplifies the acquisition and display of hard disk topology information, reduces the time and cost for managers to understand and master hard disk topology information, and improves management efficiency.
Smart Images

Figure CN118689398A
Abstract
Description
Technical Field
[0001] The present application relates to the field of server management, and in particular to a method for obtaining hard disk topology information in a server and a server. Background Art
[0002] With the continuous development of computer technology, the internal structure of servers and storage devices is becoming increasingly complex. In particular, the use of hard disk backplanes makes the connection and management of hard disks more important. However, existing servers often manage hard disks and hard disk backplanes separately, that is, hard disk management and hard disk backplane management are not related, and it is impossible to see which hard disks are deployed on which hard disk backplane. Therefore, it is necessary to implement a simple and efficient method for obtaining hard disk topology information in the server, so as to display the hard disk topology information in the server more intuitively and conveniently in the server management platform. Summary of the invention
[0003] The embodiments of the present application provide a method for obtaining hard disk topology information in a server, a server, and a computing device, which can simply and efficiently obtain the correspondence between the hard disk backplane and the hard disk in the server, thereby intuitively and conveniently displaying the hard disk topology information in the server on the server management platform.
[0004] In a first aspect, an embodiment of the present application provides a method for obtaining hard disk topology information in a server, the method comprising: reading from the inherent memory of each in-place hard disk backplane respectively to obtain the slot identification set corresponding to each in-place hard disk backplane; the slot identification set includes the first identification information of the slot on the in-place hard disk backplane; performing query operations on each in-place hard disk respectively to obtain the second identification information of the slot where each in-place hard disk is located; based on the first identification information and the second identification information, determining the correspondence between each in-place hard disk and the in-place hard disk backplane; based on the correspondence, outputting the hard disk topology information; the hard disk topology information indicates the connection status and configuration status of multiple in-place hard disk backplanes and multiple in-place hard disks.
[0005] Therefore, by obtaining a slot identification set of multiple in-place hard disk backplanes and obtaining second identification information of the slots where the multiple in-place hard disks are located, the correspondence between each in-place hard disk and the in-place hard disk backplane is determined based on the second identification information and the first identification information of the slots on the in-place hard disk backplane included in the slot identification set, thereby outputting hard disk topology information, reducing the time and cost for managers to understand and master the hard disk topology information in the server.
[0006] In a possible implementation, outputting the hard disk topology information includes: acquiring slot layout information of each in-place hard disk backplane from a preset template of the server; combining the corresponding relationship with the slot layout information, and outputting the hard disk topology information.
[0007] Thus, hard disk topology information including the corresponding relationship and slot layout information can be obtained.
[0008] In a possible implementation, the method further includes: in response to a query request issued by a management platform of the server, providing hard disk topology information to the management platform for display.
[0009] As a result, the hard disk topology information in the server can be displayed intuitively and conveniently on the server management platform.
[0010] In a possible implementation, the method also includes: reading from an inherent memory to obtain basic information of each in-place hard disk backplane; the basic information of the in-place hard disk backplane includes at least one of the following: the name, manufacturer, interface type, PCB version, and board ID of the hard disk backplane; providing hard disk topology information to the management platform includes: providing the hard disk topology information and basic information of the in-place hard disk backplane to the management platform for combined display.
[0011] Therefore, the hard disk topology information and the basic information of the hard disk backplane in place can be displayed on the server management platform.
[0012] In a possible implementation, the query operation also returns basic information of each in-place hard disk; the basic information of the in-place hard disk includes at least one of the following: hard disk model, serial number, capacity, manufacturer, interface type, and in-place status; providing hard disk topology information to the management platform includes: providing the hard disk topology information and basic information of the in-place hard disk to the management platform for combined display.
[0013] Thus, the hard disk topology information in the server and the basic information of the hard disks in place can be displayed on the server management platform.
[0014] In a possible implementation, the method is executed for an out-of-band management platform; obtaining second identification information of the slot where each in-place hard disk is located includes: using a baseboard management controller BMC integrated in a server to traverse each in-place hard disk, and using the BMC to perform a first query operation based on the IPMI protocol for the traversed current in-place hard disk to obtain the second identification information of the slot where the current in-place hard disk is located; the first query operation includes a first hard disk identifier pre-assigned by the BMC to the current in-place hard disk, and the first query operation is used to query the in-place hard disk represented by the first hard disk identifier.
[0015] Thus, the second identification information of the slot where each hard disk is located can be obtained out-of-band on the server.
[0016] In a possible implementation, the inherent memory of each in-place hard disk backplane is read separately to obtain the name of each in-place hard disk backplane; the corresponding relationship is the corresponding relationship between the first hard disk identifier of each in-place hard disk and the name of the in-place hard disk backplane.
[0017] Thus, each in-place hard disk can be matched with an in-place hard disk backplane out of the server band.
[0018] In a possible implementation, the method is executed for an in-band management platform; obtaining second identification information of the slot where each in-place hard disk is located includes: using an operating system to traverse each in-place hard disk, and using the operating system to light up an indicator light of the currently in-place hard disk for the traversed hard disk, so that the currently in-place hard disk enters a lit state; using an out-of-band management tool supported by the operating system to send an out-of-band query instruction to a baseboard management controller BMC integrated in the server, so as to obtain the second identification information of the slot where the currently in-place hard disk is located; the out-of-band query instruction is used to instruct the BMC to execute a second query operation based on the IPMI protocol, and the second query operation is used to query the in-place hard disk that has entered a lit state; using the operating system to turn off the indicator light, so that the currently in-place hard disk enters a non-lit state.
[0019] Thus, the second identification information of the slot where each hard disk is located can be obtained in the server band.
[0020] In a possible implementation, the inherent memory of each in-place hard disk backplane is read separately to obtain the name of each in-place hard disk backplane; the corresponding relationship is the relationship between the second hard disk identifier assigned by the operating system to each in-place hard disk and the name of the in-place hard disk backplane.
[0021] Thus, each in-place hard disk can be matched with an in-place hard disk backplane within the server band.
[0022] In a second aspect, an embodiment of the present application provides a server, including:
[0023] at least one memory for storing a program;
[0024] At least one processor is used to execute a program stored in a memory. When the program stored in the memory is executed, the processor is used to execute the method described in any possible implementation manner of the first aspect.
[0025] In a third aspect, an embodiment of the present application provides a computing device, including:
[0026] at least one memory for storing a program;
[0027] At least one processor is used to execute a program stored in a memory. When the program stored in the memory is executed, the processor is used to execute the method described in any possible implementation manner of the first aspect.
[0028] In a fourth 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 described in any possible implementation of the first aspect.
[0029] In a fifth 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 described in any possible implementation of the first aspect.
[0030] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0032] Figure 1 A system architecture diagram for obtaining hard disk topology information in a server provided in an embodiment of the present application;
[0033] Figure 2 A schematic diagram of a method for obtaining hard disk topology information in a server provided in an embodiment of the present application;
[0034] Figure 3 A schematic diagram of obtaining information about an in-place hard disk backplane provided in an embodiment of the present application;
[0035] Figure 4 A schematic diagram of obtaining in-place hard disk information provided by an embodiment of the present application;
[0036] Figure 5 A diagram showing hard disk topology information in a server provided in an embodiment of the present application;
[0037] Figure 6 A schematic diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0039] In the description of the embodiments of the present application, any embodiment or design scheme of "exemplary", "for example" or "for example" should not be understood as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "for example" or "for example" is intended to present related concepts in a specific way.
[0040] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized. "At least one" can be one or more, where a plurality is two or more.
[0041] The management of the network on the server can be divided into out-of-band management and in-band management. Out-of-band management is achieved by connecting to the server using a network card or a dedicated management port (such as BMC, DRAC, i L0, etc.) to achieve remote management and monitoring of the server. In-band management refers to management software running on the server itself, such as network management software, which can achieve management and monitoring of the server through the program application interface (Tel net, SSH, Web) provided by the operating system.
[0042] Regardless of whether in-band or out-of-band management is used, in existing servers, hard disks and hard disk backplanes are often managed separately, that is, hard disk management and hard disk backplane management are not associated, and it is impossible to see which hard disks are deployed on which hard disk backplane. Therefore, it is necessary to implement a method for obtaining hard disk topology information in the server on the server, so as to further display the hard disk topology information intuitively and conveniently in the server management platform.
[0043] In view of this, an embodiment of the present application obtains a slot identification set of multiple in-place hard disk backplanes, and obtains second identification information of the slots where the multiple in-place hard disks are located, and based on the second identification information and the first identification information of the slots on the in-place hard disk backplane included in the slot identification set, determines the correspondence between each in-place hard disk and the in-place hard disk backplane, thereby outputting hard disk topology information, reducing the time and cost for managers to understand and master the hard disk topology information in the server.
[0044] For example, Figure 1 A system architecture diagram for obtaining hard disk topology information in a server provided in an embodiment of the present application is shown in FIG.
[0045] like Figure 1As shown, the system includes a server, and an in-band monitoring terminal and / or an out-of-band monitoring terminal for monitoring the server, and the management platform of the server includes an in-band management platform and / or an out-of-band management platform. Among them, the in-band management platform is deployed on the in-band monitoring terminal, and the out-of-band management platform is deployed on the out-of-band monitoring terminal. The in-band management platform is connected to the server through a network interface, and the out-of-band management platform is connected to the server through an out-of-band interface (such as LAN, etc.).
[0046] For the server, at the software level, the server includes an operating system for in-band management. The operating system provides a system interface for multiple hardware deployed on the server motherboard for information exchange, and provides an application interface for the application layer software to support the application software to operate multiple hardware.
[0047] At the hardware level, a BMC for out-of-band management is also deployed on the server motherboard. BMC, or baseboard management controller, is a small operating system independent of the server main system. It has independent firmware and is responsible for BMC initialization, peripheral hardware drivers, and command parsing. It does not rely on the server's processor, memory, or operating system, but can interact with them. After the server is powered on, the BMC is responsible for managing all components of the server, including temperature, power consumption, system status monitoring, and remote power on and off.
[0048] BMC can be integrated on the server motherboard or embedded on the motherboard through a high-density connector. It communicates with the out-of-band monitoring terminal through the out-of-band interface. In the server band, the operating system can access out-of-band information through the system interface, such as sending a query command to the BMC. After receiving and parsing the query command, the BMC will execute the query command and return the corresponding query result.
[0049] In this embodiment, the server operating system is CentOS, which can provide an OpenIPMI system interface that supports the IPMI (Intelligent Platform Management Interface) protocol to implement information interaction between the operating system and the BMC in the server band. The IPMI protocol is a hardware management protocol that can remotely manage and monitor computer systems. It can be implemented through the BMC to provide support for server hardware monitoring, remote control, event logging, remote virtual media, and security management.
[0050] There are many out-of-band management tools based on the IPMI protocol, such as IPMITool, IPMICFG, OpenIPMI, FreeIPMI, etc. In this embodiment, the application software IPMITool is installed on the server to realize the function of obtaining BMC management information in the server band. Specifically, in the server band, the out-of-band management tool IPMITool and the OpenOPMI system interface provided by CentOS can be used to realize information interaction with BMC. For example, first, IPMITool issues an IPMI query instruction to any hardware on the server; secondly, the operating system receives the IPMI query instruction through the application interface, and sends the IPMI query instruction to BMC through the OpenOPMI system interface; then, BMC parses the received IPMI query instruction and queries the management information of any hardware according to the IPMI query instruction; finally, BMC returns the corresponding query result to IPMITool according to the original path. Among them, server in-band refers to the system managed by the server operating system. Correspondingly, server out-of-band refers to the system managed by BMC.
[0051] Out-of-band on the server, the BMC can manage multiple in-place hard disk backplanes deployed on the server motherboard through the I2C interface. On each in-place hard disk backplane, an inherent memory (such as an EEPROM memory) is also deployed, and the slot identification set and basic information of the hard disk backplane can be stored in the inherent memory. The slot identification set includes the first identification information of the slot on the in-place hard disk backplane. The basic information of the in-place hard disk backplane includes at least one of the following: the name, manufacturer, interface type, PCB version, and board ID of the hard disk backplane. The first identification information is information related to the slot and stored in the inherent memory of the in-place hard disk backplane, and is unique in the server, such as the slot number and / or slot identification assigned to the slot in the server.
[0052] The BMC can also manage multiple in-place hard disks deployed on the in-place hard disk backplane through the IPMI protocol. Since the IPMI protocol also provides a set of command line tools, query operations on all hardware of the server can be performed through the command line interface. Therefore, the BMC can obtain the slot information of the slot where the in-place hard disk is located, as well as the basic information of the in-place hard disk through the IPMI protocol command line. Specifically, the IPMI protocol command line is used to read the records of the sensor that monitors the in-place hard disk to obtain the second identification information of the slot where the in-place hard disk is located and the basic information of the hard disk. The basic information of the in-place hard disk includes at least one of the following: the model, serial number, capacity, manufacturer, interface type, and in-place status of the hard disk. The second identification information is information related to the slot where the in-place hard disk is located, which is obtained by the BMC and is unique in the server, such as the slot number and / or slot identification assigned to the slot in the server.
[0053] For the in-band monitoring terminal or the out-of-band monitoring terminal, it can be a general PC that does not include a BMC, and the operating system installed on the PC does not need to support the IPMI protocol. For the in-band management platform or the out-of-band management platform, it represents a series of monitoring and control functions, and the monitored object is the hardware in the server. For example, the administrator can use the server in-band management platform to issue various query instructions to the server through the network interface, such as query instructions for the status and indicator information of the monitored hardware in the server, and receive the query results through the network interface and display them in the display area of the in-band management platform. It can be understood that the out-of-band management platform also has similar functions, which will not be repeated.
[0054] In this embodiment, the server can use the BMC to obtain the slot identification set of the hard disk backplane in place and the hard disk backplane information, and the slot identification set includes the first identification information of the slot on the hard disk backplane in place. The BMC can also be used to obtain the second identification information of the slot where the hard disk in place is located. Since the information included in the first identification information and the second identification information is unique in the server, the corresponding relationship between each hard disk in place and the hard disk backplane in place can be determined based on the first identification information and the second identification information, thereby obtaining the hard disk topology information in the server.
[0055] Based on this, the in-band management platform or the out-of-band management platform can be used to respond to the query request sent by the management platform of the server and provide the management platform with the information that has been sent according to the query request. Figure 1 The hard disk topology information obtained by the method can be output and displayed; or it can also respond to the query request issued by the management platform of the server, according to the above Figure 1 The method described above obtains the hard disk topology information in the server and provides the hard disk topology information to the management platform for output and display. The specific method is not limited here. Thus, the time and cost of the management personnel to understand and master the hard disk topology information in the server can be reduced.
[0056] Based on the description in the above embodiment, a method for obtaining hard disk topology information in a server provided in an embodiment of the present application is described in detail below.
[0057] For example, Figure 2 FIG. 4 is a schematic diagram of a method for obtaining hard disk topology information in a server provided by an embodiment of the present application. Figure 2 As shown, the method for obtaining hard disk topology information in a server includes the following steps:
[0058] Step S201, respectively read out the slot identification set corresponding to each in-place hard disk backplane from the inherent memory of each in-place hard disk backplane, wherein the slot identification set includes the first identification information of the slot on the in-place hard disk backplane.
[0059] In this embodiment, the server includes multiple in-place hard disk backplanes and multiple in-place hard disks, and is integrated with a baseboard management controller BMC. Multiple hard disk backplanes of the scale and model specified by its factory settings can be deployed on the server motherboard. The in-place hard disk backplane is a hard disk backplane that can be detected by the server's operating system after the server motherboard is powered on.
[0060] like Figure 1 As shown, each on-site hard disk backplane is deployed with an inherent memory (such as EEPROM), and the BMC can manage multiple on-site hard disk backplanes of the server through the l2C interface.
[0061] Exemplarily, the BMC can be used to traverse each hard disk backplane in the server to read the slot identification set of each hard disk backplane in place and the basic information of the hard disk backplane in place from the inherent memory of each hard disk backplane in place. The basic information of the hard disk backplane in place includes at least one of the following: the name, manufacturer, interface type, PCB version, and single board ID of the hard disk backplane.
[0062] Specifically, if Figure 2 The method is executed for an out-of-band management platform, and can use the BMC to initiate the reading of the EEPROM of each in-place hard disk backplane, so as to read the basic information of the in-place hard disk backplane and the slot identification set of the in-place hard disk backplane. The slot identification set includes the first identification information of the slot on the in-place hard disk backplane. The first identification information is information related to the slot and unique in the server, which is stored in the inherent memory of the in-place hard disk backplane, including the slot number and / or slot identification assigned to the slot in the server.
[0063] For example, if Figure 2 The method is executed for the in-band management platform, and the out-of-band management tool IPMITool in the server can be used to send IPMI instructions to the BMC to obtain the basic information and slot identification set of each hard disk backplane in place. The operating system receives the IPMI instruction through the application interface, and sends the IPMI instruction to the BMC through the IPMI system interface, so that the BMC reads the basic information of the hard disk backplane in place and the slot identification set of the hard disk backplane in place from the EEPROM of each hard disk backplane in place. The BMC then returns the content read from the EEPROM to the operating system in the original path. In this way, the management information of the BMC managing the hard disk backplane in place can be obtained in the server band.
[0064] Step S202: perform query operations on each in-situ hard disk respectively to obtain second identification information of the slot where each in-situ hard disk is located.
[0065] In this embodiment, each in-place hard disk backplane of the server can be deployed with hard disks of the size and model specified by the factory settings. An in-place hard disk is a hard disk that can be detected by the server's operating system after the server mainboard is powered on. The BMC can be used to query each in-place hard disk based on the IPMI protocol to obtain the second identification information of the slot where each in-place hard disk is located. The second identification information is information obtained by the BMC that is related to the slot where the in-place hard disk is located and is unique in the server, such as the slot number and / or slot identification assigned to the slot in the server.
[0066] For example, if Figure 2 The method is performed for an out-of-band management platform, and the BMC can perform a query based on the IPMI protocol through an IPMI protocol command line. For example, the BMC can use the command line: ipmitool sdr list or ipmitoolsdr type Drive to list all information of all hard disks on the server, including serial numbers, temperatures, states, etc. Or use the command line ipmitool sdr list |grep-i′disk\|physical drive\|drive position′ to view relevant information of a specific hard disk ′i′. This command line will output information containing the keywords “physical drive” or “drive position”.
[0067] Outside the server band, the BMC pre-assigns a corresponding hard disk ID to each hard disk in place, and manages and maintains these hard disk IDs.
[0068] In one implementation, the BMC can be used to initiate a traversal of each hard disk in the server. For the traversed hard disk currently in place, the BMC is used to perform a first query operation based on the IPMI protocol to obtain the second identification information of the slot where the hard disk currently in place is located, as well as the basic information of the hard disk in place. The basic information of the hard disk in place includes at least one of the following: the model, serial number, capacity, manufacturer, interface type, and in-place status of the hard disk. The first query operation includes a first hard disk identification pre-assigned by the BMC to the hard disk currently in place, and the first query operation is used to query the hard disk in place represented by the first hard disk identification.
[0069] Specifically, when the BMC executes the first query operation based on the IPMI protocol, it can initiate an information query for the currently in-place hard disk represented by the first hard disk identifier by executing the first IPMI protocol command line with the first hard disk identifier as a parameter, thereby obtaining the second identifier information of the slot where the currently in-place hard disk is located, as well as the basic information of the in-place hard disk.
[0070] In another implementation, the BMC can execute a second IPMI protocol command line that queries the information of all hard disks on the server to output all information of all hard disks in place, and then filter the output result based on the first hard disk identifier pre-assigned by the BMC to the currently in-place hard disk, and find and obtain the second identifier information of the slot where the currently in-place hard disk is located and records related to the basic information of the currently in-place hard disk.
[0071] For example, if Figure 2 The method is performed for the in-band management platform. Since the BMC cannot identify the second hard disk identifier assigned by the operating system to the in-place hard disk, the in-place hard disk can be matched between the server in-band and the server out-band by lighting the hard disk. The server in-band refers to the system managed by the server operating system. Correspondingly, the server out-band refers to the system managed by the BMC.
[0072] In one implementation, the operating system is used to traverse each hard disk in place, and for the hard disk currently in place that is traversed, the operating system is used to light up the indicator light of the hard disk currently in place, so that the hard disk currently in place enters a lit state. An out-of-band management tool supported by the operating system, such as IPMITooL, is used to send an out-of-band query instruction to the BMC to obtain the second identification information of the slot where the hard disk currently in place is located. The out-of-band query instruction is used to instruct the BMC to execute a second query operation based on the IPMI protocol, and the second query operation is used to query the hard disk in place that has entered a lit state. Finally, the operating system is used to turn off the indicator light to put the hard disk currently in place into a non-lit state.
[0073] Specifically, when the BMC executes the second query operation based on the IPMI protocol, it can initiate an information query for the currently in-place hard disk that has entered the lit state by executing a second IPMI protocol command line with the indicator light state of the in-place hard disk as a parameter, thereby obtaining the second identification information of the slot where the currently in-place hard disk is located, as well as the basic information of the in-place hard disk.
[0074] Step S203: Determine the correspondence between each in-place hard disk and the in-place hard disk backplane based on the first identification information and the second identification information.
[0075] In this embodiment, the corresponding relationship is the relationship between each in-situ hard disk and the in-situ hard disk backplane including the slot where each in-situ hard disk is located.
[0076] Since the first identification information and the second identification information are unique in the server, the above correspondence can be determined by matching the acquired first identification information and the second identification information.
[0077] For example, if Figure 2The method is executed for an out-of-band management platform, and uses the BMC to read the inherent memory of each in-place hard disk backplane and obtain the name of each in-place hard disk backplane. Furthermore, the corresponding relationship can be expressed as the relationship between the first hard disk identifier of each in-place hard disk and the name of the in-place hard disk backplane.
[0078] For example, if Figure 2 The method is executed for the in-band management platform, and the BMC is used to read the inherent memory of each in-place hard disk backplane and obtain the name of each in-place hard disk backplane. Further, the corresponding relationship can be expressed as the relationship between the second hard disk identifier pre-assigned by the operating system to each in-place hard disk and the name of the in-place hard disk backplane.
[0079] Step S204: output hard disk topology information based on the corresponding relationship. The hard disk topology information indicates the connection and configuration of multiple hard disk backplanes and multiple hard disks in place.
[0080] In this embodiment, the hard disk topology information in the server includes the corresponding relationship and the slot layout information of each hard disk backplane in place obtained from the preset template of the server. The hard disk topology information indicates the connection and configuration of multiple hard disk backplanes in place and multiple hard disks in place.
[0081] Exemplarily, different preset templates can be written for servers of different models, and the preset templates include slot layout information of multiple hard disk backplanes of different models of servers of specified scales and models in factory settings, such as whether the hard disks in place are in a horizontal or vertical format. The slot layout information of each hard disk backplane in place can be obtained from the preset template of the server, and the slot layout information and the corresponding relationship obtained from step S203 are combined to obtain the connection status of multiple hard disk backplanes in place and multiple hard disks in place.
[0082] Furthermore, for the correspondence obtained from step S203, all on-site hard disks corresponding to each on-site hard disk backplane can be matched based on the correspondence between the first or second hard disk identifier of each on-site hard disk and the name of the on-site hard disk backplane, thereby obtaining the hard disk topology information of each on-site hard disk backplane, and the hard disk topology information in the server is composed of the hard disk topology information of all on-site hard disk backplanes.
[0083] In some embodiments, in response to a query request sent by a management platform of the server, hard disk topology information may be provided to the management platform for display. Figure 1 An in-band management platform or an out-of-band management platform for the server shown.
[0084] Optionally, the basic information of each hard disk backplane in place can be obtained by reading the inherent memory of each hard disk backplane in place using BMC. The basic information of the hard disk backplane in place includes at least one of the following: the name, manufacturer, interface type, PCB version, and board ID of the hard disk backplane. Therefore, when the management platform requests to display the hard disk topology information of each hard disk backplane in place, the configuration of the hard disk backplane in place can also be provided to the management platform for combined display.
[0085] Optionally, the BMC is used to query each hard disk in place and obtain basic information of each hard disk in place. The basic information of the hard disk in place includes at least one of the following: hard disk model, serial number, capacity, manufacturer, interface type, and in-place status. Therefore, when the management platform requests to display the hard disk topology information of each hard disk backplane in place, the configuration of the hard disk in place can also be provided to the management platform for combined display.
[0086] This can reduce the time and cost for managers to understand and master the hard disk topology information in the server, and improve the monitoring efficiency of the system.
[0087] The following will be combined Figure 3 and Figure 4 The embodiments in Figure 2 The code implementation process of the method is described in detail:
[0088] For example, Figure 3 FIG. 4 is a schematic diagram of obtaining information about an in-place hard disk backplane provided by an embodiment of the present application. Figure 3 As shown in the figure, the process of obtaining the information of the hard disk backplane in place mainly includes the following steps:
[0089] Step S301, initializing the hard disk backplane template.
[0090] In this embodiment, hard disk backplane templates are initialized for different models of servers produced by server manufacturers. The hard disk backplane template includes hard disk backplane attribute categories of configurable hard disk backplanes that match the server models. For servers of different models, the scales and models of hard disk backplanes that can be deployed on the server motherboard are different. The hard disk backplane attribute categories include various attribute categories of hard disk backplanes of different scales and models, such as "Position", which can be used to indicate the position attribute of the hard disk backplane, "InsertionType", which can be used to indicate the hard disk insertion type, "SilkScreen", which can be used to indicate the hard disk slot identification, etc.
[0091] Exemplarily, the initialized hard disk backplane template is saved as a different template file, for example, saved as a template file named DiskTopology.ini.
[0092] Step S302, loading the hard disk backplane template according to the server model.
[0093] In this embodiment, Figure 1 After the monitored server shown is powered on, the server model is obtained, and the corresponding DiskTopology.ini template file is loaded according to the server model.
[0094] Optionally, the template file includes a layout of slots in each hard disk backplane in place.
[0095] Step S303, obtaining hard disk backplane attributes and hard disk backplane basic information on the server.
[0096] In this embodiment, multiple hard disk backplanes can be deployed on the server. For the hard disk backplanes in place, the method described in step S301 can be used to use the BMC to interact with the I2C interface provided by each hard disk backplane in place to obtain the slot identification set and basic information of the hard disk backplanes of each of the multiple hard disk backplanes in place in the server.
[0097] The basic information of the hard disk backplane includes the name, manufacturer, interface type, PCB version, and board ID of the hard disk backplane. The slot identification set includes the first identification information of the slot on the hard disk backplane.
[0098] Step S304, creating a hard disk backplane object for the in-place hard disk backplane.
[0099] In this embodiment, multiple hard disk backplanes can be deployed on the server. For the hard disk backplanes in place, a hard disk backplane object is created for each hard disk backplane in place, such as hard disk backplane objects DiskBPObj.1 and DiskBPObj.2, which respectively refer to different hard disk backplanes.
[0100] Step S305, initializing the hard disk backplane object properties according to the hard disk backplane template and the hard disk backplane properties.
[0101] In this embodiment, hard disk backplane objects DiskBPObj.1, DiskBPObj.2, etc. are configured based on the hard disk backplane properties and the hard disk backplane template DiskTopology.ini, and are saved in the global dictionary.
[0102] Exemplarily, the hard disk backplane attribute category included in the hard disk backplane template DiskTopology.ini is used to initialize the corresponding object attributes for the hard disk backplane object DiskBPObj.1, and the corresponding object attributes in DiskBPObj.1 are assigned values according to the hard disk backplane attributes.
[0103] Taking Python language under Linux operating system as an example, the program code for assigning values to some object attributes of DiskBPObj.1, such as position and layout, is as follows:
[0104]
[0105]
[0106] The information included in the above program code can be expressed as:
[0107]
[0108]
[0109] Among them, the object elements in the hard disk backplane object DiskBPObj.1: the hard disk object disk_info are all initialized to not in place: [NI], and the "1", "2", etc. in the hard disk object disk_info are the slot numbers assigned by the server to the slots in the in-place hard disk backplane "BC13NHBH" corresponding to DiskBPObj.1. The slot numbers "1" to "12" are the first identification information included in the slot identification set corresponding to the in-place hard disk backplane "BC13NHBH".
[0110] Step S306, saving the hard disk backplane object in the global dictionary.
[0111] In this embodiment, the hard disk backplane objects DiskBPObj.1, DiskBPObj.2, etc. configured in step S305 are saved in the global dictionary.
[0112] Exemplarily, a global dictionary variable disk_backplane_dict is set in the program code, and its data structure is as follows:
[0113]
[0114] Among them, "BC13NHBH", "BC13NHBB" and so on represent the names of the hard disk backplanes, and DiskBPObj.1, DiskBPObj.2 and so on are the hard disk backplane objects corresponding to the hard disk backplanes.
[0115] For example, Figure 4 FIG. 4 is a schematic diagram of obtaining in-place hard disk information provided by an embodiment of the present application. Figure 4 As shown, based on the second identification information of the slot where the hard disk is located and the basic information of the hard disk in place obtained by using the BMC in step S202, the process of filling the hard disk information in place in the global dictionary obtained in step S306 mainly includes the following steps:
[0116] Step S401, traverse the hard disks in place on the server.
[0117] In this embodiment, the server operating system may determine multiple in-place hard disks on the server, and set one-to-one corresponding second hard disk identifiers for the multiple in-place hard disks and save them in the in-place hard disk list.
[0118] Optionally, based on the second hard disk identifier in the in-place hard disk list, the in-place hard disks on the server are traversed.
[0119] Step S402, obtaining second identification information of the slot where the hard disk is located.
[0120] In this embodiment, for the currently in-situ hard disk that has been traversed, the second identification information of the slot where the currently in-situ hard disk is located is obtained according to the method shown in step S302.
[0121] Step S403, loading the hard disk backplane object.
[0122] In this embodiment, the hard disk backplane objects DiskBPObj.1 and DiskBPObj.2 in the global dictionary are loaded.
[0123] Step S404, obtaining a slot identification set in the hard disk backplane object.
[0124] In this embodiment, since the first identification information of the slots in each hard disk backplane object has been saved in the hard disk object disk_info in step S305, the first identification information of the slots in each hard disk backplane object can be obtained according to the loaded hard disk backplane objects DiskBPObj.1 and DiskBPObj.2. For example, in step S405, the slot number "SilkScreen" configured by the server for the hard disk backplane object DiskBPObj.1 of the hard disk backplane "BC13NHBH" is Start: "1", End: "12", that is, the first identification information included in the slot identification set corresponding to the hard disk backplane "BC13NHBH" is "1" to "12".
[0125] Step S405: determine whether the second identification information is in the slot identification set of the hard disk backplane object.
[0126] In this embodiment, since the first identification information included in the slot identification set corresponding to each in-place hard disk backplane deployed in the server is unique in the server, for example, the first identification information included in the slot identification set corresponding to the hard disk backplane object DiskBPObj.1 is "1" to "12", and the first identification information included in the slot identification set corresponding to the hard disk backplane object DiskBPObj.2 can be "13" to "24", and so on.
[0127] Therefore, the second information identifier of the slot where the currently in-place hard disk is located can be matched with the first identification information included in the slot identification set of the in-place hard disk backplane corresponding to the hard disk backplane objects DiskBPObj.1, DiskBPObj.2, etc. in the global dictionary, so as to determine the hard disk backplane object including the second information identifier of the slot where the currently in-place hard disk is located from the hard disk backplane object in the global dictionary, and the in-place hard disk backplane represented by the matched hard disk backplane object is the corresponding in-place hard disk backplane. And establish the corresponding relationship between the traversed currently in-place hard disk and the corresponding in-place hard disk backplane.
[0128] If the match fails, go to step S407 to determine whether the traversal of the hard disks on the server is complete. If "yes", end the process. If "no", determine the next hard disk in the hard disk list until all the hard disks in the hard disk list are traversed.
[0129] Step S406, parse the basic information of the hard disk and save it into the global dictionary variable.
[0130] In this embodiment, Figure 1 The BMC shown obtains and saves basic information of the hard disk in place on the server, where the basic information of the hard disk in place includes at least one of the following: hard disk model, serial number, capacity, manufacturer, interface type, and in-place status.
[0131] Exemplarily, the parsed basic information of the hard disk in place may be filled into the disk_backplane_dict global variable according to the association relationship between the traversed currently in-place hard disk and the corresponding in-place hard disk backplane.
[0132] Taking Python language under Linux operating system as an example, the program code after filling some basic hard disk information for the hard disk object disk_info of DiskBPObj.1 is as follows:
[0133] disk_info={
[0134] "1": {"model": "OST1200MM0009", "serialNumber": "8WFK2P8654JNL, "state": "UG"},
[0135] "2": {"model": "OST1200MM0009", "serialNumber": "7WFK2P8659JNL, "state": "G"},
[0136] "3": [NI], "4": [NI], "5": [NI], "6": [NI], "7": [NI], "8": [NI],
[0137] "9": [NI], "10": [NI], "11": [NI], "12": [NI],
[0138] }
[0139] Among them, "1"~"12" is the first identification information included in the slot identification set of the in-place hard disk backplane corresponding to the corresponding DiskBPObj.1. For example, in the above code, in slot "1", some basic information of the current in-place hard disk has been filled, including "model" is "OST1200MM0009", "serial Number" is "8WFK2P8654JNL", "state" is "UG", "UG" indicates that the in-place hard disk is in-place state Ungood, and "G" indicates that the in-place hard disk is in-place running state Good.
[0140] Step S407, determining whether the traversal of the hard disks in place on the server is complete.
[0141] In this embodiment, it is determined whether the traversal of the hard disks in place on the server is completed. If "yes", the process is terminated. If "no", the next hard disk in place in the hard disk list is determined until all the hard disks in place in the hard disk list are traversed.
[0142] For example, Figure 1 The in-band monitoring terminal or out-of-band monitoring terminal shown can read the hard disk topology information of each in-place hard disk backplane stored in the global dictionary of the server through the network interface or the out-of-band interface respectively, and obtain the hard disk topology information in the server from the hard disk topology information of all in-place hard disk backplanes.
[0143] For example, Figure 5 FIG. 1 shows a display diagram of hard disk topology information in a server provided by an embodiment of the present application. Figure 5 As shown, for the hard disk backplane "BC13NHBH", it is displayed according to the information included in the hard disk backplane object DiskBPObj.1.
[0144] Optionally, the hard disk topology information of the hard disk backplane "BC13NHBH" is displayed in the display area of the server management platform, such as displaying slots with slot numbers "1" to "12" and hard disks deployed in the slots with slot numbers "1" to "12". Among them, "NI" indicates that there is currently no hard disk in the slot.
[0145] Optionally, basic information of the hard disk backplane "BC13NHBH" is displayed in the display area of the server management platform, such as the name, manufacturer, interface type, PCB version, and board ID of the hard disk backplane.
[0146] Optionally, according to the layout of each slot in DiskBPObj.1 (for example, "InsertionType": "Horizontal", "Row": 3, "Column": 4), the basic information of the hard disks in place with slot numbers "1" to "12" can be displayed in the display area. The basic information of the hard disks in place includes the model, serial number, capacity, manufacturer, interface type, and in-place status of the hard disk.
[0147] Therefore, the hard disk topology information in the server can be displayed intuitively and conveniently on the server display platform, thereby improving the monitoring efficiency of the system.
[0148] It is understandable that the size of the sequence number of each step in the above embodiment does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application. In addition, in some possible implementations, each step in the above embodiment can be selectively executed according to actual conditions, and can be partially executed or fully executed, which is not limited here. In addition, all or part of any feature in the above embodiment can be freely and arbitrarily combined without contradiction. The combined technical solution is also within the scope of the present application.
[0149] Based on the method in the above embodiment, the embodiment of the present application provides a server. Figure 6 As shown, the server 1000 includes: a bus 1002, a processor 1004, a memory 1006 and a communication interface 1008. The processor 1004, the memory 1006 and the communication interface 1008 communicate with each other through the bus 1002. It should be understood that the embodiment of the present application does not limit the number of processors and memories in the server 1000.
[0150] The bus 1002 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6The bus 1004 is represented by only one line, but it does not mean that there is only one bus or one type of bus. The bus 1004 may include a path for transmitting information between various components of the server 1000 (for example, the memory 1006, the processor 1004, and the communication interface 1008).
[0151] The processor 1004 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0152] The memory 1006 may include a volatile memory, such as a random access memory (RAM). The processor 1004 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
[0153] The memory 1006 stores executable program codes, and the processor 1004 executes the executable program codes to implement all or part of the steps of the method in the above embodiment. That is, the memory 1006 stores instructions for executing all or part of the steps of the method in the above embodiment.
[0154] Alternatively, the memory 1006 stores executable codes, and the processor 1004 executes the executable codes to implement all or part of the steps in the above-mentioned embodiment method. That is, the memory 706 stores instructions for executing all or part of the steps in the above-mentioned embodiment method.
[0155] The communication interface 1008 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the server 1000 and other devices or communication networks.
[0156] Based on the method in the above embodiment, the embodiment of the present application provides a computing device, and the computing device includes a motherboard and a chip. Among them, the chip is integrated on the motherboard, and the chip includes at least one memory for storing programs; at least one processor, the memory can be a central processing unit CPU or a baseboard management controller BMC, for executing the program stored in the memory, and when the program stored in the memory is executed, the processor is used to execute the method in the above embodiment. In the embodiment of the present application, the computing device can be a network device such as a server and a host. The method steps in the embodiment of the present application can be implemented by hardware, or by the processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in random access memory (random access memory, RAM), flash memory, read-only memory (read-only memory, ROM), programmable read-only memory (programmable rom, PROM), erasable programmable read-only memory (erasable PROM, EPROM), electrically erasable programmable read-only memory (electrically EPROM, EEPROM), register, hard disk, mobile hard disk, CD-ROM 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 an integral part of the processor. The processor and the storage medium can be located in an ASIC.
[0157] Based on the method in the above embodiment, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a processor, the processor executes the method in the above embodiment.
[0158] Based on the method in the above embodiment, an embodiment of the present application provides a computer program product, characterized in that when the computer program product runs on a processor, the processor executes the method in the above embodiment.
[0159] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, 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 described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions may be transmitted from a website site, a computer, a server or a data center to another website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium may 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 disk (SSD)), etc.
[0160] It should be understood that the various numerical numbers involved in the embodiments of the present application are only used for the convenience of description and are not used to limit the scope of the embodiments of the present application.
Claims
1. A method for obtaining hard disk topology information in a server, characterized in that: The method comprises: Reading from the inherent memory of each in-place hard disk backplane respectively to obtain the slot identification set corresponding to each in-place hard disk backplane; the slot identification set includes the first identification information of the slot on the in-place hard disk backplane; Perform query operations on each in-place hard disk respectively to obtain second identification information of the slot where each in-place hard disk is located; Determine a correspondence between each in-place hard disk and an in-place hard disk backplane based on the first identification information and the second identification information; Based on the corresponding relationship, hard disk topology information is output; the hard disk topology information indicates the connection status and configuration status of the multiple in-place hard disk backplanes and the multiple in-place hard disks.
2. The method according to claim 1, characterized in that The output hard disk topology information includes: Obtaining slot layout information of each in-place hard disk backplane from a preset template of the server; The corresponding relationship is combined with the slot layout information to output hard disk topology information.
3. The method according to claim 1 or 2, characterized in that: The method further comprises: In response to a query request sent by the management platform of the server, the hard disk topology information is provided to the management platform for display.
4. The method according to claim 3, characterized in that The method further comprises: reading from the inherent memory to obtain basic information of each hard disk backplane in place; the basic information of the hard disk backplane in place comprises at least one of the following: the name, manufacturer, interface type, PCB version, and board ID of the hard disk backplane; Providing the hard disk topology information to the management platform includes: providing the hard disk topology information and basic information of the in-place hard disk backplane to the management platform for combined display.
5. The method according to claim 3, characterized in that: The query operation also returns basic information of each hard disk in place; the basic information of the hard disk in place includes at least one of the following: hard disk model, serial number, capacity, manufacturer, interface type, and in-place status; Providing the hard disk topology information to the management platform includes: providing the hard disk topology information and basic information of the in-place hard disks to the management platform for combined display.
6. The method according to claim 1, characterized in that The method is performed for an out-of-band management platform; The step of obtaining the second identification information of the slot where each hard disk is located includes: The baseboard management controller BMC integrated in the server is used to traverse each hard disk in place, and for the traversed hard disk currently in place, The BMC is used to perform a first query operation based on the IP M1 protocol to obtain second identification information of the slot where the currently in-place hard disk is located; the first query operation includes a first hard disk identification pre-assigned by the BMC to the currently in-place hard disk, and the first query operation is used to query the in-place hard disk represented by the first hard disk identification.
7. The method according to claim 6, characterized in that The inherent memory of each in-place hard disk backplane is read respectively to obtain the name of each in-place hard disk backplane; the corresponding relationship can be expressed as the relationship between the first hard disk identifier of each in-place hard disk and the name of the in-place hard disk backplane.
8. The method according to claim 1, characterized in that The method is performed for an in-band management platform; The step of obtaining the second identification information of the slot where each hard disk is located includes: Use the operating system to traverse each hard disk in place, and for the currently traversed hard disk, Using the operating system to light up the indicator light of the hard disk currently in place, so that the hard disk currently in place enters a lighted state; Using the out-of-band management tool supported by the operating system to send an out-of-band query instruction to the baseboard management controller BMC integrated in the server to obtain the second identification information of the slot where the currently in-place hard disk is located; the out-of-band query instruction is used to instruct the BMC to perform a second query operation based on the IPM 1 protocol, and the second query operation is used to query the in-place hard disk that has entered the light-up state; The operating system is used to turn off the indicator light so that the currently in-place hard disk enters a non-lit state.
9. The method according to claim 8, characterized in that The inherent memory of each in-place hard disk backplane is read separately to obtain the name of each in-place hard disk backplane; the corresponding relationship can be expressed as the relationship between the second hard disk identifier assigned by the operating system to each in-place hard disk and the name of the in-place hard disk backplane.
10. A server, characterized in that: include: at least one memory for storing a program; At least one processor is used to execute the program stored in the memory, and when the program stored in the memory is executed, the processor is used to execute the method according to any one of claims 1 to 9.
