Injected-fault storage and electronic device

By receiving and comparing port number addresses in the storage expansion cabinet, the problem of port number verification between the HBA card and the storage expansion cabinet is solved, ensuring the accuracy of data transmission and user experience.

CN117215845BActive Publication Date: 2026-06-26INSPUR SUZHOU INTELLIGENT TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INSPUR SUZHOU INTELLIGENT TECH CO LTD
Filing Date
2023-08-30
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Existing technology cannot effectively verify whether the port numbers of the HBA card and the storage expansion cabinet are the same, leading to data transmission errors.

Method used

By receiving the port numbers of the host bus adapter and the second storage expansion cabinet in the storage expansion cabinet, converting them into addresses and comparing them, it can determine whether there is a fault of multiple controllers connected in the same location. It can then control the alarm to sound and modify the port number according to the comparison result to prevent data transmission errors.

Benefits of technology

It enables effective verification of HBA cards and storage expansion cabinet port numbers, prevents data transmission errors, ensures the proper reporting and repair of alarms, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117215845B_ABST
    Figure CN117215845B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a storage device for injecting faults and an electronic device, the storage device for injecting faults comprises a host bus adapter and two storage expansion cabinets, the two storage expansion cabinets are respectively a first storage expansion cabinet and a second storage expansion cabinet, and the first storage expansion cabinet is electrically connected with the host bus adapter and the second storage expansion cabinet. One storage expansion cabinet is used as a fault detection end, and port numbers of two devices are received respectively, so as to determine whether a fault of connecting multiple controllers at the same position occurs, thereby the port numbers of the HBA card and the storage expansion cabinet can be verified, and the situation that the addresses of the port numbers converted by the HBA card and the storage expansion cabinet are same is prevented, so as to cause subsequent data transmission errors, and further, the problem that whether the addresses of the port numbers of the HBA card and the storage expansion cabinet are same cannot be verified in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of storage devices, and more specifically, to a storage device and electronic device that can be injected with faults. Background Technology

[0002] With the development of data storage technology, the storage space of the storage device itself is sometimes insufficient to meet customer needs. In such cases, it is necessary to connect an expansion cabinet via an HBA (Host Bus Adapter) card to expand the storage capacity. As professional data storage devices, storage manufacturers not only focus on the connection status of the expansion cabinet under normal conditions but also on whether alarms under various abnormal conditions can be reported correctly. This requires storage manufacturers to ensure a superior customer experience from multiple perspectives.

[0003] The most common error injection method is to introduce errors into the data bus at one or more fixed times, thereby triggering alarms.

[0004] However, the existing solution cannot verify the port numbers of the HBA card and storage expansion cabinet, which can lead to errors in subsequent data transmission. Summary of the Invention

[0005] This application provides a fault-injecting storage device and electronic device to at least solve the problem that existing solutions cannot verify whether the port numbers of the HBA card and the storage expansion cabinet are the same.

[0006] According to one embodiment of this application, a fault-injecting storage device is provided. The fault-injecting storage device includes a host bus adapter and two storage expansion cabinets, which are a first storage expansion cabinet and a second storage expansion cabinet, respectively. The first storage expansion cabinet is electrically connected to the host bus adapter and the second storage expansion cabinet.

[0007] The first storage expansion cabinet receives a first port number sent by the host bus adapter and a second port number sent by the second storage expansion cabinet. It converts the first port number into a first port number address and the second port number into a second port number address. By comparing the first port number address and the second port number address, a comparison result is obtained. Based on the comparison result, it is determined whether a fault has occurred where multiple controllers are connected to the same location. The first port number is the fault number injected into the port of the host bus adapter connected to the first storage expansion cabinet, and the second port number is the fault number injected into the port of the second storage expansion cabinet connected to the first storage expansion cabinet. The first port number address is a unique identifier for the port of the host bus adapter connected to the first storage expansion cabinet, and the second port number address is a unique identifier for the port of the second storage expansion cabinet connected to the first storage expansion cabinet.

[0008] In an exemplary embodiment, the first storage expansion cabinet is used to determine, based on the comparison result, whether a fault has occurred where multiple controllers are connected to the same location, including:

[0009] If the comparison result shows that the first port number address and the second port number address are the same, it is determined that a fault has occurred where multiple controllers are connected to the same location;

[0010] If the comparison result shows that the first port number address and the second port number address are different, it is determined that there is no fault of multiple controllers connected to the same location.

[0011] In an exemplary embodiment, after determining that a fault has occurred where multiple controllers are connected to the same location, the first storage expansion cabinet is further configured to perform the following steps: control a first alarm to sound an alarm to indicate that a fault has occurred where multiple controllers are connected to the same location;

[0012] In one exemplary embodiment, after determining that no fault has occurred where multiple controllers are connected to the same location, the first storage expansion cabinet is further configured to perform the following steps: control a second alarm to sound an alarm to indicate that no fault has occurred where multiple controllers are connected to the same location.

[0013] In one exemplary embodiment, the host bus adapter is further configured to perform the following steps:

[0014] In response to a received first modification instruction, the first port number of the host bus adapter is modified to a first modified port number, wherein the first modification instruction is an instruction to modify the first port number of the host bus adapter.

[0015] In an exemplary embodiment, the first modification instruction includes a first mapping relationship, which is a mapping relationship between the names of each port in the host bus adapter and the port numbers corresponding to the port names. The host bus adapter is configured to, in response to the received first modification instruction, modify a first port number of the host bus adapter to a first modified port number, including:

[0016] Based on the first port name and the first mapping relationship, a first target port number is determined, wherein the first target port number is the number of the port corresponding to the first port name in the first mapping relationship;

[0017] The first modified port number is determined to be the first target port number.

[0018] In one exemplary embodiment, the second storage expansion cabinet is further configured to perform the following steps:

[0019] In response to the received second modification instruction, the second port number of the second storage expansion cabinet is modified to a second modified port number, where the second modification instruction is an instruction to modify the second port number of the second storage expansion cabinet.

[0020] In one exemplary embodiment, the second modification instruction includes a second mapping relationship, which is a mapping relationship between the names of each port in the second storage expansion cabinet and the port numbers corresponding to the port names. The second storage expansion cabinet is used to modify the second port number of the second storage expansion cabinet to a second modified port number in response to the received second modification instruction, including:

[0021] Based on the second port name and the second mapping relationship, the second target port number is determined, where the second target port number is the number of the port corresponding to the second port name in the second mapping relationship;

[0022] The second modified port number is determined to be the second target port number.

[0023] In an exemplary embodiment, after modifying the first port number of the host bus adapter to a first modified port number and modifying the second port number of the second storage expansion cabinet to a second modified port number, the first storage expansion cabinet is further configured to perform the following steps:

[0024] Obtain the first modified port number sent by the host bus adapter and the second modified port number sent by the second storage expansion cabinet;

[0025] The first modified port number is converted to a first modified port number address, and the second modified port number is converted to a second modified port number address.

[0026] If the first modified port number address and the second modified port number address are different, it is determined that the port numbers of the host bus adapter and the second storage expansion cabinet have been successfully modified, and the second alarm is controlled to sound an alarm to indicate that there is no fault of multiple controllers connected to the same location.

[0027] According to another embodiment of this application, an electronic device is provided, including any of the aforementioned injected fault storage devices.

[0028] This application utilizes a storage expansion cabinet as a fault detection terminal, receiving port numbers from two devices to determine if multiple controllers are connected to the same location. This allows for verification of the port numbers of the HBA card and the storage expansion cabinet, preventing data transmission errors caused by identical port numbers converted from the HBA card and the storage expansion cabinet. This solves the problem of existing solutions being unable to verify whether the port numbers of the HBA card and the storage expansion cabinet have identical addresses. Attached Figure Description

[0029] Figure 1 This is an interactive schematic diagram of a storage device for injecting faults according to an embodiment of this application;

[0030] Figure 2 This is a schematic diagram of the structure of a storage device for injecting faults according to an embodiment of this application;

[0031] Figure 3 This is a schematic diagram illustrating the interaction between the host bus adapter and the first storage expansion cabinet;

[0032] Figure 4 This is a flowchart of a method for determining a fault in multiple controllers connected at the same location, according to an embodiment of this application. Detailed Implementation

[0033] The embodiments of this application will be described in detail below with reference to the accompanying drawings and examples.

[0034] It should be noted that the terms "first," "second," etc., in the specification, claims, and drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0035] Definitions:

[0036] Operating system of the OSES expansion cabinet.

[0037] JBOD: Storage Expansion Cabinet.

[0038] HBA: Host Bus Adapter, a card that can be inserted into a computer or mainframe. In this application, it mainly refers to an external card used by storage to connect to an expansion cabinet.

[0039] WWPN: World Wide Port Number refers to the port number. Each port on an HBA card has a unique WWPN.

[0040] WWNN: World Wide Node Number refers to the node number. Each independent device has a unique WWNN, such as an HBA having a unique WWNN.

[0041] SAS: Serial Attached SCSI is a disk connection technology that combines the advantages of parallel SCSI and serial connection technologies (such as FC, SSA, IEEE1394). It uses serial communication protocols as its protocol architecture and adopts SCSI-3 extended instructions.

[0042] PHY: The interface between the device and the transmission system. Each PHY has both a SAS address and an ATTACHED address, which is reported by the device to which the PHY is connected. A port contains one or more PHYs with the same SAS and ATTACHED addresses.

[0043] VPD: A type of data stored in a hardware device that includes fields describing device information, such as device ID, serial number, model, and registration information.

[0044] This embodiment provides a storage device for injecting faults, such as Figure 1 As shown, the faulty storage device includes a host bus adapter (HBA) and two storage expansion cabinets, namely a first storage expansion cabinet JBOD-1 and a second storage expansion cabinet JBOD-2. The first storage expansion cabinet JBOD-1 is electrically connected to the host bus adapter (HBA) and the second storage expansion cabinet JBOD-2, respectively.

[0045] In the backplane VPD, a unique WWPN is assigned to each port of the HBA card based on the HBA card's WWNN. This is the unique identifier for the HBA card port. The expansion cabinet's SAS seed is converted into a SAS address, where the four ports of the expansion cabinet (i.e., Figure 2Each of the two in and two out ports in JBOD-1, or the two in and two out ports in JBOD-2, has a unique SAS ADDRESS as an identifier used to enable interaction between the HBA and the expansion cabinet ports. SAS ADDRESS is the node number of the expansion cabinet, and WWNN is the node number of the HBA card.

[0046] Specifically, such as Figure 2 As shown, taking a dual-controller storage device as an example, the dual-controller storage device, the first storage expansion cabinet JBOD-1, and the second storage expansion cabinet JBOD-2 each have an upper control terminal and a lower control terminal. The upper control terminal and the lower control terminal of the dual-controller storage device each have an HBA card. The input interface in of the upper control terminal of JBOD-1 is electrically connected to the HBA of the upper control terminal of the dual-controller storage device. The input interface in of the lower control terminal of JBOD-1 is electrically connected to the HBA of the lower control terminal of the dual-controller storage device. The output interface out of the upper control terminal of JBOD-1 is electrically connected to the output interface out of the upper control terminal of JBOD-2. The output interface out of the lower control terminal of JBOD-1 is electrically connected to the output interface out of the lower control terminal of JBOD-2.

[0047] The first storage expansion cabinet receives a first port number sent by the host bus adapter and a second port number sent by the second storage expansion cabinet. It converts the first port number into a first port number address and the second port number into a second port number address. By comparing the first port number address and the second port number address, a comparison result is obtained. Based on the comparison result, it is determined whether a fault has occurred where multiple controllers are connected to the same location. The first port number is the fault number injected into the port of the host bus adapter connected to the first storage expansion cabinet, and the second port number is the fault number injected into the port of the second storage expansion cabinet connected to the first storage expansion cabinet. The first port number address is a unique identifier for the port of the host bus adapter connected to the first storage expansion cabinet, and the second port number address is a unique identifier for the port of the second storage expansion cabinet connected to the first storage expansion cabinet.

[0048] The interaction between the host bus adapter and the first storage expansion enclosure is as follows: Figure 3 As shown, it will not be elaborated further here. SWITCH WWPN is the port number of the first storage expansion cabinet. SAS ADDRESS is the port number displayed when mapped to the dual-controller storage device. SAS SEED is the node number of the first storage expansion cabinet.

[0049] In the aforementioned fault-injected storage device, a storage expansion cabinet is used as a fault detection terminal to receive the port numbers of two devices (i.e., the host bus adapter and the second storage expansion cabinet). This allows the system to determine whether multiple controllers are connected to the same location, thereby verifying the port numbers of the HBA card and the storage expansion cabinet. This prevents subsequent data transmission errors caused by the port numbers being converted to the same address by the HBA card and the storage expansion cabinet. This solves the problem that existing solutions cannot verify whether the port numbers of the HBA card and the storage expansion cabinet are the same.

[0050] This method simulates fault injection by connecting multiple controllers to the same location using OSES. Each port of the product has a specific identifier, such as the WWNN of the HBA card or the SAS seed of the expansion cabinet port. When two ports have the same identifier, they are considered to be the same controller. Thus, when two controllers with the same identifier are connected to the same expansion cabinet, the expansion cabinet will think that multiple controllers are connected to the same location. This method can successfully construct faults, verify whether the corresponding alarms can be reported normally, and whether the repair process after alarm reporting is reasonable and clear, ensuring a good user experience.

[0051] Considering that the fault injection method for simulating storage of multiple controllers connected to the same location via OSES requires modification of the VPD information, and the modified VPD information cannot be automatically repaired by the storage backend, it is necessary to manually change the modified VPD back to its original value. Therefore, sufficient security measures should be taken before conducting fault injection tests, the original VPD data should be recorded and saved, and after the fault injection is completed and the alarm is reported, the VPD information should be changed back to its original value to restore the environment damaged by the fault injection and avoid unnecessary losses and risks.

[0052] In an exemplary embodiment, the first storage expansion cabinet is used to determine, based on the comparison result, whether a fault has occurred where multiple controllers are connected to the same location, including:

[0053] If the comparison results show that the first port number address and the second port number address are the same, it is determined that a fault has occurred where multiple controllers are connected to the same location.

[0054] If the comparison results show that the first port number address and the second port number address are different, it is determined that there is no fault of multiple controllers connected to the same location.

[0055] Specifically, such as Figure 2As shown, the first storage expansion cabinet JBOD-1 converts WWPN (i.e., the first port number) to SASATTACHED ADDRESS1 (i.e., the address of the first port number) and SAS ADDRESS (i.e., the second port number) to SASATTACHED ADDRESS2 (i.e., the address of the second port number). JBOD-1 compares SAS ATTACHED ADDRESS1 and SASATTACHED ADDRESS2 to determine whether they are the same. If they are the same, it is considered that a fault has occurred where multiple controllers are connected to the same location. If they are different, it is considered that no fault has occurred where multiple controllers are connected to the same location. This achieves the purpose of detecting faults where multiple controllers are connected to the same location.

[0056] In an exemplary embodiment, after determining that a fault has occurred in which multiple controllers are connected at the same location, the first storage expansion cabinet is further configured to perform the following steps: control a first alarm to sound an alarm to indicate that a fault has occurred in which multiple controllers are connected at the same location;

[0057] Specifically, in the event that a fault has occurred where multiple controllers are connected to the same location, an alarm needs to be triggered to inform staff that a fault has occurred where multiple controllers are connected to the same location.

[0058] In one exemplary embodiment, after determining that no fault has occurred where multiple controllers are connected to the same location, the first storage expansion cabinet is further configured to perform the following step: controlling a second alarm to sound an alarm to indicate that no fault has occurred where multiple controllers are connected to the same location.

[0059] Specifically, in the absence of a fault where multiple controllers are connected to the same location, an alarm is required to inform staff that there is no fault where multiple controllers are connected to the same location. The sound or light color of the second alarm should be distinguishable from the first alarm. For example, the first alarm should light up red, the second alarm should light up green, the first alarm should sound three times, and the second alarm should sound two times.

[0060] In one exemplary embodiment, the host bus adapter described above is further configured to perform the following steps:

[0061] In response to the received first modification instruction, the first port number of the host bus adapter is modified to a first modified port number, wherein the first modification instruction is an instruction to modify the first port number of the host bus adapter.

[0062] Specifically, since the first storage expansion cabinet in this application can only determine that a fault has occurred where multiple controllers are connected to the same location, but cannot determine which port number is incorrect, it is necessary to modify both the HBA card and JBOD-2. The staff inputs the first modification instruction into the host bus adapter, so that the host bus adapter modifies the first port number in the host bus adapter to the first modified port number according to the first modification instruction. The first modified port number is the correct port number. Even if the first port number was originally the correct port number, it does not affect the fact that the final first modified port number is the correct port number.

[0063] In an exemplary embodiment, the first modification instruction includes a first mapping relationship, which is a mapping relationship between the names of each port in the host bus adapter and the port numbers corresponding to the port names. The host bus adapter is configured to, in response to the received first modification instruction, modify the first port number of the host bus adapter to a first modified port number, including:

[0064] Based on the first port name and the first mapping relationship described above, the first target port number is determined, where the first target port number is the number of the port corresponding to the first port name in the first mapping relationship.

[0065] The first modified port number is determined to be the first target port number.

[0066] Specifically, the host bus adapter finds the port number corresponding to the first port name in the first mapping relationship based on the first port name (or the port node number), and uses this port number as the first port number to correct the port number. For example, if the first port number is 11111111 and the correct port number is 1211111, then it is only necessary to change the 1 in the second bit of the first port number to 2. That is, based on the correct port number and the first port number, the target position in the first port number is determined. The target position is the second bit, so the 1 in the second bit is changed to 2, and finally it is changed to 1211111.

[0067] In one exemplary embodiment, the second storage expansion cabinet described above is further configured to perform the following steps:

[0068] In response to the received second modification instruction, the second port number of the second storage expansion cabinet is modified to a second modified port number. The second modification instruction is an instruction to modify the second port number of the second storage expansion cabinet.

[0069] Specifically, because the first storage expansion cabinet in this application can only determine that a fault has occurred where multiple controllers are connected in the same location, but cannot determine which port number is incorrect, it is necessary to modify both the HBA card and JBOD-2. The staff inputs the second modification command into the second storage expansion cabinet, so that the host bus adapter modifies the second port number of the second storage expansion cabinet to the second modified port number according to the first modification command. The second modified port number is the correct port number. Even if the second port number was originally the correct port number, it does not affect the fact that the final second modified port number is the correct port number.

[0070] In an exemplary embodiment, the second modification instruction includes a second mapping relationship, which is a mapping relationship between the names of each port in the second storage expansion cabinet and the port numbers corresponding to the port names. The second storage expansion cabinet is used to modify the second port number of the second storage expansion cabinet to a second modified port number in response to the received second modification instruction, including:

[0071] Based on the second port name and the second mapping relationship described above, the second target port number is determined, where the second target port number is the number of the port corresponding to the second port name in the second mapping relationship.

[0072] The aforementioned second modified port number is determined to be the aforementioned second target port number.

[0073] Specifically, the second storage expansion cabinet finds the port number corresponding to the second port name in the second mapping relationship based on the second port name (or the port node number), and uses this port number as the second modified port number to achieve the purpose of correcting the port number. For example, if the second port number is 11111111 and the correct port number is 1211111, then it is only necessary to change the 1 in the second bit of the second port number to 2. That is, based on the correct port number and the second port number, the target position in the first port number is determined. The target position is the second bit, so the 1 in the second bit is changed to 2, and finally it is changed to 1211111.

[0074] In an exemplary embodiment, after modifying the first port number of the host bus adapter to a first modified port number and modifying the second port number of the second storage expansion cabinet to a second modified port number, the first storage expansion cabinet is further configured to perform the following steps:

[0075] Obtain the first modified port number sent by the host bus adapter and the second modified port number sent by the second storage expansion cabinet;

[0076] Based on converting the first modified port number to the first modified port number address, the second modified port number is converted to the second modified port number address;

[0077] If the first modified port number address and the second modified port number address are different, it is determined that the port numbers of the host bus adapter and the second storage expansion cabinet have been successfully modified, and the second alarm is controlled to sound an alarm to indicate that there is no fault of multiple controllers connected to the same location.

[0078] Specifically, after modifying the port numbers of the host bus adapter and the second storage expansion cabinet, the first storage expansion cabinet needs to be powered off and restarted. This allows the first storage expansion cabinet to re-acquire the first modified port number sent by the host bus adapter and the second modified port number sent by the second storage expansion cabinet to verify the correctness of the modified port numbers. The two modified port numbers are then converted into the first modified port number address and the second modified port number address, respectively. If the first modified port number address and the second modified port number address are different, it is determined that the port numbers of the host bus adapter and the second storage expansion cabinet have been successfully modified. At the same time, the staff needs to be informed of the successful modification, so the second alarm needs to be triggered. Conversely, if the first modified port number address and the second modified port number address are the same, the port numbers need to be modified again.

[0079] Additionally, check the storage controller HBA card WWNN, and execute the ec_chvpd-sa command to view VPD information.

[0080] To check the storage controller HBA card WWPN, execute the lsportsas command on the storage.

[0081] To check the JBOD-2 upper control SAS seed, first execute pl_osescli–En–P0xcN to enter the expansion cabinet interactive access interface (where “n” represents the expansion cabinet ID, i.e., node number or name, and “N” can be “0” or “1”, where “0” represents upper control of the expansion cabinet and “1” represents lower control of the expansion cabinet), and execute the / mfg / getsasaddr command.

[0082] The ec_chvpd command modifies the WWNN of the storage controller HBA card, changing the end of the WWNN to 3F, so that the port numbers of the dual-controller storage device and the second storage expansion cabinet have the same end.

[0083] pl_osescli–En–P0xc1 modifies the SAS seed of the JBOD2 controller through the interactive access interface by executing the command / mfg / setsasaddr xxxxxx (the value of the SAS seed should be consistent with the first seven bytes of the WWPN threshold of the controller HBA board, but the end should be 00).

[0084] A method for determining faults in a storage device operating with injected faults and multiple controllers connected at the same location. Figure 4 This is a flowchart illustrating a method for determining a fault in multiple controllers connected at the same location according to an embodiment of this application, as shown below. Figure 4 As shown, the process includes the following steps:

[0085] Step S1: The first storage expansion cabinet receives the first port number and the first port node number sent by the host bus adapter, and the second port number and the second port node number sent by the second storage expansion cabinet. The first port number is the number of the port in the host bus adapter that is connected to the first storage expansion cabinet, the second port number is the number of the port in the second storage expansion cabinet that is connected to the first storage expansion cabinet, the first port node number is the node number of the port in the host bus adapter that is connected to the first storage expansion cabinet, and the second port node number is the node number of the port in the second storage expansion cabinet that is connected to the first storage expansion cabinet.

[0086] Step S2: The first storage expansion cabinet converts the first port number into a first port number address and the second port number into a second port number address. The first port number address is a unique identifier of the port in the host bus adapter that is connected to the first storage expansion cabinet, and the second port number address is a unique identifier of the port in the second storage expansion cabinet that is connected to the first storage expansion cabinet.

[0087] Step S3: If the first port number address and the second port number address are the same, it is determined that a fault has occurred where multiple controllers are connected to the same location, and proceed to step S5; if the first port number address and the second port number address are different, it is determined that a fault has not occurred where multiple controllers are connected to the same location, and proceed to step S4.

[0088] Step S4: The first storage expansion cabinet controls the second alarm to sound an alarm, indicating that there is no fault of multiple controllers connected to the same location;

[0089] Step S5: The first storage expansion cabinet controls the first alarm to sound an alarm, indicating that a fault has occurred where multiple controllers are connected to the same location, and then proceeds to step S6.

[0090] Step S6: In response to the received correct port number instruction, the first storage expansion cabinet determines the correct number of the port in the host bus adapter connected to the first storage expansion cabinet and the correct number of the port in the second storage expansion cabinet connected to the first storage expansion cabinet based on the correct port number instruction, the first port node number and the second port node number. The correct port number instruction includes two mapping relationships: one is the mapping relationship between the first port node number and the correct number of the port in the host bus adapter connected to the first storage expansion cabinet, and the other is the mapping relationship between the second port node number and the correct number of the port in the second storage expansion cabinet connected to the first storage expansion cabinet.

[0091] Step S7: Display the correct port numbers of the host bus adapter connected to the first storage expansion cabinet and the correct port numbers of the second storage expansion cabinet connected to the first storage expansion cabinet on the display screen.

[0092] By using a storage expansion cabinet as a fault detection terminal, receiving port numbers from two devices (i.e., the host bus adapter and the second storage expansion cabinet), it can determine whether there is a fault of multiple controllers connected to the same location. This allows for the verification of the port numbers of the HBA card and the storage expansion cabinet, preventing subsequent data transmission errors caused by the port numbers of the HBA card and the storage expansion cabinet having the same address after port number conversion. This solves the problem that existing solutions cannot verify whether the port numbers of the HBA card and the storage expansion cabinet have the same address.

[0093] In another exemplary embodiment, after determining that a fault has occurred in which multiple controllers are connected at the same location, the first storage expansion cabinet is further configured to perform the following steps: control a first alarm to sound an alarm to indicate that a fault has occurred in which multiple controllers are connected at the same location;

[0094] In another exemplary embodiment, after determining that no fault has occurred where multiple controllers are connected to the same location, the first storage expansion cabinet is further configured to perform the following steps: controlling a second alarm to sound an alarm to indicate that no fault has occurred where multiple controllers are connected to the same location.

[0095] In another exemplary embodiment, the host bus adapter described above is also used to perform the following steps:

[0096] In response to the received first modification instruction, the first port number of the host bus adapter is modified to a first modified port number, wherein the first modification instruction is an instruction to modify the first port number of the host bus adapter.

[0097] In another exemplary embodiment, the first modification instruction includes a first mapping relationship, which is a mapping relationship between the names of each port in the host bus adapter and the port numbers corresponding to the port names. The host bus adapter is configured to, in response to the received first modification instruction, modify the first port number of the host bus adapter to a first modified port number, including:

[0098] Based on the first port name and the first mapping relationship described above, the first target port number is determined, where the first target port number is the number of the port corresponding to the first port name in the first mapping relationship.

[0099] The first modified port number is determined to be the first target port number.

[0100] In another exemplary embodiment, the second storage expansion cabinet is also used to perform the following steps:

[0101] In response to the received second modification instruction, the second port number of the second storage expansion cabinet is modified to a second modified port number. The second modification instruction is an instruction to modify the second port number of the second storage expansion cabinet.

[0102] In another exemplary embodiment, the second modification instruction includes a second mapping relationship, which is a mapping relationship between the names of each port in the second storage expansion cabinet and the port numbers corresponding to the port names. The second storage expansion cabinet is used to modify the second port number of the second storage expansion cabinet to a second modified port number in response to the received second modification instruction, including:

[0103] Based on the second port name and the second mapping relationship described above, the second target port number is determined, where the second target port number is the number of the port corresponding to the second port name in the second mapping relationship.

[0104] The aforementioned second modified port number is determined to be the aforementioned second target port number.

[0105] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to 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, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0106] By modifying the SAS seed and stored WWPN of JBOD, the above method ensures that at least two of the four ports of JBOD1 have the same ATTACHED ADDRESS. This successfully simulates the error phenomenon of multiple controllers in the same location. When applied to project testing, it can verify the abnormal handling process of multiple controllers connected in the same location, effectively improve the quality of equipment testing, and provide users with more reliable products.

[0107] The fault injection method for simulating multiple controllers connected to the same location in storage using OSES can be implemented by comparing the WWPN of the HBA with the ATTACHED ADDRESS of the four ports of the JBOD (the four ports are the in and out ports of the upper and lower controllers respectively). The fault occurs when at least two ATTACHED ADDRESS are identical. In an environment where two expansion cabinets are cascaded in a main cabinet, each port of the HBA card in the main cabinet is converted into a unique WWPN based on the HBA card's WWNN, mapped to the SAS ATTACHED ADDRESS of the corresponding in port of JBOD-1. The SAS seed of JBOD2 is converted into a SAS ADDRESS, mapped to the SAS ATTACHED ADDRESS of the corresponding out port of JBOD-1. Normally, the SAS ATTACHED ADDRESS of the four ports of JBOD1 are different. By ensuring that the WWPN of the HBA port and the SAS ADDRESS of the JBOD2 in port are consistent, two identical ATTACHED ADDRESS will appear in JBOD-1, thus the storage will perceive that two identical controllers exist in the same location on JBOD-1.

[0108] When the storage is a multi-controller product (i.e., two or more controllers), the fault of simulating multiple controllers connected to the same location in the storage can be achieved without OSES. It is only necessary to ensure that at least two controllers have the same WWNN, and the fault can be simulated.

[0109] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when run.

[0110] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0111] Embodiments of this application also provide an electronic device including any of the aforementioned injected fault storage devices. A storage expansion cabinet is used as a fault detection terminal to receive port numbers from two devices (i.e., the host bus adapter and the second storage expansion cabinet), thereby determining whether a fault exists where multiple controllers are connected to the same location. This allows for verification of the port numbers of the HBA card and the storage expansion cabinet, preventing data transmission errors caused by identical port numbers converted from the HBA card and the storage expansion cabinet. This solves the problem that existing solutions cannot verify whether the port numbers of the HBA card and the storage expansion cabinet have identical addresses.

[0112] In one exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.

[0113] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.

[0114] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a fault-injected storage device for execution by the computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular hardware and software combination.

[0115] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the principles of this application should be included within the protection scope of this application.

Claims

1. A fault-injecting storage device, characterized in that, include: Host bus adapter; Two storage expansion cabinets, namely the first storage expansion cabinet and the second storage expansion cabinet, are provided. The first storage expansion cabinet is electrically connected to the host bus adapter and the second storage expansion cabinet, respectively. The first storage expansion cabinet is used to receive a first port number sent by the host bus adapter and a second port number sent by the second storage expansion cabinet. It converts the first port number into a first port number address and the second port number into a second port number address. By comparing the first port number address and the second port number address, a comparison result is obtained. Based on the comparison result, it is determined whether a fault has occurred where multiple controllers are connected to the same location. The first port number is the fault number injected into the port of the host bus adapter connected to the first storage expansion cabinet, and the second port number is the fault number injected into the port of the second storage expansion cabinet connected to the first storage expansion cabinet. The first port number address is a unique identifier for the port of the host bus adapter connected to the first storage expansion cabinet, and the second port number address is a unique identifier for the port of the second storage expansion cabinet connected to the first storage expansion cabinet. The first storage expansion cabinet is used to determine, based on the comparison result, whether a fault has occurred where multiple controllers are connected to the same location, including: If the comparison result shows that the first port number address and the second port number address are the same, it is determined that a fault has occurred where multiple controllers are connected to the same location; If the comparison result shows that the first port number address and the second port number address are different, it is determined that there is no fault of multiple controllers connected to the same location; After determining that a fault has occurred where multiple controllers are connected to the same location, the first storage expansion cabinet is also used to perform the following steps: control the first alarm to sound an alarm to indicate that a fault has occurred where multiple controllers are connected to the same location; After confirming that there is no fault of multiple controllers connected to the same location, the first storage expansion cabinet is also used to perform the following steps: control the second alarm to sound an alarm to indicate that there is no fault of multiple controllers connected to the same location.

2. The storage device for injecting faults according to claim 1, characterized in that, The host bus adapter is also used to perform the following steps: In response to a received first modification instruction, the first port number of the host bus adapter is modified to a first modified port number, wherein the first modification instruction is an instruction to modify the first port number of the host bus adapter.

3. The storage device for injecting faults according to claim 2, characterized in that, The first modification instruction includes a first mapping relationship, which is a mapping relationship between the names of each port in the host bus adapter and the port numbers corresponding to the port names. The host bus adapter, in response to the received first modification instruction, modifies the first port number of the host bus adapter to a first modified port number, including: Based on the first port name and the first mapping relationship, a first target port number is determined, wherein the first target port number is the number of the port corresponding to the first port name in the first mapping relationship; The first modified port number is determined to be the first target port number.

4. The storage device for injecting faults according to claim 2, characterized in that, The second storage expansion cabinet is also used to perform the following steps: In response to the received second modification instruction, the second port number of the second storage expansion cabinet is modified to a second modified port number, where the second modification instruction is an instruction to modify the second port number of the second storage expansion cabinet.

5. The storage device for injecting faults according to claim 4, characterized in that, The second modification instruction includes a second mapping relationship, which is a mapping relationship between the names of each port in the second storage expansion cabinet and the port numbers corresponding to the port names. The second storage expansion cabinet, in response to the received second modification instruction, modifies the second port number of the second storage expansion cabinet to a second modified port number, including: Based on the second port name and the second mapping relationship, the second target port number is determined, where the second target port number is the number of the port corresponding to the second port name in the second mapping relationship; The second modified port number is determined to be the second target port number.

6. The storage device for injecting faults according to claim 4, characterized in that, After modifying the first port number of the host bus adapter to the first modified port number and modifying the second port number of the second storage expansion cabinet to the second modified port number, the first storage expansion cabinet is further configured to perform the following steps: Obtain the first modified port number sent by the host bus adapter and the second modified port number sent by the second storage expansion cabinet; The first modified port number is converted to a first modified port number address, and the second modified port number is converted to a second modified port number address. If the first modified port number address and the second modified port number address are different, it is determined that the port numbers of the host bus adapter and the second storage expansion cabinet have been successfully modified, and the second alarm is controlled to sound an alarm to indicate that there is no fault of multiple controllers connected to the same location.

7. An electronic device, characterized in that, The storage device includes the injection fault as described in any one of claims 1 to 6.