Volume processing method, device, equipment and storage medium
By sending logical unit number request commands in the tgt platform and establishing a management structure, the problem of slow processing when configuring a large number of volumes is solved, and fast processing and resource conservation are achieved.
Patent Information
- Application Number
- CN202210453037.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-27
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2042-04-27
AI Technical Summary
When the tgt platform is connected to a distributed storage system, the existing solution causes slow processing of tgt processes and process jamming when configuring a large number of volumes, affecting the system's ease of use and resource overhead.
After the ISCSI client logs in, it sends a preset request command for logical unit number information to the target, obtains the returned logical unit number information, creates SCSI logical units based on the volume mapping information saved in the form of a linked list, and connects it to the distributed storage cluster to establish a management structure so as to directly process the volume processing commands.
Improves system ease of use, reduces system resource overhead, ensures that it can be processed quickly when large volumes are configured, and avoids duplicate connections and resource consumption.
Smart Images

Figure CN114816256B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a volume processing method, apparatus, device and storage medium. Background Art
[0002] The iSCSI (Internet Small Computer System Interface) protocol is a standard protocol that uses the TCP (Transmission Control Protocol) / IP (Internet Protocol Address) communication protocol to implement the exchange of SCSI (Small Computer System Interface) commands between two computers. This allows computers to simulate SAN (Storage Area Networks) as local storage devices through high-speed local area network hubs.
[0003] In a distributed block storage system, librbd (block repository) can provide block-related services to the outside world. tgt (target), as the target software of the ISCSI protocol, is configured through commands to connect to the distributed storage system and provide ISCSI block services to the outside world. By logging into the target, the ISCSI client can enable the local computer to access the remote volume, thereby treating the remote volume as a local block device for read and write operations.
[0004] When the TGT platform is connected to a distributed storage system, librbd is used to connect to the distributed storage cluster system and complete volume-related read and write operations. In the existing TGT solution, through the TGT command line and the existing process, TGT first creates scsi_lun (Logical Unit Number) information, initializes it in the backend storage management, connects to the storage cluster, and performs rbd_open. In the current implementation, TGT can process a small number of volumes normally. However, when configuring a large number of volumes in batches through the command line or configuration files, the large number of volumes requires cluster connection and volume opening operations, resulting in slow TGT processing and process freezes. Summary of the Invention
[0005] In view of this, the present invention aims to provide a volume processing method, apparatus, device, and storage medium that can improve the usability of the system and reduce the overhead of system resources. The specific solution is as follows:
[0006] In a first aspect, the present application discloses a volume processing method, which is applied to an iSCSI server, comprising:
[0007] After the iSCSI client logs in, it sends a preset request command for the logical unit number information to the target device, and obtains the logical unit number information returned by the target device;
[0008] Creating a SCSI logical unit based on the logical unit number information and volume mapping information pre-stored locally in a linked list form;
[0009] The SCSI logic unit is connected to the distributed storage cluster, and a corresponding management structure is established, so that when a current volume processing command is received, the management structure is directly used to perform corresponding processing operations.
[0010] Optionally, before creating the SCSI logical unit based on the logical unit number information and the volume mapping information pre-stored locally in a linked list form, the method further includes:
[0011] The volume mapping information is obtained by traversing the information obtained by binding the block device and the target volume in advance using a preset binding command locally, and the volume mapping information is stored locally in the form of a linked list.
[0012] Optionally, before the iSCSI client logs in, the method further includes:
[0013] A server is selected from the preset binding command based on the ISCSI protocol as the target ISCSI server.
[0014] Optionally, sending a preset request command for logical unit number information to the target device and obtaining the logical unit number information returned by the target device includes:
[0015] A preset request command for logical unit number information is sent to the target device, and the number of logical unit numbers and a list of the logical unit numbers are obtained.
[0016] Optionally, connecting the SCSI logical unit to a distributed storage cluster and establishing a corresponding management structure includes:
[0017] Connecting the SCSI logical unit to the distributed storage cluster and configuring a corresponding cluster handle;
[0018] Complete the creation of the input and output context, and configure the input and output context handle of the cluster with the storage pool name as the keyword in the preset binding command;
[0019] A volume handle with the volume name as a keyword in the preset binding command is configured.
[0020] Optionally, upon receiving the current volume processing command, directly using the management structure to perform corresponding processing operations includes:
[0021] When receiving a current volume processing command, the cluster handle, the input / output context handle, and the volume handle are sequentially matched by the SCSI logic unit to obtain a corresponding matching handle;
[0022] The configuration information of the volume mapping information of the current volume is sent to the distributed storage cluster through the corresponding matching handle.
[0023] Optionally, after establishing the corresponding management structure, the method further includes:
[0024] The volume mapping information is opened, and the SCSI logical unit is returned to the iSCSI client.
[0025] In a second aspect, the present application discloses a volume processing device, which is applied to an iSCSI server, comprising:
[0026] An information acquisition module is used to send a preset request command for logical unit number information to the target after the iSCSI client logs in, and obtain the logical unit number information returned by the target;
[0027] A unit creation module, configured to create a SCSI logical unit based on the logical unit number information and volume mapping information pre-stored locally in a linked list form;
[0028] The cluster connection module is used to connect the SCSI logic unit with the distributed storage cluster and establish a corresponding management structure so as to directly use the management structure to perform corresponding processing operations when receiving the current volume processing command.
[0029] In a third aspect, the present application discloses an electronic device, comprising:
[0030] Memory, used to store computer programs;
[0031] The processor is configured to execute the computer program to implement the steps of the volume processing method disclosed above.
[0032] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the volume processing method disclosed above is implemented.
[0033] It can be seen that the present application provides a volume processing method, including: after the ISCSI client logs in, sending a preset request command for logical unit number information to the target device, and obtaining the logical unit number information returned by the target device; creating a SCSI logical unit based on the logical unit number information and the volume mapping information pre-stored locally in the form of a linked list; connecting the SCSI logical unit with a distributed storage cluster, and establishing a corresponding management structure, so that when the current volume processing command is received, the management structure can be directly used to perform corresponding processing operations. It can be seen that after creating the SCSI logical unit, the present application connects the created SCSI logical unit with the distributed storage cluster, and then establishes a corresponding management structure. Therefore, when the current volume processing command is received, the management structure can be directly called to perform corresponding processing operations without having to perform the step of connecting to the distributed storage cluster again, thereby improving the usability of the system and reducing the overhead of system resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0035] Figure 1 A flow chart of a volume processing method disclosed in this application;
[0036] Figure 2 A flow chart of a specific volume processing method disclosed in this application;
[0037] Figure 3 A schematic diagram of the structure of the roll processing device provided in this application;
[0038] Figure 4 This is a structural diagram of an electronic device provided in this application. DETAILED DESCRIPTION
[0039] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0040] Currently, when the TGT platform is connected to a distributed storage system, librbd is used to connect to the distributed storage cluster system and complete volume-related read and write operations. In the current implementation, TGT can process a small number of volumes normally. However, when configuring a large number of volumes in batches through the command line or configuration files, the large number of volumes requires cluster connection and volume opening operations, resulting in slow TGT processing and process freezes. Therefore, this application provides a volume processing method that improves system usability and reduces system resource consumption.
[0041] The embodiment of the present invention discloses a volume processing method, see Figure 1 As shown, applied to the iSCSI server, the method includes:
[0042] Step S11: After the iSCSI client logs in, it sends a preset request command for logical unit number information to the target, and obtains the logical unit number information returned by the target.
[0043] In this embodiment, the ISCSI server is first logged in through the ISCSI client. After the login is successful, a preset request command for the logical unit number information is sent to the target, and then the logical unit number information returned by the target is obtained. It is understandable that during business processing, when the discovery and login operations are performed based on the ISCSI protocol, the target (server) already exists, and the target can be queried and logged in normally. Then, a preset request command for the logical unit number information is sent to the target, such as 0xA0 Report LUNs. When the target receives the preset request command, it performs corresponding processing operations to obtain the logical unit number information corresponding to the preset request command, and returns the logical unit number information to the ISCSI server.
[0044] Step S12: creating a SCSI logical unit based on the logical unit number information and the volume mapping information pre-stored locally in the form of a linked list.
[0045] In this embodiment, after receiving the logical unit number information returned by the target, a SCSI logical unit is created based on the logical unit number information and volume mapping information pre-stored locally in a linked list format. It will be understood that the SCSI logical unit is a structure representing the correspondence between the logical unit number information and the volume mapping information. The SCSI logical unit can also be referred to as a scsilun volume, and backend storage management is initialized after the SCSI logical unit is created.
[0046] Step S13: Connect the SCSI logical unit to the distributed storage cluster and establish a corresponding management structure so that when a current volume processing command is received, the management structure is directly used to perform corresponding processing operations.
[0047] In this embodiment, after creating a SCSI logical unit, the SCSI logical unit is connected to the distributed storage cluster and a corresponding management structure is established so that when a current volume processing command is received, the management structure is directly used to perform corresponding processing operations. It is understood that when a processing command for the current volume is received for the first time, the SCSI logical unit is connected to the distributed storage cluster, and then a corresponding management structure is established. After the establishment of the management structure is completed, the volume mapping information is opened, and the SCSI logical unit is returned to the iSCSI client. If it is not the first time that an IO (input / output) request for the current volume is received, there is no need to repeat the above steps. The corresponding volume mapping configuration information is directly and quickly distributed using the established management structure. Therefore, by using the method of opening volumes when needed and simultaneously implementing the management structure solution in the distributed storage cluster, not only can normal use be achieved when configuring a small number of volumes, but also normal and rapid configuration and distribution can be achieved when configuring a large number of volumes. The volume opening operation is not performed when the volume is not in service, which can also reduce system resource overhead.
[0048] It can be seen that the present application provides a volume processing method, including: after the ISCSI client logs in, sending a preset request command for logical unit number information to the target device, and obtaining the logical unit number information returned by the target device; creating a SCSI logical unit based on the logical unit number information and the volume mapping information pre-stored locally in the form of a linked list; connecting the SCSI logical unit with a distributed storage cluster, and establishing a corresponding management structure, so that when the current volume processing command is received, the management structure can be directly used to perform corresponding processing operations. It can be seen that after creating the SCSI logical unit, the present application connects the created SCSI logical unit with the distributed storage cluster, and then establishes a corresponding management structure. Therefore, when the current volume processing command is received, the management structure can be directly called to perform corresponding processing operations without having to perform the step of connecting to the distributed storage cluster again, thereby improving the usability of the system and reducing the overhead of system resources.
[0049] See also Figure 2 As shown, an embodiment of the present invention discloses a volume processing method. Compared with the previous embodiment, this embodiment further illustrates and optimizes the technical solution.
[0050] Step S21: selecting a server from the preset binding command as the target ISCSI server based on the ISCSI protocol.
[0051] In this embodiment, a server is selected from the preset binding command based on the iSCSI protocol as the target iSCSI server. Before logging into the iSCSI client, the volume mapping information is first obtained through the preset binding command, for example, the preset binding command is as follows:
[0052] Tgtadm--lld iscsi--op new--mode logicalunit--tid 1--lun 1--bstypearbd-bpool / image1.
[0053] In the above command statements, lld iscsi indicates the use of the ISCSI protocol, op new indicates the creation of a new mapping relationship, mode logicalunit indicates the mode, tid 1 indicates the id of the target, lun 1 indicates the volume number of the volume in the target, bstypearbd indicates the management backend, and bpool indicates the volume corresponding to rbd (RADOS Block Device, a storage service middle layer built on a RADOS cluster that provides a block device interface for clients). It can be understood that in the above command, the rbd is bound to the volume to obtain the volume mapping information. In the prior art, it is necessary to create a lun device, initialize the tgt backend storage management, and then connect to the distributed cluster, and open the volume mapping operation at the same time. This solution directly saves the volume mapping message in the form of a linked list on the target, and no longer performs the opening operation on the volume mapping, thereby realizing the rapid distribution of the configuration.
[0054] Step S22: After the iSCSI client logs in, it sends a preset request command for the logical unit number information to the target, and obtains the logical unit number information returned by the target.
[0055] In this embodiment, before logging into the iSCSI client, it is necessary to first determine the target iSCSI server to log in. It is understandable that in the preset binding command in the previous step, multiple servers can be bound. Therefore, one server is selected from all the servers in the preset binding command as the target iSCSI server. Then, a preset request command for logical unit number information is sent to the target device, and the number of logical unit numbers and a list of the logical unit numbers queried according to the preset request command are obtained.
[0056] Step S23: creating a SCSI logical unit based on the logical unit number information and the volume mapping information pre-stored locally in the form of a linked list.
[0057] In this embodiment, after obtaining the logical unit number information returned by the target device, a SCSI logical unit is created based on the logical unit number information and the volume mapping information that is pre-stored locally in the form of a linked list. It is understandable that before creating the SCSI logical unit, it is necessary to traverse the information obtained by binding the block device to the target volume in advance through a preset binding command locally to obtain the volume mapping information. Then, the SCSI logical unit is created based on the volume mapping information obtained through the traversal, the number of the logical unit numbers, and the list of the logical unit numbers. It should be noted that the volume mapping information is stored locally in the form of a linked list.
[0058] Step S24: Connect the SCSI logical unit to the distributed storage cluster and establish a corresponding management structure.
[0059] In this embodiment, after creating the SCSI logical unit, the SCSI logical unit is connected to the distributed storage cluster, and a corresponding management structure is established. It can be understood that the SCSI logical unit is connected to the distributed storage cluster, and the corresponding cluster handle is configured; the creation of the input and output context is completed, and the input and output context handle of the cluster with the storage pool name as the keyword in the preset binding command is configured, and the volume handle with the volume name as the keyword in the preset binding command is configured. At this time, a three-layer management structure can be obtained, the first layer is the cluster handle, the second layer is the input and output context handle, and the third layer is the volume handle. When there are a large number of volume configurations, through the processing of the three processes in the above management structure, it is possible to achieve rapid distribution of the configuration without affecting the processing of normal business.
[0060] Step S25: When the current volume processing command is received, the cluster handle, the input / output context handle, and the volume handle are matched in sequence by the SCSI logic unit to obtain a corresponding matching handle.
[0061] In this embodiment, when a large number of volumes are configured, different volumes are individually matched with handles in the management structure using the SCSI logical unit. When a corresponding handle is matched, the currently matched volume can directly call the matched handle to send the volume mapping configuration information to the distributed storage cluster. If no corresponding handle is matched, the currently matched volume needs to repeat all the above steps.
[0062] Step S26: Send the configuration information of the volume mapping information of the current volume to the distributed storage cluster through the corresponding matching handle.
[0063] In this embodiment, when the corresponding handle is matched, it indicates that the currently matched volume can directly call the above-mentioned matched handle to send the configuration information of the volume mapping to the distributed storage cluster, that is, all IO operations of the same volume can call the matching handle, which reduces the number of times of creating connections with the distributed storage cluster and the number of times of creating IO contexts, thereby reducing the consumption of TGT resources and realizing the rapid delivery of a large number of configurations.
[0064] It can be seen that the embodiment of the present application selects a server as the target ISCSI server from the preset binding command based on the ISCSI protocol; after the ISCSI client logs in, a preset request command for the logical unit number information is sent to the target, and the logical unit number information returned by the target is obtained; a SCSI logical unit is created based on the logical unit number information and the volume mapping information pre-stored locally in the form of a linked list; the SCSI logical unit is connected to the distributed storage cluster, and a corresponding management structure is established; when the current volume processing command is received, the cluster handle, the input and output context handle and the volume handle are matched in sequence through the SCSI logical unit to obtain a corresponding matching handle; the configuration information of the volume mapping information of the current volume is sent to the distributed storage cluster through the corresponding matching handle, thereby reducing the number of times the connection with the distributed storage cluster and the number of times the io context is created, reducing resource consumption, and realizing the rapid distribution of a large number of configurations, thereby improving the system usability.
[0065] See also Figure 3 As shown, the embodiment of the present application also discloses a volume processing device, which is applied to an iSCSI server, including:
[0066] The information acquisition module 11 is used to send a preset request command for logical unit number information to the target after the iSCSI client logs in, and obtain the logical unit number information returned by the target;
[0067] A unit creation module 12 is configured to create a SCSI logical unit based on the logical unit number information and volume mapping information pre-stored locally in a linked list format;
[0068] The cluster connection module 13 is used to connect the SCSI logical unit with the distributed storage cluster and establish a corresponding management structure so as to directly use the management structure to perform corresponding processing operations when receiving a current volume processing command.
[0069] It can be seen that the present application includes: after the ISCSI client logs in, a preset request command for the logical unit number information is sent to the target, and the logical unit number information returned by the target is obtained; based on the logical unit number information and the volume mapping information pre-stored locally in the form of a linked list, a SCSI logical unit is created; the SCSI logical unit is connected to the distributed storage cluster, and a corresponding management structure is established, so that when the current volume processing command is received, the management structure is directly used to perform the corresponding processing operation. It can be seen that after creating the SCSI logical unit, the present application connects the created SCSI logical unit to the distributed storage cluster, and then establishes a corresponding management structure. Therefore, when the current volume processing command is received, the management structure can be directly called to perform the corresponding processing operation without having to perform the step of connecting to the distributed storage cluster again, thereby improving the usability of the system and reducing the overhead of system resources.
[0070] In some specific embodiments, the information acquisition module 11 specifically includes:
[0071] A server determining unit, configured to select a server as the target ISCSI server from the preset binding command based on the ISCSI protocol;
[0072] A server login unit, configured to log in to the target iSCSI server via an iSCSI client;
[0073] A command sending unit, configured to send a preset request command for logical unit number information to the target after the iSCSI client logs in;
[0074] The information acquisition unit is used to acquire the number of logical unit numbers and a list of the logical unit numbers.
[0075] In some specific embodiments, the unit creation module 12 specifically includes:
[0076] A volume mapping information acquisition unit is configured to acquire the volume mapping information by traversing information obtained by locally binding a block device to a target volume using a preset binding command in advance;
[0077] A volume mapping information storage unit, configured to store the volume mapping information locally in the form of a linked list;
[0078] The logical unit creating unit is used to create a SCSI logical unit based on the logical unit number information and the volume mapping information pre-stored locally in the form of a linked list.
[0079] In some specific embodiments, the cluster connection module 13 specifically includes:
[0080] A storage cluster connection unit, configured to connect the SCSI logic unit to the distributed storage cluster;
[0081] A cluster handle configuration unit, used to configure the corresponding cluster handle;
[0082] A context creation unit, used to complete the creation of input and output contexts;
[0083] An input / output context handle configuration unit, configured to configure the input / output context handle of the cluster with the storage pool name as a keyword in the preset binding command;
[0084] A volume handle configuration unit, configured to configure a volume handle with the volume name as a keyword in the preset binding command;
[0085] a volume mapping information opening unit, configured to open the volume mapping information;
[0086] A logical unit returning unit, configured to return the SCSI logical unit to the iSCSI client;
[0087] a handle matching unit, configured to, upon receiving a current volume processing command, sequentially match the cluster handle, the input / output context handle, and the volume handle through the SCSI logic unit to obtain a corresponding matching handle;
[0088] A configuration information sending unit is configured to send the configuration information of the volume mapping information of the current volume to the distributed storage cluster through the corresponding matching handle.
[0089] Furthermore, an embodiment of the present application also provides an electronic device. Figure 4 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram should not be considered as any limitation to the scope of application of the present application.
[0090] Figure 4 This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps of the volume processing method disclosed in any of the aforementioned embodiments. Furthermore, the electronic device 20 in this embodiment may be a computer.
[0091] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device. The communication protocol it follows is any communication protocol that can be applied to the technical solution of this application and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world. Its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0092] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or CD, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0093] The operating system 221 is used to manage and control the hardware devices on the electronic device 20 and the computer program 222. The operating system 221 can be Windows Server, NetWare, Unix, Linux, etc. In addition to including computer programs capable of implementing the volume processing method disclosed in any of the aforementioned embodiments and executed by the electronic device 20, the computer program 222 can further include computer programs capable of performing other specific tasks.
[0094] Furthermore, an embodiment of the present application also discloses a storage medium, in which a computer program is stored. When the computer program is loaded and executed by a processor, the volume processing method steps disclosed in any of the aforementioned embodiments are implemented.
[0095] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from the other embodiments. Reference can be made to the descriptions of the identical or similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and the relevant parts can be referred to the descriptions of the methods.
[0096] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.
[0097] The above is a detailed introduction to the volume processing method, device, equipment and storage medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core ideas. At the same time, for those skilled in the art, according to the ideas of the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A volume processing method, characterized in that: Applied to iSCSI server, including: After the iSCSI client logs in, it sends a preset request command for the logical unit number information to the target device, and obtains the logical unit number information returned by the target device; Creating a SCSI logical unit based on the logical unit number information and volume mapping information pre-stored locally in a linked list form; Connecting the SCSI logical unit to the distributed storage cluster and establishing a corresponding management structure so that the management structure can be directly used to perform corresponding processing operations when a current volume processing command is received; Before creating the SCSI logical unit based on the logical unit number information and the volume mapping information pre-stored locally in the form of a linked list, the method further includes: The volume mapping information is obtained by traversing the information obtained by binding the block device to the target volume in advance using a preset binding command locally, and the volume mapping information is stored locally in the form of a linked list; The step of connecting the SCSI logical unit to the distributed storage cluster and establishing a corresponding management structure includes: Connecting the SCSI logical unit to the distributed storage cluster and configuring a corresponding cluster handle; Complete the creation of the input and output context, and configure the input and output context handle of the cluster with the storage pool name as the keyword in the preset binding command; Configuring a volume handle with the volume name as a keyword in the preset binding command; The directly using the management structure to perform corresponding processing operations upon receiving the current volume processing command includes: When receiving a current volume processing command, the cluster handle, the input / output context handle, and the volume handle are sequentially matched by the SCSI logic unit to obtain a corresponding matching handle; The configuration information of the volume mapping information of the current volume is sent to the distributed storage cluster through the corresponding matching handle.
2. The roll processing method according to claim 1, characterized in that: Before the iSCSI client logs in, the process further includes: A server is selected from the preset binding command based on the ISCSI protocol as the target ISCSI server.
3. The roll processing method according to claim 1, wherein: The step of sending a preset request command for logical unit number information to a target device and obtaining the logical unit number information returned by the target device includes: A preset request command for logical unit number information is sent to the target device, and the number of logical unit numbers and a list of the logical unit numbers are obtained.
4. The roll processing method according to any one of claims 1 to 3, characterized in that: After the corresponding management structure is established, the following steps are also included: The volume mapping information is opened, and the SCSI logical unit is returned to the iSCSI client.
5. A roll processing device, characterized in that: Applied to iSCSI server, including: An information acquisition module is used to send a preset request command for logical unit number information to the target after the iSCSI client logs in, and obtain the logical unit number information returned by the target; A unit creation module, configured to create a SCSI logical unit based on the logical unit number information and volume mapping information pre-stored locally in a linked list form; A cluster connection module, configured to connect the SCSI logical unit to a distributed storage cluster and establish a corresponding management structure so as to directly utilize the management structure to perform corresponding processing operations upon receiving a current volume processing command; The unit creation module specifically includes: A volume mapping information acquisition unit is configured to acquire the volume mapping information by traversing information obtained by locally binding a block device to a target volume using a preset binding command in advance; A volume mapping information storage unit, configured to store the volume mapping information locally in the form of a linked list; A logical unit creation unit, configured to create a SCSI logical unit based on the logical unit number information and volume mapping information pre-stored locally in a linked list form; The cluster connection module specifically includes: A storage cluster connection unit, configured to connect the SCSI logic unit to the distributed storage cluster; A cluster handle configuration unit, used to configure the corresponding cluster handle; A context creation unit, used to complete the creation of input and output contexts; An input / output context handle configuration unit, configured to configure the input / output context handle of the cluster with the storage pool name as a keyword in the preset binding command; A volume handle configuration unit, configured to configure a volume handle with the volume name as a keyword in the preset binding command; a handle matching unit, configured to, upon receiving a current volume processing command, sequentially match the cluster handle, the input / output context handle, and the volume handle through the SCSI logic unit to obtain a corresponding matching handle; A configuration information sending unit is configured to send the configuration information of the volume mapping information of the current volume to the distributed storage cluster through the corresponding matching handle.
6. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor is configured to execute the computer program to implement the steps of the volume processing method according to any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that Used to store a computer program; wherein, when the computer program is executed by a processor, the volume processing method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Logical unit management method and system
CN106325777A
Data storage method based on distributed cluster and related equipment thereof
CN110784515A