Logical volume construction method, device, equipment, readable storage medium and program product

By building logical volumes and using host permission settings, the problem of read and write control among multiple hosts is solved, and the global level read and write control and logical volume management are simplified, improving system performance and scalability.

CN114115722BActive Publication Date: 2025-08-01ALIBABA CLOUD COMPUTING CO LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111205600.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-15
Publication Date
2025-08-01
Estimated Expiration
2041-10-15

AI Technical Summary

Technical Problem

Existing logical volume management solutions such as LVM and CLVM cannot realize the global level one-write and multiple read-read control between multiple hosts, and require the cooperation of application layers such as file systems, resulting in high management complexity and inability to meet the global level read-write control requirements.

Method used

By building a logical volume, the logical units from different physical storage devices are combined into a new logical volume. Without the cooperation of the file system, the read and write permissions of different hosts are set to realize read and write control between multiple hosts, and the PRs function of the SCSI protocol is used for permission management.

Benefits of technology

On the premise of reducing the complexity of logical volume management, it meets the global level of read and write control requirements of one-write and multiple reads, provides a global read and write control solution, and supports dynamic expansion of logical volumes, improving system IO throughput performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114115722B_ABST
    Figure CN114115722B_ABST
Patent Text Reader

Abstract

An embodiment of the present disclosure discloses a method, apparatus, device, readable storage medium, and program product for constructing a logical volume. The method includes: obtaining logical volume construction requirement information; constructing a logical volume according to the logical volume construction requirement information and obtaining logical volume information, where the logical volume includes one or more logical units from different physical storage devices; establishing a connection between one or more hosts and the logical volume according to the logical volume information, where there is a mapping relationship between the host and the logical volume, and the read and write permissions for the logical volume are different. This technical solution can realize the management and read / write control of the logical volume among multiple hosts by setting the read / write permissions of different hosts for the logical volume without the cooperation of the application layer such as the file system. Therefore, on the premise of reducing the complexity of implementing logical volume management, it can also meet the read / write control requirements of one write and multiple reads at the global level, providing a global read / write control solution for applications in the form of one write and multiple reads.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to the technical field of data storage, and particularly to a method, apparatus, device, readable storage medium, and program product for constructing a logical volume. Background Art

[0002] With the development of data technology, the use of shared storage is becoming more and more widespread. Shared storage refers to a type of storage product that can be mounted on multiple hosts or computing nodes, and the hosts or computing nodes can simultaneously access the data on the storage product. For example, SAN (Storage Area Network) storage and distributed storage are both commonly used shared storage products that support write-once-read-many. However, both SAN storage and distributed storage have limitations in terms of capacity, read-write switching, etc. Existing solutions include LVM (Logical Volume Manager) and CLVM (Cluster Logical Volume Manager). However, LVM is a single-machine version and cannot implement read-write control of LVs (Logical Volumes) between multiple hosts. Although CLVM is a cluster version, it lacks read-write control and requires application layers such as file systems to implement read-write control. That is to say, existing solutions can only partially solve the LV capabilities and cannot meet the read-write control requirements of write-once-read-many at the global level. Summary of the Invention

[0003] Embodiments of the present disclosure provide a method, apparatus, device, readable storage medium, and program product for constructing a logical volume.

[0004] In a first aspect, embodiments of the present disclosure provide a method for constructing a logical volume.

[0005] Specifically, the method for constructing a logical volume includes:

[0006] Obtain logical volume construction requirement information;

[0007] Construct a logical volume according to the logical volume construction requirement information, and obtain logical volume information, where the logical volume includes one or more logical units from different physical storage devices;

[0008] Establish a connection between one or more hosts and the logical volume according to the logical volume information, where there is a mapping relationship between the host and the logical volume, and the read-write permissions for the logical volume are different.

[0009] Combined with the first aspect, in a first implementation manner of the first aspect of embodiments of the present disclosure, the obtaining of the logical volume construction requirement information includes:

[0010] Obtain the logical volume construction requirement information from the interactive interface of a terminal.

[0011] Combined with the first aspect and the above implementation manners of the first aspect, in the second implementation manner of the first aspect of the embodiments of the present disclosure, the logical volume construction requirement information includes one or more of the following information: logical volume name, logical volume level requirement information, logical unit information constituting the logical volume, and logical unit combination manner;

[0012] The logical volume information includes one or more of the following information: logical volume name, logical volume level information, logical volume size, logical unit information constituting the logical volume, and logical unit combination manner.

[0013] Combined with the first aspect and the above implementation manners of the first aspect, in the third implementation manner of the first aspect of the embodiments of the present disclosure, constructing the logical volume according to the logical volume construction requirement information includes:

[0014] Determine a target logical unit according to the logical volume level requirement information and the logical unit information constituting the logical volume in the logical volume construction requirement information;

[0015] Combine the target logical units according to the logical unit combination manner to obtain the logical volume;

[0016] Name the logical volume according to the logical volume name.

[0017] Combined with the first aspect and the above implementation manners of the first aspect, in the fourth implementation manner of the first aspect of the embodiments of the present disclosure, establishing a connection between one or more hosts and the logical volume according to the logical volume information includes:

[0018] The logical volume management component sends the logical volume information to the logical volume proxy component, where the logical volume proxy component is deployed on different hosts;

[0019] The logical volume proxy component establishes a connection between the host and the logical volume according to the logical volume information.

[0020] Combined with the first aspect and the above implementation manners of the first aspect, in the fifth implementation manner of the first aspect of the embodiments of the present disclosure, the logical volume proxy component establishing a connection between the host and the logical volume according to the logical volume information includes:

[0021] Execute the logical volume proxy component to perform a level check according to the logical volume information;

[0022] After confirming that the level check passes, the executing logical volume proxy component stores the logical volume information, the logical unit information included in the logical volume, and the logical unit mapping data in a preset sector of the corresponding logical unit of the logical volume;

[0023] The non-executable logical volume proxy component reads the logical volume information, the logical unit information and the logical unit mapping data included in the logical volume from a preset sector of the logical unit, and performs a security check based on the logical unit information;

[0024] When it is confirmed that the security check has passed, the logical volume proxy component establishes a connection between the host and the logical volume according to the logical unit mapping data.

[0025] In combination with the first aspect and the above implementation of the first aspect, in a sixth implementation of the first aspect of the embodiment of the present disclosure, after confirming that the security check has passed, the logical volume proxy component establishes a connection between the host and the logical volume according to the logical unit mapping data, including:

[0026] When confirming that the security check has passed, the logical volume proxy component sends the logical unit mapping data reading result to the logical volume management component;

[0027] When all logical volume proxy components successfully read the logical unit mapping data, confirming that the mapping data has been read successfully, the logical volume management component sends a mapping data reading success message to the logical volume proxy component, and the logical volume proxy component establishes a connection between the host and the logical volume according to the logical unit mapping data;

[0028] When one of the logical volume proxy components fails to read the logical unit mapping data, the mapping data reading failure is confirmed, the logical volume management component sends a mapping data reading failure message to the logical volume proxy component, and the logical volume proxy component deletes the read logical unit mapping data.

[0029] In combination with the first aspect and the foregoing implementation of the first aspect, the embodiment of the present disclosure, in a seventh implementation of the first aspect, further includes:

[0030] The logical volume proxy component obtains and stores the logical unit metadata, and sends the logical unit metadata to the logical volume management component for storage.

[0031] In combination with the first aspect and the foregoing implementation of the first aspect, the embodiment of the present disclosure, in an eighth implementation of the first aspect, further includes:

[0032] The read and write permissions of the one or more hosts are controlled according to the received read and write designated instructions.

[0033] In combination with the first aspect and the above implementation of the first aspect, in a ninth implementation of the first aspect of the embodiment of the present disclosure, controlling the read and write permissions of the one or more hosts according to the received read and write designation instructions includes:

[0034] In response to receiving a read / write specification instruction, the logical volume management component sends a read / write lock grab instruction to the target logical volume proxy component of the target host corresponding to the read / write specification instruction;

[0035] In response to receiving the read / write lock grab instruction, the target logical volume proxy component performs a read / write lock grab operation;

[0036] In response to the successful completion of the read / write lock grab operation, the target logical volume proxy component performs a data read / write test on the logical unit of the logical volume;

[0037] The target logical volume proxy component sends the read / write lock grab result and the data read / write test result to the logical volume management component;

[0038] When both the read / write lock grab result and the data read / write test result are successful, the logical volume management component sends a data read / write test command to other logical volume proxy components to confirm that the data reading of other logical volume proxy components is successful while the data writing fails;

[0039] When the read / write lock grab result is a failure, the logical volume management component sends a read / write reclaim instruction to the historical read / write logical volume proxy component to enable the historical read / write logical volume proxy component to reclaim the read / write permission;

[0040] When both the read / write lock grab result of the target logical volume proxy component and the read / write reclaim result of the historical read / write logical volume proxy component are failures, the logical volume management component marks the logical volume as faulty.

[0041] In a second aspect, an embodiment of the present disclosure provides a logical volume construction device.

[0042] Specifically, the logical volume construction device includes:

[0043] An acquisition module, configured to acquire logical volume construction requirement information;

[0044] A construction module, configured to construct a logical volume according to the logical volume construction requirement information and obtain logical volume information, where the logical volume includes one or more logical units from different physical storage devices;

[0045] An establishment module, configured to establish a connection between one or more hosts and the logical volume according to the logical volume information, where there is a mapping relationship between the host and the logical volume, and the read / write permissions for the logical volume are different.

[0046] In combination with the second aspect, in the first implementation manner of the second aspect of the embodiment of the present disclosure, the acquisition module is configured to:

[0047] Acquire the logical volume construction requirement information from an interactive interface of a terminal.

[0048] Combined with the second aspect and the above implementation manners of the second aspect, in the second implementation manner of the second aspect of the embodiments of the present disclosure, the logical volume construction requirement information includes one or more of the following information: logical volume name, logical volume level requirement information, logical unit information constituting the logical volume, logical unit combination manner;

[0049] The logical volume information includes one or more of the following information: logical volume name, logical volume level information, logical volume size, logical unit information constituting the logical volume, logical unit combination manner.

[0050] Combined with the second aspect and the above implementation manners of the second aspect, in the third implementation manner of the second aspect of the embodiments of the present disclosure, the part in the construction module that constructs a logical volume according to the logical volume construction requirement information is configured to:

[0051] Determine a target logical unit according to the logical volume level requirement information and the logical unit information constituting the logical volume in the logical volume construction requirement information;

[0052] Combine the target logical units according to the logical unit combination manner to obtain the logical volume;

[0053] Name the logical volume according to the logical volume name.

[0054] Combined with the second aspect and the above implementation manners of the second aspect, in the fourth implementation manner of the second aspect of the embodiments of the present disclosure, the establishment module is configured to:

[0055] The logical volume management component sends the logical volume information to the logical volume proxy component, where the logical volume proxy component is deployed on different hosts;

[0056] The logical volume proxy component establishes a connection between the host and the logical volume according to the logical volume information.

[0057] Combined with the second aspect and the above implementation manners of the second aspect, in the fifth implementation manner of the second aspect of the embodiments of the present disclosure, the part in the logical volume proxy component that establishes a connection between the host and the logical volume according to the logical volume information is configured to:

[0058] Execute the logical volume proxy component to perform a level verification according to the logical volume information;

[0059] When it is confirmed that the level verification passes, the executing logical volume proxy component stores the logical volume information, the logical unit information included in the logical volume, and the logical unit mapping data into a preset sector of the corresponding logical unit of the logical volume;

[0060] The non-executing logical volume proxy component reads the logical volume information, the logical unit information included in the logical volume, and the logical unit mapping data from a preset sector of the logical unit, and performs a security check according to the logical unit information;

[0061] After confirming that the security check passes, the logical volume proxy component establishes a connection between the host and the logical volume according to the logical unit mapping data.

[0062] Combined with the second aspect and the above implementation manners of the second aspect, in the sixth implementation manner of the second aspect of the embodiments of the present disclosure, the part where, after confirming that the security check passes, the logical volume proxy component establishes a connection between the host and the logical volume is configured as:

[0063] After confirming that the security check passes, the logical volume proxy component sends a logical unit mapping data reading result to the logical volume management component;

[0064] When the logical unit mapping data reading of all logical volume proxy components is successful, it is confirmed that the mapping data reading is successful. The logical volume management component sends a mapping data reading success message to the logical volume proxy component, and the logical volume proxy component establishes a connection between the host and the logical volume according to the logical unit mapping data;

[0065] When the logical unit mapping data reading of one of the logical volume proxy components fails, it is confirmed that the mapping data reading fails. The logical volume management component sends a mapping data reading failure message to the logical volume proxy component, and the logical volume proxy component deletes the read logical unit mapping data.

[0066] Combined with the second aspect and the above implementation manners of the second aspect, in the seventh implementation manner of the second aspect of the embodiments of the present disclosure, the obtaining module is further configured as:

[0067] The logical volume proxy component obtains and stores logical unit metadata, and sends the logical unit metadata to the logical volume management component for storage.

[0068] Combined with the second aspect and the above implementation manners of the second aspect, in the eighth implementation manner of the second aspect of the embodiments of the present disclosure, it further includes:

[0069] A control module, configured to control the read and write permissions of the one or more hosts according to the received read and write specified instructions.

[0070] Combined with the above implementation manners of the second aspect, in the ninth implementation manner of the second aspect of the present disclosure, the part that controls the read / write permissions of the one or more hosts according to the received read / write specified instruction is configured as follows:

[0071] In response to receiving the read / write specified instruction, the logical volume management component sends a read / write lock grabbing instruction to the target logical volume proxy component of the target host corresponding to the read / write specified instruction;

[0072] In response to receiving the read / write lock grabbing instruction, the target logical volume proxy component performs a read / write lock grabbing operation;

[0073] In response to the success of the read / write lock grabbing operation, the target logical volume proxy component performs data read / write tests on the logical units of the logical volume;

[0074] The target logical volume proxy component sends the read / write lock grabbing result and the data read / write test result to the logical volume management component;

[0075] When both the read / write lock grabbing result and the data read / write test result are successful, the logical volume management component sends a data read / write test command to other logical volume proxy components to confirm that other logical volume proxy components succeed in data reading but fail in data writing;

[0076] When the read / write lock grabbing result is a failure, the logical volume management component sends a read / write lock reclaiming instruction to the historical read / write logical volume proxy component to enable the historical read / write logical volume proxy component to reclaim the read / write permission;

[0077] When both the read / write lock grabbing result of the target logical volume proxy component and the read / write lock reclaiming result of the historical read / write logical volume proxy component are failures, the logical volume management component marks the logical volume as faulty.

[0078] In a third aspect, an embodiment of the present disclosure provides an electronic device, including a memory and a processor. The memory is used to store one or more computer instructions for supporting the logical volume construction device to execute the above logical volume construction method, and the processor is configured to execute the computer instructions stored in the memory. The logical volume construction device may further include a communication interface for the logical volume construction device to communicate with other devices or communication networks.

[0079] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium for storing computer instructions used by the logical volume construction device, which includes computer instructions for executing the above logical volume construction method involved by the logical volume construction device.

[0080] Fifth aspect, embodiments of the present disclosure provide a computer program product, including computer programs / instructions, wherein when the computer programs / instructions are executed by a processor, the method steps of the above-mentioned logical volume construction method are implemented.

[0081] The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects:

[0082] The above technical solution combines logical units from different or heterogeneous physical storage devices to construct a new logical volume, which is mapped to all hosts that need to access data storage, that is, a connection is established with one or more hosts. In this way, when subsequent applications access physical storage devices, they can all be based on the new logical volume. Without the cooperation of the application layer such as the file system, this technical solution can realize the management and read / write control of the logical volume among multiple hosts by setting the read / write permissions of the logical volume for different hosts. Thus, on the premise of reducing the complexity of logical volume management implementation, it can also meet the read / write control requirements of one write and multiple reads at the global level, providing a global read / write control solution for storage for applications in the form of one write and multiple reads.

[0083] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the embodiments of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0084] In combination with the accompanying drawings, through the following detailed description of non-limiting embodiments, other features, objectives, and advantages of the embodiments of the present disclosure will become more obvious. In the drawings:

[0085] Figure 1 A flowchart showing a logical volume construction method according to an embodiment of the present disclosure;

[0086] Figure 2A A schematic diagram showing a logical unit combination method according to an embodiment of the present disclosure;

[0087] Figure 2B A schematic diagram showing a logical unit combination method according to another embodiment of the present disclosure;

[0088] Figure 3 A schematic diagram showing the sector allocation of a certain logical unit according to an embodiment of the present disclosure;

[0089] Figure 4 A schematic diagram showing the overall process of logical volume construction according to an embodiment of the present disclosure;

[0090] Figure 5 A schematic diagram showing a logical volume constructed according to an embodiment of the present disclosure;

[0091] Figure 6A structural block diagram of a logical volume construction device according to an embodiment of the present disclosure is shown;

[0092] Figure 7 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown;

[0093] Figure 8 It is a schematic structural diagram of a computer system suitable for implementing a logical volume construction method according to an embodiment of the present disclosure. Detailed implementation manners

[0094] Hereinafter, exemplary implementation manners of embodiments of the present disclosure will be described in detail with reference to the accompanying drawings, so that those skilled in the art can easily implement them. In addition, for the sake of clarity, parts irrelevant to the description of the exemplary implementation manners are omitted in the drawings.

[0095] In the embodiments of the present disclosure, it should be understood that terms such as "including" or "having" are intended to indicate the presence of features, numbers, steps, actions, components, parts, or combinations thereof disclosed in this specification, and are not intended to exclude the possibility of the presence or addition of one or more other features, numbers, steps, actions, components, parts, or combinations thereof.

[0096] In addition, it should be noted that, without conflict, the embodiments in the present disclosure and the features in the embodiments can be combined with each other. Hereinafter, embodiments of the present disclosure will be described in detail with reference to the accompanying drawings and in combination with the embodiments.

[0097] The technical solution provided by the embodiments of the present disclosure combines logical units from different or heterogeneous physical storage devices to construct a new logical volume, which is mapped to all hosts that need to perform data storage access, that is, a connection is established with one or more hosts. In this way, when subsequent applications access physical storage devices, they can all be based on the new logical volume. Without the cooperation of the application layer such as a file system, this technical solution can realize the management and read / write control of the logical volume between multiple hosts by setting the read / write permissions of the logical volume for different hosts. Thus, on the premise of reducing the implementation complexity of logical volume management, it can also meet the read / write control requirements of one write and multiple reads at the global level, providing a global read / write control solution for applications in the form of one write and multiple reads.

[0098] Figure 1 A flowchart of a logical volume construction method according to an embodiment of the present disclosure is shown. As Figure 1 shown, the logical volume construction method includes the following steps S101-S103:

[0099] In step S101, obtain logical volume construction requirement information;

[0100] In step S102, a logical volume is constructed according to the logical volume construction requirement information, and logical volume information is obtained, where the logical volume includes one or more logical units from different physical storage devices;

[0101] In step S103, a connection is established between one or more hosts and the logical volume according to the logical volume information, where there is a mapping relationship between the host and the logical volume, and the read / write permissions for the logical volume are different.

[0102] As mentioned above, with the development of data technology, shared storage is used more and more widely. Shared storage refers to a type of storage product that can be mounted on multiple hosts or computing nodes, and the hosts or computing nodes can access the data on the storage product simultaneously. For example, SAN storage and distributed storage are both commonly used shared storage products that support write-once-read-many. However, both SAN storage and distributed storage have limitations to varying degrees in terms of capacity, read / write switching, etc. Existing solutions include LVM and CLVM. However, LVM is a single-machine version and cannot achieve read / write control of LVs between multiple hosts. Although CLVM is a cluster version, it lacks read / write control and requires an application layer such as a file system to implement read / write control. That is to say, existing solutions can only partially solve the LV capabilities and cannot meet the read / write control requirements of write-once-read-many at the global level.

[0103] Considering the above problems, in this embodiment, a logical volume construction method is proposed. This method combines logical units from different or heterogeneous physical storage devices to construct a new logical volume, and this logical volume is mapped to all hosts that need to access data storage, that is, a connection is established with one or more hosts. In this way, when subsequent applications access physical storage devices, they can all be based on the new logical volume. This technical solution can, without the cooperation of an application layer such as a file system, manage and control the read / write of logical volumes between multiple hosts by setting the read / write permissions of different hosts for the logical volume. Thus, while reducing the complexity of implementing logical volume management, it can also meet the read / write control requirements of write-once-read-many at the global level, providing a global read / write control solution for applications in the write-once-read-many form.

[0104] In an embodiment of the present disclosure, the logical volume construction method is applicable to computers, electronic devices, servers, server clusters, etc. that can perform logical volume construction processing.

[0105] In an embodiment of the present disclosure, the logical volume refers to a virtual disk formed by logical disks. Further, the logical volume may include one or more logical units from different or heterogeneous physical storage devices. Among them, the physical storage device may be a system-level physical storage device, such as a computer, or a component-level physical storage device, such as a storage chip; the physical storage device may be a device supporting a SAN storage structure or a device supporting a distributed storage structure.

[0106] In an embodiment of the present disclosure, the logical volume construction requirement information refers to the requirement information of users and logical volume constructors for logical volume construction. The logical volume construction requirement information may include one or more of the following information: logical volume name, logical volume level requirement information, logical unit information constituting the logical volume, logical unit combination method, and other logical volume construction requirement information.

[0107] Among them, the logical volume level requirement information refers to the requirement information for the level of the logical volume to be constructed. As mentioned above, the logical volume may include one or more logical units from different physical storage devices. Since the geographical location, performance bandwidth, and device reliability of different physical storage devices may vary, the availability of a logical volume composed of one or more logical units from different physical storage devices will also be different. Therefore, in an embodiment of the present disclosure, the logical volume can be level-set to identify logical volumes with different performances and provide options for the construction of logical volumes. Specifically, the logical volume can be divided into the following four levels: Level 1, all logical units of the logical volume come from the same physical storage device, that is, the source storage devices of all logical units of the logical volume are the same, and the recognizable identification information such as the manufacturer, model, and serial number of the physical storage device and the storage type are the same. Among them, the storage type refers to SAN storage or distributed storage. Since the logical units constituting the logical volume of this level come from the same physical storage device, the reliability of the logical volume of this level is also the highest; Level 2, the logical units of the logical volume do not necessarily come from the same physical storage device, but the manufacturers, models, and storage types of the physical storage devices from which they come are the same; Level 3, the manufacturers and storage types of the physical storage devices from which the logical units of the logical volume come are the same; Level 4, there are no special restrictions on the physical storage devices from which the logical units of the logical volume come.

[0108] Among them, the logical unit information constituting the logical volume refers to the distinguishable information about the requirements for the logical units constituting the logical volume, such as distinguishable identification information of logical units such as WWID (The World Wide Identification Number), etc. Based on the logical unit information constituting the logical volume, the logical units constituting the logical volume can be determined, and then the logical volume can be constructed.

[0109] Among them, the way of combining logical units refers to the way of combining logical units to generate a logical volume. The way of combining logical units can be, for example, the striping (stripe) way, the linear way, and the linear + striping combination way based on the Linux device mapper. Among them, the striping way means that logical units are combined in a striping way to obtain a logical volume; the linear way means that logical units are combined in a linear way to obtain a logical volume; the linear + striping combination way means that logical units are combined in a linear and striping way to obtain a logical volume. This way can not only effectively improve the system IO throughput but also support the later storage capacity expansion operation. Figure 2A Illustrate the way of combining logical units according to an embodiment of the present disclosure, as Figure 2A shown. In this embodiment, there are a total of 5 logical units: logical unit 1 - logical unit 5. Among them, logical unit 1 and logical unit 2 are combined in a striping way, and logical unit 3, logical unit 4, and logical unit 5 are also combined in a striping way. Then, the two striping combinations are combined linearly to obtain the final logical volume. Figure 2B Illustrate a schematic diagram of the way of combining logical units according to another embodiment of the present disclosure, as Figure 2B shown. In this embodiment, there are a total of 6 logical units: logical unit 1 - logical unit 6. Among them, logical unit 1, logical unit 2, and logical unit 3 are combined linearly, and logical unit 4, logical unit 5, and logical unit 6 are also combined linearly. Then, the two linear combinations are combined in a striping way to obtain the final logical volume. In this way, based on the stripe and linear of the Linux device mapper, logical units from different physical storage devices can be remapped into a new logical volume, and subsequent applications can access the physical storage devices based on the new logical volume.

[0110] In an embodiment of the present disclosure, the logical volume information refers to the relevant information of the logical volume obtained after the logical volume is constructed. The logical volume construction requirement information may include one or more of the following information: logical volume name, logical volume level information, logical volume size, logical unit information constituting the logical volume, the way of combining logical units, and other logical volume-related information. Among them, the logical volume name, logical volume level information, logical unit information constituting the logical volume, and the way of combining logical units are similar to the explanations and descriptions of the logical volume construction requirement information above, except that the information in the logical volume information is the relevant information of the logical volume constructed according to the logical volume construction requirement information.

[0111] In the above-described embodiment, after obtaining the logical volume construction requirement information, a logical volume including one or more logical units from different physical storage devices can be constructed according to the logical volume construction requirement information, and the information of the constructed logical volume can be obtained; then, a connection between one or more hosts and the logical volume is established according to the logical volume information, that is, the logical volume is mapped to the one or more hosts, and subsequently, data access to the logical volume can be performed through the host. Among them, there is a mapping relationship between the host and the logical volume, so that the one or more hosts can all access the logical volume. It should be emphasized that the read / write permissions of the one or more hosts for the logical volume are different. That is to say, the logical volume provides different read / write roles for different hosts. For example, in an embodiment of the present disclosure, among the one or more hosts, only one host has read / write permissions, while other hosts only have read-only permissions.

[0112] In an embodiment of the present disclosure, the step S101, that is, the step of obtaining the logical volume construction requirement information, may include the following steps:

[0113] Obtain the logical volume construction requirement information from an interactive interface of a terminal.

[0114] In this embodiment, the logical volume construction requirement information can be input by a user or other logical volume construction parties through the interactive interface of the corresponding terminal according to the actual application needs.

[0115] In an embodiment of the present disclosure, the step of constructing a logical volume according to the logical volume construction requirement information in the step S102 may include the following steps:

[0116] Determine the target logical unit according to the logical volume level requirement information and the logical unit information constituting the logical volume in the logical volume construction requirement information;

[0117] Combine the target logical units according to the logical unit combination method to obtain the logical volume;

[0118] Name the logical volume according to the logical volume name.

[0119] In this embodiment, after obtaining the logical volume construction requirement information, a logical volume that meets the requirements of the logical volume construction party can be constructed according to the logical volume construction requirement information. Specifically, first, determine the target logical unit constituting the logical volume according to the logical volume level requirement information and the logical unit information in the logical volume construction requirement information; then, combine the target logical units according to the logical unit combination method in the logical volume construction requirement information to obtain the logical volume; finally, name the logical volume according to the logical volume name in the logical volume construction requirement information to complete the construction of the logical volume.

[0120] In an embodiment of the present disclosure, step S103, that is, the step of establishing a connection between one or more hosts and the logical volume according to the logical volume information, may include the following steps:

[0121] The logical volume management component sends the logical volume information to the logical volume proxy components, where the logical volume proxy components are deployed on different hosts;

[0122] The logical volume proxy components establish a connection between the host and the logical volume according to the logical volume information.

[0123] In this embodiment, the establishment of the connection between the host and the logical volume is realized by means of the logical volume management component and the logical volume proxy components deployed on different hosts. Specifically, first, the logical volume management component sends the logical volume information to the logical volume proxy components deployed on each host, where the logical volume management component refers to a component that can realize the overall scheduling of all logical volume proxy components, and thus realize the global management of the logical volume. The logical volume management component can be installed on the one or more hosts using the logical volume, or on a host connected to the network composed of the one or more hosts; the logical volume proxy component refers to a component that can communicate with the logical volume management component, execute the instructions issued by the logical volume management component, and feedback relevant information to the logical volume management component. The logical volume proxy component is installed on all hosts that are related to or connected to the logical volume and need to perform data storage access; then, the logical volume proxy component establishes a connection between the host and the logical volume according to the received logical volume information.

[0124] In an embodiment of the present disclosure, the step of the logical volume proxy component establishing a connection between the host and the logical volume according to the logical volume information may include the following steps:

[0125] The logical volume proxy component performs a level verification according to the logical volume information;

[0126] When it is confirmed that the level verification is passed, the logical volume proxy component stores the logical volume information, the logical unit information included in the logical volume, and the logical unit mapping data into a preset sector of the corresponding logical unit of the logical volume;

[0127] The non-executing logical volume proxy component reads the logical volume information, the logical unit information included in the logical volume, and the logical unit mapping data from the preset sector of the logical unit, and performs a security verification according to the logical unit information;

[0128] After confirming that the security verification has passed, the logical volume proxy component establishes a connection between the host and the logical volume according to the logical unit mapping data.

[0129] Among them, the executing logical volume proxy component refers to the logical volume proxy component among multiple logical volume proxy components that is used to guide the establishment of the connection between the host and the logical volume. The executing logical volume proxy component can be determined in advance. For example, it can be preset as the logical volume proxy component deployed on the first host among the one or more hosts.

[0130] In this embodiment, the establishment of the connection between the host and the logical volume is guided by the pre-set executing logical volume proxy component. Specifically:

[0131] The executing logical volume proxy component first performs a level verification according to the logical volume information. Among them, the level verification refers to performing a level verification according to the logical volume level information included in the logical volume information, that is, comparing the logical volume level information included in the logical volume information with the logical volume level requirement information in the logical volume construction requirement information. If the two are consistent, it is considered that the level verification has passed; otherwise, it is considered that the level verification has not passed. Among them, for the convenience of performing the level verification, the logical volume construction requirement information can be pre-stored in the executing logical volume proxy component or the host where the executing logical volume proxy component is located;

[0132] If it is confirmed that the level verification has passed, in order to ensure the consistency of the metadata, the execution logic volume proxy component stores the logical volume information, the logical unit information included in the logical volume, and the logical unit mapping data in the preset sectors of the corresponding logical unit of the logical volume. Among them, the logical unit information included in the logical volume may include one or more of the following information: the total number of logical units in the logical volume, the distinguishable identification information of the logical units in the logical volume, the order of the distinguishable identification information of the logical units in the logical volume, the sequence number of a certain logical unit in the logical volume, the security verification code of a certain logical unit, the total number of sectors of a certain logical unit, the reserved sector quantity of a certain logical unit, the starting number of the reserved sectors of a certain logical unit, the number of read / write test sectors of a certain logical unit, the starting number of the read / write test sectors of a certain logical unit, the number of data sectors of a certain logical unit, the starting number of the data sectors of a certain logical unit, the logical unit information of the next logical unit, etc. Among them, since a certain logical unit stores not only the metadata of this logical unit but also the logical unit information of the next logical unit, the redundant storage of the above logical unit information of the next logical unit can effectively ensure the metadata recovery when the metadata of the next logical unit is lost or fails, and realize the metadata disaster recovery ability. Among them, the security verification code of the logical unit refers to the verification code used to determine the data security and unmodified nature of the logical unit. The security verification code of the logical unit can be, for example, an MD5 code generated by the system, etc.; the logical unit mapping data refers to the mapping data from logical devices such as logical units to physical devices such as hosts, such as dm-table (the set of Linux Device mapper mapping rules). Among them, the preset sector refers to the sector reserved in each logical unit for storing the above information in order to ensure the consistency of the metadata. The quantity and location of the preset sectors can be set according to the needs of actual applications. For example, the quantity of the preset sectors can be set to >= 4096. The present disclosure does not make special limitations on the quantity and location of the preset sectors. The sector allocation schematic diagram of a certain logical unit according to an embodiment of the present disclosure is as Figure 3 shown. In this embodiment, the first N sectors (N >= 4096) of this logical unit are set as reserved sectors. Among them, the first N1 sectors in the reserved sectors are used to store the above information, and the latter N2 sectors are used for read / write tests. The remaining sectors of this logical unit are set as data sectors.

[0133] Then, the non-executing logical volume proxy component reads the logical volume information, the logical unit information included in the logical volume, and the logical unit mapping data from a preset sector of the logical unit, and performs data security verification based on the logical unit security verification code in the logical unit information to ensure that the data has not been tampered with. Herein, the non-executing logical volume proxy component refers to other logical volume proxy components in the logical volume proxy component except the executing logical volume proxy component. That is to say, among multiple logical volume proxy components, only one logical volume proxy component performs the metadata writing operation, and other logical volume proxy components only perform metadata reading and data security verification operations;

[0134] Finally, after confirming that the security verification has passed, the corresponding logical volume proxy component can obtain the logical unit mapping data, and establish a connection between the host and the logical volume according to the logical unit mapping data, that is, the logical unit mapping data becomes effective on the corresponding host. This can ensure that the logical volume proxy component obtains the same logical unit mapping data, thereby guaranteeing the consistency of the logical volume information of each host. Although the logical volume is independent for each host, since the logical volume information of each host has consistency, from the perspective of the global host cluster, when in use, only by using the name of the same logical volume for association, the free migration and application of data between different hosts can be realized, which is equivalent to using the same logical volume and does not affect the access to the stored data.

[0135] In an embodiment of the present disclosure, the step that after confirming that the security verification has passed, the logical volume proxy component establishes a connection between the host and the logical volume according to the logical unit mapping data may include the following steps:

[0136] After confirming that the security verification has passed, the logical volume proxy component sends a logical unit mapping data reading result to the logical volume management component;

[0137] When the logical unit mapping data reading of all logical volume proxy components is successful, it is confirmed that the mapping data reading is successful. The logical volume management component sends a mapping data reading success message to the logical volume proxy component, and the logical volume proxy component establishes a connection between the host and the logical volume according to the logical unit mapping data;

[0138] When the logical unit mapping data reading of one of the logical volume proxy components fails, it is confirmed that the mapping data reading fails. The logical volume management component sends a mapping data reading failure message to the logical volume proxy component, and the logical volume proxy component deletes the obtained logical unit mapping data.

[0139] In this embodiment, after confirming that the security verification is passed, the logical volume proxy component establishes the connection between the host and the logical volume. Specifically, after confirming that the security verification is passed, the logical volume proxy component sends the logical unit mapping data reading result to the logical volume management component. For example, the logical unit mapping data reading is successful or failed. If the logical unit mapping data reading fails, the reason for the failure of the logical unit mapping data reading also needs to be sent to the logical volume management component. Among them, the reason for the failure of the logical unit mapping data reading can be, for example, data being tampered with, security verification not passing, etc. After that, the logical volume management component summarizes the logical unit mapping data reading results sent by the logical volume proxy component. When the logical unit mapping data reading of all logical volume proxy components is successful, it can be confirmed that the mapping data reading is successful, that is, the logical volume host mapping is successful. After that, the logical volume management component sends the mapping data reading success message to the logical volume proxy component, and the logical volume proxy component can establish the connection between the host and the logical volume according to the logical unit mapping data. If the logical unit mapping data reading of one of the logical volume proxy components fails, it is confirmed that the mapping data reading fails, that is, the logical volume host mapping fails. The logical volume management component also sends the mapping data reading failure message to the logical volume proxy component. At this time, the logical volume proxy component that has read the logical unit mapping data needs to delete the read logical unit mapping data. At the same time, the data written to the logical unit during this mapping connection operation can also be deleted, waiting for the next mapping connection operation, while the logical volume proxy component that has not read the logical unit mapping data does not need to perform any actions.

[0140] In an embodiment of the present disclosure, the method may further include the following steps:

[0141] The logical volume proxy component obtains and stores the logical unit metadata, and sends the logical unit metadata to the logical volume management component for storage.

[0142] To provide data support for the above-mentioned logical volume construction operation and logical volume connection operation, it is also necessary to obtain and store logical unit metadata in a timely manner. Further, to ensure the security of the logical unit metadata and avoid the loss of the logical unit metadata, after the logical volume proxy component obtains the logical unit metadata, it will not only send the logical unit metadata to the logical volume management component in real time, so that the logical volume management component can uniformly store and manage the logical unit metadata, but also store it locally to facilitate real-time comparison of changes in the logical unit metadata. Among them, the logical volume proxy component can periodically or in real time collect and obtain logical unit metadata mapped to the host, logical unit configuration change information such as capacity changes, etc. Among them, the logical unit metadata may include one or more of the following data: logical unit ID, logical unit WWID, manufacturer of the physical storage device where the logical unit is located, model of the physical storage device, serial number of the physical storage device, HBA (Host Bus Adapter) information of the physical storage device, logical unit size, number of logical unit sectors, whether the logical unit is formatted, the file system to which the logical unit is formatted, and so on.

[0143] In an embodiment of the present disclosure, after the above-mentioned logical volume mapping operation is completed, it is necessary to configure the read and write permissions of the host according to the requirements of the application for data storage, that is, the method may further include the following steps:

[0144] Control the read and write permissions of the one or more hosts according to the received read and write specified instructions.

[0145] In an embodiment of the present disclosure, the step of controlling the read and write permissions of the one or more hosts according to the received read and write specified instructions may include the following steps:

[0146] In response to receiving the read and write specified instructions, the logical volume management component sends a read and write lock grab instruction to the target logical volume proxy component of the target host corresponding to the read and write specified instructions;

[0147] In response to receiving the read and write lock grab instruction, the target logical volume proxy component performs a read and write lock grab operation;

[0148] In response to the success of the read and write lock grab operation, the target logical volume proxy component performs a data read and write test on the logical unit of the logical volume;

[0149] The target logical volume proxy component sends the read and write lock grab result and the data read and write test result to the logical volume management component;

[0150] When both the read / write lock grabbing result and the data read / write test result are successful, the logical volume management component sends a data read / write test command to other logical volume proxy components to confirm that the data reading of other logical volume proxy components is successful while the data writing fails;

[0151] When the read / write lock grabbing result is a failure, the logical volume management component sends a read / write reclaim instruction to the historical read / write logical volume proxy component to enable the historical read / write logical volume proxy component to reclaim the read / write permission;

[0152] When both the read / write lock grabbing result of the target logical volume proxy component and the read / write reclaim result of the historical read / write logical volume proxy component are failures, the logical volume management component marks the logical volume as faulty.

[0153] In this embodiment, based on the 7th lock of the PRs (Persistent Reservations) function of the read / write control SCSI protocol SCSI-3, the read / write control of the logical volume between multiple hosts is realized by setting the read / write permissions of the logical unit of the logical volume for different hosts. Thus, on the premise of reducing the implementation complexity of the logical volume management, it can also meet the read / write control requirements of one write and multiple reads at the global level. Among them, the logical unit of the logical volume and its physical storage device both need to support the SCSI-3 protocol and the 7th lock type of PRs, and the PRs lock type on the host corresponding to all logical units of the logical volume is pre-registered as the PRs-7th lock. In the 7th lock of PRs, all registrants can perform write operations, and at the same time all registered I_T connections (initiator and target connections) are holders. If the system is set so that only one host has read and write permissions, then if a host with only read-only permissions grabs the read and write permissions, then the original host with read and write permissions will automatically be downgraded to only have read-only permissions, so as to ensure that in the entire storage structure, there is always only one host with read and write permissions. Specifically:

[0154] In response to receiving a read / write specification instruction, the logical volume management component sends a read / write lock grabbing instruction to the target logical volume proxy component of the target host corresponding to the read / write specification instruction. Herein, the read / write specification instruction refers to an instruction sent by an application or other instruction sender for specifying a host with read and write permissions. That is to say, the target host corresponding to the read / write specification instruction is the host specified with read and write permissions. Herein, the read / write specification instruction can be received through the external service interface provided by the logical volume management component; the read / write lock grabbing instruction refers to an instruction for triggering the target logical volume proxy component of the target host corresponding to the read / write specification instruction to perform a read / write lock grabbing operation. In an embodiment of the present disclosure, assume that there are currently 3 hosts: Host1, Host2, and Host3. The read / write specification instruction indicates that Host2 is in the read / write state, and the rest are in the read-only state. That is to say, Host2 has read and write permissions, while Host1 and Host3 only have read-only permissions.

[0155] Then, in response to receiving the read / write lock grabbing instruction, the target logical volume proxy component performs a read / write lock grabbing operation, that is, registers the PRs lock type corresponding to all logical units in the logical volume for the target host as the PRs-7 lock. Specifically, first register the host key (hostkey) of the target host on all logical units of the logical volume, and then apply the PRs-7 lock to the host key of the target host. Since the logical volume includes multiple logical units, the read / write lock grabbing operation on all logical units needs to be successful to confirm that the read / write lock grabbing operation of the target host is successful; otherwise, it is regarded as the read / write lock grabbing operation of the target host fails.

[0156] Then, in response to the successful read / write lock grabbing operation, the target logical volume proxy component performs a data read / write test on the logical units of the logical volume, that is, performs a data writing operation on the read / write test sectors on the logical units of the logical volume to confirm whether the read / write state of the target host is normal. Under normal circumstances, at this time, the target logical volume proxy component, or rather the target host, can write data to the read / write test sectors on the logical units of the logical volume; if the read / write lock grabbing operation fails, the target logical volume proxy component does not perform any action. In this way, through the dual operations of the PRs-7 type lock and the data read / write test, the accuracy and reliability of the read / write lock grabbing operation can be guaranteed.

[0157] Then, the target logical volume proxy component sends the read / write lock grabbing result and the data read / write test result to the logical volume management component.

[0158] When both the read-write lock grabbing result and the data read-write test result are successful, the logical volume management component sends a data read-write test command to other logical volume proxy components to trigger the other logical volume proxy components to perform a data writing operation on the read-write test sectors on the logical units of the logical volume, so as to confirm whether the other logical volume proxy components are in a read-only state where data reading is successful but data writing fails.

[0159] If the read-write lock grabbing result is a failure, the logical volume management component sends a read-write reclaim instruction to the historical read-write logical volume proxy component, so that the historical read-write logical volume proxy component performs a read-write lock grabbing operation to reclaim the read-write permission, that is, to return the read-write permission to the previous host with read and write permissions, where the historical read-write logical volume proxy component refers to the logical volume proxy component on the host with read and write permissions before designating the target host as the host with read and write permissions, and the read-write lock grabbing operation of the historical read-write logical volume proxy component is similar to the above read-write lock grabbing operation.

[0160] In practical applications, there may also be a situation where both the read-write lock grabbing result of the target logical volume proxy component and the read-write reclaim result of the historical read-write logical volume proxy component are failures. At this time, the logical volume management component can mark the logical volume as faulty and wait for subsequent maintenance, and then perform relevant operations again after its state returns to normal.

[0161] For the data read-write test, considering that there may be multiple hosts performing read-write operations on the test sectors simultaneously, therefore, when performing the data read-write test, the logical volume management component can allocate the positions of the test sectors written by each host in sequence in each logical unit. For example, in an embodiment of the present disclosure, assuming that a certain logical unit is provided with 128 test sectors, the first host can be allocated the first and second test sectors among the 128 test sectors for read-write tests, the second host can be allocated the third and fourth test sectors among the 128 test sectors for read-write tests, and so on.

[0162] In summary, the overall construction process of the logical volume according to an embodiment of the present disclosure can be as Figure 4 shown. In this embodiment, first, logical unit metadata is obtained, then logical volume construction requirement information is obtained from the user through human-computer interaction, then a logical volume is constructed according to the logical unit metadata and logical volume construction requirement information, and the mapping between the logical volume and all participating hosts is realized. Finally, the read-write permissions of the hosts for the logical volume are set.

[0163] Based on the above technical solution, without the cooperation of application layers such as the file system, the read and write control of logical volumes between multiple hosts can be achieved by setting the read and write permissions of logical volumes for different hosts. Thus, on the premise of reducing the implementation complexity of logical volume management, it can also meet the read and write control requirements of one write and multiple reads at the global level, providing a global read and write control solution for applications in the form of one write and multiple reads. At the same time, logical units from different physical storage devices can also achieve dynamic expansion, breaking through the capacity limitations of a single logical unit and a single physical storage device, and effectively improving the system IO throughput performance by means of the striped logical unit combination method.

[0164] Figure 5 The figure shows a schematic diagram of a logical volume constructed according to an embodiment of the present disclosure. Figure 5 In the figure, the logical volume is composed of multiple logical units from different physical storage devices in a linear striped combination manner. Among them, logical unit 5 from physical storage device 1 and logical unit 3 also from physical storage device 1 are combined in a striped manner, and logical unit 1 from physical storage device 1 and logical unit 3 from physical storage device 2 are combined in a striped manner, and so on. Finally, the obtained multiple striped combinations are combined linearly. The logical volume proxy components deployed on N hosts have a mapping relationship with the logical volume. Among them, the first host has read and write permissions, and other hosts only have read-only permissions. The logical volume management component is deployed on a host connected to the network composed of the N hosts and communicates with the logical volume proxy components deployed on the N hosts.

[0165] The following is an embodiment of the device of the present disclosure, which can be used to execute the embodiment of the method of the present disclosure.

[0166] Figure 6 The figure shows a structural block diagram of a logical volume construction device according to an embodiment of the present disclosure. This device can be implemented as part or all of an electronic device through software, hardware, or a combination of both. As Figure 6 shown, the logical volume construction device includes:

[0167] An acquisition module 601, configured to acquire logical volume construction requirement information;

[0168] A construction module 602, configured to construct a logical volume according to the logical volume construction requirement information and obtain logical volume information, where the logical volume includes one or more logical units from different physical storage devices;

[0169] An establishment module 603, configured to establish a connection between one or more hosts and the logical volume according to the logical volume information, where the host has a mapping relationship with the logical volume and has different read and write permissions for the logical volume.

[0170] As mentioned above, with the development of data technology, the use of shared storage has become increasingly widespread. Shared storage refers to a type of storage product that can be mounted on multiple hosts or computing nodes, and the hosts or computing nodes can simultaneously access the data on this storage product. For example, both SAN storage and distributed storage are commonly used shared storage products that support write-once and multiple-reads currently. However, both SAN storage and distributed storage have limitations to varying degrees in terms of capacity, read-write switching, etc. Existing solutions include LVM and CLVM. However, LVM is a single-machine version and cannot achieve read-write control of LVs between multiple hosts. Although CLVM is a cluster version, it lacks read-write control and requires application layers such as file systems to implement read-write control. That is to say, existing solutions can only partially solve the LV capabilities and cannot meet the read-write control requirements of write-once and multiple-reads at the global level.

[0171] Considering the above problems, in this embodiment, a logical volume construction device is proposed. This device combines logical units from different or heterogeneous physical storage devices to construct a new logical volume, and this logical volume is mapped to all hosts that need to access data storage, that is, connections are established with one or more hosts. In this way, when subsequent applications access physical storage devices, they can all be based on the new logical volume. This technical solution can, without the cooperation of application layers such as file systems, achieve the management and read-write control of logical volumes between multiple hosts by setting the read-write permissions of logical volumes for different hosts. Thus, on the premise of reducing the implementation complexity of logical volume management, it can also meet the read-write control requirements of write-once and multiple-reads at the global level, providing a global read-write control solution for storage for applications in the write-once and multiple-reads form.

[0172] In an embodiment of the present disclosure, the logical volume construction device can be implemented as a computer, an electronic device, a server, a server cluster, etc. that can execute logical volume construction processing.

[0173] In an embodiment of the present disclosure, the obtaining module is configured to:

[0174] Obtain the logical volume construction requirement information from the interaction interface of a terminal.

[0175] In an embodiment of the present disclosure, the logical volume construction requirement information includes one or more of the following information: logical volume name, logical volume level requirement information, logical unit information constituting the logical volume, logical unit combination method;

[0176] The logical volume information includes one or more of the following information: logical volume name, logical volume level information, logical volume size, logical unit information constituting the logical volume, logical unit combination method.

[0177] In an embodiment of the present disclosure, the part of the building module that builds a logical volume according to the logical volume building requirement information is configured to:

[0178] Determine a target logical unit according to the logical volume level requirement information and the logical unit information that composes the logical volume in the logical volume building requirement information;

[0179] Combine the target logical units according to the logical unit combination method to obtain the logical volume;

[0180] Name the logical volume according to the logical volume name.

[0181] In an embodiment of the present disclosure, the establishment module is configured to:

[0182] The logical volume management component sends the logical volume information to the logical volume proxy component, where the logical volume proxy component is deployed on different hosts;

[0183] The logical volume proxy component establishes a connection between the host and the logical volume according to the logical volume information.

[0184] In an embodiment of the present disclosure, the part of the logical volume proxy component that establishes a connection between the host and the logical volume according to the logical volume information is configured to:

[0185] Execute the logical volume proxy component to perform a level check according to the logical volume information;

[0186] When it is confirmed that the level check passes, the executing logical volume proxy component stores the logical volume information, the logical unit information included in the logical volume, and the logical unit mapping data in a preset sector of the corresponding logical unit of the logical volume;

[0187] The non-executing logical volume proxy component reads the logical volume information, the logical unit information included in the logical volume, and the logical unit mapping data from the preset sector of the logical unit, and performs a security check according to the logical unit information;

[0188] When it is confirmed that the security check passes, the logical volume proxy component establishes a connection between the host and the logical volume according to the logical unit mapping data.

[0189] In an embodiment of the present disclosure, the part of the logical volume proxy component that establishes a connection between the host and the logical volume according to the logical unit mapping data when it is confirmed that the security check passes is configured to:

[0190] When it is confirmed that the security check passes, the logical volume proxy component sends a logical unit mapping data reading result to the logical volume management component;

[0191] When the logical unit mapping data of all logical volume proxy components is successfully read, it is confirmed that the mapping data is successfully read. The logical volume management component sends a mapping data read success message to the logical volume proxy component, and the logical volume proxy component establishes a connection between the host and the logical volume according to the logical unit mapping data;

[0192] When the logical unit mapping data of one of the logical volume proxy components fails to be read, it is confirmed that the mapping data is read failed. The logical volume management component sends a mapping data read failed message to the logical volume proxy component, and the logical volume proxy component deletes the read logical unit mapping data.

[0193] In an embodiment of the present disclosure, the obtaining module is further configured to:

[0194] The logical volume proxy component obtains and stores the logical unit metadata, and sends the logical unit metadata to the logical volume management component for storage.

[0195] In an embodiment of the present disclosure, it further includes:

[0196] A control module, configured to control the read and write permissions of the one or more hosts according to the received read and write specified instructions.

[0197] In an embodiment of the present disclosure, the part that controls the read and write permissions of the one or more hosts according to the received read and write specified instructions is configured to:

[0198] In response to receiving the read and write specified instructions, the logical volume management component sends a read and write lock grabbing instruction to the target logical volume proxy component of the target host corresponding to the read and write specified instructions;

[0199] In response to receiving the read and write lock grabbing instruction, the target logical volume proxy component performs a read and write lock grabbing operation;

[0200] In response to the success of the read and write lock grabbing operation, the target logical volume proxy component performs a data read and write test on the logical unit of the logical volume;

[0201] The target logical volume proxy component sends the read and write lock grabbing result and the data read and write test result to the logical volume management component;

[0202] When both the read and write lock grabbing result and the data read and write test result are successful, the logical volume management component sends a data read and write test command to other logical volume proxy components to confirm that the data reading of other logical volume proxy components is successful while the data writing fails;

[0203] When the result of the read / write lock acquisition fails, the logical volume management component sends a read / write reclaim instruction to the historical read / write logical volume proxy component, so that the historical read / write logical volume proxy component reclaims the read / write permission;

[0204] When the read / write lock acquisition result of the target logical volume proxy component and the read / write reclaim result of the historical read / write logical volume proxy component both fail, the logical volume management component marks the logical volume as faulty.

[0205] The technical features involved in the above device embodiments and their corresponding explanations and descriptions are the same, corresponding, or similar to the technical features involved in the above method embodiments and their corresponding explanations and descriptions. For the technical features involved in the above device embodiments and their corresponding explanations and descriptions, reference can be made to the technical features involved in the above method embodiments and their corresponding explanations and descriptions, which will not be elaborated herein.

[0206] The present disclosure also discloses an electronic device, Figure 7 showing a structural block diagram of an electronic device according to an embodiment of the present disclosure, as Figure 7 shown, the electronic device 700 includes a memory 701 and a processor 702; wherein,

[0207] The memory 701 is used to store one or more computer instructions, and wherein, the one or more computer instructions are executed by the processor �02 to implement the above method steps.

[0208] Figure 8 is a schematic structural diagram of a computer system suitable for implementing the logical volume construction method according to an embodiment of the present disclosure.

[0209] As Figure 8 shown, the computer system 800 includes a processing unit 801, which can execute various processes in the above embodiments according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage section 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the system 800 are also stored. The processing unit 801, the ROM 802, and the RAM 803 are connected to each other through a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0210] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as required. A removable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is mounted on the drive 810 as required so that a computer program read therefrom is installed into the storage section 808 as required. Among them, the processing unit 801 can be implemented as a processing unit such as a CPU, a GPU, a TPU, an FPGA, an NPU, etc.

[0211] Specifically, according to an embodiment of the present disclosure, the method described above can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product that includes a computer program tangibly embodied on a computer-readable medium, the computer program including program code for performing the route planning method. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 809, and / or installed from the removable medium 811.

[0212] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code that includes one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0213] The units or modules involved in the embodiments described in the present disclosure can be implemented in software or in hardware. The units or modules described can also be provided in a processor, and the names of these units or modules do not constitute a limitation to the units or modules themselves in some cases.

[0214] As another aspect, embodiments of the present disclosure also provide a computer-readable storage medium. The computer-readable storage medium may be the computer-readable storage medium included in the device described in the above embodiments; or it may exist separately and be a computer-readable storage medium not assembled into the device. The computer-readable storage medium stores one or more programs, and the one or more programs are used by one or more processors to execute the methods described in the embodiments of the present disclosure.

[0215] The above description is only a preferred embodiment of the present disclosure and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by the specific combination of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the technical solutions formed by mutually replacing the above features with the technical features (but not limited to) disclosed in the embodiments of the present disclosure that have similar functions.

Claims

1. A method for constructing a logical volume, comprising: Obtaining logical volume construction requirement information, where the logical volume construction requirements include logical volume level requirement information and logical unit information constituting the logical volume; Constructing a logical volume according to the logical volume construction requirement information and obtaining logical volume information, where the logical volume includes one or more logical units from different physical storage devices, and the logical volume information includes logical volume level information and logical unit information constituting the logical volume; the level of the logical volume is set according to the physical storage devices from which the logical units in the logical volume are sourced; Establishing a connection between one or more hosts and the logical volume according to the logical volume information, where there is a mapping relationship between the host and the logical volume, and the read and write permissions for the logical volume are different; the connection between the host and the logical volume is established according to logical unit mapping data after passing the level verification and the security verification, the level verification is a verification based on the logical volume level information, and the security verification is a verification based on the logical unit information included in the logical volume.

2. The method according to claim 1, where obtaining the logical volume construction requirement information includes: Obtaining the logical volume construction requirement information from an interactive interface of a terminal.

3. The method according to claim 1 or 2, where the logical volume construction requirement information further includes one or more of the following information: logical volume name, logical unit combination method; The logical volume information further includes one or more of the following information: logical volume name, logical volume size, logical unit combination method.

4. The method according to claim 3, where constructing a logical volume according to the logical volume construction requirement information includes: Determining target logical units according to the logical volume level requirement information and the logical unit information constituting the logical volume in the logical volume construction requirement information; Combining the target logical units according to the logical unit combination method to obtain the logical volume; Naming the logical volume according to the logical volume name.

5. The method according to any one of claims 1-2, 4, where establishing a connection between one or more hosts and the logical volume according to the logical volume information includes: The logical volume management component sends the logical volume information to the logical volume proxy component, where the logical volume proxy component is deployed on different hosts; The logical volume proxy component establishes a connection between the host and the logical volume according to the logical volume information.

6. The method according to claim 5, where the logical volume proxy component establishing a connection between the host and the logical volume according to the logical volume information includes: Performing level verification by the logical volume proxy component according to the logical volume information; When it is confirmed that the level verification passes, the executing logical volume proxy component stores the logical volume information, the logical unit information included in the logical volume, and the logical unit mapping data in a preset sector of the corresponding logical unit of the logical volume; The non-executing logical volume proxy component reads the logical volume information, the logical unit information, and the logical unit mapping data from the preset sector of the logical unit and performs security verification according to the logical unit information. After confirming that the security check passes, the logical volume proxy component establishes a connection between the host and the logical volume according to the logical unit mapping data.

7. The method according to claim 6, wherein after confirming that the security check passes, the logical volume proxy component establishing a connection between the host and the logical volume according to the logical unit mapping data includes: After confirming that the security check passes, the logical volume proxy component sends a logical unit mapping data reading result to the logical volume management component; When the logical unit mapping data of all logical volume proxy components is successfully read, it is confirmed that the mapping data is successfully read. The logical volume management component sends a mapping data reading success message to the logical volume proxy component, and the logical volume proxy component establishes a connection between the host and the logical volume according to the logical unit mapping data; When the logical unit mapping data of one of the logical volume proxy components fails to be read, it is confirmed that the mapping data reading fails. The logical volume management component sends a mapping data reading failure message to the logical volume proxy component, and the logical volume proxy component deletes the read logical unit mapping data.

8. The method according to any one of claims 1-2, 4, 6-7, further comprising: The logical volume proxy component acquires and stores logical unit metadata, and sends the logical unit metadata to the logical volume management component for storage.

9. The method according to any one of claims 1-2, 4, 6-7, further comprising: Controlling the read and write permissions of the one or more hosts according to the received read and write specified instructions.

10. The method according to claim 9, wherein controlling the read and write permissions of the one or more hosts according to the received read and write specified instructions includes: In response to receiving a read and write specified instruction, the logical volume management component sends a read and write lock grab instruction to the target logical volume proxy component of the target host corresponding to the read and write specified instruction; In response to receiving the read and write lock grab instruction, the target logical volume proxy component performs a read and write lock grab operation; In response to a successful read and write lock grab operation, the target logical volume proxy component performs a data read and write test on the logical unit of the logical volume; The target logical volume proxy component sends the read and write lock grab result and the data read and write test result to the logical volume management component; When both the read and write lock grab result and the data read and write test result are successful, the logical volume management component sends a data read and write test command to other logical volume proxy components to confirm that other logical volume proxy components succeed in data reading but fail in data writing; When the read and write lock grab result is a failure, the logical volume management component sends a read and write lock back instruction to the historical read and write logical volume proxy component to enable the historical read and write logical volume proxy component to grab back the read and write permission; When both the read and write lock grab result of the target logical volume proxy component and the read and write lock back result of the historical read and write logical volume proxy component are failures, the logical volume management component marks the logical volume as faulty.

11. A logical volume construction device, comprising: An acquisition module, configured to acquire logical volume construction requirement information, where the logical volume construction requirements include logical volume level requirement information and logical unit information that makes up the logical volume; A construction module, configured to construct a logical volume according to the logical volume construction requirement information and obtain logical volume information, where the logical volume includes one or more logical units from different physical storage devices, and the logical volume information includes logical volume level information and logical unit information that makes up the logical volume; the level of the logical volume is set according to the physical storage device from which the logical unit in the logical volume originates; An establishment module, configured to establish a connection between one or more hosts and the logical volume according to the logical volume information, where there is a mapping relationship between the host and the logical volume, and the read / write permissions for the logical volume are different; the connection between the host and the logical volume is established according to logical unit mapping data after passing the level check and the security check. The level check is a check based on the logical volume level information, and the security check is a check based on the logical unit information included in the logical volume.

12. An electronic device, including a memory and a processor; where The memory is used to store one or more computer instructions, where the one or more computer instructions are executed by the processor to implement the method steps described in any one of claims 1-10.

13. A computer-readable storage medium having computer instructions stored thereon, wherein, When the computer instructions are executed by the processor, the method steps described in any one of claims 1-10 are implemented.

14. A computer program product comprising a computer program / instructions, wherein, When the computer program / instructions are executed by the processor, the method steps described in any one of claims 1-10 are implemented.

Citation Information

Patent Citations

  • Storage network and data reading and writing method thereof

    CN101986655A

  • Storage area network virtualization management method

    CN105471695A

  • A method and system for configuring RAID in a server system

    CN109144581A