Method, device, equipment and program product for managing disk array
By creating the domain path of the disk group in the processor core and passing notification messages, the problem of mismatched path creation timing was resolved, ensuring the correct creation of the disk array and guaranteeing the normal startup of the operating system.
Patent Information
- Application Number
- CN202411958649.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2044-12-27
AI Technical Summary
When the volume management device in the processor manages a redundant array of independent disks, the timing of path creation does not match the timing of RAID creation by the device management driver, resulting in error reporting and affecting the startup and operation of the operating system.
The first program, which runs in the first kernel, creates a domain path for the target disk group. After the path creation is complete, it sends a notification message to the volume management driver, which in turn notifies the disk driver to scan. Finally, the device manager completes the creation of the disk array.
Ensure that the disk array is correctly created when the electronic device is powered on to avoid affecting the normal operation of the operating system.
Smart Images

Figure CN119937918B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of electronics, and relate to but are not limited to a disk array management method, device, equipment and program product. BACKGROUND
[0002] A Volume Management Device (VMD) in a processor has a problem of mismatch between a path creation timing and a device management driver RAID creation timing when managing a Redundant Array of Independent Disks (RAID).
[0003] When the VMD reports a Non-Volatile Memory Express (NVMe) driver to a Userspace device manager (Udev), the device manager checks a disk redundancy array corresponding path, but at this time, the VMD driver may not have completed the creation of the path, in which case an error is reported, further affecting the startup and operation of the operating system. SUMMARY
[0004] Therefore, embodiments of the present application provide a disk array management method, device, equipment and program product.
[0005] The technical solution of the embodiments of the present application is as follows:
[0006] In a first aspect, the embodiments of the present application provide a disk array management method, comprising:
[0007] A first program running in a first kernel creates a corresponding domain path for a target disk group, and sends a first notification message to a volume management driver program running in the first kernel in a case where it is determined that the domain path creation is completed;
[0008] The volume management driver program sends a second notification message to a disk driver program running in a second kernel in response to the first notification message, the second notification message being used to notify the disk driver program to perform scanning;
[0009] The disk driver program sends a third notification message to a device management program running in a third kernel in a case where the scanning of the target disk group is completed, so that the device management program completes the creation of a disk array corresponding to the target disk group in response to the third notification message.
[0010] In a second aspect, the embodiments of the present application provide a disk array management device, comprising:
[0011] The creating module is configured to create a corresponding domain path for the target disk group by using the first program running in the first kernel, and send a first notification message to a volume management driver running in the first kernel when it is determined that the domain path creation is completed.
[0012] The first sending module is configured to send second notification information to a disk driver running in the second kernel by using the volume management driver in response to the first notification message, the second notification information being used to notify the disk driver to perform scanning.
[0013] The second sending module is configured to send third notification information to a device management program running in the third kernel by using the disk driver in response to the second notification information when the scanning of the target disk group is completed, so that the device management program completes the creation of a corresponding disk array of the target disk group in response to the third notification information.
[0014] In a third aspect, an electronic device is provided, which includes a memory and a processor. The memory stores a computer program capable of running on the processor. When the processor executes the program, the first program running in the first kernel creates a corresponding domain path for the target disk group, and sends a first notification message to a volume management driver running in the first kernel when it is determined that the domain path creation is completed. The volume management driver sends second notification information to a disk driver running in the second kernel in response to the first notification message, the second notification information being used to notify the disk driver to perform scanning. The disk driver sends third notification information to a device management program running in the third kernel in response to the second notification information when the scanning of the target disk group is completed, so that the device management program completes the creation of a corresponding disk array of the target disk group in response to the third notification information.
[0015] In a fourth aspect, a storage medium is provided, which stores executable instructions. When the processor executes the instructions, the first program running in the first kernel creates a corresponding domain path for the target disk group, and sends a first notification message to a volume management driver running in the first kernel when it is determined that the domain path creation is completed. The volume management driver sends second notification information to a disk driver running in the second kernel in response to the first notification message, the second notification information being used to notify the disk driver to perform scanning. The disk driver sends third notification information to a device management program running in the third kernel in response to the second notification information when the scanning of the target disk group is completed, so that the device management program completes the creation of a corresponding disk array of the target disk group in response to the third notification information.
[0016] In a fifth aspect, a computer program product includes a first program, a volume management driver, a disk driver and a device management program, wherein the first program running in the first kernel creates a corresponding domain path for the target disk group, and sends a first notification message to the volume management driver running in the first kernel upon determining that the domain path creation is completed; the volume management driver sends a second notification message to the disk driver running in the second kernel in response to the first notification message, and the second notification message is used to notify the disk driver to perform scanning; the disk driver sends a third notification message to the device management program running in the third kernel upon completing the scanning of the target disk group, so that the device management program completes the creation of the corresponding disk array of the target disk group in response to the third notification message. BRIEF DESCRIPTION OF DRAWINGS
[0017] Figure 1 An implementation flowchart of a disk array management method provided by an embodiment of the present application is shown in the figure.
[0018] Figure 2 An implementation flowchart of a domain path creation method provided by an embodiment of the present application is shown in the figure.
[0019] Figure 3A An implementation flowchart of a domain name information acquisition method provided by an embodiment of the present application is shown in the figure.
[0020] Figure 3B An implementation flowchart of a domain path creation method provided by an embodiment of the present application is shown in the figure.
[0021] Figure 4A An implementation flowchart of a disk management method provided by an embodiment of the present application is shown in the figure.
[0022] Figure 4B An implementation flowchart of a domain path creation method provided by an embodiment of the present application is shown in the figure.
[0023] Figure 5 A component structure diagram of a disk array management device provided by an embodiment of the present application is shown in the figure.
[0024] Figure 6 A hardware entity diagram of an electronic device provided by an embodiment of the present application is shown in the figure. DETAILED DESCRIPTION
[0025] To make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the specific technical solutions of the embodiments of the present application will be further described in detail below with reference to the accompanying drawings of the embodiments of the present application. The following embodiments are used to illustrate the present application, but not to limit the scope of the present application.
[0026] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments, but it is understood that "some embodiments" can be the same subset or different subsets as each other and can be combined with each other as long as there is no conflict.
[0027] In the following description, the terms "first\second\third" are only to distinguish similar objects, and do not represent the specific order of the objects. It is understood that "first\second\third" can be interchanged in specific order or sequence as long as it is allowed, so that the embodiments of the application described herein can be implemented in an order other than that illustrated or described herein.
[0028] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the application only and is not intended to be limiting of the application.
[0029] The embodiments of the application provide a management method of a disk array, as shown in Figure 1 The method comprises the following steps.
[0030] In step S110, a first program running in a first core creates a corresponding domain path for a target disk group, and sends a first notification message to a volume management driver running in the first core when it is determined that the domain path creation is completed.
[0031] Here, the first core is also called a central processing unit core (CPU core), which is an intermediate core chip of a central processing unit (CPU) and is used for performing all calculations, accepting / storing commands, processing data and other tasks, and is the core of digital processing. A central processing unit contains multiple processor cores (CPU cores), each of which can independently process tasks and can process multiple tasks in parallel, thereby improving computing efficiency. The first core (Core 0) is a processor core set in a central processing unit.
[0032] The target disk group can include multiple independent disks. For example, multiple solid state disks (SSDs) can be combined into a disk group to improve read / write speed and data throughput.
[0033] The first program is arranged in the first kernel and can create a corresponding domain path for a target disk group of the electronic device. The first program can be independent of a Volume Management Device (VMD) driver running in the first kernel, and is a program for implementing domain path creation. For example, the first program can be a Domain Framework program. The Domain Framework can be a software framework specially designed for a specific application field, and provides a set of predefined functions, classes, and interfaces for the specific needs of the field, so that developers can quickly develop application programs that meet the requirements of the field based on the framework. The Domain Framework usually has good scalability, allowing developers to customize and extend as needed, and has high stability, which can reduce the risk of application errors. The VMD driver is a Volume Management Device (VMD) driver.
[0034] The VMD driver can be used to identify hardware devices (disk groups) connected to the central processor, ensuring that the operating system can effectively control and manage the disk groups, thereby enabling the normal operation of various hardware functions. The VMD is a module integrated in the central processor, which is used for hot plug management and error handling of disks, supports hot upgrade and replacement of Non-Volatile Memory Express (NVMe) solid state disks from a peripheral component interconnect express (PCIe) bus, and can more quickly identify the status of the disk, which is helpful for system management and maintenance. The Non-Volatile Memory Express is a communication protocol designed based on device interface standards for high-speed solid state disks. It provides high-speed and low-latency access performance, and is suitable for application scenarios that require high-performance storage solutions, such as data centers, servers, high-performance computing (HPC), and client systems that require fast data access.
[0035] Here, the first program and the VMD driver run in the same kernel, i.e., the first kernel, and the programs in the first kernel run in the kernel space of the operating system. The device drivers in the kernel space (including the VMD driver) are used to interact with hardware devices (including the disk manager).
[0036] The domain path is a condition for creating a disk array corresponding to the target disk, that is, in the case of identifying a correct domain path, the creation of the disk array can be realized. The Redundant Array of Independent Disks (RAID ARRAY), referred to as RAID, is a combination of multiple independent hard disks (physical hard disks) in different ways to form a hard disk group (logical hard disk), thereby providing higher storage performance than a single hard disk and providing a data backup technology. For example, the domain path of the target disk group can be " / sys / bus / pci / drivers / vmd / 0000:c7:00.5 / domain / device", wherein "0000:c7:00.5" is the Peripheral Component Interconnect (PCI) domain corresponding to the target disk group, "0000" can represent the root domain or the starting domain of the PCI bus; "c7" can identify the number of a target disk group on the PCI bus; and "00.5" can represent a specific function or port on the target disk group. In the implementation process, in the case of identifying that the domain path is created, the corresponding disk array can be successfully created.
[0037] In the implementation process, the first program can send a first notification message to a volume management driver also running in the first kernel in the case of completing the creation of the domain path corresponding to the target disk group, so that the volume management driver determines that the domain path has been created.
[0038] Step S120, the volume management driver sends a second notification message to a disk driver running in a second kernel in response to the first notification message, the second notification message being used to notify the disk driver to perform scanning.
[0039] In the implementation process, the volume management driver sends a second notification message to a disk driver running in a second kernel in the case of receiving the first notification message, notifying the disk driver to scan the NVME devices.
[0040] Here, the volume management driver can scan the VMD controller available in the system, that is, the scanning object is the VMD controller.
[0041] The disk driver can scan the NVMe disk connected to the VMD controller, that is, the scanning object is the NVMe disk.
[0042] In the implementation process, the disk driver performs a scan on the NVMe disks, that is, a disk initialization and identification process, to ensure that the system can correctly identify, configure and use these high-speed storage disks.
[0043] The disk driver runs in another core, that is, a second core (Core 2), which is different from the first core. The second notification message is a message sent by the volume management driver running in the first core to the disk driver running in the second core.
[0044] Here, the program in the second core runs in the kernel space of the operating system. Among them, the device driver (including the disk driver) in the kernel space is used to interact with the hardware device (including the disk group).
[0045] In step S130, the disk driver sends third notification information to the device management program running in the third core in response to the second notification information when the scan of the target disk group is completed, so that the device management program completes the creation of the disk array corresponding to the target disk group in response to the third notification information.
[0046] In the implementation process, when the disk driver receives the second notification information, it starts scanning the target disk group, that is, initializes and identifies the target disk group. When the scan is completed, the disk driver sends third notification information to the device management program (Userspace DEVice manager, udev) running in the third core (Core 2).
[0047] Here, the device management program running in the third core runs in the user space (UserSpace) of the operating system. Among them, the user space refers to the memory area in the operating system running by the user program and the application program, which is opposite to the kernel space of the operating system. The user space includes non-kernel code and data, such as application programs, library functions, runtime environments, etc. The user space isolates the user program from the kernel, preventing the user program from directly accessing or damaging the kernel data, thereby enhancing the security of the system.
[0048] The device management program is a tool for managing hardware devices (disk groups), which can automatically identify and configure devices, flexible device rules, dynamic device management, and simplify device naming and access, etc. For example, in the Linux system, the mdadm tool can be used to manage the disk array. In the Windows system, the disk management tool can be used to view and manage the disk array. When the disk group is inserted into the electronic device, the device management program can automatically detect and identify the disk group, and perform corresponding configuration according to the predefined rules.
[0049] In the implementation process, the device management program checks whether the domain path of the target disk group is created in response to the third notification information, and completes the creation of the disk array corresponding to the target disk group in the case of determining that the domain path is correct.
[0050] In some embodiments, in the case of completing the creation of the disk array corresponding to the target disk group, the first program can continue to create the corresponding domain path for the next target disk group (disk group 2) to realize the creation of the disk array corresponding to the disk group 2 based on the delivery of the notification message. In the order of execution, the creation of the array corresponding to all the disk groups set on the electronic device can be realized.
[0051] In the embodiments of the present application, the first program creates the corresponding domain path for the target disk group, and can realize the successful configuration of the disk array corresponding to the target disk by the delivery of the notification information in the case of checking the completion of the creation of the domain path. In this way, the disk array can be correctly created each time the electronic device is started, and the normal operation of the operating system will not be affected.
[0052] In some embodiments, the above step S110 "the first program running in the first kernel creates the corresponding domain path for the target disk group, and sends a first notification message to the volume management driver running in the first kernel in the case of determining the completion of the creation of the domain path" can be realized by the following steps: Figure 2
[0053] Step S210, the first program obtains the domain name information corresponding to the target disk group;
[0054] Here, different disk groups correspond to different domain name information. For example, the domain name information corresponding to the disk group 1 is "0000:c7:00.5", and the domain name information corresponding to the disk group 2 is "0000:c8:00.5".
[0055] In the implementation process, the domain name information can be obtained by the first program (Domain Framework). For example, the PCI domain name information "0000:c7:00.5" corresponding to disk 1 can be obtained by the domain framework program set in the first kernel (Core 0).
[0056] Step S220, the first program creates the domain path based on the domain name information;
[0057] Here, the domain path can be used to describe a path of a PCI device (disk group) in an operating system, and can be a disk group related to a VMD driver. The disk group controller (VMD controller) is connected to the mainboard through a PCIe or other interface. For example, different disk groups connected to the same processor can correspond to a path of a part of the domain path set in the same part, and different disk groups can correspond to a path of a part of the domain path set based on different domain name information.
[0058] In the implementation process, since different disk groups correspond to different domain name information, the domain paths of different disk groups are different, so the first program can create a domain path based on the domain name information. For example, the domain path corresponding to disk group 1 can be " / sys / bus / pci / drivers / vmd / 0000:c7:00.5 / domain / device". " / sys / bus / pci / drivers / vmd / " and " / domain / device" are paths corresponding to a part of the domain path set in the same part for different disk groups connected to the same processor, and "0000:c7:00.5" is a path corresponding to a part of the domain path set based on different domain name information for different disk groups.
[0059] Step S230, the first program sends the first notification message to the volume management driver when determining that the domain path creation is completed.
[0060] In the implementation process, the first program determines that the domain path creation (VMD path generation) is completed, and sends the first notification message (Notify) to the volume management driver in the first kernel.
[0061] In the embodiment of the application, the first program first acquires the domain name information corresponding to the target disk group, then creates a domain path based on the domain name information, and finally sends a first notification message to the volume management driver when determining that the domain path creation is completed. In this way, the correct domain path can be created based on the domain name information obtained first, and the creation of the domain path before the creation of the disk array is further realized.
[0062] In some embodiments, the above step S210 "the first program acquires the domain name information corresponding to the target disk group" can be implemented by the following steps: Figure 3A
[0063] Step S211, the volume management driver scans the bus interface to identify the domain name information corresponding to a group of disks connected to the bus interface as the domain name information corresponding to the target disk group;
[0064] Here, the volume management driver is used to identify, configure and manage the physical disks and logical volumes connected to the system to ensure the correct storage and access of data. When scanning the bus interface, the volume management driver can scan the bus interface to find a set of disks connected to the bus interface and collect the domain name information of the disk set as the domain name information corresponding to the target disk set.
[0065] In the implementation process, the volume management driver first identifies the bus type connected to the system, such as SATA, SAS, PCIe, etc. Then the volume management driver can enumerate all disk sets connected to the bus through the bus interface. A specific command or query can be sent to obtain the list of connected devices. For the enumerated disk set, the volume management driver can also query the domain name information of the disk set, which involves communicating with the disk set to obtain its configuration or metadata. Here, the domain name information can be related to the file system or network configuration. And different disk sets correspond to different domain name information.
[0066] Step S212, the first program executes the domain name information callback function to obtain the domain name information, wherein the domain name information callback function is registered by the volume management driver for the first program.
[0067] Here, the domain name information callback function, vmd_get_domain_info(), is registered by the volume management driver for the first program. Registering the domain name information callback function once can use the domain name information callback function to obtain the domain name information multiple times. For example, vmd_get_domain_info() can be used to obtain the PCI domain of the VMD hardware (target disk set): 0000:c7:00.5.
[0068] In the embodiment of the application, first, the volume management driver scans the bus interface to identify the domain name information corresponding to the disk set connected to the bus interface as the domain name information corresponding to the target disk set; then the domain name information callback function is executed to obtain the domain name information. In this way, the domain name information callback function registered in advance can be used to obtain the domain name information of the target disk set identified and generated by the volume management driver.
[0069] In some embodiments, the above step S220 "the first program creates the domain path based on the domain name information" can be implemented by the following steps: Figure 3B As shown in the figure, the following steps can be implemented:
[0070] Step S221, the first program obtains volume management path information;
[0071] Here, the volume management path information is the path information of the same part in the part of the domain path corresponding to the different disk group connected to the same processor. For example, the volume path can be " / sys / bus / pci / drivers / vmd / ", which is the system volume path generated by the volume management driver.
[0072] In the implementation process, the corresponding volume management path information can be generated when the volume management driver is loaded.
[0073] Step S222, the first program creates the domain path based on the domain name information and the volume management path information.
[0074] Here, since the domain name information corresponding to the target disk group has been obtained, the domain path corresponding to the target disk can be created based on the domain name information and the volume management path information. For example, the volume path can be " / sys / bus / pci / drivers / vmd / ", and the domain information can be "0000:c7:00.5", and then the domain path corresponding to the target disk can be created as " / sys / bus / pci / drivers / vmd / 0000:c7:00.5 / domain / device".
[0075] In the embodiments of the present application, first, the first program obtains the volume management path information; and then creates the domain path based on the domain name information and the volume management path information. In this way, a correct and usable domain path can be generated for the target disk group based on the volume management path information and the domain name information.
[0076] In some embodiments, the above step 221 "the first program obtains the volume management path information" can be implemented by the following process:
[0077] In the case of loading the volume management driver, the volume management path information is generated;
[0078] Here, when the operating system is started or the disk group is identified, the volume management driver can be loaded into the memory and initialized. The initialization process includes checking the compatibility of the disk group, allocating necessary system resources, etc.
[0079] In the process of constructing the disk group, the volume management driver generates the corresponding volume management path information. These volume management path information can be used to uniquely identify and access the disk group in the operating system. The volume management path information can include the name, identifier, file path, etc. of the disk group.
[0080] Correspondingly, the above step 222 "the first program creates the domain path based on the domain name information and the volume management path information" can be implemented by the following process:
[0081] The first program splices the domain name information and the volume management path information to obtain the domain path.
[0082] For example, the domain name information of the target disk group is "0000:c7:00.5", the volume management path information is " / sys / bus / pci / drivers / vmd / ", and the domain path information after the domain name information is spliced with the firmware path information " / domain / device", and the domain path is as follows:
[0083] " / sys / bus / pci / drivers / vmd / 0000:c7:00.5 / domain / device".
[0084] In the embodiment of the application, the volume management path information is generated in the case that the volume management driver is loaded, and then the first program splices the domain name information and the volume management path information to obtain the domain path. In this way, the volume management firmware information obtained when the volume management program is loaded is spliced with the domain name information, and a fixed path information after the domain name information is spliced, so that a correct and usable domain path of the target disk group can be generated.
[0085] In some embodiments, after the first program sends the first notification message to the volume management driver in step S110, the following steps are further included:
[0086] In step S140, the first program wakes up other programs waiting to run in the first kernel.
[0087] Here, the task scheduler in the operating system kernel can determine which program should run in the next processor time slice. When a program needs to wait for an event, such as constructing a domain path corresponding to a target disk group, the program is put into a waiting queue. The waiting queue is a data structure in the kernel for managing waiting programs.
[0088] In the implementation process, the first kernel can provide a wake-up mechanism to allow the first program to wake up other programs by sending a signal or modifying the state of the waiting queue.
[0089] When the first program triggers a wake-up event, the kernel checks the corresponding waiting queue and moves the other programs in the waiting queue to the ready queue, so that they can be scheduled for execution by the task scheduler.
[0090] In the embodiment of the application, after the first program sends the first notification message to the volume management driver, the first program wakes up other programs waiting to run in the first kernel. In this way, the wake-up mechanism can be used to schedule other programs to run in a timely manner and reduce the waiting time of other programs.
[0091] Figure 4A A flowchart of a method for managing a disk array is provided in the embodiments of the present application, as shown in Figure 4A The method can be implemented by the following steps:
[0092] Step 1: When the VMD driver is loaded, a corresponding path is generated.
[0093] In the implementation process, when the VMD driver is loaded, the path “ / sys / bus / pci / drivers / vmd / 0000:c7:00.5 / ” can be generated.
[0094] Step 2: The VMD driver registers a domain information callback function to the domain framework module.
[0095] Here, the domain framework module is the first program and runs in the first core (Core 0). The domain information callback function is used to obtain the PCI domain information of the VMD hardware. The VMD driver registers a domain information callback function to the domain framework module. This registration action can complete the registration of the domain information callback function once, and the domain information callback function can be used multiple times to obtain domain information thereafter. The VMD driver also runs in the first core.
[0096] Step 3: The domain framework module executes the corresponding domain information callback function to obtain the corresponding PCI domain.
[0097] Step 4: The domain framework module uses the domain information callback function to obtain the PCI domain of the VMD hardware.
[0098] For example, the domain information callback function is vmd_get_domain_info(), which can obtain the PCI domain of the target VMD hardware: 0000:c7:00.5.
[0099] Step 5: After the domain framework module obtains the PCI domain of the corresponding VMD hardware, the corresponding domain path is created.
[0100] For example, after the domain framework module obtains the PCI domain of the corresponding VMD hardware: 0000:c7:00.5, the volume path “ / sys / bus / pci / drivers / vmd / ” obtained in step 1 is spliced with the PCI domain and the fixed path “domain / device” is added to create the domain path corresponding to the disk array: “ / sys / bus / pci / drivers / vmd / 0000:c7:00.5 / domain / device”.
[0101] Step 6: The domain framework module notifies the VMD driver that the corresponding domain path has been created.
[0102] In the implementation process, the domain framework module can send a first notification message to a volume management driver (VMD driver) in a case where it is determined that the domain path creation has been completed.
[0103] Step 7, the VMD driver notifies the NVME driver to start scanning the NVMe hard disks connected to the VMD controller.
[0104] In the implementation process, the VMD driver sends a second notification message to a disk driver (NVME driver) running in a second core (Core 1) in response to the first notification message, and the second notification message is used to notify the NVME driver to perform disk scanning.
[0105] The NVME driver scans the NVMe hard disks connected to the VMD controller in response to the second notification message, that is, can create a disk group 1 as shown in the following figure. Figure 4A
[0106] Step 8, the NVME driver notifies the device management program to create a disk array.
[0107] In the implementation process, the NVME driver sends a third notification message to a device management program running in a third core (Core 1) in a case where it completes the scanning of the disk group 1 in response to the second notification message, so that the device management program completes the creation of a disk array corresponding to the disk group 1 in response to the third notification message.
[0108] Step 9, the disk management tool checks the domain path.
[0109] For example, the disk management tool can be mdadm, which is a software independent disk redundancy array management tool under Linux, and the full name is multiple devices admin. Among them, mdadm can perform almost all RAID management functions, including but not limited to:
[0110] Create a RAID array: You can specify parameters such as RAID level (such as RAID0, RAID1, RAID5, etc.), number of active devices, and number of standby devices.
[0111] Manage the RAID array: including adding, removing, replacing RAID device members, and marking devices as faulty, etc.
[0112] Monitor the RAID array: you can start or stop monitoring mode, and view the status and detailed information of the RAID array in real time.
[0113] Save the RAID configuration: you can save the RAID configuration information to a configuration file, so as to automatically reassemble the RAID array after reboot.
[0114] In the implementation process, mdadm can be used to check whether the domain path has been successfully created.
[0115] Step 1, the disk management tool creates a disk array when it is determined that the domain path is correct.
[0116] In some embodiments, when the disk array corresponding to disk group 1 is completed, the domain framework module can continue to create the domain path corresponding to the next target disk group (disk group 2) to achieve the creation of the disk array corresponding to disk group 2 based on the delivery of the notification message. By sequentially performing, the creation of the array corresponding to all disk groups set on the electronic device can be achieved.
[0117] In the embodiments of the present application, the domain framework module is added to complete the creation of the domain path of the disk group before the disk array needs to be created, thereby achieving effective and error-free disk array creation.
[0118] Figure 4B A flowchart of a method for creating a domain path provided in the embodiments of the present application is shown in FIG. 1. Figure 4B As shown in FIG. 1, the method can be implemented by the following steps:
[0119] Step 1, when the VMD driver is loaded, the corresponding path is generated;
[0120] In the implementation process, the Probe function can be used to obtain the volume path " / sys / bus / pci / drivers / vmd / ". The probe function is an entry point in the NVMe driver. When the operating system identifies a storage device supporting the NVMe protocol through the PCIe bus, the probe function of the NVMe driver of the device can be called to obtain the volume path.
[0121] Step 2, the VMD driver registers a domain information callback function to the domain framework module;
[0122] Here, the domain information callback function is used to obtain the PCI domain information of the VMD hardware. The registration action is performed once to complete the registration of the domain information callback function, and the domain information callback function can be used multiple times to obtain the domain information thereafter.
[0123] Step 3, the domain framework module executes the corresponding domain information callback function to obtain the corresponding PCI domain;
[0124] Step 4, the domain information callback function obtains the PCI domain of the VMD hardware.
[0125] For example, the domain information callback function is vmd_get_domain_info(), which can obtain the PCI domain of the target VMD hardware: 0000:c7:00.5.
[0126] Step 5, the domain framework module acquires the PCI domain corresponding to the VMD hardware, and creates a corresponding domain path;
[0127] For example, after the domain framework module acquires the PCI domain corresponding to the VMD hardware: 0000:c7:00.5, the volume path obtained in step 1, / sys / bus / pci / drivers / vmd / , is spliced with the PCI domain, and a fixed path "domain / device" is added, so that the domain path corresponding to the disk array is created as " / sys / bus / pci / drivers / vmd / 0000:c7:00.5 / domain / device".
[0128] Step 6, the domain framework module notifies the VMD driver that the corresponding domain path has been created.
[0129] In some embodiments, after step 6 is completed, other waiting programs can also be awakened to continue execution.
[0130] In the embodiments of the present application, the domain framework module is added, and after the domain path of the disk group is created, the volume management driver program is notified, so that the creation of the domain path corresponding to the disk group is completed before the creation of the disk array.
[0131] Based on the foregoing embodiments, the embodiments of the present application provide a disk array management device, which includes various modules, each module includes various sub-modules, each sub-module includes units, and can be implemented by a processor in an electronic device; of course, it can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor unit (MPU), a digital signal processing (DSP), or a field programmable gate array (FPGA).
[0132] Figure 5 The composition structure diagram of the disk array management device provided by the embodiments of the present application is shown in Figure 5 As shown in the figure, the device 500 includes:
[0133] The creation module 510 is configured to create a domain path corresponding to a target disk group by using a first program running in a first kernel, and send a first notification message to a volume management driver program running in the first kernel when it is determined that the domain path creation is completed.
[0134] The first sending module 520 is configured to send, by using the volume management driver, second notification information to a disk driver running in the second kernel in response to the first notification message, where the second notification information is used to notify the disk driver to perform scanning.
[0135] The second sending module 530 is configured to send, by using the disk driver, third notification information to a device management program running in the third kernel in response to the second notification information, where the third notification information is used to notify the device management program to complete creation of a disk array corresponding to the target disk group in response to the third notification information.
[0136] In some embodiments, the creating module 510 includes an obtaining sub-module, a creating sub-module and a sending sub-module, where the obtaining sub-module is configured to obtain, by using the first program, domain name information corresponding to the target disk group; the creating sub-module is configured to create, by using the first program, the domain path based on the domain name information; and the sending sub-module is configured to send, by using the first program, the first notification message to the volume management driver in a case where it is determined that the domain path is created.
[0137] In some embodiments, the obtaining sub-module includes a scanning unit and a first obtaining unit, where the scanning unit is configured to scan, by using the volume management driver, a bus interface to identify domain name information corresponding to a group of disks connected to the bus interface as the domain name information corresponding to the target disk group; and the first obtaining unit is configured to obtain, by using the first program, the domain name information by executing a domain name information callback function, where the domain name information callback function is registered by the volume management driver for the first program.
[0138] In some embodiments, the creating sub-module includes a second obtaining unit and a creating unit, where the second obtaining unit is configured to obtain, by using the first program, volume management path information; and the creating unit is configured to create, by using the first program, the domain path based on the domain name information and the volume management path information.
[0139] In some embodiments, the second obtaining unit is further configured to generate the volume management path information in a case where the volume management driver is loaded; and the creating unit is further configured to splice, by using the first program, the domain name information and the volume management path information to obtain the domain path.
[0140] In some embodiments, the disk management apparatus further includes a waking module configured to wake, by using the first program, other programs waiting to run in the first kernel.
[0141] In some embodiments, the first program, the volume management driver and the disk driver run in a kernel space of an operating system, and the device management program runs in a user space of the operating system.
[0142] The above description of the device embodiments is similar to the description of the method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the device embodiments of the present application, please refer to the description of the method embodiments of the present application.
[0143] It should be noted that, in the embodiments of the present application, if the above method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application can be embodied in the form of a software product, and the computer software product is stored in a storage medium, and includes a plurality of instructions for causing an electronic device (which can be a mobile phone, a tablet computer, a notebook computer, a desktop computer, etc.) to execute all or part of the methods described in the embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk, and various media that can store program codes. Thus, the embodiments of the present application are not limited to any particular hardware and software combination.
[0144] Correspondingly, the embodiments of the present application provide a storage medium having a computer program stored thereon, and the computer program is executed by a processor to implement the steps of the management method of the disk array provided in the above embodiments.
[0145] Correspondingly, the embodiments of the present application provide an electronic device, Figure 6 A hardware entity schematic diagram of the electronic device provided in the embodiments of the present application is shown in FIG. 6, which includes a memory 601 and a processor 602. The memory 601 stores a computer program executable on the processor 602, and the processor 602 implements the steps of the management method of the disk array provided in the above embodiments when executing the program. Figure 6 The memory 601 is configured to store instructions and applications executable by the processor 602, and can also cache data (for example, image data, audio data, voice communication data and video communication data) to be processed by the processor 602 and each module in the electronic device 600, which can be implemented by a FLASH or a random access memory (RAM).
[0146] The memory 601 is configured to store instructions and applications executable by the processor 602, and can also cache data (for example, image data, audio data, voice communication data and video communication data) to be processed by the processor 602 and each module in the electronic device 600, which can be implemented by a FLASH or a random access memory (RAM).
[0147] It should be noted that the description of the storage medium and device embodiments above is similar to the description of the method embodiments above, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of the present application, please refer to the description of the method embodiments of the present application for understanding.
[0148] It should be understood that the description of "one embodiment" or "an embodiment" throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that the size of the sequence number of each process in various embodiments of the present application does not mean the order of execution, and the execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The sequence number of the above embodiments of the present application is only for description, not representing the advantages and disadvantages of the embodiments.
[0149] It should be noted that in this document, the terms "comprise", "contain" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitations, the element defined by the statement "comprises a" does not exclude the presence of additional identical elements in the process, method, article or device including the element.
[0150] In several embodiments provided by the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division, and actual implementation can have another division manner, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed components can be through some interface, indirect coupling or communication connection between devices or units, which can be electrical, mechanical or other forms.
[0151] The units described above as separate components can or can not be physically separated, and the components displayed as units can or can not be physical units; they can be located in one place or distributed on multiple network units; some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.
[0152] In addition, each of the functional units in the embodiments of the present application can be integrated into one processing unit, each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in the form of hardware, or in the form of hardware plus software function units.
[0153] Those skilled in the art can understand that all or part of the steps of the above-mentioned method embodiments can be completed by relevant hardware instructed by programs. The aforementioned programs can be stored in a computer readable storage medium, and when the programs are executed, the steps of the above-mentioned method embodiments are executed. The aforementioned storage medium includes mobile storage devices, read-only memories (ROM), magnetic discs or optical discs, and various media that can store program codes.
[0154] Alternatively, when the integrated units of the present application are implemented in the form of software function modules and sold or used as independent products, they can also be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present application can be embodied in the form of software products, and the computer software products are stored in a storage medium, including a number of instructions for making an electronic device (which can be a mobile phone, a tablet computer, a notebook computer, a desktop computer, etc.) execute all or part of the methods described in the embodiments of the present application. The aforementioned storage medium includes mobile storage devices, ROM, magnetic discs or optical discs, and various media that can store program codes.
[0155] The methods disclosed in the several method embodiments provided by the present application can be combined arbitrarily without conflict to obtain new method embodiments.
[0156] The features disclosed in the several product embodiments provided by the present application can be combined arbitrarily without conflict to obtain new product embodiments.
[0157] The features disclosed in the several method or device embodiments provided by the present application can be combined arbitrarily without conflict to obtain new method embodiments or device embodiments.
[0158] The above is only an implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical range disclosed in the present application, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method for managing a disk array, the method comprising: a first program running in a first kernel creating a domain path corresponding to a target disk group, and sending a first notification message to a volume management driver running in the first kernel upon determining that the domain path creation is completed; the volume management driver sending a second notification message to a disk driver running in a second kernel in response to the first notification message, the second notification message being used to notify the disk driver to perform scanning; the disk driver sending a third notification message to a device management program running in a third kernel upon completing scanning the target disk group in response to the second notification message, so that the device management program completes creation of a disk array corresponding to the target disk group in response to the third notification message. 2.The method of claim 1, wherein the first program running in the first kernel creates a domain path corresponding to a target disk group, and sends a first notification message to a volume management driver running in the first kernel upon determining that the domain path creation is completed, comprising: the first program obtaining domain name information corresponding to the target disk group; the first program creating the domain path based on the domain name information; the first program sending the first notification message to the volume management driver upon determining that the domain path creation is completed. 3.The method of claim 2, wherein the first program obtains domain name information corresponding to the target disk group, comprising: the volume management driver scanning a bus interface to identify domain name information corresponding to a group of disks connected to the bus interface as the domain name information corresponding to the target disk group; the first program executing a domain name information callback function to obtain the domain name information, wherein the domain name information callback function is registered by the volume management driver for the first program. 4.The method of claim 2, wherein the first program creates the domain path based on the domain name information, comprising: the first program obtaining volume management path information; the first program creating the domain path based on the domain name information and the volume management path information. 5.The method of claim 4, wherein the first program obtains volume management path information, comprising: generating the volume management path information upon loading the volume management driver; correspondingly, the first program creates the domain path based on the domain name information and the volume management path information, comprising: the first program concatenating the domain name information and the volume management path information to obtain the domain path. 6.The method of any one of claims 1 to 5, after the first program sends the first notification message to the volume management driver, the method further comprising: the first program waking up other programs waiting to run in the first kernel. 7.The method of any one of claims 1 to 5, wherein the first program, the volume management driver and the disk driver run in a kernel space of an operating system, and the device management program runs in a user space of the operating system.
8. A management apparatus of a disk array, the apparatus comprising: a creating module configured to create a corresponding domain path for a target disk group by a first program running in a first kernel, and send a first notification message to a volume management driver running in the first kernel upon determining that the domain path creation is completed; a first sending module configured to send, by the volume management driver, a second notification message to a disk driver running in a second kernel in response to the first notification message, the second notification message being configured to notify the disk driver to perform scanning; a second sending module configured to send, by the disk driver, a third notification message to a device management program running in a third kernel upon completing scanning the target disk group in response to the second notification message, so that the device management program completes creation of a disk array corresponding to the target disk group in response to the third notification message.
9. An electronic device comprising a memory and a processor, the memory storing a computer program executable on the processor, the processor implementing, when executing the program, a first program running in a first kernel to create a corresponding domain path for a target disk group, and sending a first notification message to a volume management driver running in the first kernel upon determining that the domain path creation is completed. the volume management driver sends a second notification message to a disk driver running in a second kernel in response to the first notification message, the second notification message being configured to notify the disk driver to perform scanning; the disk driver sends a third notification message to a device management program running in a third kernel upon completing scanning the target disk group in response to the second notification message, so that the device management program completes creation of a disk array corresponding to the target disk group in response to the third notification message.
10. A computer program product comprising a first program, a volume management driver, a disk driver and a device management program, wherein, the first program running in a first kernel creates a corresponding domain path for a target disk group, and sends a first notification message to a volume management driver running in the first kernel upon determining that the domain path creation is completed; the volume management driver sends a second notification message to a disk driver running in a second kernel in response to the first notification message, the second notification message being configured to notify the disk driver to perform scanning; the disk driver sends a third notification message to a device management program running in a third kernel upon completing scanning the target disk group in response to the second notification message, so that the device management program completes creation of a disk array corresponding to the target disk group in response to the third notification message. the first program running in a first kernel creates a corresponding domain path for a target disk group, and sends a first notification message to a volume management driver running in the first kernel upon determining that the domain path creation is completed; the volume management driver sends a second notification message to a disk driver running in a second kernel in response to the first notification message, the second notification message being configured to notify the disk driver to perform scanning; the disk driver sends a third notification message to a device management program running in a third kernel upon completing scanning the target disk group in response to the second notification message, so that the device management program completes creation of a disk array corresponding to the target disk group in response to the third notification message.
Citation Information
Patent Citations
Magnetic disk device driving method, system, device and readable storage medium
CN109032523A
Disk management method and device based on libvirt, equipment and storage medium
CN117193631A