Disk configuration method and device, electronic equipment, storage medium and program product
By automatically allocating disks through the presence detection of in-situ ports using the extender, the problem of low disk configuration efficiency in existing technologies is solved, achieving efficient configuration and flexible adaptability without the need for a restart.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- EVEX TECHNOLOGY CO LTD
- Filing Date
- 2022-12-14
- Publication Date
- 2026-08-04
AI Technical Summary
In existing technologies, disk configuration in servers is inefficient, complex to operate, requires a restart to take effect, and demands a high level of expertise from operators.
The extender detects the available ports in its ports and automatically allocates disks to the HBA based on the availability of ports, achieving automatic disk configuration without the need for manual configuration and restart.
It simplifies the disk configuration process, improves configuration efficiency and user experience, adapts to different scenarios, and has a higher degree of matching between disk allocation and HBA connection.
Smart Images

Figure CN115827530B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a disk configuration method, apparatus, electronic device, storage medium, and program product. Background Technology
[0002] To alleviate the burden on the main processor for data storage and retrieval tasks and improve server performance, an HBA (Host Bus Adapter) provides input / output processing and physical connectivity between the server and the JBOD (Just a Bunch of Disk). In a server, multiple HBAs are often connected to the JBOD. To improve overall transfer speed and optimize resource allocation, the disks in the JBOD can be divided into different zones, with each HBA having different access permissions to each zone.
[0003] In current technology, SMP (Serial Management Protocol) Zone configuration can flexibly configure any feasible Zone, but the steps are cumbersome, inefficient, require a high level of expertise from the operators, and require a restart to take effect after configuration. Summary of the Invention
[0004] This application provides a disk configuration method, apparatus, electronic device, storage medium, and program product to improve disk configuration efficiency and enhance user experience.
[0005] In a first aspect, embodiments of this application provide a disk configuration method applied to an extender, the extender including multiple ports for connecting to at least one host bus adapter (HBA), the at least one HBA for accessing multiple disks through the extender; the method includes:
[0006] Detecting the presence of a port among multiple ports of the extender, wherein the presence port is a port connected to the HBA via a cable;
[0007] Based on the detected in-place port, a disk is allocated to each HBA in at least one HBA connected to the extender, so that each HBA can access the corresponding disk through the extender.
[0008] Optionally, the plurality of ports are divided into N groups; each group includes at least two ports for connecting to the same HBA; based on the detected in-place ports, disks are allocated to each HBA in at least one HBA connected to the extender, including:
[0009] The number of HBAs connected to the extender is determined based on whether there are in-place ports in each group of ports;
[0010] Based on the number of HBAs, allocate disk space to each HBA.
[0011] Optionally, based on the number of HBAs, disks are allocated to each HBA, including:
[0012] If the number of HBAs is at least two, then multiple disks are allocated to the HBAs connected to the expander according to a uniform allocation strategy; and / or,
[0013] If there is only one HBA, then all disks are allocated to the HBA connected to the extender.
[0014] Optionally, at least one of the N groups of ports of the extender is a redundant port;
[0015] The number of HBAs connected to the extender is determined based on whether there are any in-place ports in each group of ports, including:
[0016] If the number of groups with in-place ports is less than or equal to the threshold, the number of HBAs connected to the extender is determined based on whether there are in-place ports in each group.
[0017] The threshold is N minus the number of redundant port groups.
[0018] Optionally, the method further includes:
[0019] If the number of groups in the bit port exceeds the threshold, an alarm message is generated, and / or the bit port is logged.
[0020] Optionally, based on the detected in-place port, disks are allocated to each of the at least one HBA connected to the extender, including:
[0021] According to a pre-set lookup table, determine the allocation strategy corresponding to the current in-place port, and allocate disks to the at least one HBA according to the allocation strategy;
[0022] The lookup table is a user-defined lookup table used to store the correspondence between bit ports and allocation strategies.
[0023] Secondly, embodiments of this application provide a disk configuration device applied to an extender, the extender including multiple ports for connecting to at least one HBA, the at least one HBA for accessing multiple disks through the extender; the device includes:
[0024] A detection module is used to detect the presence of a port among multiple ports of the extender, wherein the presence port is a port connected to the HBA via a cable;
[0025] The allocation module is used to allocate disks to each of the at least one HBA connected to the extender based on the detected in-place port, so that each HBA can access the corresponding disk through the extender.
[0026] Thirdly, embodiments of this application provide an electronic device, including:
[0027] At least one processor; and a memory communicatively connected to said at least one processor;
[0028] The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, cause the electronic device to perform the method described in any of the above aspects.
[0029] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the method described in any of the above aspects.
[0030] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the methods described in any of the above aspects.
[0031] This application provides a disk configuration method, apparatus, electronic device, storage medium, and program product. The extender can detect the presence of ports among its multiple ports, wherein the presence port is a port connected to an HBA via a cable. Based on the detected presence ports, disks are allocated to each HBA in at least one HBA connected to the extender, enabling each HBA to access the corresponding disk through the extender. The disk allocation strategy can be determined based on the number of presence ports, making the disk allocation more closely match the actual connection status of the HBAs, providing greater flexibility and adaptability to different scenarios. Furthermore, the disk configuration can be automatically adjusted based on the presence port status, eliminating the need for manual configuration and restarts, effectively simplifying the configuration process and improving configuration efficiency and user experience. Attached Figure Description
[0032] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0033] Figure 1 A system architecture diagram provided for an embodiment of this application;
[0034] Figure 2 A schematic flowchart illustrating a disk configuration method provided in an embodiment of this application;
[0035] Figure 3 A connection diagram provided for an embodiment of this application;
[0036] Figure 4 Another connection diagram provided for an embodiment of this application;
[0037] Figure 5 This is yet another connection diagram provided in an embodiment of this application;
[0038] Figure 6 A connection diagram including redundant ports is provided for an embodiment of this application;
[0039] Figure 7 Another connection diagram including redundant ports is provided for an embodiment of this application;
[0040] Figure 8 Another connection diagram including redundant ports is provided for embodiments of this application;
[0041] Figure 9 This is a schematic diagram of the structure of a disk configuration device provided in an embodiment of this application;
[0042] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0043] The accompanying drawings have illustrated specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to specific embodiments. Detailed Implementation
[0044] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0045] In a server, multiple HBAs are often connected to a JBOD. The disks attached to the JBOD can be divided into different zones. Each HBA has different access permissions to different zones, thereby improving the overall transmission speed and optimizing resource allocation.
[0046] In some technologies, zone configuration can be performed through SMP zone configuration data, or through manual CLI (Command Line Interface) / custom SES (SCSI Enclosure Service) Page (data page) selection. These methods require a high level of expertise from the operator, are cumbersome, inefficient, and require a restart to take effect after configuration.
[0047] In view of this, embodiments of this application provide a disk configuration method that, upon each power-on, can automatically configure the disk zone based on the availability of the cable between the HBA and the IO (Input / Output) Expander in the JBOD, allowing each HBA to access the disk in a specific zone.
[0048] Figure 1 This is a system architecture diagram provided for an embodiment of this application. For example... Figure 1 As shown, the electronic device may include at least one HBA and at least one JBOD, and each JBOD may be connected to at least one HBA.
[0049] The JBOD contains an IO Expander, which can connect to at least one BP (Backplane) Expander, and each BP Expander connects to at least one disk.
[0050] like Figure 1 As shown, the JBOD contains 108 disks, 1 IO Expander, and 4 BP Expanders. The IO Expander's 4 ports (ports 0-3) are responsible for connecting to the HBA card (HBA0-1), and the 4 BP Expanders are responsible for connecting to the 108 disks on the Backplane.
[0051] In this embodiment of the application, the IO Expander can allocate a disk to the HBA based on the availability of the port, and the HBA can access the corresponding disk.
[0052] In summary, the IO Expander in JBOD can allocate disks to HBAs connected to the IO Expander based on the detected port availability, ensuring a more balanced distribution of disks to each HBA, thereby improving the overall storage and retrieval speed. Furthermore, it enables automatic disk zone configuration, which takes effect immediately upon power-up of the JBOD. This is simple, direct, and highly adaptable and flexible, effectively simplifying the configuration process and improving the overall efficiency of the device.
[0053] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0054] Figure 2 This is a flowchart illustrating a disk configuration method provided in an embodiment of this application. The method provided in this embodiment can be applied to an extender, which includes multiple ports for connecting to at least one HBA, the at least one HBA being used to access multiple disks through the extender; such as... Figure 2 As shown, the method includes:
[0055] Step 201: Detect the in-place port among the multiple ports of the extender, wherein the in-place port is the port connected to the HBA via a cable.
[0056] Optionally, the expander may include an IO Expander and a BP Expander, wherein the IO Expander can be used to connect to an HBA, and the multiple ports included in the expander may specifically be multiple ports of the IO Expander.
[0057] In one alternative implementation, this step can be performed by the IO Expander, some ports of which are connected to the HBA card via cables. When the cable is in a valid conducting state, the corresponding port is the in-place port.
[0058] In this step, the presence of ports between the IO Expander and the HBA can be detected in several ways. Optionally, the IO Expander can check its own presence ports once after the JBOD is powered on. Alternatively, the IO Expander can check its own presence ports at regular intervals.
[0059] Step 202: Based on the detected in-place ports, allocate disks to each HBA in at least one HBA connected to the extender, so that each HBA can access the corresponding disk through the extender.
[0060] Specifically, the IO Expander allocates disks to all HBA cards connected to it based on the detected port availability. Since different BP Expanders can connect to different disks, a BP Expander can be assigned to each HBA. In this way, the disks connected to each BP Expander will be assigned to the same HBA, and the HBA can then access the corresponding disks.
[0061] For example, you can refer to Figure 1 The IO Expander detects that there are 4 ports in operation, and there are also 4 BP Expanders. Therefore, BP0 Expander can be assigned to port 0, BP1 Expander to port 1, BP2 Expander to port 2, and BP3 Expander to port 3. Assuming that BP0 Expander is connected to disks 0-27, BP1 Expander is connected to disks 28-55, BP2 Expander is connected to disks 56-81, and BP3 Expander is connected to disks 82-107, then HBA0 can access disks 0-27 through port 0 and disks 28-55 through port 1, and HBA1 can access disks 56-81 through port 2 and disks 82-107 through port 3.
[0062] Optionally, the execution flow of the above steps can be programmed into the firmware of the IO Expander. Upon each power-on, the IO Expander can automatically allocate disks based on the available ports. After allocation, the HBA can access the corresponding disks through the ports. Alternatively, the above steps can also be executed by the BP Expander. For the specific implementation principles and technical effects, please refer to the above embodiments, which will not be repeated here.
[0063] In another optional implementation, the IO Expander and BP Expander can each perform the above steps separately. After the JBOD powers on, the IO Expander allocates disk space to the HBA based on the availability of ports, and simultaneously, the BP Expander also allocates disk space to the HBA based on the availability of ports. The allocation methods are identical for both. Afterward, the IO Expander and BP Expander can assist in enabling the HBA to access the disk based on the allocation information. The specific implementation principles and technical effects can be found in the above embodiments, and will not be repeated here.
[0064] Optionally, the plurality of ports are divided into N groups; each group includes at least two ports for connecting to the same HBA; based on the detected in-place ports, disks are allocated to each HBA in at least one HBA connected to the extender, including:
[0065] The number of HBAs connected to the extender is determined based on whether there are in-place ports in each group of ports;
[0066] Based on the number of HBAs, allocate disk space to each HBA.
[0067] Optionally, the IO Expander has multiple ports, which can be divided into N groups, each group containing two or more ports. The number of HBAs connected to the IO Expander is accumulated sequentially, starting from the first group and continuing up to the Nth group. The accumulation rule is as follows: The count is set to 0. For each group, if the number of active ports is greater than or equal to 1, an HBA is connected to that group, and the count is incremented by 1. If the number of active ports is less than 1, no HBA is connected, and the count remains unchanged. After traversing all N groups, the final count is the number of HBAs connected to the IO Expander. Then, based on the number of HBAs connected to the IO Expander, at least one BP Expander can be assigned to each HBA. This ensures that all disks connected to the BP Expander are assigned to their corresponding HBAs, allowing the HBAs to access those disks.
[0068] For example, Figure 3 This is a schematic diagram illustrating a connection as provided in an embodiment of this application. Figure 3 As shown, there are 3 HBAs (HBA0~2) on the HBA side, and a total of 108 disks in the JBOD, 1 IO Expander, and 4 BP Expanders (BP0~3 Expanders). The 6 ports (ports 0~5) of the IO Expander are divided into 3 groups: ports 0 and 1 are in the first group, ports 2 and 3 are in the second group, and ports 4 and 5 are in the third group. According to the cumulative rule, the number of HBAs connected to the IO Expander is 2. Then, the 4 BP Expanders can be allocated to 2 HBAs according to certain rules, so that HBA0 and HBA1 can access the disks under the corresponding BP Expanders.
[0069] Disk zone configuration ultimately boils down to HBA's configuration of disk access permissions. The number of HBAs is determined based on the availability of ports. Regardless of whether the same HBA is connected to the IO Expander port through one, two, or more cables, the number of HBAs can be accurately determined. Thus, disks can be allocated to HBAs based on the number of HBAs, meeting the usage needs of different scenarios. The design is more convenient and direct, enhancing the user experience.
[0070] Optionally, based on the number of HBAs, disks are allocated to each HBA, including:
[0071] If the number of HBAs is at least two, then multiple disks are allocated to the HBAs connected to the expander according to a uniform allocation strategy; and / or,
[0072] If there is only one HBA, then all disks are allocated to the HBA connected to the extender.
[0073] It should be noted that the embodiments of this application may employ a uniform allocation strategy to distribute disks to HBAs connected to the IOExpander port. This uniform allocation strategy means that the number of disks allocated to each HBA should be as similar as possible during allocation. However, the final allocation result may not be completely uniform for the following reasons: First, each disk is connected to its corresponding BP Expander. Since disk allocation is essentially BP Expander allocation, when the number of BP Expanders is not divisible by the number of HBAs, the number of BP Expanders allocated to each HBA will not be the same. Second, when the number of disks is not divisible by the number of BP Expanders, the number of disks connected to each BP Expander will not be the same.
[0074] Optionally, the uniform allocation strategy can be implemented as follows: divide the number of BP Expanders by the number of HBAs connected to the IO Expanders, and the quotient is M. Allocate M BP Expanders to each HBA card. If there are any remaining unallocated BP Expanders, they can be randomly allocated among at least two HBAs.
[0075] For example, the device may include multiple BP Expanders, each connected to the same number of disks. When there is only one HBA connected to the IO Expander, all BP Expanders are assigned to this HBA, which means all disks are assigned to this HBA. Figure 4 This is another connection diagram provided for an embodiment of this application. (See diagram below.) Figure 4 As shown, only HBA0 is connected to the IO expander through port 0 and port 1. Therefore, the IO expander assigns BP0 to BP4 expanders to HBA0, that is, disks 0 to 107 are all assigned to HBA0.
[0076] When the number of HBAs connected to the IO Expander is greater than or equal to two, the IO Expander will distribute all BP Expanders to the HBAs connected to the IO Expander according to the uniform distribution strategy, that is, the disks will be evenly distributed to the HBAs. Figure 5 This is yet another connection diagram provided for an embodiment of this application. For example... Figure 5As shown, HBA0 is connected to the IO Expander through ports 0 and 1, and HBA1 is connected to the IO Expander through ports 2 and 3. The IO Expander can then allocate BP0 Expander and BP1 Expander to HBA0 and BP2 Expander and BP3 Expander to HBA1 according to a uniform allocation strategy. That is, all disks connected to BP0 Expander and BP1 Expander are allocated to HBA0, and all disks connected to BP2 Expander and BP3 Expander are allocated to HBA1.
[0077] Figure 5 In the diagram, the cables between the HBA and the port, as well as the connection lines between the IO Expander and the BP Expander, all include dashed lines and solid lines. These are used to distinguish the specific allocation situation. The BP Expander connected by a dashed line is assigned to the HBA connected by a dashed line, and the BP Expander connected by a solid line is assigned to the HBA connected by a solid line.
[0078] The following example illustrates the uniform allocation strategy. If there are 3 HBAs connected to the IO Expander and 9 BP Expanders, each HBA will receive 9 ÷ 3 = 3 BP Expanders. If there are 4 HBAs connected to the IO Expander and 11 BP Expanders, the quotient of 11 divided by 4 is 2 and the remainder is 3. Therefore, each HBA card is first allocated 2 BP Expanders, and then 3 are randomly selected from the 4 HBAs. Each selected HBA card can then receive one more BP Expander.
[0079] In this way, by following the strategy of even distribution, the number of BP Expanders allocated to each HBA is as similar as possible, which means that the number of disks allocated to each HBA card is as similar as possible, thereby optimizing the overall resource configuration and improving the overall storage and read speed.
[0080] Optionally, at least one of the N groups of ports of the extender is a redundant port;
[0081] The number of HBAs connected to the extender is determined based on whether there are any in-place ports in each group of ports, including:
[0082] If the number of groups with in-place ports is less than or equal to the threshold, the number of HBAs connected to the extender is determined based on whether there are in-place ports in each group.
[0083] The threshold is N minus the number of redundant port groups.
[0084] Specifically, when Q out of the N groups of ports in the IO Expander are redundant ports, if the number of groups with active ports is less than or equal to NQ, the number of HBAs connected to the expander is determined based on whether there are active ports in each group. The specific method is described in the above embodiment and will not be repeated here. When a non-redundant port of the IO Expander is damaged, a redundant port can replace the damaged port.
[0085] For example, Figure 6 This is a schematic diagram illustrating a connection including redundant ports, provided as an embodiment of this application. Figure 6 As shown, the IO Expander has 6 ports (ports 0 to 5) and is divided into 3 groups: ports 0 and 1 are in the first group, ports 2 and 3 are in the second group, and ports 4 and 5 are in the third group. The third group of ports is set as redundant ports. HBA0 is connected to the IO Expander through ports 0 and 1, and HBA1 is connected to the IO Expander through ports 2 and 3. The IO Expander can allocate the disks connected to BP0 Expander and BP1 Expander to HBA0 according to the uniform allocation strategy, and allocate the disks connected to BP2 Expander and BP3 Expander to HBA1.
[0086] Figure 7 This is another connection diagram including redundant ports provided for an embodiment of this application. When Figure 6 If ports 2 and 3 are damaged, ports 4 and 5 can take their place, and the final disk allocation method will be the same as... Figure 6 similar. Figure 8 This is another connection diagram including redundant ports provided as an embodiment of this application. For example... Figure 8 As shown, only HBA2 is connected to the IO Expander through ports 4 and 5. At this time, the IO Expander allocates all the disks connected to the BP Expander to HBA2.
[0087] In this way, the IO Expander will only allocate disks when it detects that the number of HBAs connected to the expander is less than a certain threshold, which can improve the accuracy of disk allocation and reduce the probability of anomalies.
[0088] Optionally, if there is a group on the bit port that is greater than the threshold, an alarm message is generated, and / or the bit port is logged.
[0089] Specifically, if the number of groups with active ports is greater than NQ, an alarm message will be generated, or the detected active ports will be recorded in the log information, or an alarm message will be generated and the active ports will be recorded in the log information at the same time.
[0090] When the number of groups with active ports exceeds NQ, it indicates that the number of port groups actually connected to the HBA exceeds the number of port groups that should be connected to the HBA. This may indicate a connection error or other abnormal situation. Generating alarm information allows administrators to quickly determine the cause of the abnormality and check the connection status between the HBA and the IO Expander ports. Recording active ports in the log information can help administrators find the incorrectly connected ports more quickly and improve the efficiency of troubleshooting.
[0091] Alternatively, besides determining the number of HBAs based on the number of in-place ports and then allocating disks accordingly, other methods can be used to allocate disks. For example, in some scenarios where each HBA is always connected to the extender via a fixed number of cables, disk allocation can be performed directly based on the number of in-place ports.
[0092] For example, if each HBA is connected to the expander via a single cable, the disk can be evenly distributed among the in-place ports after the number of in-place ports is detected, thereby achieving even distribution of disks among HBAs and omitting the intermediate step of determining the number of HBAs based on the in-place ports.
[0093] Optionally, based on the detected in-place port, disks are allocated to each of the at least one HBA connected to the extender, including:
[0094] According to a pre-set lookup table, determine the allocation strategy corresponding to the current in-place port, and allocate disks to the at least one HBA according to the allocation strategy;
[0095] The lookup table is a user-defined lookup table used to store the correspondence between bit ports and allocation strategies.
[0096] Specifically, users can pre-create a lookup table to map the in-situ port status to the allocation policy, then determine the allocation policy corresponding to the current in-situ port status based on the pre-set lookup table, and allocate disks to at least one HBA in the system according to the allocation policy.
[0097] against Figure 1The system architecture lookup table is shown in Table 1, where O indicates the port is present, X indicates the port is not present, and Value is the binary representation of the presence or absence of the four ports. One Zone means all disks are assigned to a single HBA, and Half-Half Zone means half of the disks connected to the BP Expander are assigned to HBA0, and half of the disks connected to the BP Expander are assigned to HBA1. (See reference...) Figure 1 When only ports 0 and 1 are present, the Value is 1100b. According to Table 1, the corresponding allocation strategy is One Zone, meaning HBA0 can access all disks connected to BP0Expander to BP3Expander. When only ports 0 and 2 are present, the Value is 1010b. According to Table 1, the corresponding allocation strategy is Half-HalfZone, meaning that disks connected to BP0Expander and BP1Expander can be allocated to HBA0, and disks connected to BP2Expander and BP3Expander can be allocated to HBA1.
[0098]
[0099] against Figure 6 The system architecture diagram and lookup table are shown in Table 2. This system architecture has a set of redundant ports, where N / A indicates that the number of port groups actually connected to the HBA exceeds two. The system does not support this situation; the IO Expander will not allocate disk space, will generate alarm information, and / or will record the bit ports in the log information. (Reference) Figure 6 When ports 0, 1, 2, and 4 are in position, while ports 3 and 5 are not in position, the Value is 111010b. By looking up Table 2, we can see that the corresponding allocation policy is N / A. The IO Expander generates alarm information and / or records the in-position ports in the log information.
[0100]
[0101]
[0102] In practical applications, the relationship between the number of ports and the allocation strategy can be set according to the user's actual needs before the IO Expander leaves the factory and saved to the IO Expander's firmware. After leaving the factory, when the IO Expander starts up, it first determines the number of ports in place, finds the corresponding allocation strategy based on the number of ports in place, and allocates the corresponding ports to the BP Expander according to this allocation strategy.
[0103] In this way, users can flexibly customize the disk allocation strategy that best suits their needs based on specific application scenarios, without having to perform cumbersome zone configuration through SMP, thus improving efficiency and enhancing user experience.
[0104] The above explanation uses an expander including an IO Expander and a BP Expander as an example. In addition, the expander can also be a single Expander; that is, the functions of the IO Expander and BP Expander can be integrated into a single Expander. This Expander can connect to an HBA and includes multiple ports. The Expander can detect the active ports among these ports and allocate disks to the connected HBAs based on the detected active ports, allowing each HBA to access the corresponding disk through the Expander. The specific implementation principles and technical effects can be found in the above embodiments, and will not be repeated here.
[0105] In summary, the disk configuration method provided in this application can detect the presence of ports among multiple ports of an extender, wherein the presence port is a port connected to an HBA via a cable; based on the detected presence ports, a disk is allocated to each HBA in at least one HBA connected to the extender, so that each HBA can access the corresponding disk through the extender. Thus, the disk allocation strategy can be determined according to the number of presence ports, making the disk allocation more compatible with the actual connection situation of the HBA, with greater flexibility and adaptability to different scenarios. Furthermore, the disk configuration can be automatically adjusted according to the presence port status without manual configuration and restart, effectively simplifying the configuration process and improving configuration efficiency and user experience.
[0106] Corresponding to the disk configuration method described above, this application also provides a disk configuration device. Figure 9 This is a schematic diagram of a cable configuration device provided in an embodiment of this application. The device is applied to an extender, which includes multiple ports for connecting to at least one HBA, the at least one HBA being used to access multiple disks through the extender; the device includes:
[0107] The detection module 901 is used to detect the presence of a port among multiple ports of the extender, wherein the presence port is a port connected to the HBA via a cable;
[0108] The allocation module 902 is configured to allocate disks to each of the at least one HBA connected to the extender based on the detected in-place ports, so that each HBA can access the corresponding disk through the extender.
[0109] In one or more embodiments of this application, optionally, the plurality of ports are divided into N groups; each group includes at least two ports for connecting to the same HBA; the allocation module 902 is specifically used for:
[0110] The number of HBAs connected to the extender is determined based on whether there are in-place ports in each group of ports;
[0111] Based on the number of HBAs, allocate disk space to each HBA.
[0112] In one or more embodiments of this application, optionally, when the allocation module 902 allocates disks to each HBA according to the number of HBAs, it is specifically used for:
[0113] If the number of HBAs is at least two, then multiple disks are allocated to the HBAs connected to the expander according to a uniform allocation strategy; and / or,
[0114] If there is only one HBA, then all disks are allocated to the HBA connected to the extender.
[0115] In one or more embodiments of this application, optionally, at least one of the N groups of ports of the extender is a redundant port; when the allocation module 902 determines the number of HBAs connected to the extender based on whether there is an in-place port in each group of ports, it is specifically used for:
[0116] If the number of groups with in-place ports is less than or equal to the threshold, the number of HBAs connected to the extender is determined based on whether there are in-place ports in each group.
[0117] The threshold is N minus the number of redundant port groups.
[0118] In one or more embodiments of this application, optionally, the allocation module 902 may also be used for:
[0119] If the number of groups in the bit port exceeds the threshold, an alarm message is generated, and / or the bit port is logged.
[0120] In one or more embodiments of this application, optionally, when the allocation module 902 allocates disks for each of the at least one HBA connected to the extender based on the detected in-situ port, it is specifically configured to:
[0121] According to a pre-set lookup table, determine the allocation strategy corresponding to the current in-place port, and allocate disks to the at least one HBA according to the allocation strategy;
[0122] The lookup table is a user-defined lookup table used to store the correspondence between bit ports and allocation strategies.
[0123] The disk configuration device provided in this application embodiment can be used to perform the above-described... Figures 1 to 8 The technical solutions of the embodiments shown are similar in principle and in effect, and will not be described again here.
[0124] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 10 As shown, the electronic device in this embodiment includes:
[0125] At least one processor 1001; and a memory 1002 communicatively connected to said at least one processor;
[0126] The memory 1002 stores instructions that can be executed by the at least one processor 1001, which, when executed by the at least one processor 1001, cause the electronic device to perform the method described in any of the above embodiments.
[0127] Alternatively, the memory 1002 can be either standalone or integrated with the processor 1001.
[0128] The implementation principle and technical effects of the cable configuration device provided in this embodiment can be found in the foregoing embodiments, and will not be repeated here.
[0129] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the methods described in any of the above embodiments.
[0130] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the methods described in any of the above embodiments.
[0131] This application also provides an electronic device including an HBA and a JBOD, wherein the JBOD includes an extender and at least one disk connected to the extender.
[0132] The extender is used to perform the method described in any of the foregoing embodiments.
[0133] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein.
[0134] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope.
[0135] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed.
[0136] The integrated modules implemented as software functional modules described above can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods described in the various embodiments of this application.
[0137] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the application can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor. The memory may include high-speed RAM, and may also include non-volatile memory (NVM), such as at least one disk storage device, and may also be a USB flash drive, external hard drive, read-only memory, disk, or optical disc, etc.
[0138] The aforementioned storage medium can be implemented from any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The storage medium can be any available medium accessible to general-purpose or special-purpose computers.
[0139] An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Alternatively, the storage medium can be an integral part of the processor. Both the processor and the storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and storage medium can exist as discrete components in an electronic device or host device.
[0140] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0141] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0142] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0143] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A disk configuration method, characterized in that, Applied to an extender, the extender including multiple ports for connecting to at least one host bus adapter (HBA), the at least one HBA for accessing multiple disks through the extender; the method includes: Detecting the presence of a port among multiple ports of the extender, wherein the presence port is a port connected to the HBA via a cable; Based on the detected in-place port, a disk is allocated to each HBA in at least one HBA connected to the extender, so that each HBA can access the corresponding disk through the extender; The plurality of ports are divided into N groups; each group includes at least two ports for connecting to the same HBA; based on the detected in-place ports, disks are allocated to each HBA in at least one HBA connected to the extender, including: The number of HBAs connected to the extender is determined based on whether there are in-place ports in each group of ports; Based on the number of HBAs, allocate disk space to each HBA.
2. The method according to claim 1, characterized in that, Based on the number of HBAs, allocate disk space to each HBA, including: If the number of HBAs is at least two, then multiple disks are allocated to the HBAs connected to the expander according to a uniform allocation strategy; and / or, If there is only one HBA, then all disks are allocated to the HBA connected to the extender.
3. The method according to claim 1 or 2, characterized in that, At least one of the N groups of ports of the extender is a redundant port; The number of HBAs connected to the extender is determined based on whether there are any in-place ports in each group of ports, including: If the number of groups with in-place ports is less than or equal to the threshold, the number of HBAs connected to the extender is determined based on whether there are in-place ports in each group. The threshold is N minus the number of redundant port groups.
4. The method according to claim 3, characterized in that, The method further includes: If the number of groups in the bit port exceeds the threshold, an alarm message is generated, and / or the bit port is logged.
5. The method according to claim 1, characterized in that, Based on the number of HBAs, allocate disk space to each HBA, including: Based on a pre-set lookup table, determine the allocation strategy corresponding to the number of HBAs, and allocate disks to the at least one HBA according to the allocation strategy; The lookup table is a user-defined lookup table used to store the correspondence between the number of HBAs and the allocation strategy.
6. A disk configuration device, characterized in that, Applied to an extender, the extender including multiple ports for connecting to at least one HBA, the at least one HBA for accessing multiple disks through the extender; the device includes: A detection module is used to detect the presence of a port among multiple ports of the extender, wherein the presence port is a port connected to the HBA via a cable; The allocation module is used to allocate disks to each HBA in at least one HBA connected to the extender based on the detected in-place port, so that each HBA can access the corresponding disk through the extender; The multiple ports are divided into N groups; each group includes at least two ports for connecting to the same HBA; the allocation module is specifically used for: The number of HBAs connected to the extender is determined based on whether there are any in-place ports in each group of ports; disks are allocated to each HBA based on the number of HBAs.
7. An electronic device, characterized in that, include: At least one processor; and a memory communicatively connected to the at least one processor; The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, cause the electronic device to perform the method according to any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the method as described in any one of claims 1-5.
9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-5.