Implementation method, device and component of virtual raid card

By simulating the RAID card control module and related sub-modules in a virtualization tool, the problems of high cost and incomplete functionality of RAID cards are solved. Dynamic management and read/write operations of hardware RAID cards are realized, reducing the implementation cost of RAID cards and improving their functionality.

CN115826874BActive Publication Date: 2026-01-09SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211708531.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-29
Publication Date
2026-01-09
Estimated Expiration
2042-12-29

AI Technical Summary

Technical Problem

Existing RAID card implementations are costly and lack functionality. In particular, QEMU cannot dynamically create namespaces or simulate hardware RAID card attributes, resulting in the operating system being unable to see the disk, which limits the functionality and cost optimization of RAID cards.

Method used

The virtualization tool simulates and generates a RAID card control module, establishes a communication connection with the user's operating system, generates a RAID group, creates logical volumes and binds namespaces, implements command queues and asynchronous events through the NVME protocol, simulates the hardware functions of the RAID card control module, including information management, disk control and RAID algorithms, and enables reading and writing of disks in the RAID.

Benefits of technology

It effectively reduces the implementation cost of RAID cards, improves RAID card functions, enables dynamic management and read/write operations of hardware RAID cards, supports dynamic creation and management of namespaces, and improves read/write efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115826874B_ABST
    Figure CN115826874B_ABST
Patent Text Reader

Abstract

The application provides an implementation method of a virtual RAID card, comprising the following steps: generating a RAID card control module in a virtualization tool, and establishing a communication connection between the RAID card control module and a user operating system; the RAID card control module sends its own information and disk information mounted under the RAID card control module, generates a RAID group according to the user's selection; the RAID card control module creates a logical volume based on the RAID in the RAID group, dynamically creates a namespace according to the created logical volume, and binds the namespace and the logical volume; the RAID card control module reads and writes the disks in the RAID based on the RAID group information, the logical volume information and the disk information. The application further provides an implementation device and component of the virtual RAID card, which effectively reduces the implementation cost of the RAID card and perfects the function of the RAID card.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of RAID card, and particularly relates to a virtual RAID card implementation method, device and component. BACKGROUND

[0002] The RAID (Redundant Array of Independent Disks) technology can be realized in a software mode, a hardware mode or a combination of software and hardware.

[0003] The soft RAID (RAID card realized in a software mode) has no special control chip and I / O chip, and the functions of the RAID are completely realized by the operating system and the CPU. The modern operating system basically provides the soft RAID support, and provides an abstract layer between the physical drive and the logical drive by adding a software layer on the disk device driver. At present, the most common RAID levels supported by the operating system include RAID0, RAID1, RAID10, RAID01 and RAID5.

[0004] The configuration management and data recovery of the soft RAID are relatively simple, but the processing of all tasks of the RAID is completed by the CPU, such as the calculation of the check value, so the execution efficiency is relatively low. This mode needs to consume a large amount of operation resources, supports less RAID modes, and is difficult to be widely applied.

[0005] The soft RAID is realized by the operating system, so the partition where the operating system is located cannot be used as the logical member disk of the RAID, and the soft RAID cannot protect the system disk. For some operating systems, the configuration information of the RAID is saved in the system information, instead of being saved in the form of file on the disk. In this way, when the system is accidentally crashed and needs to be reinstalled, the RAID information will be lost. In addition, the fault tolerance technology of the disk does not equal to the complete support of the online replacement, hot plug or hot swap. Whether the hot swap of the error disk can be supported is related to the implementation of the operating system, and some operating systems support the hot swap.

[0006] The hard RAID has its own RAID control processing and I / O processing chip, and even has array buffer, and the CPU occupancy rate and overall performance are the best among the three types of implementation, but the implementation cost is also the highest. The hard RAID usually supports hot swapping technology, and the failed disk can be replaced under system running. The hard RAID includes a RAID card and a RAID chip integrated on a motherboard, and the server platform usually adopts the RAID card. The RAID card is composed of a RAID core processing chip (CPU on the RAID card), a port, a cache and a battery. Among them, the port refers to the disk interface type supported by the RAID card, such as IDE (Integrated Drive Electronics), ATA (Advanced Technology Attachment), SCSI (Small Computer System Interface), SATA (Serial Advanced Technology Attachment), SAS (Serial Attached SCSI) and FC (Fibre Channel).

[0007] The soft RAID has poor performance, and cannot protect the system partition, so it is difficult to apply to the desktop system. The hard RAID is very expensive, and different RAIDs are independent of each other and do not have interoperability. Therefore, people adopt the combination of software and hardware to realize the RAID, so as to obtain a compromise in performance and cost, that is, a higher cost performance. Although this RAID adopts a processing control chip, in order to save cost, the chip is usually cheap and has weak processing capacity, and most of the RAID task processing is completed by the CPU through the firmware driver.

[0008] In the prior art, there is no scheme for realizing the function of the hardware RAID card by software, and only the nvme-ctl (NVME controller) is set in qemu (Quick Emulator, a general open source emulation and virtualization tool), such as Figure 1As shown, a plurality of ns (namespace, i.e. namespace) is hung under the nvme-ctl, and the plurality of ns belongs to a disk. The actual storage device is processed by a block (storage block) module (i.e. block-dev); when qemu is started, it is associated with the block-dev, then the device size information and the like is read, and the information is mapped to the ns to be simulated; the ns device (i.e. ns-dev1) is a sub-device of the nvme-ctl. However, the block module is not a sub-device of the nvme-ctl, but only associated when the ns device is started; the ns can only be specified at the start time, and cannot be dynamically created in the running process; there is no simulation mode for the disk, and the operating system can only see the ns, and cannot see the disk, therefore, although a plurality of nvme-ctls can be created in qemu, there is no simulation implementation scheme of the hardware RAID, and in the view of the operating system, there is no hardware RAID card attribute, which is not conducive to reducing the implementation cost of the RAID card and perfecting the function of the RAID card. SUMMARY

[0009] In order to solve the problems in the prior art, the application provides an implementation method, device and component of a virtual RAID card, which effectively solves the problems of high implementation cost and imperfect function of the RAID card in the prior art, effectively reduces the implementation cost of the RAID card, and perfects the function of the RAID card.

[0010] The first aspect of the application provides an implementation method of a virtual RAID card, comprising:

[0011] A RAID card control module is simulated and generated in a virtualization tool, and a communication connection between the RAID card control module and a user operating system is established;

[0012] The RAID card control module sends its own information and disk information mounted under the RAID card control module, generates a RAID group according to the user's selection;

[0013] The RAID card control module creates a logical volume based on the RAID in the RAID group, creates a namespace according to the created logical volume, and binds the namespace and the logical volume;

[0014] The RAID card control module reads and writes the disks in the RAID based on the RAID group information, the logical volume information and the disk information.

[0015] Optionally, the RAID card control module is created based on the NVME protocol, is used for creation, deletion, processing and response of a command queue, and realizes triggering of an asynchronous event.

[0016] Optionally, after the namespace is created according to the created logical volume information, the method further comprises:

[0017] The created namespace information is associated to the RAID card control module.

[0018] Optionally, the binding of the namespace and the logical volume corresponds specifically to using the start address of the logical volume as the start address of the namespace and using the space size of the logical volume as the space size of the namespace.

[0019] Optionally, before the RAID card control module sends the self information, the method further includes:

[0020] The information management module is simulated in the virtualization tool, and the information management module is used to store RAID group RAID query information, disk query information, logical volume query information, and namespace query information, the RAID group RAID query information is used for the RAID card control module to find RAID information according to RAID index information, the disk query information is used for the RAID card control module to find disk information according to disk index information, the logical volume query information is used for the RAID card control module to find logical volume information according to logical volume index information, and the namespace query information is used for the RAID card control module to find namespace information according to namespace index information.

[0021] Further, the RAID group query information includes RAID information, logical volume information, disk information, and corresponding index relationships among the RAID, the logical volume, and the disk in the RAID group.

[0022] Optionally, before the RAID card control module sends the self information, the method further includes:

[0023] The disk control module is simulated in the virtualization tool, and the disk control module is used as a sub-device of the RAID card control module, is used to register disk information to the RAID card control module, and is used to facilitate the RAID card control module to read and write the disk through the disk control module.

[0024] Optionally, before the RAID card control module sends the self information, the method further includes: simulating a RAID algorithm module in the virtualization tool, and the RAID algorithm module is used to implement data mirroring, data striping, and data checking.

[0025] Optionally, the RAID card control module reads and writes the disk in the RAID based on the RAID group information, the logical volume information, and the disk information specifically includes:

[0026] The RAID card control module acquires ID information of the logical volume and read-write object information, determines RAID information where the logical volume is located according to the ID information of the logical volume;

[0027] According to the RAID information where the logical volume is located, corresponding disk information in the RAID is determined;

[0028] Obtain the offset and size of the to-be-read / written data in each disk;

[0029] Call the IO interface of the corresponding disk to complete the read / write operation of the to-be-read / written data.

[0030] Further, the task queue identifier of each disk and the task queue identifier of the RAID card control module are both remapped to a linear task queue identifier.

[0031] The second aspect of the present application provides an implementation device of a virtual RAID card, comprising:

[0032] A generating unit generates a RAID card control module in a virtualization tool, and establishes a communication connection between the RAID card control module and a user operating system;

[0033] A sending unit sends information of the RAID card control module and disk information mounted under the RAID card control module, and generates a RAID group according to a user's selection;

[0034] A creating unit creates a logical volume based on the RAID group, creates a namespace according to the created logical volume, and binds the namespace and the logical volume;

[0035] A read / write unit reads and writes disks in the RAID based on RAID group information, logical volume information and disk information.

[0036] The third aspect of the present application provides an implementation component of a virtual RAID card, comprising: a RAID card control module, a RAID group, a disk, a namespace and a block device, the RAID card control module is connected in communication with a user operating system, sends information of the RAID card control module and disk information mounted under the RAID card control module, and generates a RAID group according to a user's selection; creates a logical volume based on the RAID group, creates a namespace according to the created logical volume, and binds the namespace and the logical volume; reads and writes disks in the RAID based on RAID group information, logical volume information and disk information; each disk corresponds to a block device, and the block device is used to store data written into the disk.

[0037] The technical solution adopted by the present application includes the following technical effects:

[0038] 1. This invention simulates and generates a RAID card control module in a virtualization tool. The RAID card control module sends its own information and the disk information mounted under it, and generates a RAID group according to the user's selection. The RAID card control module dynamically creates logical volumes based on the RAID in the RAID group, creates namespaces based on the created logical volumes, and binds the namespaces to the logical volumes accordingly. Based on the RAID group information, logical volume information, and disk information, it reads and writes to the disks in the RAID. Hardware RAID can be simulated and generated using software methods, thus possessing hardware RAID functionality. Existing technologies focus on RAID control read and write, while this solution focuses on disk read and write control within the RAID, effectively solving the problems of high implementation cost and incomplete functionality of RAID cards caused by existing technologies. It effectively reduces the implementation cost of RAID cards and improves their functionality.

[0039] 2. In the technical solution of this invention, the created namespace information is associated with the RAID card control module, which makes it easy for the RAID card control module to obtain the namespace information and realize the dynamic management of the namespace.

[0040] 3. In the technical solution of the present invention, an information management module is simulated and generated in the virtualization tool. The information management module is used to store RAID query information, disk query information, logical volume query information, and namespace query information in the RAID group, so that users can obtain RAID, disk, logical volume, and namespace information in the virtual RAID card in a timely manner and realize the dynamic management of the virtual RAID card.

[0041] 4. In the technical solution of this invention, a disk control module is simulated and generated in the virtualization tool. The disk information can be registered to the RAID card control module, which makes it convenient for the RAID card control module to read and write the disk through the disk control module, thus realizing the reading and writing of the disk in RAID.

[0042] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit the invention. Attached Figure Description

[0043] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0044] Figure 1 This is a schematic diagram of an existing technology that uses QEMU to implement a RAID card (the RAID card functionality is incomplete);

[0045] Figure 2Flowchart of the method of example one in the present application scheme (one);

[0046] Figure 3 Scheme diagram of the method of example one in the present application scheme for realizing the hardware RAID card by using qemu;

[0047] Figure 4 Flowchart of the method of example one in the present application scheme for creating and calling ns;

[0048] Figure 5 Flowchart of the method of example one in the present application scheme (two);

[0049] Figure 6 Index relationship diagram among raid, volume and disk in example one in the present application scheme;

[0050] Figure 7 Flowchart of the method of example one in the present application scheme (three);

[0051] Figure 8 Flowchart of the method of example one in the present application scheme (four);

[0052] Figure 9 Flowchart of step S14 in the method of example one in the present application scheme (four);

[0053] Figure 10 Re-mapping relationship diagram of the task queue identifier of the disk and the task queue identifier of the RAID card control module in example one in the present application scheme;

[0054] Figure 11 Structure diagram of the device of example two in the present application scheme. DETAILED DESCRIPTION

[0055] To clearly illustrate the technical features of the present application, the present application will be described in detail below with reference to the accompanying drawings. The following disclosure provides many different embodiments or examples for implementing the different structures of the present application. In order to simplify the disclosure of the present application, the components and settings of specific examples are described below. In addition, the present application can repeatedly refer to the numbers and / or letters in different examples. Such repetition is for the purpose of simplification and clarity, and it does not indicate the relationship between the various embodiments and / or settings discussed. It should be noted that the components illustrated in the drawings are not necessarily drawn to scale. The present application omits the description of well-known components and processing techniques and processes to avoid unnecessary limitation of the present application.

[0056] Example one

[0057] As Figures 2-3As shown, the present application provides a virtual RAID card implementation method, comprising:

[0058] S11, a RAID card control module is generated in a virtualization tool to establish a communication connection between the RAID card control module and a user operating system;

[0059] S12, the RAID card control module sends its own information and disk information mounted under the RAID card control module, and generates a RAID group according to user selection;

[0060] S13, the RAID card control module creates a logical volume based on the RAID in the RAID group, dynamically creates a namespace according to the created logical volume, and binds the namespace and the logical volume;

[0061] S14, the RAID card control module reads and writes the disks in the RAID based on RAID group information, logical volume information, and disk information.

[0062] In step S11, the RAID card control module is created based on the NVME (Non-Volatile Memory Express, Non-Volatile Memory Host Controller Interface Specification) protocol, which is used for command queue creation, deletion, processing and response, and realizes the triggering of asynchronous events. The RAID card control module, as a qemu PCI (Peripheral Component Interconnect, Peripheral Component Interconnect) device sub-device, can simulate the processing and response of bar (base address register) space registers and the processing and response of interrupts. The RAID card control module, as an NVME device, realizes the creation, deletion, processing and response of command queues (such as submission queue sq and completion queue cq). The device realizes the triggering of NVME asynchronous events. The device adds a RAID management command entry (RAID management command interface), and the RAID card control module communicates with the RAID management module and the user operating system to process custom RAID commands and realize user indexing of other RAID-related management information through the RAID card control module structure.

[0063] The definition and implementation of the RAID management command are as follows:

[0064] The NVME protocol specifies the meaning and format of NVME instructions, implements a standard protocol instruction, and reserves a part of the operation code range for custom instructions. The RAID card control module redefines the reserved operation code according to the requirements of the NVME protocol. The RAID card control module (raid-ctl) completes the simulation of the RAID card management interface through the definition and implementation of the above expansion commands, thereby realizing the related functions of the hardware RAID.

[0065] Specifically, the RAID management command can include:

[0066] RAID card control module information acquisition instruction, used by the user operating system (guest software) to acquire RAID card control module detailed information. The RAID card control module information includes RAID card control module ID (Identity document), RAID card control module version number, RAID card control module state information, maximum number of arrays supported by the RAID card control module, maximum number of disks supported by each array, maximum number of logic volumes supported by each array, maximum cache size, etc.

[0067] Disk information acquisition instruction, used by the user operating system (guest software) to acquire disk information under the RAID card control module. The disk information includes disk ID, disk SN (serial number), disk capacity, disk LBA (Logical Block Address) Format, whether the disk is added to a RAID group, and disk ID of the disk already added to the RAID group.

[0068] RAID group creation, deletion, modification, and query instructions, used by the user operating system (guest software) to operate the RAID group, add or delete disks from the RAID group, modify the level of the RAID group, and modify the cache strategy, etc. The RAID group information includes: RAID ID in the RAID group, RAID level in the RAID group, RAID stripe unit size in the RAID group, RAID cache strategy in the RAID group, cache strategy of the physical disk in the RAID, total capacity size of the RAID in the RAID group, remaining capacity size of the RAID in the RAID group, number of physical disks included in the RAID in the RAID group, and detailed information of the physical disk in the RAID in the RAID group.

[0069] Logical volume creation, deletion, and query instructions, used by the user operating system (guest software) to operate the logical volume. The logical volume information includes: logical volume ID, RAID ID where the logical volume is located, logical volume capacity size, logical volume LBA Format, logical volume capacity, and logical volume cache strategy, etc.

[0070] In step S12, the RAID card control module sends its own information (RAID card control module information) and disk information under the RAID card control module to the user operating system through the RAID management command, and generates a corresponding RAID group according to the user's selection.

[0071] In step S13, the RAID card control module creates a logical volume based on the RAID in the RAID group, dynamically creates a namespace according to the created logical volume, and binds the namespace to the logical volume.

[0072] The present application creates the namespace based on the creation of the RAID group, encapsulates the creation and deletion of the namespace into an interface called by other modules, and realizes the functions of dynamic creation and deletion of the namespace. Figure 4 As shown in the figure, after the namespace is created according to the created logical volume information, the created namespace information is associated to the RAID card control module; when the namespace is created, all the namespace information can be indexed from the RAID card control module. After the user operating system sends an identify instruction, the RAID card control module transmits the namespace information to the user operating system, so that the user operating system can create, delete and query the namespace during the running process, and the functions are consistent with the hardware RAID card.

[0073] Preferably, the binding of the namespace to the logical volume is specifically that the start address of the logical volume is used as the start address of the namespace, and the space size of the logical volume is used as the space size of the namespace.

[0074] Further, as shown in the figure, the present application also provides an implementation method of the virtual RAID card, before step S12, further comprising: Figure 5 As shown in the figure, the present application also provides an implementation method of the virtual RAID card, before step S12, further comprising:

[0075] S111, generating an information management module in the virtualization tool, the information management module is used for storing RAID group RAID query information (RAID_info information management submodule), disk query information (disk_info information management submodule), logical volume query information (volume_info information management submodule), and namespace query information (ns_info information management submodule); the RAID group RAID query information is used for the RAID card control module to find the RAID information according to the RAID index information; the disk query information is used for the RAID card control module to find the disk information according to the disk index information; the logical volume query information is used for the RAID card control module to find the logical volume information according to the logical volume index information; and the namespace query information is used for the RAID card control module to find the namespace information according to the namespace index information.

[0076] The embodiment of the present application defines and creates an information management module for maintaining more abundant RAID query information, disk query information, logical volume query information, and namespace query information. For example, the disk query information includes serial number (SN), model number, logical block address format (LB AF), status, whether the disk is added to a RAID group, and the disk ID of the disk that has been added to the RAID group. The information management module has strong scalability and can be used to implement more abundant content in the future.

[0077] Specifically, the RAID group query information includes RAID information, logical volume information, disk information in the RAID group, and the corresponding index relationship among the RAID, the logical volume, and the disk in the RAID group. The RAID information maintains the information of the RAID, the volume, and the disk and the dependency relationship among the three, thereby implementing the management of the entire RAID. The RAID information is mounted to the RAID card control module. As shown in the figure, the index relationship among the RAID, the logical volume, and the disk, the RAID card control module can determine the corresponding disk information or the logical volume information according to the RAID information index input by the user, can determine the corresponding RAID information or namespace information according to the logical volume information index input by the user, and can determine the corresponding RAID information according to the disk information index input by the user, thereby improving the flexibility and efficiency of the index. Figure 6

[0078] Further, as shown in the figure, the technical scheme of the present application further provides an implementation method of a virtual RAID card, and before step S12, the method further includes: Figure 7

[0079] S112, a disk control module is simulated and generated in the virtualization tool. The disk control module is a sub-device of the RAID card control module and is used to register the disk information to the RAID card control module, so that the RAID card control module reads and writes the disk through the disk control module.

[0080] In step S112, the disk control module (disk-ctl device) is created as a sub-device of the RAID card control module and is used to manage the information of the disk. The disk control module includes parent node information, storage interface information, disk capacity, disk cache information, and disk ID. Moreover, the disk control module encapsulates the read / write, flush, and drain interfaces of the disk. The disk information is registered to the RAID card control module and is assigned to a disk ID. The RAID card control module reads and writes the disk through the disk control module.

[0081] Further, as shown in the figure, the technical scheme of the present application further provides an implementation method of a virtual RAID card, and before step S12, the method further includes:​​Figure 8 As shown, the technical scheme of the present application further provides an implementation method of a virtual RAID card, before step S12, further comprising:

[0082] S113, generating a RAID algorithm module in the virtualization tool, the RAID algorithm module being used to implement data mirroring, data striping and data checking.

[0083] In step S113, a raid algorithm entry (RAID algorithm module, i.e. Raid_algorithm) is added, which is used to implement data mirroring, data striping and data checking, and implement raid1, raid5 and raid6 schemes based on these algorithms.

[0084] Specifically, as shown, Figure 9 in step S14, specifically comprising:

[0085] S141, the RAID card control module acquires ID information of a logical volume, and determines RAID information where the logical volume is located according to the ID information of the logical volume;

[0086] S142, determining corresponding disk information in the RAID according to the RAID information where the logical volume is located;

[0087] S143, acquiring offset and size of to-be-read-and-written data in each disk;

[0088] S144, calling an IO interface of the corresponding disk to complete read and write operations of the to-be-read-and-written data.

[0089] In step S14, the RAID card control module implements disk read and write in the RAID through a RAID data IO interface and a disk IO interface. The RAID data IO interface read and write operation is based on a logical volume. After a RAID is created, IO read and write cannot be directly performed. A logical volume needs to be created first, and IO read and write operation can be performed after the logical volume is bound to ns. When the disk in the RAID is read and written, RAID card control module information, logical volume ID, offset based on logical volume data and size based on logical volume data are required. The write operation needs to include written data, and the read operation needs to include an address where the read data is stored.

[0090] In step S141, the RAID card control module acquires Nvme-cmd parsed in a submission queue in a command queue, and acquires ID of a logical volume, and indexes to logical volume information (volume_info, i.e. logical volume detailed information) according to the ID of the logical volume.

[0091] In step S142, the RAID card control module determines corresponding disk information in the RAID according to the logical volume information (RAID information where the logical volume information is located).

[0092] In step S143, the RAID card control module acquires the offset and size of the data to be read and written in each disk to be written; specifically, first, the offset information of the data in the raid is calculated using the offset_1 based on the RAID in the volume_info and the offset_2 of the read-write interface; then, the corresponding disk information is indexed using the RAID information (raid_info); the offset and size of the RAID data [offset, size] in each disk are calculated using the RAID level in the RAID information (raid_info) and calling the RAID algorithm module; the check data and the offset and size of the check data in each disk are calculated using the RAID level in the RAID information (raid_info) and calling the RAID algorithm module.

[0093] In step S144, the IO interface of the corresponding disk is called to complete the IO read and write operation of the data to be read and written and the check data corresponding to the data to be read and written.

[0094] Further, to distinguish different read-write objects (i.e. RAID or disk in RAID), a custom command is defined, and a command queue (submission queue and completion queue) is created for the disk; the bar space of the RAID card control module is divided into bar space addresses for each disk, and the doorbell (wake-up) operation of the disk is responded. As shown in Figure 10 Each disk QID (task queue identifier) and the QID of the RAID card control module are remapped to a linear QID. It can be seen that the QID of the disk is mapped to the high bit area, and when processing the submission queue, the IO this time is the IO of the RAID card control module or the IO of the disk can be distinguished according to the QID, so as to distinguish different read-write objects. In this scheme, compared with the data read and write in the RAID in the prior art, the data read and write of the disk in the RAID can be realized, and the read-write efficiency is improved.

[0095] The application simulates generation of a RAID card control module in a virtualization tool, the RAID card control module sends its own information and disk information mounted under the RAID card control module, and generates a RAID group according to user selection; the RAID card control module creates a logical volume based on RAID dynamic creation in the RAID group, creates a namespace according to the created logical volume, and binds the namespace and the logical volume; and reads and writes the disks in the RAID based on RAID group information, logical volume information and disk information, so that the hardware RAID can be simulated and generated by using a software method, the hardware RAID function can be achieved, the prior art is directed to control of reading and writing of the RAID, and the present application is directed to control of reading and writing of the disks in the RAID, effectively solves the problems of high implementation cost and imperfect function of the RAID card caused by the prior art, effectively reduces the implementation cost of the RAID card, and perfects the function of the RAID card.

[0096] In the technical scheme of the application, the created namespace information is associated to the RAID card control module, so that the RAID card control module can acquire the namespace information, and dynamic management of the namespace can be realized.

[0097] In the technical scheme of the application, an information management module is simulated and generated in the virtualization tool, the information management module is used for storing RAID query information, disk query information, logical volume query information and namespace query information in the RAID group, so that the user can acquire RAID, disk, logical volume and namespace information in the virtual RAID card in time, and dynamic management of the virtual RAID card is realized.

[0098] In the technical scheme of the application, a disk control module is simulated and generated in the virtualization tool, the disk information can be registered to the RAID card control module, so that the RAID card control module can read and write the disks in the RAID through the disk control module.

[0099] Embodiment two

[0100] As shown in Figure 11 The technical scheme of the application further provides an implementation device of the virtual RAID card, which comprises:

[0101] The generating unit 101 simulates generation of a RAID card control module in a virtualization tool, and establishes a communication connection between the RAID card control module and a user operating system;

[0102] The sending unit 102 sends its own information and disk information mounted under the RAID card control module, and generates a RAID group according to user selection;

[0103] The creating unit 103, the RAID card control module creates a logical volume based on a RAID group, dynamically creates a namespace according to the created logical volume, and binds the namespace with the logical volume;

[0104] The read-write unit 104, the RAID card control module reads and writes the disk in the RAID based on the RAID group information, the logical volume information and the disk information.

[0105] In the generating unit 101, the RAID card control module is created based on the NVME (Non-Volatile Memory Express, Non-Volatile Memory Host Controller Interface Specification) protocol, which is used for the creation, deletion, processing and response of the command queue, and realizes the triggering of the asynchronous event. The RAID card control module is a sub-device of the qemu PCI (Peripheral Component Interconnect, Peripheral Component Interconnect) device, which can simulate the processing and response of the bar (base address register) space register and the processing and response of the interrupt. The RAID card control module is an NVME device, which realizes the creation, deletion, processing and response of the command queue (such as the submission queue sq and the completion queue cq). The device realizes the triggering of the NVME asynchronous event. The device adds a RAID management command entrance (RAID management command interface), and the RAID card control module communicates with the RAID management module and the user operating system to process the custom RAID command, so as to realize that the user indexes other RAID related management information through the RAID card control module structure.

[0106] In the sending unit 102, the RAID card control module sends its own information (RAID card control module information) and the disk information under the RAID card control module to the user operating system through the RAID management command, and generates a corresponding RAID group according to the user's selection.

[0107] In the creating unit 103, the RAID card control module creates a logical volume based on the RAID in the RAID group, dynamically creates a namespace according to the created logical volume, and binds the namespace with the logical volume. Specifically, the original implementation of the namespace (ns) in the qemu is to directly virtually output an ns device, which is associated with the storage area during initialization, but after the qemu is started, it can only be queried and cannot be modified.

[0108] The application encapsulates the creation and deletion of the ns into an interface called by other modules, and realizes the functions of dynamic creation and deletion of the ns. Figure 4As shown, after the namespace is created according to the created logical volume information, the created namespace information is associated to the RAID card control module; when the ns is created, all the ns information can be indexed from the RAID card control module. When the user operating system sends an identify instruction, the RAID card control module transmits the ns information to the user operating system, so that the user operating system can create, delete and query the ns during running, and the function is consistent with the hardware RAID card.

[0109] Preferably, the namespace is bound to the logical volume, specifically, the start address of the logical volume is used as the start address of the namespace, and the space size of the logical volume is used as the space size of the namespace.

[0110] Further, the technical scheme of the present application also provides a generating unit 101 in an implementation device of a virtual RAID card, and the information management module can also be simulated in a virtualization tool. The information management module is used for storing RAID query information (RAID_info information management submodule), disk query information (disk_info information management submodule), logical volume query information (volume_info information management submodule) and namespace query information (ns_info information management submodule) in a RAID group. The RAID query information is used for the RAID card control module to find RAID information according to RAID index information. The disk query information is used for the RAID card control module to find disk information according to disk index information. The logical volume query information is used for the RAID card control module to find logical volume information according to logical volume index information. The namespace query information is used for the RAID card control module to find namespace information according to namespace index information.

[0111] By defining and creating the information management module, the embodiment of the present application is used for maintaining more abundant RAID query information, disk query information, logical volume query information and namespace query information. For example, the disk query information contains serial number (SN), model number, logical block address format (LB AF), status, whether the disk is added to a RAID group, the disk ID of the disk added to the RAID group, and has strong scalability, which is used for realizing more abundant content in the future.

[0112] Specifically, the RAID group query information includes RAID information, logical volume information, disk information in the RAID group, and corresponding index relationship among the RAID, the logical volume, and the disk in the RAID group. The RAID information maintains information storage of the RAID, the volume, and the disk, and dependency relationship among the three, so as to realize management of the whole RAID, and the RAID information is mounted to the RAID card control module. As shown in Figure 6 the index relationship among the RAID, the logical volume, and the disk, the RAID card control module can determine corresponding disk information or logical volume information according to the RAID information index input by the user, can determine corresponding RAID information or namespace information according to the logical volume information index input by the user, and can determine corresponding RAID information according to the disk information index input by the user, so that the index flexibility and efficiency are improved.

[0113] Further, the technical scheme of the present application further provides a generation unit 101 in an implementation device of a virtual RAID card, which can also simulate generation of a disk control module in a virtualization tool. The disk control module is a sub-device of the RAID card control module, and is used for registering disk information to the RAID card control module, so as to facilitate the RAID card control module to read and write the disk through the disk control module.

[0114] By creating a disk control module (disk-ctl device) as a sub-device of the RAID card control module, the disk control module is used for managing information of the disk. The disk control module contains parent node information, storage interface information, disk capacity, disk cache information, and disk ID. Moreover, the disk control module encapsulates read / write, flush, and drain interfaces of the disk. The disk information is registered to the RAID card control module and is assigned to a disk ID. This facilitates the RAID card control module to read and write the disk through the disk control module.

[0115] Further, the technical scheme of the present application further provides a generation unit 101 in an implementation device of a virtual RAID card, which can also simulate generation of a RAID algorithm module in a virtualization tool. The RAID algorithm module is used for implementing data mirroring, data striping, and data checking, and implements raid1, raid5, and raid6 schemes based on these algorithms.

[0116] The beneficial effects of the device in the embodiment of the present application are the same as those in the embodiment one, and the embodiment is not described herein.

[0117] Embodiment three

[0118] As Figure 3As shown, the technical scheme of the present application further provides an implementation component (i.e. qemu) of a virtual RAID card, comprising: a RAID card control module (Raid_ctr), RAID groups (Raid_a, Raid_b), disks (disk_dev1, disk_dev2, disk_dev3, disk_dev4), namespaces (ns_1, ns_2, ns_3, ns_4), block devices (block_dev1, block_dev2, block_dev3, block_dev4), the RAID card control module is in communication connection with a user operating system through a RAID management module (Raid_management), sends its own information and disk information mounted under the RAID card control module, and generates RAID groups (Raid_a, Raid_b) according to the user's selection; creates logical volumes (Raid_a corresponds to vol_1, vol_4, and Raid_b corresponds to vol_2, vol_3) based on the RAID groups (Raid_a, Raid_b), creates namespaces according to the created logical volumes, and binds the namespaces and the logical volumes (vol_1 corresponds to ns_1, vol_2 corresponds to ns_2, vol_3 corresponds to ns_3, and vol_4 corresponds to ns_4); reads and writes the disks in the RAID based on RAID group information, logical volume information, and disk information; each disk corresponds to a block device (disk_dev1 corresponds to block_dev1, disk_dev2 corresponds to block_dev2, disk_dev3 corresponds to block_dev3, and disk_dev4 corresponds to block_dev4), and the block device is used for storing data files written into the disk (block_dev1 corresponds to host_file1, block_dev2 corresponds to host_file2, block_dev3 corresponds to host_file3, and block_dev4 corresponds to host_file4).

[0119] Among them, the RAID card control module communicates with the user operating system through the RAID management module, is used for processing the custom RAID command, realizes that the user indexes other RAID related management information through the RAID card control module structure. The RAID card control module sends its own information (RAID card control module information) and disk information mounted under the RAID card control module to the user operating system through the RAID management command, and generates corresponding RAID groups according to the user's selection.

[0120] Further, in the implementation component (i.e. qemu) of the virtual RAID card, an information management module is further included, and the information management module is used for storing RAID query information (RAID_info information management submodule, i.e. Raid_info) in a RAID group, disk query information (disk_info information management submodule, i.e. disk_info), logical volume query information (volume_info information management submodule, i.e. volume_info), and namespace query information (ns_info information management submodule, i.e. ns_info). The RAID query information in the RAID group is used for the RAID card control module to find RAID information according to RAID index information. The disk query information is used for the RAID card control module to find disk information according to disk index information. The logical volume query information is used for the RAID card control module to find logical volume information according to logical volume index information. The namespace query information is used for the RAID card control module to find namespace information according to namespace index information.

[0121] Further, in the implementation component (i.e. qemu) of the virtual RAID card, a disk control module (not shown in the figure) is further included. The disk control module is used as a sub-device of the RAID card control module, and is used for registering disk information to the RAID card control module, so as to facilitate the RAID card control module to perform read-write control on the disks (disk_dev1, disk_dev2, disk_dev3, disk_dev4) through the disk control module. The disk control module (disk-ctl device) is created as a sub-device of the RAID card control module, and is used for managing information of the disks.

[0122] Further, in the implementation component (i.e. qemu) of the virtual RAID card, a RAID algorithm module (Raid_algorithm) is further included. The RAID algorithm module is used for implementing data mirroring, data striping, and data checking, and implementing raid1, raid5, and raid6 schemes based on the algorithms.

[0123] It should be noted that the RAID groups (Raid_a and Raid_b) in the qemu are actual RAID function modules, and Raid_a and Raid_b outside the qemu are actual presentation forms of Raid_a and Raid_b in the qemu in a user operating system. Similarly, the logical volumes (vol_1, vol_2, vol_3, and vol_4) outside the qemu are actual presentation forms of ns_1, ns_2, ns_3, and ns_4 in the qemu in the user operating system.

[0124] The beneficial effects of the components in the embodiment are the same as those in the first embodiment, and the embodiment will not be described here.

[0125] The above describes the specific embodiments of the present application in conjunction with the drawings, but is not a limitation on the scope of protection of the present application. Those skilled in the art should understand that various modifications or variations made by those skilled in the art on the basis of the technical solutions of the present application without creative labor are still within the scope of protection of the present application.

Claims

1. A method for implementing a virtual RAID card, the method comprising: The application comprises the following steps: The virtualization tool is qemu, the RAID card control module is created based on the NVME protocol, the hardware RAID with hardware functions is generated by simulating software method, and is used for creating, deleting, processing and responding the command queue, and triggering the asynchronous event; the RAID card control module is a sub-device of the qemu PCI device, and is used for simulating and realizing the processing and responding of the bar space register and the processing and responding of the interrupt; the RAID card control module is an NVME device, and is used for realizing the creating, deleting, processing and responding of the command queue; the RAID card control module adds the RAID management command entrance, and is used for processing the customized RAID command by communicating with the user operating system, and realizing that the user indexes other RAID related management information through the RAID card control module structure; The RAID card control module sends the information of the RAID card control module and the information of the disk mounted under the RAID card control module, generates the RAID group according to the selection of the user; The RAID card control module creates the logical volume based on the RAID in the RAID group, dynamically creates the namespace according to the created logical volume, and binds the namespace and the logical volume. The RAID card control module reads and writes the disk in the RAID based on the RAID group information, the logical volume information and the disk information.

2. The method of claim 1, wherein, After the namespace is created according to the created logical volume information, the application further comprises the following steps: The created namespace information is associated to the RAID card control module.

3. The method of claim 1, wherein the virtual RAID card is implemented by a software module. The namespace and the logical volume are bound by using the start address of the logical volume as the start address of the namespace and using the space size of the logical volume as the space size of the namespace.

4. The method of claim 1, wherein, Before the RAID card control module sends the information, the application further comprises the following steps: An information management module is simulated and generated in the virtualization tool, the information management module is used for storing the RAID query information in the RAID group, the disk query information, the logical volume query information and the namespace query information, the RAID query information in the RAID group is used for the RAID card control module to find the RAID information according to the RAID index information, the disk query information is used for the RAID card control module to find the disk information according to the disk index information, the logical volume query information is used for the RAID card control module to find the logical volume information according to the logical volume index information, and the namespace query information is used for the RAID card control module to find the namespace information according to the namespace index information.

5. The method of claim 4, wherein, The RAID group query information comprises the RAID information in the RAID group, the logical volume information, the disk information and the corresponding index relationship among the RAID, the logical volume and the disk in the RAID group.

6. The method of claim 1, wherein, Before the RAID card control module sends the information, the application further comprises the following steps: The disk control module is generated in the virtualization tool and serves as a sub-device of the RAID card control module, and is used for registering disk information to the RAID card control module, so that the RAID card control module reads and writes the disk through the disk control module.

7. The method of claim 1, wherein the virtual RAID card is implemented by a software driver. Before the RAID card control module sends the information thereof, the RAID algorithm module is generated in the virtualization tool, and the RAID algorithm module is used for realizing data mirroring, data striping and data checking.

8. The method of claim 1, wherein the virtual RAID card is implemented by a software module. The RAID card control module reads and writes the disk in the RAID based on RAID group information, logical volume information and disk information, and specifically includes the following steps. The RAID card control module acquires ID information of the logical volume, determines RAID information where the logical volume is located according to the ID information of the logical volume; According to the RAID information where the logical volume is located, the corresponding disk information in the RAID is determined; The offset and size of the data to be read and written in each disk are acquired; The IO interface of the corresponding disk is called to complete the read and write operation of the data to be read and written.

9. The method of claim 8, wherein, The task queue identifier of each disk and the task queue identifier of the RAID card control module are both remapped to a linear task queue identifier.

10. An apparatus for implementing a virtual RAID card, the apparatus comprising: The RAID card control module is generated in the virtualization tool and establishes a communication connection between the RAID card control module and a user operating system; wherein the virtualization tool is qemu, the RAID card control module is created based on the NVME protocol, a hardware RAID with hardware functions is simulated by a software method, is used for creating, deleting, processing and responding to a command queue, and triggers an asynchronous event; the RAID card control module serves as a sub-device of the qemu PCI device, is used for simulating processing and responding to a bar space register and processing and responding to an interrupt; the RAID card control module serves as an NVME device, is used for creating, deleting, processing and responding to the command queue; the RAID card control module adds a RAID management command entry, is used for processing a custom RAID command through communication with the user operating system, and indexes other RAID-related management information through the RAID card control module structure by the user; The RAID card control module sends information thereof and disk information hung under the RAID card control module, and generates a RAID group according to a user selection; The RAID card control module creates a logical volume based on the RAID group, dynamically creates a namespace according to the created logical volume, and binds the namespace and the logical volume; The RAID card control module reads and writes the disk in the RAID based on RAID group information, logical volume information and disk information. ​ 11. An implementation component of a virtual RAID card, comprising: The virtualization tool is provided, including: a RAID card control module, a RAID group, a disk, a namespace, and a block device, the RAID card control module is connected with a user operating system, sends its own information and disk information mounted under the RAID card control module, generates a RAID group according to the user's selection; a logical volume is created based on the RAID group, a namespace is created according to the created logical volume, and the namespace is bound with the logical volume; the RAID card control module reads and writes the disk in the RAID based on RAID group information, logical volume information, and disk information; each disk corresponds to a block device, and the block device is used for storing data written into the disk; wherein the virtualization tool is qemu, the RAID card control module is created based on the NVME protocol, a hardware RAID with hardware functions is simulated and generated through a software method, is used for creation, deletion, processing and response of a command queue, and triggering of an asynchronous event is realized; the RAID card control module is a sub-device of a qemu PCI device, is used for simulating and realizing processing and response of a bar space register and processing and response of an interrupt; the RAID card control module is an NVME device, is used for realizing creation, deletion, processing and response of a command queue; the RAID card control module adds a RAID management command entry, is used for processing a custom RAID command through communication with a user operating system, and realizes that the user indexes other RAID related management information through the RAID card control module structure.

Citation Information

Patent Citations

  • Management method and system of soft redundant array of independent disk

    CN101984399A

  • Storage system based on NVMe equipment

    CN111722786A