Hard disk slot management method and device of server, server and storage medium
By determining the target grouping and actual grouping of hard disk slots in the server and establishing a mapping relationship, the problem of inconsistent slot numbers of servers of different models is solved, and operation and maintenance efficiency is improved.
Patent Information
- Application Number
- CN202510420041.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-03
- Publication Date
- 2025-07-22
AI Technical Summary
Due to the different slot numbers of the extended backplane hard disks, the operation and maintenance personnel cannot quickly locate the faulty hard disks, which reduces the server's operation and maintenance efficiency.
By obtaining the total number of hard disk slots on the extension backplane and the slot line number where the main route is located, determine the target grouping and actual grouping of the hard disk slot, and establish a mapping relationship to ensure that the hard disk slot number on the software interface corresponds one by one to the actual hard disk slot number.
The slot numbers of the hard disk in the upper left corner of the server model of different models are unified from 1. Operations and maintenance personnel can quickly locate the faulty hard disk, improving the server's operation and maintenance efficiency.
Smart Images

Figure CN120353389A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the technical field of servers, and in particular, to a method, device, server, and storage medium for managing hard disk slots of a server. Background Art
[0002] For servers of the same model, for the first hard disk slot number in the upper left corner of the extended backplane, the hard disk slot number of some models is 1, and the hard disk slot number of some models is 4, and they cannot all start from 1. For the convenience of design, for servers of the same model, the hard disk slot numbers in the upper left corner of the extended backplane of the server model displayed on the software interface are usually set to start from 1, resulting in a difference between the position of the faulty hard disk on the extended backplane displayed on the software interface and the position of the hard disk on the actual extended backplane of the server. When a hard disk fails, the operation and maintenance personnel cannot quickly locate the position of the faulty hard disk on the actual extended backplane of the server through the position of the faulty hard disk on the software interface, and thus cannot quickly locate the faulty hard disk, reducing the operation and maintenance efficiency of the server. Summary of the Invention
[0003] In view of the above problems, the embodiments of the present application provide a method, device, server, and storage medium for managing hard disk slots of a server, which improves the operation and maintenance efficiency of the server.
[0004] According to one aspect of the embodiments of the present application, a method for managing hard disk slots of a server is provided, and the method includes:
[0005] In an alternative manner,
[0006] According to another aspect of the embodiments of the present application, a device for managing hard disk slots of a server is provided, which is applied to a server. The server includes a RAID card and an extended backplane. The RAID card includes multiple groups of data link interfaces, and a plurality of hard disk slots are provided on the extended backplane. Each data link interface is connected to a hard disk through each hard disk slot; the method includes: obtaining the total number MAX of hard disk slots of the extended backplane and the slot row number r where the main route of the extended backplane is located; determining the target grouping and the maximum number of groups n of each hard disk slot according to the total number MAX of hard disk slots and the total number L of each group of data link interfaces of the RAID card; determining the actual grouping of each hard disk slot on the extended backplane according to the maximum number of groups n and the slot row number r where the main route is located; sequentially establishing a mapping relationship between the target grouping and the actual grouping in the grouping order until all the target grouping and the actual grouping are traversed, where the r-th group in the target grouping is mapped to the group where the main route is located in the actual grouping of the extended backplane; and managing the hard disk slots on the extended backplane according to the target grouping and the mapping relationship.
[0007] In an alternative manner, after obtaining the total number MAX of hard disk slots on the expansion backplane and the slot row number r where the main route of the expansion backplane is located, the method further includes: determining whether the slot row number r where the main route is located is equal to a first preset threshold; if the slot row number r where the main route is located is equal to the first preset threshold, stopping managing the hard disk slots of the server; otherwise, performing the step of determining the target grouping and the maximum number of groups n of each of the hard disk slots according to the total number MAX of hard disk slots and the total number L of data link interfaces in each group of the RAID card.
[0008] In an alternative manner, after obtaining the total number MAX of hard disk slots on the expansion backplane and the slot row number r where the main route of the expansion backplane is located, the method further includes: obtaining the model of the expansion backplane configured on the server and the model of the expansion backplane connected to the RAID card; determining whether the model of the expansion backplane configured on the server is the same as the model of the expansion backplane connected to the RAID card; if the model of the expansion backplane configured on the server is the same as the model of the expansion backplane connected to the RAID card, performing the step of determining the target grouping and the maximum number of groups n of each of the hard disk slots according to the total number MAX of hard disk slots and the total number L of data link interfaces in each group of the RAID card; otherwise, generating a prompt message and stopping managing the hard disk slots of the server, where the prompt message is used to indicate that the expansion backplane connected to the RAID card is not compatible with the server.
[0009] In an alternative manner, after obtaining the total number MAX of hard disk slots on the expansion backplane and the slot row number r where the main route of the expansion backplane is located, the method further includes: obtaining the power-on flag bit of the RAID card; determining whether the power-on flag bit is equal to a second preset threshold; if the power-on flag bit is equal to the second preset threshold, performing the step of determining the target grouping and the maximum number of groups n of each of the hard disk slots according to the total number MAX of hard disk slots and the total number L of data link interfaces in each group of the RAID card; otherwise, stopping managing the hard disk slots of the server.
[0010] In an alternative manner, when the power-on flag bit is equal to the second preset threshold, the method further includes: obtaining the configuration flag bit of the RAID card; determining whether the configuration flag bit is equal to a third preset threshold; if the configuration flag bit is equal to the third preset threshold, stopping managing the hard disk slots of the server; otherwise, performing the step of determining the target grouping and the maximum number of groups n of each of the hard disk slots according to the total number MAX of hard disk slots and the total number L of data link interfaces in each group of the RAID card.
[0011] According to another aspect of the embodiments of the present application, there is provided a hard disk slot management device for a server, including: an acquisition module, configured to acquire the total number MAX of hard disk slots on the expansion backplane and the slot row number r where the main route of the expansion backplane is located; a first determination module, configured to determine the target grouping and the maximum number of groups n of each of the hard disk slots according to the total number MAX of hard disk slots and the total number L of data link interfaces in each group of the RAID card; a second determination module, configured to determine the actual grouping of each of the hard disk slots on the expansion backplane according to the maximum number of groups n and the slot row number r where the main route is located; a mapping establishment module, configured to sequentially establish a mapping relationship between the target grouping and the actual grouping in the order of grouping until all the target grouping and the actual grouping are traversed, where the r-th group in the target grouping is mapped to the group where the main route is located in the actual grouping of the expansion backplane; a management module, configured to manage the hard disk slots on the expansion backplane according to the target grouping and the mapping relationship.
[0012] According to another aspect of the embodiments of the present application, there is provided a server, including a processor, a RAID card, and an expansion backplane. The RAID card includes a PCIE interface and multiple groups of data link interfaces. The PCIE interface is connected to the processor. Multiple hard disk slots are provided on the expansion backplane. Each of the data link interfaces is respectively connected to a hard disk through each of the hard disk slots. The RAID card is configured to: acquire the total number MAX of hard disk slots on the expansion backplane and the slot row number r where the main route of the expansion backplane is located; determine the target grouping and the maximum number of groups n of each of the hard disk slots according to the total number MAX of hard disk slots and the total number L of data link interfaces in each group of the RAID card; determine the actual grouping of each of the hard disk slots on the expansion backplane according to the maximum number of groups n and the slot row number r where the main route is located; sequentially establish a mapping relationship between the target grouping and the actual grouping in the order of grouping until all the target grouping and the actual grouping are traversed, where the r-th group in the target grouping is mapped to the group where the main route is located in the actual grouping of the expansion backplane; the processor is configured to: acquire the target grouping and the mapping relationship; manage the hard disk slots on the expansion backplane according to the target grouping and the mapping relationship.
[0013] In an optional manner, the server further includes a BMC, and the BMC is connected to the RAID card through an I2C bus; the BMC is configured to, after starting a task thread, send the total number MAX of hard disk slots on the expansion backplane and the slot row number r where the main route of the expansion backplane is located to the RAID card through the I2C bus.
[0014] In an alternative manner, after starting a task thread, the BMC is configured to send the total number MAX of hard disk slots on the expansion backplane and the slot row number r where the main route of the expansion backplane is located to the RAID card via the I2C bus until a response message sent by the RAID card is received via the I2C bus. The response message is generated by the RAID card after receiving the total number MAX of hard disk slots on the expansion backplane and the slot row number r where the main route of the expansion backplane is located.
[0015] According to another aspect of the embodiments of the present application, there is provided a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the hard disk slot management method for a server provided in any of the above embodiments.
[0016] In the embodiments of the present application, by obtaining the total number MAX of hard disk slots on the expansion backplane and the slot row number r where the main route of the expansion backplane is located, the target grouping and the maximum number of groups n of each hard disk slot can be determined based on the total number of hard disk slots and the total number of SAS interfaces in each group of the RAID card. Furthermore, the actual grouping of each hard disk slot can be determined based on the maximum number of groups n and the slot row number r where the main route is located. After that, starting from mapping the r-th group in the target grouping to the group where the main route is located in the actual grouping of the expansion backplane, by sequentially mapping all the groups in the target grouping and the actual grouping in the grouping order, the mapping relationship between the target grouping and the actual grouping can be obtained. Finally, by using the target grouping and the mapping relationship to manage the hard disk slots on the expansion backplane, not only can the hard disk slot numbers be displayed on the server model in the software interface according to the target grouping, so that the first hard disk slot of the expansion backplane of the server models of different models starts from 1, but also the physical positions of the hard disk slots of the actual server and the hard disk slot numbers of the server model can be in one-to-one correspondence. Thus, when a hard disk fails, the operation and maintenance personnel can quickly locate the faulty hard disk in the computer room according to the position of the faulty hard disk on the server model, and thus quickly handle the faulty hard disk, thereby improving the operation and maintenance efficiency of the server.
[0017] The above description is only an overview of the technical solutions of the embodiments of the present application. In order to be able to understand the technical means of the embodiments of the present application more clearly, it can be implemented according to the content of the specification. And in order to make the above and other purposes, features, and advantages of the embodiments of the present application more obvious and understandable, the following specific embodiments of the present application are specifically given. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings are only used to illustrate the embodiments and are not considered to be a limitation of the present application. Moreover, throughout the drawings, the same reference numerals are used to represent the same components. In the drawings:
[0019] Figure 1 are the hard disk slot numbers of the expansion backplanes of servers of different models;
[0020] Figure 2 Schematic diagram of the structure of the server provided by the embodiment of the present application;
[0021] Figure 3 Schematic diagram of the modules of the server provided by the embodiment of the present application;
[0022] Figure 4 Schematic flow chart of the hard disk slot management method of the server provided by the embodiment of the present application;
[0023] Figure 5 Hard disk slot numbers of the target group and the actual group provided by the embodiment of the present application;
[0024] Figure 6 is Figure 4 Schematic flow chart of the steps after step 110 in
[0025] Figure 7 is Figure 4 Schematic flow chart of the steps after step 110 in
[0026] Figure 8 Schematic diagram of the structure of the hard disk slot management device of the server provided by the embodiment of the present application. Detailed implementation manners
[0027] Hereinafter, exemplary embodiments of the present application will be described in more detail with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein.
[0028] A RAID (Redundant Arrays of Independent Disks) card is an expansion card used to implement RAID functions and is usually inserted into the PCIE (Peripheral Component Interface Express) slot of a server. An expansion backplane is a hardware device used to expand the storage capacity of a server, which can provide additional hard disk slots for the server to connect more hard disks. A hard disk slot is a physical location on the expansion backplane for installing a hard disk. A hard disk slot number is a unique number used to identify a hard disk slot, and both the RAID card and the operating system of the server identify and manage the hard disk on the hard disk slot through the corresponding hard disk slot number.
[0029] The RAID card contains multiple groups of SAS (Serial Attached SCSI) interfaces. The RAID card is connected to the expansion backplane, that is, the RAID card is connected to the hard disk slots of the expansion backplane through the SAS interfaces. When a hard disk is inserted into a hard disk slot, the RAID card can be connected to the hard disk in the hard disk slot through the SAS interface to manage the read and write operations of the hard disk. Among them, each SAS interface can connect to one hard disk, which enables the RAID card to achieve parallel operation of multiple hard disks.
[0030] Through the RAID card and the expansion backplane, the server can be connected to dozens or even hundreds of hard disks to store a large amount of data. For example, when the server is connected to an expansion backplane with 24 hard disk slots, in this configuration, after the RAID card is connected to the expansion backplane through the SAS interface, the expansion backplane can connect the SAS interfaces of the RAID card to 24 hard disk slots respectively through the expansion chip. Since each hard disk slot has its corresponding hard disk slot number, the RAID card can identify and manage the hard disks in 24 hard disk slots through 24 hard disk slot numbers respectively.
[0031] The existing server of the 2U 12-disk type has a height of 8.89 cm and can support 12 3.5-inch hot-swappable hard disk bays. This type of server may have three different models. Since these three models of servers may be manufactured by different manufacturers, it may lead to different hard disk slot numbers on the expansion backplanes of the three models of servers. For example, as Figure 1 shown in the hard disk slot numbers of servers of the same model but different models, for the first hard disk slot in the upper left corner of the expansion backplane, the hard disk slot numbers of models a and c are both 1, and the hard disk slot number of model b is 5. Thus, it can be seen that the hard disk slot numbers of the expansion backplanes of servers of different models cannot all start from 1.
[0032] There are a large number of server models of the same type. To facilitate the management and operation and maintenance of servers, a unified server model for servers of the same type is usually provided on the software interface, so that the operation and maintenance personnel can manage the servers in the computer room, that is, the actual servers, according to the server model on the software interface. Usually, the hard disk slot numbers in the upper left corner of the expansion backplane of the server model are designed to start from 1, which may result in different positions of the hard disk slot corresponding to the same hard disk on the expansion backplane of the server model and on the actual server. When a hard disk fails, since the position of the hard disk on the expansion backplane of the server model does not correspond one-to-one to the position on the expansion backplane of the actual server. For example, from the server model, the hard disk slot of the faulty hard disk is the first hard disk slot in the upper left corner, but in fact, the hard disk slot of the faulty hard disk is not located in the first hard disk slot in the upper left corner of the server, that is, the hard disk slot of the faulty hard disk seen in the server model is inconsistent with the hard disk slot of the actual server, resulting in the operation and maintenance personnel being unable to quickly locate the abnormal hard disk and reducing the operation and maintenance efficiency of the server.
[0033] It is found that each expansion backplane of a model has its own router path configuration. Different router path configurations will cause different communication paths for each SAS interface of the RAID card to connect to the hard disk, thus affecting the hard disk slot numbers assigned to the hard disk slots. Among them, each group of SAS interfaces of the RAID card includes multiple lane interfaces. For example, the RAID card can include 4 groups of SAS interfaces, namely SAS1, SAS2, SAS3, and SAS4, and each group of SAS interfaces can include 4 interfaces, namely lane 1, lane 2, lane3, and lane 4.
[0034] The allocation of the hardware slot numbers for the hard disk slots is jointly determined by the router path configuration and the SAS interface. Specifically, the router path configuration determines the starting hardware slot number for each group of hard disk slots. For example, the router1 path is the main router path, and the hard disk slots connected to the main router path form the first group. The hard disk slot numbers for the first group of hard disk slots start incrementing from 1 in sequence. The hard disk slots connected to the router 2 path form the second group, and the hard disk slot numbers for the second group of hard disk slots start incrementing sequentially after the hard disk slot numbers of the first group... and so on, and the starting hard disk slot numbers for other groups of hard disk slots can be determined one by one. The hard disk slot numbers for each group of hard disk slots are set in sequence according to the serial numbers of the lane interfaces. For example, in the first group of hard disk slots connected to the main router path, the hard disk slot number assigned to the lane 1 interface is 1, the hard disk slot number assigned to the lane 2 interface is 2, the hard disk slot number assigned to the lane 3 interface is 3, the hard disk slot number assigned to the lane 4 interface is 4. In the second group of hard disk slots connected to the router 2 path, the hard disk slot number assigned to the lane 1 interface is 5... and so on, and the hard disk slot numbers corresponding to each group of hard disk slots can be determined.
[0035] Based on the above research, this application provides a method for managing the hard disk slots of a server. By determining the target hard disk slot numbers for each hard disk slot of the server model, and determining the actual hard disk slot numbers for each hard disk slot on the extended backplane of the actual server through the slot row number where the main router is located. Then, by establishing the mapping relationship between the target hard disk slot numbers and the actual hard disk slot numbers, the management of the server hard disk slots can be realized according to the target hard disk slot numbers and the mapping relationship. Specifically, designing the hard disk slot numbers of the server model according to the target hard disk slot numbers can make the hard disk slot number of the first hard disk slot in the upper left corner of the extended backplane of the server models of different models start from 1 uniformly. Further, it can make the hard disk slots of the actual server correspond to the hard disk slot numbers of the server model. When a hard disk fails, the failed hard disk can be quickly found at the corresponding position on the extended backplane of the actual server through the position of the failed hard disk on the extended backplane of the server model, enabling the operation and maintenance personnel to quickly process the failed hard disk, thereby improving the operation and maintenance efficiency of the server.
[0036] The method for managing the hard disk slots of the server provided by the embodiments of this application is executed by the server. Figure 2 Shows the structural schematic diagram of the server provided by the embodiments of this application, Figure 3 Shows the module schematic diagram of the server provided by the embodiments of this application, as Figure 2 and Figure 3As shown in the figure, the server 1 includes a RAID card 11, an expansion backplane 12, and a motherboard 13. Among them, the RAID card 11 includes a PCIE interface 111, a controller 112, and multiple groups of data link interfaces 113.
[0037] Specifically, the controller 112 is used to perform RAID operations and data processing, and is respectively connected to the PCIE interface 111 and multiple groups of data link interfaces 113. The PCIE interface 111 is inserted into the PCIE slot 131 of the motherboard 13 to realize the connection between the RAID card 11 and the motherboard 13. The multiple groups of data link interfaces 113 are connected to the expansion backplane 12.
[0038] Multiple hard disk slots are provided on the expansion backplane 12, and the hard disks are inserted into the hard disk slots of the expansion backplane 12. The SAS IC (Integrated Circuit) controller in the expansion backplane 12 is configured with a low-latency distribution router, which can realize time-sharing access to multiple hard disks. Each data link interface 113 of the RAID card 11 is respectively connected to the hard disk through each hard disk slot. The RAID card 11 can convert the PCIE interface (protocol) of the server into a SAS interface (protocol) to connect to hard disks that support the SAS protocol, thereby realizing high-performance data transmission and management.
[0039] For example, the RAID card 11 may include 4 groups of data link interfaces 113. When each group of data link interfaces 113 includes 4 data link interfaces 113 and the 4 data link interfaces in each group are respectively connected through lane1, lane2, lane3, and lane4, the RAID card 11 can access 16 hard disks when connected to the expansion backplane 12, that is, it can realize time-sharing access to 16 hard disks; when each group of data link interfaces 113 includes 8 data link interfaces, the RAID card can access 32 hard disks when connected to the expansion backplane 12, that is, it can realize time-sharing access to 32 hard disks.
[0040] Figure 4 The figure shows a flowchart of a method for managing hard disk slots of a server provided by an embodiment of the present application. This method is Figure 2 executed by the server 1 shown in the figure. Specifically, steps S110 - S140 in this method are executed by the RAID card 11, and step S150 is executed by the processor on the motherboard 13. As Figures 2 - 4 shown in the figure, this method includes the following steps:
[0041] Step S110: Obtain the total number MAX of hard disk slots on the expansion backplane and the slot row number r where the main route of the expansion backplane is located.
[0042] Among them, the total number of hard disk slots MAX on the expansion backplane can be the maximum number of hard disks that can be inserted into the server. The slot row number r where the main router of the expansion backplane is located refers to: the hard disk slot connected to the main router of the expansion backplane of the actual server is the r-th row.
[0043] In the embodiment of the present application, the total number of hard disk slots MAX on the expansion backplane and the slot row number r where the main router of the expansion backplane is located can be sent by the BMC of the server to the controller of the RAID card. Specifically, after the server is powered on, the BMC starts a task thread, and can read the total number of hard disk slots MAX on the expansion backplane and the slot row number r where the main router of the expansion backplane is located from the configuration file of the server. After reading, the BMC sends the total number of hard disk slots MAX on the expansion backplane and the slot row number r where the main router is located to the RAID card.
[0044] Preferably, after receiving the slot row number r where the main router is located sent by the BMC, the RAID card first determines whether the slot row number r where the main router is located is equal to a first preset threshold, and the first preset threshold can be set to 1. When the slot row number r where the main router is located is equal to 1, it indicates that the hard disk slot connected to the main router of the expansion backplane of the server is the first row of hard disk slots, that is, the hard disk slot number of the first hard disk slot in the first row of the expansion backplane is 1, which is consistent with the hard disk slot number of the server model to be displayed, so there is no need to manage the hard disk slots of this server, and the management of the hard disk slots of this server is stopped. When the slot row number r where the main router is located is not equal to 1, for example, equal to 2, it indicates that the hard disk slot connected to the main router of the expansion backplane of the server is the second row of hard disk slots, that is, the hard disk slot number of the first hard disk slot in the second row of the expansion backplane is 1. In this case, the hard disk slots of this server need to be managed, and step S120 is executed. By judging the slot row number r where the main router is located, when the hard disk slot number of the expansion backplane of the server is consistent with the hard disk slot number of the server model to be displayed, additional management of the hard disk slot number of the expansion backplane can be avoided, saving management costs and improving system efficiency.
[0045] In some embodiments, the total number of hard disk slots MAX on the expansion backplane obtained in this step can also be the maximum hard disk slot number of the expansion backplane actually read by the RAID card. Specifically, the RAID card can read the hard disk slot numbers of the expansion backplane through multiple groups of data link interfaces. For example, when the hard disk slot numbers of all the expansion backplane read by the RAID card through the data link interface are 1, 2, 3, 4,..., max in sequence, the total number of hard disk slots MAX on the expansion backplane can be the maximum hard disk slot number max read by the RAID card.
[0046] Step S120: Determine the target grouping and the maximum number of groups n of each hard disk slot according to the total number of hard disk slots MAX and the total number of data link interfaces L in each group of the RAID card.
[0047] The target grouping of each hard disk slot refers to the numbers of each group of hard disk slots on the extended backplane of the server model on the software interface.
[0048] Suppose the RAID card includes 3 groups of data link interfaces, and when each group of data link interfaces includes 4 data link interfaces, the total number of data link interfaces L in each group of the RAID card is 4.
[0049] The maximum number of groups n of each hard disk slot is: n = MAX / L. The target grouping of each hard disk slot includes: G1, G2, G3,..., Gn. For example, as shown in (a) of Figure 5 when the total number of hard disk slots MAX is 12 and the total number of data link interfaces L in each group of the RAID card is 4, the maximum number of groups n of each hard disk slot can be calculated as: n = 12 / 4 = 3. The target grouping of each hard disk slot includes: G1(1 2 3 4), G2(5 6 7 8), G3(9 10 11 12).
[0050] Step S130: Determine the actual grouping of each hard disk slot on the extended backplane according to the maximum number of groups n and the slot row number r where the main route is located.
[0051] The actual grouping of each hard disk slot refers to the numbers of each group of hard disk slots on the extended backplane connected to the RAID card of the actual server.
[0052] According to the maximum number of groups n, it can be preliminarily determined that the actual grouping of each hard disk slot includes n groups, that is, including G1’, G2’, G3’,..., Gn’. Then, according to the slot row number r where the main route is located, the row number where G1’ is located can be determined, and further the row numbers where G2’, G3’,..., Gn’ are located can be determined, and finally the actual grouping of each hard disk slot can be determined.
[0053] For example, suppose the maximum number of groups n is 3. When the slot row number r where the main route is located is 2, as shown in (b) of Figure 5 the row number where G1’ is located is 2, the row number where G2’ is located is 3, and the row number where G3’ is located is 1. Then the actual grouping of each hard disk slot as shown in (b) of Figure 5 includes: G3’(9 10 11 12), G1’(1 2 3 4), G2’(5 6 7 8); when the slot row number r where the main route is located is 3, the row number where G1’ is located is 3, as shown in (c) of Figure 5 the row number where G2’ is located is 1, and the row number where G3’ is located is 2. Then the actual grouping of each hard disk slot as shown in Figure 5As shown in (c), it includes: G2’(5 6 7 8), G3’(9 10 11 12), G1’(1 2 3 4).
[0054] Step S140: Establish the mapping relationship between the target groups and the actual groups in sequence according to the grouping order until all the target groups and actual groups are traversed. Among them, the r-th group in the target groups is mapped to the group where the main route is located in the actual groups of the extended backplane.
[0055] The r-th group in the target groups refers to Gr in the target groups, and the group where the main route is located refers to G1’ in the actual groups. Among them, the grouping order can be: starting from r for the target groups, from the smallest grouping number to the largest grouping number n, and then from 1 to r-1; for the actual groups, starting from 1, from the smallest to the largest grouping number n; the grouping order can also be: starting from r for the target groups, from the largest grouping number to 1, and then from the largest grouping number n to r+1; for the actual groups, after starting from 1, then starting from the largest grouping number n to 2.
[0056] For example, first establish the mapping relationship between Gr and G1’, then add 1 to the grouping numbers respectively to get G(r+1) and G2’, then establish the mapping relationship between G(r+1) and G2’, and then add 1 to the grouping numbers respectively to get G(r+2) and G3’, then establish the mapping relationship between G(r+2) and G3’... and so on until the mapping relationships are established between all the groups in the target groups and all the groups in the actual groups.
[0057] When the slot row number r where the main route is located is 2, as shown in (a) and (b) of Figure 5 , establish the mapping relationships between G2(5 6 7 8) and G1’(1 2 3 4), G3(9 10 11 12) and G2’(5 6 7 8), G1(1 2 3 4) and G3’(9 10 11 12) in sequence; when the slot row number r where the main route is located is 3, as shown in (a) and (c) of Figure 5 , establish the mapping relationships between G3(9 10 11 12) and G1’(1 2 3 4), G1(1 2 3 4) and G2’(5 6 7 8), G2(5 6 7 8) and G3’(9 10 11 12) in sequence.
[0058] Step S150: Manage the hard disk slots on the extended backplane according to the target groups and the mapping relationship.
[0059] Specifically, the RAID card can send the target groups and mapping relationships to the motherboard of the server through the PCIE interface. After the motherboard receives the target groups and mapping relationships, its processor can manage the hard disk slots on the expansion backplane based on the target groups and mapping relationships. Specifically, displaying the server model according to the target groups in the software interface can make the expansion backplane of the server model display the hard disk slot numbers according to the target groups. In this way, the first hard disk slot number of the expansion backplane of server models of different models all starts from 1. Further, it can be ensured that the physical positions of the hard disk slots of the actual server correspond one-to-one with the hard disk slot numbers of the server model. In this way, when a hard disk fails, the operation and maintenance personnel can quickly find the hard disk slot of the actual server according to the hard disk slot in the server model.
[0060] In the embodiment of the present application, by obtaining the total number MAX of hard disk slots on the expansion backplane and the slot row number r where the main route of the expansion backplane is located, the target groups and the maximum number of groups n of each hard disk slot can be determined based on the total number of hard disk slots and the total number of SAS interfaces in each group of the RAID card. Furthermore, the actual group of each hard disk slot can be determined based on the maximum number of groups n and the slot row number r where the main route is located. After that, starting from mapping the r-th group in the target group to the group where the main route is located in the actual group on the expansion backplane, by sequentially mapping all the groups in the target group and the actual group in the order of the groups, the mapping relationship between the target group and the actual group can be obtained. Finally, by managing the hard disk slots on the expansion backplane based on the target group and the mapping relationship, not only can the server model on the software interface display the hard disk slot numbers according to the target group, so that the first hard disk slot of the expansion backplane of server models of different models all starts from 1, but also the physical positions of the hard disk slots of the actual server can correspond one-to-one with the hard disk slot numbers of the server model. Thus, when a hard disk fails, the operation and maintenance personnel can quickly locate the faulty hard disk in the computer room according to the position of the faulty hard disk on the server model, and thus quickly handle the faulty hard disk, thereby improving the operation and maintenance efficiency of the server.
[0061] The power management of the BMC and the RAID card is independent. In some cases, when the BMC restarts due to firmware upgrade, in order to protect the cache data in the RAID card from being lost, the RAID card may not lose power due to the restart of the BMC. In this case, in order to avoid the problem of repeated management of hard disk slots caused by the restart of the BMC but the RAID card not losing power, according to some embodiments of the present application, optionally, Figure 6 This is a schematic flowchart of the steps after step S110 of the present application. As shown in Figure 6, the steps after the above step S110 include the following steps:
[0062] Step S111: Obtain the power-on flag bit of the RAID card.
[0063] Step S112: Determine whether the power-on flag bit is equal to the second preset threshold. If it is, execute Step S113; if not, execute Step S115.
[0064] Step S113: Obtain the configuration flag bit of the RAID card.
[0065] Step S114: Determine whether the configuration flag bit is equal to the third preset threshold. If it is, execute Step S115; if not, execute Step S120.
[0066] Step S115: Stop the hard disk slots of the management server.
[0067] Among them, both the second preset threshold and the third preset threshold can be set to 1.
[0068] The controller of the RAID card may include a power-on register and a configuration register. When the RAID card is powered on for the first time after a power failure, the power-on flag bit in the power-on register is set to 1. When the server has managed the hard disk slots, the configuration flag bit in the configuration register of the RAID card is set to 1.
[0069] After receiving information such as the total number MAX of hard disk slots on the extended backplane and the slot row number r where the main route of the extended backplane is located sent by the BMC, the RAID card first reads the power-on flag bit of the power-on register and judges the power-on flag bit. If the power-on flag bit is equal to 1, it indicates that the RAID card is powered on for the first time after a power failure, then reads the configuration flag bit of the configuration register and judges the configuration flag bit. If the power-on flag bit is not equal to 1, it indicates that the RAID card is not powered on for the first time and the server has managed the hard disk slots, then loads the target group and mapping relationship generated when the hard disk slots of the last managed server were loaded from the flash, and stops the hard disk slots of the management server.
[0070] When it is determined in Step S144 that the configuration flag bit is equal to 1, it indicates that the server has not managed the hard disk slots yet, then execute Step S120 to continue managing the hard disk slots.
[0071] When it is determined in Step S144 that the configuration flag bit is not equal to 1, it indicates that the server has managed the hard disk slots, then load the target group and mapping relationship generated when the hard disk slots of the last managed server were loaded from the flash, and stop the hard disk slots of the management server.
[0072] To ensure that the RAID card can communicate with the extended backplane normally, according to some embodiments of the present application, optionally, Figure 7 This is a schematic flowchart of the steps after Step S110 of the present application, as Figure 7 shown, the steps after the above Step S110 include the following steps:
[0073] Step S116: Obtain the model of the expansion backplane configured on the server and the model of the expansion backplane connected to the RAID card.
[0074] Step S117: Determine whether the model of the expansion backplane configured on the server is the same as the model of the expansion backplane connected to the RAID card. If so, execute Step S120; if not, execute Step S118.
[0075] Step S118: Generate a prompt message and stop managing the hard disk slots of the server. The prompt message is used to indicate that the expansion backplane connected to the RAID card is not compatible with the server.
[0076] Among them, the model of the expansion backplane configured on the server refers to the model of the expansion backplane adapted to the server, which can be preset in the BMC. The model of the expansion backplane connected to the RAID card refers to the model of the expansion backplane actually connected to the RAID card of the server. Among them, the RAID card can read the model of the connected expansion backplane through Figure 3 the data interface 1121 shown in.
[0077] When the BMC sends the total number MAX of hard disk slots of the expansion backplane and the slot row number r where the main route of the expansion backplane is located to the controller of the RAID card, it can also send the model of the expansion backplane configured on the server to the RAID card at the same time. After the RAID card receives the model of the expansion backplane configured on the server and reads the model of the connected expansion backplane, it compares the model of the expansion backplane configured on the server with the model of the expansion backplane connected to the RAID card.
[0078] If the model of the expansion backplane configured on the server is the same as the model of the expansion backplane connected to the RAID card, the controller of the RAID card configures the SAS CSR (Control Status Register) so that each group of SAS interfaces enters the waiting state mode until the management of the hard disk slot numbers is completed before entering the normal working mode. If the model of the expansion backplane configured on the server is different from the model of the expansion backplane connected to the RAID card, the controller of the RAID card generates a prompt message and stops managing the hard disk slots of the server. Further, after the controller of the RAID card generates a prompt message, it can also pass through Figure 3 the I2C bus shown in to send the generated prompt message to the BMC. After the BMC receives the prompt message, it generates an alarm event according to the prompt message and displays it on the software interface to notify the operation and maintenance personnel to replace the expansion backplane.
[0079] By comparing the model of the expansion backplane configured on the server with the model of the expansion backplane actually connected to the RAID card, the inadapted expansion backplane of the server can be replaced in a timely manner, ensuring that the RAID card can communicate with the expansion backplane normally, thereby ensuring the normal management of the hard disk slots of the server.
[0080] Figure 8 FIG. shows a schematic structural diagram of a hard disk slot management device for a server provided by an embodiment of the present application. As Figure 8 shown, the hard disk slot management device 300 of the server includes: an acquisition module 310, a first determination module 320, a second determination module 330, a mapping establishment module 340, and a management module 350. The acquisition module 310 is configured to acquire the total number MAX of hard disk slots of the expansion backplane and the slot row number r where the main route of the expansion backplane is located; the first determination module 320 is configured to determine the target grouping and the maximum number of groups n of each hard disk slot according to the total number MAX of hard disk slots and the total number L of each group of data link interfaces of the RAID card; the second determination module 330 is configured to determine the actual grouping of each hard disk slot on the expansion backplane according to the maximum number of groups n and the slot row number r where the main route is located; the mapping establishment module 340 is configured to sequentially establish a mapping relationship between the target grouping and the actual grouping in the grouping order until all the target groupings and actual groupings are traversed, where the r-th group in the target grouping is mapped to the group where the main route is located in the actual grouping of the expansion backplane; the management module 350 is configured to manage the hard disk slots on the expansion backplane according to the target grouping and the mapping relationship.
[0081] The hard disk slot management device 300 of the server provided in this embodiment is used to execute the technical solution of the hard disk slot management method for the server in the foregoing method embodiment, and its implementation principle and technical effect are similar, and will not be elaborated here.
[0082] An embodiment of the present application provides a server. The schematic structural diagram of the server can be further referred to Figure 3 , and the specific implementation of the server is not limited in the specific embodiment of the present application.
[0083] As Figure 3 shown, the server 1 includes a processor 131, a RAID card 11, and an expansion backplane 12. The RAID card 11 includes a PCIE interface 111 and multiple groups of data link interfaces 113. A plurality of hard disk slots are provided on the expansion backplane 12, and each data link interface 111 is connected to a hard disk through each hard disk slot;
[0084] The RAID card 11 is configured to:
[0085] acquire the total number MAX of hard disk slots of the expansion backplane 12 and the slot row number r where the main route of the expansion backplane 12 is located;
[0086] Determine the target grouping and the maximum number of groups n of each hard disk slot according to the total number of hard disk slots MAX and the total number of data link interfaces L in each group of the RAID card;
[0087] Determine the actual grouping of each hard disk slot on the expansion backplane 12 according to the maximum number of groups n and the slot row number r where the main route is located;
[0088] Establish the mapping relationship between the target grouping and the actual grouping in sequence according to the grouping order until all target groupings and actual groupings are traversed, where the r-th group in the target grouping is mapped to the group where the main route is located in the actual grouping of the expansion backplane 12;
[0089] The processor 131 is used for:
[0090] Obtain the target grouping and the mapping relationship;
[0091] Manage the hard disk slots on the expansion backplane 12 according to the target grouping and the mapping relationship.
[0092] The server 1 provided in this embodiment is used to execute the technical solution of the hard disk slot management method of the server in the foregoing method embodiment, and its implementation principle and technical effect are similar, which will not be elaborated here.
[0093] In order to implement the management of the hard disk slots of the server 1, the present application further provides an implementation manner. Optionally, please continue to refer to Figure 3 , as shown in the figure, the server further includes a BMC 14, and the BMC 14 is connected to the RAID card 11 through an I2C bus. The BMC 14 is used to send the total number of hard disk slots MAX of the expansion backplane 12 and the slot row number r where the main route of the expansion backplane 12 is located to the RAID card 11 through the I2C bus after starting a task thread.
[0094] The BMC 14 is connected to the controller 112 of the RAID card 11 through an I2C bus. After the server is powered on, the BMC 14 starts a task thread, and can read the total number of hard disk slots MAX of the expansion backplane 12 and the slot row number r where the main route of the expansion backplane 12 is located from the configuration file of the server. Then, the BMC 14 sends the total number of hard disk slots MAX of the expansion backplane 12 and the slot row number r where the main route is located to the controller 112 of the RAID card 11 through the I2C. Through the communication between the BMC 14 and the controller 112 of the RAID card 11, it can be ensured that the RAID card 11 obtains the correct total number of hard disk slots MAX of the expansion backplane 12 and the slot row number r where the main route is located, and ensure the stability of the hard disk slot number management process.
[0095] In some embodiments, to ensure the normal operation of the hard disk slot management of server 1, after receiving the total number of hard disk slots MAX of the expansion backplane 12 and the slot row number r where the main route of the expansion backplane 12 is located sent by the BMC 14, the RAID card 11 generates response information and sends the response information to the BMC 14 through the I2C bus to notify the BMC 14 that it has received the total number of hard disk slots MAX of the expansion backplane 12 and the slot row number r where the main route is located. If the BMC 14 sends the total number of hard disk slots MAX of the expansion backplane 12 and the slot row number r where the main route is located to the RAID card 11 and does not receive the response information from the RAID card 11 within a certain period of time, it will send the total number of hard disk slots MAX of the expansion backplane 12 and the slot row number r where the main route is located to the RAID card 11 again until it receives the response information from the RAID card 11.
[0096] An embodiment of the present application provides a computer-readable storage medium, and the storage medium stores a computer program, and when the computer program is executed by a processor, it implements the embodiment of the hard disk slot management method of the above-mentioned server.
[0097] An embodiment of the present application provides a computer program, and the computer program can be executed by a processor to implement the embodiment of the hard disk slot management method of the above-mentioned server.
[0098] An embodiment of the present application provides a computer program product, and the computer program product includes a computer program, and when the computer program is executed by a processor, it implements the embodiment of the hard disk slot management method of the above-mentioned server.
[0099] In several embodiments provided by the present application, if any function is implemented in the form of a software function module / unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, part or all of the technical solutions of the present application can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or other electronic devices) to execute all or part of the steps of the methods described in the various embodiments of the present application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store computer program codes.
[0100] The algorithms or displays provided herein are not inherently related to any particular computer, virtual system, or other device. A variety of general-purpose systems may also be used in conjunction with the teachings based herein. The structure required to construct such systems will be apparent from the above description. Additionally, the embodiments of the present application are not directed to any particular programming language. It should be understood that the content of the present application described herein can be implemented using a variety of programming languages, and the description of a particular language above is for the purpose of disclosing the best mode of the present application.
[0101] It should be noted that the above embodiments illustrate the present application rather than limit the present application, and those skilled in the art can design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in the claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present application can be implemented by means of hardware including several different elements and by means of a suitably programmed computer. In a claim listing several devices, several units or modules of these devices may be embodied by the same item of hardware. The use of the words first, second, and third, etc. does not denote any order. These words can be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be construed as limiting the order of execution.
[0102] The above-described embodiments merely represent several implementation manners of the present application, and their descriptions are relatively specific and detailed, but should not be construed as limiting the patent scope of the present application. It should be pointed out that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.
Claims
1. A method for managing hard disk slots of a server, which is applied to the server, characterized in that, The server includes a RAID card and an expansion backplane. The RAID card includes multiple groups of data link interfaces. Multiple hard disk slots are provided on the expansion backplane. Each of the data link interfaces is connected to a hard disk through each of the hard disk slots; The method includes: Obtain the total number MAX of hard disk slots on the expansion backplane and the slot row number r where the main route of the expansion backplane is located; Determine the target grouping and the maximum number of groups n of each of the hard disk slots according to the total number MAX of hard disk slots and the total number L of each group of data link interfaces of the RAID card; Determine the actual grouping of each of the hard disk slots on the expansion backplane according to the maximum number of groups n and the slot row number r where the main route is located; Establish a mapping relationship between the target grouping and the actual grouping in sequence according to the grouping order until all the target grouping and the actual grouping are traversed, where the r-th group in the target grouping is mapped to the group where the main route is located in the actual grouping of the expansion backplane; Manage the hard disk slots on the expansion backplane according to the target grouping and the mapping relationship.
2. The method according to claim 1, wherein After obtaining the total number MAX of hard disk slots on the expansion backplane and the slot row number r where the main route of the expansion backplane is located, the method further includes: Judge whether the slot row number r where the main route is located is equal to a first preset threshold; If the slot row number r where the main route is located is equal to the first preset threshold, stop managing the hard disk slots of the server; Otherwise, execute the step of determining the target grouping and the maximum number of groups n of each of the hard disk slots according to the total number MAX of hard disk slots and the total number L of each group of data link interfaces of the RAID card.
3. The method according to claim 1, characterized in that After obtaining the total number MAX of hard disk slots on the expansion backplane and the slot row number r where the main route of the expansion backplane is located, the method further includes: Obtain the model of the expansion backplane configured by the server and the model of the expansion backplane connected to the RAID card; Judge whether the model of the expansion backplane configured by the server is the same as the model of the expansion backplane connected to the RAID card; If the model of the expansion backplane configured by the server is the same as the model of the expansion backplane connected to the RAID card, execute the step of determining the target grouping and the maximum number of groups n of each of the hard disk slots according to the total number MAX of hard disk slots and the total number L of each group of data link interfaces of the RAID card; Otherwise, generate a prompt message and stop managing the hard disk slots of the server. The prompt message is used to indicate that the expansion backplane connected to the RAID card is not compatible with the server.
4. The method according to claim 1, wherein After obtaining the total number MAX of hard disk slots on the expansion backplane and the slot row number r where the main route of the expansion backplane is located, the method further includes: Obtain the power-on flag bit of the RAID card; Judge whether the power-on flag bit is equal to a second preset threshold; If the power-on flag bit is equal to the second preset threshold, execute the step of determining the target grouping and the maximum number of groups n of each of the hard disk slots according to the total number MAX of hard disk slots and the total number L of each group of data link interfaces of the RAID card; Otherwise, stop managing the hard disk slots of the server.
5. The method according to claim 4, wherein When the power-on flag bit is equal to the second preset threshold, the method further includes: Obtaining the configuration flag bit of the RAID card; Determining whether the configuration flag bit is equal to a third preset threshold; If the configuration flag bit is equal to the third preset threshold, stop managing the hard disk slots of the server; Otherwise, execute the step of determining the target grouping and the maximum number of groups n of each hard disk slot according to the total number of hard disk slots MAX and the total number of data link interfaces L of each group of the RAID card.
6. A hard disk slot management device for a server, characterized in that The device includes: An obtaining module, configured to obtain the total number of hard disk slots MAX of the expansion backplane and the slot row number r where the main route of the expansion backplane is located; A first determining module, configured to determine the target grouping and the maximum number of groups n of each hard disk slot according to the total number of hard disk slots MAX and the total number of data link interfaces L of each group of the RAID card; A second determining module, configured to determine the actual grouping of each hard disk slot on the expansion backplane according to the maximum number of groups n and the slot row number r where the main route is located; A mapping establishing module, configured to sequentially establish a mapping relationship between the target grouping and the actual grouping in the grouping order until all the target grouping and the actual grouping are traversed, where the r-th group in the target grouping is mapped to the group where the main route is located in the actual grouping of the expansion backplane; A management module, configured to manage the hard disk slots on the expansion backplane according to the target grouping and the mapping relationship.
7. A server, characterized in that, It includes a processor, a RAID card, and an expansion backplane. The RAID card includes a PCIE interface and multiple groups of data link interfaces. The PCIE interface is connected to the processor. Multiple hard disk slots are provided on the expansion backplane, and each data link interface is respectively connected to a hard disk through each hard disk slot; The RAID card is used for: Obtaining the total number of hard disk slots MAX of the expansion backplane and the slot row number r where the main route of the expansion backplane is located; Determining the target grouping and the maximum number of groups n of each hard disk slot according to the total number of hard disk slots MAX and the total number of data link interfaces L of each group of the RAID card; Determining the actual grouping of each hard disk slot on the expansion backplane according to the maximum number of groups n and the slot row number r where the main route is located; Sequentially establishing a mapping relationship between the target grouping and the actual grouping in the grouping order until all the target grouping and the actual grouping are traversed, where the r-th group in the target grouping is mapped to the group where the main route is located in the actual grouping of the expansion backplane; The processor is used for: Obtaining the target grouping and the mapping relationship; Managing the hard disk slots on the expansion backplane according to the target grouping and the mapping relationship.
8. The server according to claim 7, wherein The server further includes a BMC, and the BMC is connected to the RAID card through an I2C bus; The BMC is used for, after starting a task thread, sending the total number of hard disk slots MAX of the expansion backplane and the slot row number r where the main route of the expansion backplane is located to the RAID card through the I2C bus.
9. The server according to claim 8, wherein The BMC is configured to send the total number of hard disk slots MAX of the expansion backplane and the slot row number r where the main route of the expansion backplane is located to the RAID card through the I2C bus after starting a task thread, until response information sent by the RAID card is received through the I2C bus, where the response information is generated by the RAID card after receiving the total number of hard disk slots MAX of the expansion backplane and the slot row number r where the main route of the expansion backplane is located.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the hard disk slot management method for the server according to any one of claims 1 to 5.