Access control method and device of storage equipment, storage medium and electronic equipment
By keeping the control link closed until configuration synchronization when the storage device is connected to the storage cluster, the problem of the storage device being unable to respond to server requests when the storage device is not ready, realizing the timely response of the storage device in the ready state, improving business continuity.
Patent Information
- Application Number
- CN202510775879.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-11
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2045-06-11
AI Technical Summary
When accessing the storage cluster, the storage device is in an unready state due to the incomplete configuration synchronization, and cannot respond to server requests in time, resulting in low business continuity.
Detect the storage device to be accessed and control the link between its service port and the server to remain closed until the configuration information is synchronized, and then open the link to ensure that the storage device responds to server requests when it is ready.
Avoid server waiting timeout and business interruption caused by unsynchronized configurations, and improves the business continuity of the storage system.
Smart Images

Figure CN120281808A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computers, and in particular, to an access control method and device for a storage device, a storage medium, and an electronic device. Background Art
[0002] FC (Fibre Channel) technology, with its advantages of high performance and low latency, is widely used in host service access and complex storage architectures such as multi-control clusters and dual-active disaster recovery, and has become the core interconnection technology of storage systems.
[0003] In the related art, when a storage device node rejoins the storage cluster after a fault recovery, whether it is the FC port that bears the host service access function or serves the multi-control interconnection within the storage cluster, a link initialization operation will be immediately executed. However, in high-load and IO-intensive scenarios, when a storage device node undergoes a fault recovery, the host may send a service data request before the storage device node has completed the cluster configuration recovery. At this time, since the storage device node is in an unready state, it cannot respond to the host request in time, which is extremely likely to cause a volume scan timeout phenomenon, and then lead to the loss of the volume path on the host side. Especially in complex situations such as multiple storage node failures or system upgrades, it is more likely to cause abnormal read and write interruptions, seriously affecting the reliability and service continuity of the storage system.
[0004] In view of the technical problems in the related art that when a storage device is accessing a storage cluster, it is in an unready state due to incomplete configuration synchronization and cannot respond to server requests in time, resulting in low service continuity, no effective solution has been proposed yet. Summary of the Invention
[0005] The embodiments of the present application provide an access control method and device for a storage device, a storage medium, and an electronic device, so as to at least solve the technical problems in the related art that when a storage device is accessing a storage cluster, it is in an unready state due to incomplete configuration synchronization and cannot respond to server requests in time, resulting in low service continuity.
[0006] According to an embodiment of the embodiments of the present application, an access control method for a storage device is provided, including:
[0007] Detecting whether there is currently a storage device to be accessed to a storage cluster, where each storage device in the storage cluster is used to provide service data required for running services to a server through a service port;
[0008] When it is detected that a target storage device is to be connected to a storage cluster, control the link between the target service port of the target storage device and the server to remain closed, and during the process of performing the connection operation on the target storage device, detect the synchronization status of the target storage device synchronizing the configuration information of the storage cluster, where the configuration information is used to indicate the manner in which the storage devices in the storage cluster provide service data to the server;
[0009] Control the link between the target service port and the server to be opened according to the synchronization status.
[0010] According to another embodiment of the embodiments of the present application, there is also provided an access control device for a storage device, including:
[0011] A first detection module, configured to detect whether there is currently a storage device to be connected to a storage cluster, where each storage device in the storage cluster is used to provide service data required for running services to the server through a service port;
[0012] A first control module, configured to control the link between the target service port of the target storage device and the server to remain closed when it is detected that the target storage device is to be connected to the storage cluster, and during the process of performing the connection operation on the target storage device, detect the synchronization status of the target storage device synchronizing the configuration information of the storage cluster, where the configuration information is used to indicate the manner in which the storage devices in the storage cluster provide service data to the server;
[0013] A second control module, configured to control the link between the target service port and the server to be opened according to the synchronization status.
[0014] The present application also provides an electronic device, including: a memory, configured to store a computer program; a processor, configured to implement the steps of any of the above-mentioned access control methods for a storage device when executing the computer program.
[0015] The present application also provides a computer-readable storage medium, in which a computer program is stored, where the computer program implements the steps of any of the above-mentioned access control methods for a storage device when being executed by a processor.
[0016] The present application also provides a computer program product, including a computer program, where the computer program implements the steps of any of the above-mentioned access control methods for a storage device when being executed by a processor.
[0017] Through the present application, when a target storage device to be connected to a storage cluster is detected, the link between the target service port of the target storage device and the server is controlled to remain closed. During the process of performing the connection operation, the synchronization status of the target storage device synchronizing the configuration information of the storage cluster is detected, and the link between the target service port and the server is controlled to be opened according to the synchronization status, that is, the opening of the link between the target service port and the server is controlled according to the synchronization status of the configuration information, ensuring that the link is opened after the target storage device completes the synchronization of the configuration information. At this time, the target storage device can normally respond to the requests of the server, avoiding the situation in the related art where the server sends requests when the target storage device has not completed the synchronization of the configuration information of the storage cluster, and at this time the target storage device cannot respond in time, thereby causing the server to wait for a timeout and even a service interruption. Therefore, it can solve the technical problems in the related art that the storage device is in an unready state due to incomplete configuration synchronization when accessing the storage cluster and cannot respond to the server's requests in time, resulting in low service continuity, and realizes the technical effect of ensuring that the target storage device processes the server's requests in a ready state, responds to the server's requests in time, and improves service continuity. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] To more clearly illustrate the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0019] Figure 1 is a hardware structure block diagram of a computer device for an access control method of a storage device according to an embodiment of the present application;
[0020] Figure 2 is a flowchart of an access control method of a storage device according to an embodiment of the present application;
[0021] Figure 3 is a structural diagram of a storage cluster according to an embodiment of the present application;
[0022] Figure 4 is a flowchart of port link initialization according to an embodiment of the present application;
[0023] Figure 5 is a flowchart of configuring cluster ports according to an embodiment of the present application;
[0024] Figure 6 is a flowchart of clearing cluster ports according to an embodiment of the present application;
[0025] Figure 7 is a flowchart of importing target port information according to an embodiment of the present application;
[0026] Figure 8 is a flowchart for performing initialization of port link enabling on a port of a target storage device according to an embodiment of the present application;
[0027] Figure 9 is a structural diagram of an access control system for a storage device according to an embodiment of the present application;
[0028] Figure 10 is a structural block diagram of an access control device for a storage device according to an embodiment of the present application;
[0029] Figure 11 is a schematic diagram of an electronic device according to an embodiment of the present application. Detailed implementation manners
[0030] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the protection scope of the present application.
[0031] It should be noted that in the description of the present application, the terms "include", "comprise" or any other variant thereof are intended to cover a non-exclusive inclusion, such that a process, method, article or device including a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. The terms "first", "second", etc. in the present application are used to distinguish similar objects and not to describe a specific order or sequence.
[0032] To enable those skilled in the art of the present technology to better understand the solution of the present application, the present application will be further described in detail below in conjunction with the accompanying drawings and specific implementation manners.
[0033] The method embodiments provided in the embodiments of the present application can be executed on a server device or a similar computing device. Taking running on a server device as an example, Figure 1 is a hardware structural block diagram of a computer device for an access control method of a storage device according to an embodiment of the present application. As Figure 1 shown, the server device may include one or more ( Figure 1Only one processor 102 is shown (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a field programmable gate array FPGA), and a memory 104 for storing data. Among them, the above server device may further include a transmission device 106 for communication functions and an input / output device 108. Those of ordinary skill in the art can understand that Figure 1 The structure shown is only schematic and does not limit the structure of the above server device. For example, the server device may further include more or fewer components than Figure 1 shown in, or have a different configuration from Figure 1 shown.
[0034] The memory 104 can be used to store computer programs. For example, software programs and modules of application software, such as the computer program corresponding to the access control method of the storage device in the embodiments of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implements the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely set relative to the processor 102, and these remote memories can be connected to the server device through a network. Examples of the above network include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0035] The transmission device 106 is used to receive or send data via a network. Specific examples of the above network may include a wireless network provided by a communication provider of the server device. In one instance, the transmission device 106 includes a network adapter (abbreviated as NIC), which can be connected to other network devices through a base station and thus communicate with the Internet. In one instance, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0036] Explanations of the nouns involved in the embodiments of the present application are as follows:
[0037] Volume (usually also called Logical Unit Number, LUN): A logical storage unit used to abstract physical storage resources (such as disks, solid state disks, etc.) into manageable logical units for access by servers, hosts, or other storage devices.
[0038] In this embodiment, an access control method for a storage device is provided. Figure 2It is a flowchart of an access control method for a storage device according to an embodiment of the present application. As Figure 2 shown, the process includes the following steps:
[0039] Step S12, detect whether there is a storage device to be connected to the storage cluster currently. Among them, each storage device in the storage cluster is used to provide service data required for the operation of the service to the server through the service port;
[0040] Step S14, when it is detected that the target storage device is to be connected to the storage cluster, control the link between the target service port of the target storage device and the server to remain closed, and during the process of performing the access operation on the target storage device, detect the synchronization status of the target storage device synchronizing the configuration information of the storage cluster. Among them, the configuration information is used to indicate the manner in which the storage devices in the storage cluster provide service data to the server;
[0041] Step S16, control the link between the target service port and the server to be opened according to the synchronization status.
[0042] Optionally, in this embodiment, Figure 3 It is a structural diagram of a storage cluster according to an embodiment of the present application. As Figure 3 shown, the storage cluster can be, but is not limited to, a storage system that establishes multi-control clusters, active-active disaster recovery, etc. through FC ports. For example: a storage device cluster with multi-control interconnection, a storage architecture composed of inter-frame FC links, etc.; the storage device can be, but is not limited to, any one of multiple storage nodes (storage nodes 1 to N) that support the FC protocol in the storage cluster. Each storage device is deployed with FC ports including: an FC service port (port A) and an FC cluster port (port B). Among them, the FC service port is used for communication between the storage device and the server to provide service data required for the operation of the server; the FC cluster port is used for communication between the storage device and other storage devices to complete master-slave controller election and configuration information synchronization (such as volume mapping relationship, active-active disaster recovery strategy, LUN list, etc.). The server can be, but is not limited to, a host device that accesses the storage cluster through the FC protocol. For example: an FC host, an application server connected to the storage system, etc.
[0043] Optionally, in this embodiment, the target storage device to be connected to the storage cluster can be, but is not limited to: a storage device that reconnects to the storage cluster after a hardware failure, software exception, or active restart; a storage device that joins an existing storage cluster for the first time; a storage device that rejoins the storage cluster after completing a software version upgrade. The target service port can be the FC service port for interconnection between the target storage device and the server.
[0044] Optionally, in this embodiment, the step of detecting whether there is a storage device to be connected to the storage cluster may include, but is not limited to: identifying whether there is a storage node that has not been connected to the storage cluster through the self-check process during the power-on initialization of the storage controller; monitoring the heartbeat status through the storage cluster management module to detect whether a storage device is back online and requests to join the storage cluster.
[0045] Optionally, in this embodiment, when it is detected that the target storage device is to be connected to the storage cluster, the link between the target service port of the target storage device and the server is controlled to remain closed, and at this time, the server is not allowed to establish a connection with the target storage device.
[0046] Optionally, in this embodiment, the access operation may include, but is not limited to, operations that need to be performed when a storage device joins the storage cluster, such as port initialization and configuration information synchronization, etc., to ensure that the storage device can establish a service connection with the server safely and stably.
[0047] Optionally, in this embodiment, the step of detecting the synchronization status of the target storage device synchronizing the configuration information of the storage cluster may include, but is not limited to: monitoring the volume online status in real time through the protocol module to verify whether the mapping relationship of all volumes in the target storage device is consistent with the global cluster configuration, which can directly reflect whether the target storage device is ready; in a complex cluster architecture (such as dual-active disaster recovery), querying the data synchronization progress between the target storage device and the peer storage device through the internal communication protocol to ensure that no business exception is caused by data lag after the target storage device is connected; using the heartbeat monitoring mechanism of the storage cluster management module to count the communication status between the target storage device and other storage devices to verify whether the internal communication of the storage cluster is stable, which can indirectly verify whether the collaborative working status between storage devices is normal.
[0048] That is, the link is controlled to be turned on according to the synchronization status of the configuration information, ensuring that the link is turned on after the target storage device has completed the synchronization of the configuration information. At this time, the target storage device can normally respond to the server's request to obtain service data, avoiding the situation in the related art where the server sends a request when the target storage device has not yet completed the synchronization of the configuration information of the storage cluster, and at this time the target storage device cannot respond in time, resulting in server waiting timeouts and even business interruptions. Thus, the technical effect of ensuring that the target storage device processes server requests in a ready state, responds to server requests in a timely manner, and improves business continuity is achieved, and further solves the technical problem in the related art that the storage device is in an unready state due to incomplete configuration synchronization when accessing the storage cluster and cannot respond to server requests in time, resulting in low business continuity.
[0049] As an optional solution, controlling the link between the target service port of the target storage device and the server to remain closed includes:
[0050] S21. Obtain the target port information of the target storage device from the target storage space corresponding to the target storage device, where the target port information records the port identifiers of the target cluster ports in the target storage device, and the target storage device is used to establish links with each storage device in the storage cluster through the target cluster ports;
[0051] S22. Determine the ports among the multiple ports of the target storage device that do not belong to the target cluster ports indicated by the target port information as target service ports;
[0052] S23. Set the link enable flag of the target service port to a first status value, where the link enable flag is used to indicate whether to allow enabling the link corresponding to the port, and the link enable flag in the first status value is used to indicate prohibiting enabling the link corresponding to the port, and the enabling operation is an operation to turn on the corresponding link.
[0053] Optionally, in this embodiment, each storage device in the storage cluster has a corresponding storage space (node VPD), and the port information of the corresponding storage device is stored in each storage space, and the port information records the port identifiers of the cluster ports in the corresponding storage device. The step of obtaining the target port information may include, but is not limited to: reading the port attribute information from the target storage space corresponding to the target storage device through the driver module, and parsing and extracting the port identifiers of the target cluster ports in the target storage device used for the cluster ports.
[0054] Optionally, in this embodiment, after extracting the port identifiers of the target cluster ports in the target storage device used for the cluster ports, the method for obtaining the target service ports for the service ports may be: traversing all FC ports of the target storage device, and automatically classifying the FC ports not included in the target port information as target service ports, that is, the FC ports used for communication between the target storage device and the server.
[0055] Optionally, in this embodiment, a link enable flag is newly added to the data structure of the FC port. For the target service port, its link enable flag is configured to the first status value "FALSE", indicating prohibiting turning on the link corresponding to the target service port.
[0056] Optionally, in this embodiment, Figure 4 is a flowchart of port link initialization according to an embodiment of the present application. As Figure 4 shown, the steps of port link initialization include:
[0057] Step S401. The driver module periodically (such as every 60 seconds) performs port status polling and executes step S402;
[0058] Step S402: Detect whether the port is active. If the port is detected as active, execute Step S409; if the port is detected as inactive, execute Step S403;
[0059] Step S403: Read the static data SFP PAGE A0 of the optical module of the port, and verify whether the rate of the optical module matches the rate of the fiber channel (FC card). If the rate of the optical module does not match the rate of the FC card, execute Step S409; if the rate of the optical module matches the rate of the FC card, execute Step S404;
[0060] Step S404: Judge the link enable flag of the port. If the link enable flag is configured as "TRUE" (correct), execute Step S405; if the link enable flag is configured as "FALSE" (incorrect), execute Step S408;
[0061] Step S405: Determine that the module validity is successful, execute the port link initialization action, trigger the optical module to emit light, and judge whether the cable is connected. If the cable is connected, execute Step S406; if the cable is not connected, execute Step S407;
[0062] Step S406: The FC card firmware FW will report a "Link Up message" (connection successful), the port becomes active, the port link is successfully enabled, and execute Step S409;
[0063] Step S407: The port is in an inactive state, and execute Step S403;
[0064] Step S408: Determine that the module validity fails, terminate the port link initialization action, maintain the link closed state, and execute Step S409;
[0065] Step S409: End the process.
[0066] As an optional solution, before obtaining the target port information of the target storage device from the target storage space corresponding to the target storage device, the method further includes:
[0067] S31: Receive a port configuration instruction carrying a reference port identifier and cluster port parameters, where the port configuration instruction is used to indicate that the port with the reference port identifier is configured as the cluster port indicated by the cluster port parameters;
[0068] S32: Respond to the port configuration instruction, and check whether the multiple ports of the target storage device include the port with the port identifier;
[0069] S33. When it is verified that the reference port in the target storage device is a port with a reference port identifier, add the correspondence between the port location parameter of the reference port and the reference port identifier to the initial port information of the target storage device to obtain the target port information, and store the target port information in the target storage space corresponding to the target storage device;
[0070] S34. Synchronize the target port information in the target storage space to the target cluster space corresponding to the storage cluster, where the target cluster space is used to record the port identifiers of the cluster ports in each storage device included in the storage cluster.
[0071] Optionally, in this embodiment, before obtaining the target port information of the target storage device from the target storage space corresponding to the target storage device, generating and storing the target port information further includes: configuring cluster ports preferentially used for cluster interconnection through the port configuration instruction (chnodeportfc) instruction. Each storage device can configure at most 4 cluster ports (to avoid over-configuring cluster ports). After the cluster port configuration is successful, the slot number and port number of the cluster port are assembled according to the port information storage format (such as a specific structure) to obtain the target port information. Then, the target port information is recorded in the target storage space and the target cluster space (backplane VPD) to ensure that in the scenarios of system restart (depending on node VPD to restore configuration) or backplane replacement (depending on backplane VPD to synchronize configuration), the port configuration can be quickly restored, the system recovery time can be shortened, the system fault recovery ability and availability can be improved, and the impact on business continuity can be reduced.
[0072] Optionally, in this embodiment, Figure 5 is a flowchart of configuring cluster ports according to an embodiment of the present application. As Figure 5 shown, the steps of configuring cluster ports (i.e., setting port priorities) include:
[0073] Step S501. Receive the port configuration instruction (chnodeportfc). The port configuration instruction carries the reference port identifier (port_id) and the cluster port parameter (cluster_priority = yes), and then execute step S502. Among them, the reference port identifier (port_id) represents the unique identifier of the FC port; the cluster port parameter (cluster_priority = yes) indicates that the FC port is used as a cluster port. The port configuration instruction is used to instruct to configure the port with port_id as the cluster port indicated by cluster_priority = yes. For example, inputting the instruction "port_id = 3, cluster_priority = yes" means "set the No. 3 port as the cluster port";
[0074] Step S502: Determine whether the parameters are valid. Detect whether port_id is valid (such as whether there is a port with the port identifier "3"), whether the cluster_priority field is configured, and whether the total number of configured ports exceeds 4. After detecting that port_id is valid, the cluster_priority field is configured, and the number of configured ports does not exceed 4, execute Step S503; otherwise, end the process.
[0075] Step S503: Determine whether there is a reference port identifier port_id in the target storage space. Traverse the port information of multiple cluster ports in the target storage space corresponding to the target storage device. If a port matching the reference port identifier is found, execute Step S504; if a port matching the reference port identifier is not found, execute Step S505.
[0076] Step S504: Save the port position parameter (slot number) and port number of the reference port corresponding to the reference port identifier to the memory location corresponding to the target storage space location, and execute Step S506.
[0077] Step S505: Save the slot number and port number of the reference port corresponding to the reference port identifier to an idle memory location, and execute Step S506.
[0078] Step S506: Assemble the slot number and port number in the memory location according to the port information storage format to obtain the target port information, write it to the position corresponding to the reference port identifier in the target storage space, and execute Step S507.
[0079] Step S507: Synchronously write the target port information to the corresponding position in the target cluster space, and end the process.
[0080] Optionally, in this embodiment, Figure 6 is a flowchart of clearing cluster ports according to an embodiment of the present application. As Figure 6 shown, the steps of clearing cluster ports (i.e., clearing port priorities) include:
[0081] Step S601, receive a port clearing instruction (chnodeportfc). The port clearing instruction carries a candidate port identifier (port_id) and a non-cluster port parameter (cluster_priority=no), and then proceed to step S602. Among them, the candidate port identifier (port_id) represents the unique identifier of the FC port; the non-cluster port parameter (cluster_priority=no) indicates that the FC port is a non-cluster port. The port clearing instruction is used to indicate that the port with port_id is to be configured as the non-cluster port indicated by cluster_priority=no. For example, entering the instruction "port_id=3, cluster_priority=no" means "set port No. 3 as a non-cluster port".
[0082] Step S602, determine whether the parameters are valid. Detect whether port_id is valid (such as whether there is a port with the port identifier "3") and whether the cluster_priority field has been configured. After detecting that port_id is valid and the cluster_priority field has been configured, proceed to step S603; otherwise, end the process.
[0083] Step S603, find the port corresponding to the candidate port identifier port_id in the target storage space. Traverse the port information of multiple cluster ports in the target storage space (node VPD) corresponding to the target storage device, find the port that matches the candidate port identifier, and proceed to step S604;
[0084] Step S604, clear the candidate port identifier, slot number, and port number in the memory location corresponding to the candidate port identifier in the target storage space, and proceed to step S605;
[0085] Step S605, clear the candidate port identifier, slot number, and port number in the corresponding location in the target storage space, and proceed to step S606;
[0086] Step S606, clear the candidate port identifier, slot number, and port number in the corresponding location in the target cluster space, and end the process.
[0087] Optionally, in this embodiment, four fields are allocated to each storage device in the target cluster space to store the cluster ports preferentially used for cluster interconnection. The fields record the slot number and port number of the cluster ports. During system initialization, the target cluster space is read to detect whether there is valid port information already saved in the target cluster space for the cluster ports. If there is valid port information in the target cluster space, the valid port information needs to be saved to the target storage space. Among them, if the port information saved in the target cluster space for the cluster ports includes the FC ports of the target storage device, the port information is considered valid. The method for detecting whether there is valid port information in the target cluster space can be but is not limited to: querying all the FC ports of the target storage device through the query instruction lsnodeportfc. If the slot number and port number of a certain FC port of the target storage device are recorded in the target cluster space, the port information is considered valid, and this port is the port preferentially used for the cluster ports.
[0088] Optionally, in this embodiment, before obtaining the target port information of the target storage device from the target storage space corresponding to the target storage device, importing the target port information is further included. Figure 7 It is a flowchart of importing the target port information according to the embodiment of the present application. As Figure 7 shown, the steps of importing the target port information include:
[0089] Step S701, determine whether the backplane is normal. If the backplane is normal, execute step S702; if the backplane is abnormal, execute step S704;
[0090] Step S702, read the port data in the backplane VPD (target cluster space), and after parsing according to the port information storage format, match the valid port identifiers from the FC ports of the target storage device, and execute step S703;
[0091] Step S703, temporarily save the port data such as the slot number, port number, and port identifier to the memory, and execute step S706;
[0092] Step S704, read the port data in the node VPD (target storage space corresponding to the target storage device), and after parsing according to the port information storage format, match the valid port identifiers from the FC ports of the target storage device, and execute step S705;
[0093] Step S705, temporarily save the port data such as the slot number, port number, and port identifier to the memory, and the process ends.
[0094] Step S706: Determine whether the backplane has been replaced by checking whether the backplane data mtm (Manufacturing Test Mode, original factory mode) is 0. If mtm is 0, it means the current backplane is newly replaced and has no original factory configuration data, then execute Step S707; if mtm is not 0, that is, the current backplane is the original backplane when the device left the factory and the data is the original configuration, then execute Step S709;
[0095] Step S707: Read the port data in the target storage space, such as the target cluster ports of the old backplane. After parsing according to the port information storage format, match the valid port identifiers from the FC ports of the target storage device, and temporarily save the port data such as slot number, port number, and port identifier into the memory, then execute Step S708;
[0096] Step S708: Write the port data such as slot number, port number, and port identifier back to the target cluster space, and the process ends.
[0097] Step S709: Write the port data temporarily saved in the memory into the target storage space to ensure that the information of both is consistent, and the process ends.
[0098] As an optional solution, after obtaining the target port information of the target storage device from the target storage space corresponding to the target storage device, it further includes:
[0099] S41: Determine the target cluster ports from multiple ports of the target storage device according to the target port information;
[0100] S42: Set the link enable flag of the target cluster ports to the second state value, where the link enable flag in the second state value is used to indicate that the link corresponding to the port is allowed to perform the enable operation, and the enable operation is the operation of turning on the corresponding link.
[0101] Optionally, in this embodiment, after obtaining the target port information of the target storage device from the target storage space, the port identifier for the cluster ports is obtained. Determine the target cluster ports from multiple ports of the target storage device according to the port identifier, and then configure the link enable flag of the target cluster ports to the second state value "TRUE", indicating that the link corresponding to the target cluster ports is allowed to be turned on.
[0102] Optionally, in this embodiment, Figure 8 is the flowchart for initializing the port link enable of the ports of the target storage device according to the embodiments of the present application, such as Figure 8As shown in the figure, the port of the target storage device can perform the initialization of the port link enablement in the following ways, but not limited to: after the drive module obtains the target port information of the target storage device from the target storage space, it obtains the port identifier for the cluster port (configuring its port link enablement to "TRUE") and the port identifier for the service port (configuring its port link enablement to "FALSE"). Traverse all the FC ports of the target storage device. For the FC ports used for the cluster port, perform the link initialization port opening. For the FC ports of the service port, the port startup will be delayed until the protocol module enables these ports after confirming that the configuration information synchronization of the target storage device is completed or automatically enables them after waiting for timeout.
[0103] Optionally, in this embodiment, the way that the protocol module enables these ports after confirming that the configuration information synchronization of the target storage device is completed or automatically enables them after waiting for timeout includes: after the protocol module confirms that the configuration information synchronization of the target storage device is completed, it calls the port enablement interface and traverses all the FC ports. If the port link enablement flag is "FALSE", it means that the FC port is used for the service port. At this time, the configuration information synchronization of the target storage device is completed, allowing the link corresponding to the service port to be opened, triggering the link enablement, checking the validity of the optical module corresponding to the service port, triggering the optical module to emit light to activate the link corresponding to the service port, and modifying the port link enablement flag to TRUE. If the protocol module has not called the port enablement interface to open the link all the time, the drive module will actively open the link after the link automatic enablement timeout (such as exceeding the threshold of 5 minutes).
[0104] As an optional solution, detecting the synchronization status of the configuration information of the target storage device for the storage cluster further includes:
[0105] S51, detecting the synchronization progress of the volume mapping information, volume attribute information, volume port information, and volume backup information of the target storage device for the storage cluster. Among them, the volume mapping information is used to indicate the mapping relationship between the storage volumes and the servers in the storage cluster, the volume attribute information is used to indicate the attribute parameters of the storage volumes in the storage cluster, the volume port information is used to indicate the ports allowed to be used when the storage volumes in the storage cluster provide service data to the servers, and the volume backup information is used to indicate the takeover method for the standby storage volumes corresponding to the storage volume failures in the storage cluster. The configuration information includes the volume mapping information, volume attribute information, volume port information, and volume backup information;
[0106] S52, in the case where the synchronization progress is equal to or greater than the target progress threshold, determining the synchronization status as the synchronization completion status. Among them, when the synchronization progress is equal to or greater than the target progress threshold, the target storage device is allowed to provide the service data required for running services to the server;
[0107] S53. When the synchronization progress is less than the target progress threshold, determine the synchronization status as the in-sync status.
[0108] Optionally, in this embodiment, the configuration information of the target storage device synchronizing the storage cluster may include, but is not limited to: volume mapping information, which is used to indicate the storage volumes with corresponding relationships and the server information that can access the storage volumes. For example, the mapping relationship between storage volume LUN 0 and servers A (FC ID = 0x1234) and B (FC ID = 0x5678) ensures that the servers can address and access the specified volume through the FC protocol; volume attribute information, which is used to indicate the capacity limit and access permissions of the storage volume, etc. For example, parameters such as the maximum available space of the volume (such as 10TB), read / write permissions (read-only or read / write), and encryption status; volume port information, which is used to indicate the FC ports for the storage volume to conduct host services. For example, it is specified that volume LUN 0 only provides services externally through the 3rd FC port (port_id = 3) of the storage device, and realizes service isolation from the cluster interconnection ports (such as ports 1 and 2); volume backup information, that is, the dual-active relationship of the volume, which is used to indicate how the standby storage volume takes over the service when the primary storage volume fails. For example, the replication link status (synchronous or asynchronous) between the primary storage volume and the standby storage volume, the failover strategy (automatic or manual), and the consistency group configuration, etc.
[0109] Optionally, in this embodiment, the methods for detecting the synchronization progress of the target storage device synchronizing the volume mapping information, volume attribute information, volume port information, and volume backup information of the storage cluster may include, but are not limited to, the following: viewing the synchronization progress through the storage cluster management interface. For example, enter the storage device node management or cluster status page to view the synchronization progress bar, synchronization status label, and the synchronization status of specific configuration items of the newly added storage device; querying the synchronization status through command-line tools, such as using the gluster volume info command of Gluster CLI to obtain the storage device configuration and volume synchronization information; analyzing the synchronization process through log files. For example, view the logs of the managed storage device and search for keywords to locate the transmission status of the configuration information. By implementing multiple methods to detect the synchronization progress, the synchronization status of the target storage device for volume mapping, attributes, ports, backups, etc. can be grasped in real time, ensuring that the data and configurations are complete and consistent when accessing the production environment, and avoiding service exceptions caused by information out-of-sync.
[0110] Optionally, in this embodiment, the synchronization progress can be, but is not limited to, represented by a numerical percentage and a status label. Among them, the numerical percentage can accurately display the proportion of configuration items that have been synchronized. For example, 85% of the volume mapping information has been synchronized, and 92% of the volume attribute information has been synchronized. The status label can be automatically marked as "not synchronized" (0%), "synchronizing" (0% - 99%), or "synchronized" (100%) according to the synchronization completion degree. When the synchronization progress exceeds the preset target progress threshold, the synchronization status is determined to be the synchronization completion status. At this time, the target storage device is allowed to be officially connected to the production environment to provide complete business data to the server. When the synchronization progress is less than or equal to the threshold, the synchronization status is determined to be the synchronizing status. At this time, the storage device can only perform internal synchronization operations and cannot respond to the business requests of the server. For example, if the target progress threshold is set to 99%, when the synchronization progress is 100%, the storage device immediately switches to the "synchronized" state and can officially provide services. When the synchronization progress is 80%, the storage device is still in the "synchronizing" state and needs to wait for the synchronization to complete before it can be connected to the production environment. By displaying the synchronization progress with a numerical percentage and a status label, and setting the target progress threshold to judge the synchronization status, when the threshold is not reached, the storage device only performs internal synchronization and does not respond to business requests, preventing problems such as service interruption and abnormal data reading and writing caused by unready responses to requests, and improving the stability of the storage system and services.
[0111] Optionally, in this embodiment, the target progress threshold can be adjusted according to business requirements. In scenarios with extremely high requirements for data consistency, it can be set to 100%.
[0112] As an optional solution, controlling the link between the target service port and the server according to the synchronization status includes:
[0113] S61, when the synchronization status is the synchronizing status, continue to control the link between the target service port of the target storage device and the server to remain closed, where the synchronizing status is used to indicate that the target storage device has not completed the synchronization of the configuration information of the storage cluster;
[0114] S62, when the synchronization status is the synchronization completion status, control the link between the target service port and the server to switch from closed to open, where the synchronization completion status is used to indicate that the target storage device has completed the synchronization of the configuration information of the storage cluster.
[0115] Optionally, in this embodiment, the following method may be used, but is not limited thereto, to control the link between the target service port and the server to be enabled according to the synchronization status: when the synchronization status is the ongoing synchronization status, continue to control the link between the target service port of the target storage device and the server to remain closed, that is, the current target storage device has not completed the synchronization of the configuration information of the storage cluster, and only internal synchronization operations can be performed, and it cannot respond to the service requests of the server, and the link between the target service port and the server is not allowed to be enabled. When the synchronization status is the synchronization completed status, control the link between the target service port and the server to switch from closed to open, that is, the current target storage device has completed the synchronization of the configuration information of the storage cluster, can provide complete service data to the server, and the link between the target service port and the server is allowed to be enabled.
[0116] Optionally, in this embodiment, the method for controlling the link between the target service port and the server to switch from closed to open may be: after confirming that the target storage device has completed the synchronization of the configuration information of the storage cluster, the protocol module notifies the driver module to start the target service port. When the driver module detects that the optical module rate of the target service port matches successfully and the cable is already connected, it triggers the optical module to emit light to enable the link corresponding to the target service port, and starts the link between the target storage device and the server.
[0117] As an optional solution, after controlling the link between the target service port and the server to switch from closed to open, the method further includes:
[0118] S71, detecting the current instruction execution status of the target storage device, where the instruction execution status is used to indicate whether the target storage device currently allows the execution of read / write instructions sent by the server;
[0119] S72, when the instruction execution status indicates that the target storage device currently does not allow the execution of read / write instructions sent by the server and a volume scan instruction is received, adding the volume scan instruction to the waiting queue and starting timing, where the volume scan instruction is an instruction sent by the server to request a scan of the storage volume of the target storage device;
[0120] S73, when the timing duration reaches the preset duration, detecting the current instruction execution status of the target storage device again;
[0121] S74, when the instruction execution status still indicates that the target storage device currently does not allow the execution of read / write instructions sent by the server, sending a retry instruction to the server, where the server is configured to resend the volume scan instruction to the target storage device when receiving the retry instruction;
[0122] S75: When the instruction execution status indicates that the target storage device currently allows the execution of the read and write instructions sent by the server, execute the scan volume instructions in the waiting queue.
[0123] Optionally, in this embodiment, when the storage volume and server configuration information in the target storage device have not been restored, but the server has received a REPORT LUN instruction (operation code 0x40) to query the available storage volume list (i.e., scan the disk) sent to the target storage device through the SCSI protocol, the instruction is not processed immediately, but the scan volume instruction is added to the waiting queue (Startup_queue), and a timer is started in the fiber queue to monitor the instruction processing status of the scan volume instruction in the waiting queue, wherein the scan volume instruction is an instruction sent by the server to request a scan of the storage volume of the target storage device. Set the timer timeout threshold (preset duration): 10 seconds. If the scan volume instruction is not processed in the waiting queue for more than 10 seconds, the system returns a retry instruction (KCQ: 062900) to the server, indicating "device power-on reset". After receiving the retry instruction, the server will automatically retry to send the scan volume instruction. Each time the server retries to send the scan volume instruction, the timer will be reset, thereby extending the time of the overall scan disk process. For example, the default server timeout is 30 seconds. After three retries, the scan time can be extended to 90 seconds, giving the target storage device more time to restore the configuration. When the target storage device completes configuration synchronization (such as storage volume online), the protocol module responds to the scan command normally and returns the correct storage volume list. The server completes the scan and establishes a connection with the target storage device, and the path is restored successfully.
[0124] Optionally, in this embodiment, when the storage volume and server configuration information in the target storage device are restored, first check whether all restored storage volumes are online (i.e., in the "online" state and can provide services): if it is checked that all restored storage volumes are online, immediately process all instructions temporarily stored in Startup_queue (including volume scanning instructions), exit the timer, and no longer process instructions in Startup_queue. That is, after the storage volumes and server configurations in the target storage device are complete and the storage volumes are ready, quickly release the temporarily stored instructions and resume normal services.
[0125] Optionally, in this embodiment, when the storage volume and server configuration information in the target storage device are restored, if it is detected that there are unmounted storage volumes, a timer is started on the current fibre queue to monitor whether all unmounted storage volumes are mounted (triggered by polling or status callback) and whether the timer reaches the timeout threshold of 60 seconds. When all unmounted storage volumes are mounted and / or the timer reaches the timeout threshold of 60 seconds, the timer ends. If the timer ends because all storage volumes are mounted, the instructions in the Startup_queue are processed and the service link corresponding to the target service port is opened; if the end is triggered by timeout (some storage volumes are still unmounted), the instructions in the waiting queue are forcibly processed and the service link corresponding to the target service port is opened (there may be data risks, but infinite blocking is avoided). That is, a reasonable timeout threshold is set to achieve a balance between consistency (waiting for storage volumes to be mounted) and availability (avoiding excessive blocking).
[0126] Optionally, in this embodiment, during the process of keeping the link between the target service port of the target storage device and the server closed, the server cannot send a volume scanning instruction to the target storage device, there are no instructions in the waiting queue Startup_queue, and the timer will not start.
[0127] Optionally, in this embodiment, Figure 9 is a structural diagram of an access control system for a storage device according to an embodiment of the present application, as Figure 9 shown, the access control system for the storage device includes a chassis management module (pl_control), a driver module, a protocol module, a target storage space, and a target cluster space.
[0128] Among them, the chassis management module is used to configure and store FC port attributes, synchronize port information in the target storage space (node VPD) and the target cluster space (backplane VPD). Among them, the backplane VPD is used to store the slot numbers and port numbers of the ports for cluster ports (up to 4 for each node, to avoid over-allocation), and the node VPD is used to store the local storage port configuration of the target storage device for the FC driver module to read.
[0129] Among them, the drive module, namely the FC drive module, is used to manage the initialization of all FC port links of the target storage device and distinguish between cluster ports and service ports. When the standby storage system is initialized and started, the FC drive will read the port information in the target storage space and the target cluster space, and confirm whether the FC port of the current target storage device is used as a cluster port. If the port is configured to be used as a cluster port, the link will be enabled immediately when the optical module is normal, that is, the corresponding link will be turned on. If the port is not configured to be used as a cluster port, it will wait for the protocol module to issue a link enable command or wait for the longest threshold (such as 5 minutes), and then enable the link when the optical module is normal, so as to achieve the effect of delaying the port startup and prevent premature connection with the server from causing volume scanning timeouts, abnormal volume paths, and abnormal IO reads and writes.
[0130] Among them, the protocol module is used to coordinate the restoration of the storage cluster configuration and handle server request retries. It can send a link enable instruction to the drive module to control the link to be turned on according to the link enable flag of the port and the synchronization status of the storage device for synchronizing the configuration information. Specifically, before the storage device completes the synchronization of the configuration information, it issues a link enable command to notify the drive module to turn on the link corresponding to the port with the link enable flag set to "TRUE". After the storage device completes the synchronization of the configuration information, it issues a link enable command to notify the drive module to turn on the link corresponding to the port with the link enable flag set to "FALSE".
[0131] Optionally, in this embodiment, the service port and the cluster port are distinguished by configuring the FC port attributes. Among them, the cluster port is started immediately when the storage node accesses the storage cluster, and the service port is started with a delay; a protocol module retry mechanism is introduced. When the protocol module detects that all volume lists of the storage device performing the access operation have not been brought online, it sends a retry instruction to the volume scanning request of the server to extend the volume scanning process, ensuring that the service link corresponding to the service port is enabled after the storage volume is brought online or after reaching the processing time threshold. This avoids the problem that when the storage node accesses the storage cluster, the server sends a volume scanning request too early, and the storage device cannot respond within the specified time because it is not ready, resulting in a volume scanning instruction waiting timeout and causing the volume path to be lost and abnormal interruption of IO reads and writes. That is, it ensures that the link corresponding to the service port is turned on after the storage device is fully ready to process the volume scanning instruction, and uses the retry mechanism to prevent the server from giving up the request due to waiting timeout, thereby improving the reliability and service continuity of the storage system.
[0132] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation method.
[0133] 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 disc) and includes several instructions to enable a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of this application.
[0134] In this embodiment, an access control device for a storage device is also provided. This device is used to implement the above embodiments and preferred implementation manners, and those that have been described will not be repeated. As used hereinafter, the term "module" can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
[0135] Figure 10 is a structural block diagram of an access control device for a storage device according to an embodiment of this application; as Figure 10 shown, it includes:
[0136] A first detection module 1002, configured to detect whether there is currently a storage device to be connected to the storage cluster. Among them, each storage device in the storage cluster is used to provide service data required for running services to the server through a service port;
[0137] A first control module 1004, configured to, when detecting that a target storage device is to be connected to the storage cluster, control the link between the target service port of the target storage device and the server to remain closed, and during the process of performing an access operation on the target storage device, detect the synchronization status of the target storage device synchronizing the configuration information of the storage cluster. Among them, the configuration information is used to indicate the manner in which the storage devices in the storage cluster provide service data to the server;
[0138] A second control module 1008, configured to control the link between the target service port and the server to be opened according to the synchronization status.
[0139] In an exemplary embodiment, the first control module includes:
[0140] An acquisition unit, configured to acquire the target port information of the target storage device from the target storage space corresponding to the target storage device. Among them, the target port information records the port identifier of the target cluster port in the target storage device, and the target storage device is used to establish a link with each storage device in the storage cluster through the target cluster port;
[0141] A first determination unit, configured to determine the port among the multiple ports of the target storage device that does not belong to the target cluster port indicated by the target port information as the target service port;
[0142] A setting unit for setting the link enable flag of a target service port to a first state value, where the link enable flag is used to indicate whether to allow enabling operations on the link of the corresponding port, and the link enable flag in the first state value is used to indicate prohibiting enabling operations on the link of the corresponding port, and the enabling operation is an operation to turn on the corresponding link.
[0143] In an exemplary embodiment, the apparatus further includes:
[0144] A receiving module for receiving a port configuration instruction carrying a reference port identifier and cluster port parameters before obtaining the target port information of the target storage device from the target storage space corresponding to the target storage device, where the port configuration instruction is used to indicate configuring the port with the reference port identifier as the cluster port indicated by the cluster port parameters;
[0145] A response module for responding to the port configuration instruction and verifying whether the multiple ports of the target storage device include the port with the port identifier;
[0146] An adding module for, in the case where it is verified that the reference port in the target storage device is the port with the reference port identifier, adding the correspondence between the port position parameter of the reference port and the reference port identifier to the initial port information of the target storage device to obtain the target port information, and storing the target port information in the target storage space corresponding to the target storage device;
[0147] A synchronization module for synchronizing the target port information in the target storage space to the target cluster space corresponding to the storage cluster, where the target cluster space is used to record the port identifiers of the cluster ports in each storage device included in the storage cluster.
[0148] In an exemplary embodiment, the apparatus further includes:
[0149] A determining module for, after obtaining the target port information of the target storage device from the target storage space corresponding to the target storage device, determining the target cluster port from the multiple ports of the target storage device according to the target port information;
[0150] A setting module for setting the link enable flag of the target cluster port to a second state value, where the link enable flag in the second state value is used to indicate allowing enabling operations on the link of the corresponding port, and the enabling operation is an operation to turn on the corresponding link.
[0151] In an exemplary embodiment, the first control module includes:
[0152] A detection unit for detecting the synchronization progress of the target storage device to synchronize volume mapping information, volume attribute information, volume port information, and volume backup information of the storage cluster, where the volume mapping information is used to indicate the mapping relationship of access between the storage volume and the server in the storage cluster, the volume attribute information is used to indicate the attribute parameters of the storage volume in the storage cluster, the volume port information is used to indicate the ports allowed to be used when the storage volume in the storage cluster provides service data to the server, the volume backup information is used to indicate the takeover method of the corresponding backup storage volume when the storage volume in the storage cluster fails, and the configuration information includes volume mapping information, volume attribute information, volume port information, and volume backup information;
[0153] A second determination unit for determining the synchronization state as the synchronization completed state when the synchronization progress is equal to or greater than the target progress threshold, where when the synchronization progress is equal to or greater than the target progress threshold, the target storage device is allowed to provide the service data required for running the service to the server;
[0154] A third determination unit for determining the synchronization state as the being synchronized state when the synchronization progress is less than the target progress threshold.
[0155] In an exemplary embodiment, the second control module includes:
[0156] A first control unit for continuing to control the link between the target service port of the target storage device and the server to remain closed when the synchronization state is the being synchronized state, where the being synchronized state is used to indicate that the target storage device has not completed the synchronization of the configuration information of the storage cluster;
[0157] A second control unit for controlling the link between the target service port and the server to switch from closed to open when the synchronization state is the synchronization completed state, where the synchronization completed state is used to indicate that the target storage device has completed the synchronization of the configuration information of the storage cluster.
[0158] In an exemplary embodiment, the apparatus further includes:
[0159] A second detection module for detecting the current instruction execution state of the target storage device after controlling the link between the target service port and the server to switch from closed to open, where the instruction execution state is used to indicate whether the target storage device is currently allowed to execute the read and write instructions sent by the server;
[0160] An adding module for adding the volume scanning instruction to the waiting queue and starting timing when the instruction execution state indicates that the target storage device is currently not allowed to execute the read and write instructions sent by the server and the volume scanning instruction is received, where the volume scanning instruction is an instruction sent by the server for requesting to scan the storage volume of the target storage device;
[0161] A third detection module, configured to detect again the current instruction execution status of the target storage device when the timing duration reaches a preset duration;
[0162] A sending module, configured to send a retry instruction to the server when the instruction execution status still indicates that the target storage device currently does not allow the execution of read / write instructions sent by the server, where the server is configured to re-send a volume scanning instruction to the target storage device when receiving the retry instruction;
[0163] An execution module, configured to execute the volume scanning instruction in the waiting queue when the instruction execution status indicates that the target storage device currently allows the execution of read / write instructions sent by the server.
[0164] It should be noted that the above-mentioned modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to this: the above-mentioned modules are all located in the same processor; or, the above-mentioned modules are respectively located in different processors in any combination form.
[0165] For the description of the features in the corresponding embodiments of the access control device of the storage device, reference can be made to the relevant description in the corresponding embodiments of the access control method of the storage device, which will not be elaborated here one by one.
[0166] An embodiment of the present application further provides an electronic device, Figure 11 which is a schematic diagram of the electronic device according to the embodiment of the present application, as Figure 11 shown. The electronic device includes a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above-mentioned embodiments of the access control method of the storage device.
[0167] In an exemplary embodiment, the above-mentioned electronic device may further include a transmission device and an input / output device, where the transmission device is connected to the above-mentioned processor, and the input / output device is connected to the above-mentioned processor.
[0168] Specific examples in this embodiment can refer to the examples described in the above-mentioned embodiments and exemplary embodiments, and will not be elaborated here.
[0169] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, where the computer program is configured to execute the steps in any one of the above-mentioned embodiments of the access control method of the storage device when running.
[0170] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: various media that can store computer programs, such as USB flash drives, read-only memory (ROM for short), random access memory (RAM for short), external hard drives, magnetic disks, or optical discs.
[0171] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: various media that can store computer programs, such as USB flash drives, read-only memory (ROM for short), random access memory (RAM for short), external hard drives, magnetic disks, or optical discs.
[0172] An embodiment of the present application also provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements the steps of the methods in various embodiments of the present application; the computer program product further includes a non-volatile computer-readable storage medium that stores the computer program. When the computer program is executed by a processor, it implements the steps of the access control method for the storage device in various embodiments of the present application.
[0173] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described according to their functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Skilled professionals can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0174] The above has introduced in detail an access control method for a storage device provided by the present application. Specific examples are used herein to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. It should be noted that for those of ordinary skill in the art in the technical field, without departing from the principle of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.
Claims
1. An access control method for a storage device, characterized in that Including: Detecting whether there is currently a storage device to be connected to the storage cluster, where each storage device in the storage cluster is used to provide service data required for running services to the server through a service port; When it is detected that a target storage device is to be connected to the storage cluster, controlling the link between the target service port of the target storage device and the server to remain closed, and during the process of performing an access operation on the target storage device, detecting the synchronization status of the target storage device synchronizing the configuration information of the storage cluster, where the configuration information is used to indicate the manner in which the storage devices in the storage cluster provide service data to the server; Controlling the link between the target service port and the server to be opened according to the synchronization status.
2. The method according to claim 1, wherein: The controlling the link between the target service port of the target storage device and the server to remain closed includes: Obtaining the target port information of the target storage device from the target storage space corresponding to the target storage device, where the target port information records the port identifier of the target cluster port in the target storage device, and the target storage device is used to establish a link with each of the storage devices in the storage cluster through the target cluster port; Determining the port among the multiple ports of the target storage device that does not belong to the target cluster port indicated by the target port information as the target service port; Setting the link enable flag of the target service port to a first state value, where the link enable flag is used to indicate whether to allow enabling the link of the corresponding port, and the link enable flag in the first state value is used to indicate prohibiting the enabling operation of the link of the corresponding port, and the enabling operation is an operation to open the corresponding link.
3. The method according to claim 2, wherein: Before obtaining the target port information of the target storage device from the target storage space corresponding to the target storage device, the method further includes: Receiving a port configuration instruction carrying a reference port identifier and cluster port parameters, where the port configuration instruction is used to indicate configuring the port with the reference port identifier as the cluster port indicated by the cluster port parameters; Responding to the port configuration instruction, and verifying whether the multiple ports of the target storage device include the port with the port identifier; When it is verified that the reference port in the target storage device is the port with the reference port identifier, adding the corresponding relationship between the port position parameter of the reference port and the reference port identifier to the initial port information of the target storage device to obtain the target port information, and storing the target port information in the target storage space corresponding to the target storage device; Synchronizing the target port information in the target storage space to the target cluster space corresponding to the storage cluster, where the target cluster space is used to record the port identifiers of the cluster ports in each of the storage devices included in the storage cluster.
4. The method according to claim 2, wherein: after obtaining the target port information of the target storage device from the target storage space corresponding to the target storage device, the method further includes: determining the target cluster port from multiple ports of the target storage device according to the target port information; setting the link enable flag of the target cluster port to a second state value, wherein the link enable flag in the second state value is used to indicate that the enabling operation on the link corresponding to the port is allowed, and the enabling operation is an operation to turn on the corresponding link.
5. The method according to claim 1, wherein: detecting the synchronization state of the target storage device synchronizing the configuration information of the storage cluster includes: detecting the synchronization progress of the target storage device synchronizing volume mapping information, volume attribute information, volume port information, and volume backup information of the storage cluster, wherein the volume mapping information is used to indicate the mapping relationship between the storage volumes in the storage cluster and the access to the server, the volume attribute information is used to indicate the attribute parameters of the storage volumes in the storage cluster, the volume port information is used to indicate the ports allowed to be used when the storage volumes in the storage cluster provide the service data to the server, the volume backup information is used to indicate the takeover method of the corresponding backup storage volume when the storage volume in the storage cluster fails, and the configuration information includes the volume mapping information, the volume attribute information, the volume port information, and the volume backup information; when the synchronization progress is equal to or greater than a target progress threshold, determining the synchronization state as a synchronization completed state, wherein when the synchronization progress is equal to or greater than the target progress threshold, the target storage device is allowed to provide the service data required for running the service to the server; when the synchronization progress is less than the target progress threshold, determining the synchronization state as a being synchronized state.
6. The method according to claim 1, wherein: controlling the link between the target service port and the server to be turned on according to the synchronization state includes: when the synchronization state is a being synchronized state, continuing to control the link between the target service port of the target storage device and the server to remain closed, wherein the being synchronized state is used to indicate that the target storage device has not completed synchronizing the configuration information of the storage cluster; when the synchronization state is a synchronization completed state, controlling the link between the target service port and the server to switch from closed to open, wherein the synchronization completed state is used to indicate that the target storage device has completed synchronizing the configuration information of the storage cluster.
7. The method according to claim 6, wherein: after controlling the link between the target service port and the server to switch from closed to open, the method further includes: Detect the current instruction execution status of the target storage device, where the instruction execution status is used to indicate whether the target storage device currently allows the execution of read / write instructions sent by the server; When the instruction execution status is used to indicate that the target storage device currently does not allow the execution of the read / write instructions sent by the server, and a volume scanning instruction is received, add the volume scanning instruction to the waiting queue and start timing, where the volume scanning instruction is an instruction sent by the server for requesting to scan the storage volume of the target storage device; When the timing duration reaches the preset duration, detect the current instruction execution status of the target storage device again; When the instruction execution status is still used to indicate that the target storage device currently does not allow the execution of the read / write instructions sent by the server, send a retry instruction to the server, where the server is configured to re-send the volume scanning instruction to the target storage device when receiving the retry instruction; When the instruction execution status is used to indicate that the target storage device currently allows the execution of the read / write instructions sent by the server, execute the volume scanning instruction in the waiting queue.
8. An access control device for a storage device, characterized in that: Comprising: A first detection module, configured to detect whether there is a storage device to be accessed to a storage cluster currently, where each storage device in the storage cluster is used to provide service data required for running services to a server through a service port; A first control module, configured to control the link between the target service port of the target storage device and the server to remain closed when it is detected that the target storage device is to be accessed to the storage cluster, and detect the synchronization status of the target storage device synchronizing the configuration information of the storage cluster during the process of performing an access operation on the target storage device, where the configuration information is used to indicate the manner in which the storage devices in the storage cluster provide service data to the server; A second control module, configured to control the link between the target service port and the server to be opened according to the synchronization status.
9. An electronic device, characterized in that, Comprising: A memory, configured to store a computer program; A processor, configured to implement the steps of the access control method for a storage device according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that, The computer program is stored in a computer-readable storage medium, where the computer program implements the steps of the access control method for a storage device according to any one of claims 1 to 7 when executed by a processor.
Citation Information
Patent Citations
Data replication disaster recovery processing method and device
CN117234807A
Distributed storage system automatic monitoring deployment method and electronic equipment
CN119225636A
Integrated hardware peer-to-peer deployment-oriented cluster configuration synchronization system and method
CN119322678A
High-availability cluster architecture and protocol
US20140258771A1
Extending expiration of user sessions with authentication refresh
US20230121834A1